Browse Source

Merge branch 'master' of https://git.catrenelle.com/Kevin_Smarts/glife

julzor 5 years ago
parent
commit
8bc59fba0a

+ 1 - 0
glife.qproj

@@ -1130,6 +1130,7 @@
 	<Location name="BanSexType"/>
 	<Folder name="Magic">
 		<Location name="castSpell"/>
+		<Location name="castSpellNPC"/>
 		<Location name="spellList"/>
 		<Location name="spellBook"/>
 		<Location name="spellTimer"/>

+ 1 - 1
locations/barbershop.qsrc

@@ -174,7 +174,7 @@ elseif barbershop_wrk = 1 and barbershop_wrk_day ! daystart:
 		money += 125
 		barbershop_wrk_day = daystart
 		gs 'stat'
-		'You work diligently and fast. You clean the floor, take out the trash, dust off the shelves and wipe some mirrors and windows. Before you know an hour has passed and you''re 90 <b>₽</b> richer.'
+		'You work diligently and fast. You clean the floor, take out the trash, dust off the shelves and wipe some mirrors and windows. Before you know an hour has passed and you''re 125 <b>₽</b> richer.'
 
 		act 'Leave': gt 'barbershop','start'
 	end

+ 6 - 2
locations/castSpell.qsrc

@@ -18,8 +18,12 @@ $SpellArgs = ""
 i=1
 :ArgLoop
 if i < arrsize('$ARGS'):
+	if $ARGS[i] = '':
+		$SpellArgs += ", <<ARGS[i]>>"
+	else
+		$SpellArgs += ", '<<$ARGS[i]>>'"
+	end
 	i += 1
-	$SpellArgs = $SpellArgs + ", '<<$ARGS[i - 1]>>'"
 	jump 'ArgLoop'
 end
 killvar 'i'
@@ -67,10 +71,10 @@ if spellKnown[$SpellID] = 1:
 		minut += spellTime[$SpellID]
 
 		gs 'stat'
-
 		$SpellExec = "gs 'spell', '<<$SpellID>>', '<<spellSuccess>>'<<$SpellArgs>>"
 
 		dynamic $SpellExec
+
 	else
 		*pl "You realize you don''t have enough mana for this spell."
 	end

+ 50 - 0
locations/castSpellNPC.qsrc

@@ -0,0 +1,50 @@
+# castSpellNPC
+! Used for NPCs to cast a spell.
+!
+!    ARGS[0] is the spell being cast
+!	$ARGS[1] = Target Type ('opp','pcs')
+!	 ARGS[2] = Target party member number
+!	$ARGS[3] = Caster Type ('opp','pcs')
+!	 ARGS[4] = Caster party member number
+! ARGS[5-n] are any parameters that need to be passed to the Spell
+!
+!	Example:
+!		gs 'castSpell', 'teleport', 'CentralPark'
+
+gs 'spellList'
+
+spellSuccess = 0
+
+$SpellID = $ARGS[0]
+$SpellArgs = ""
+i=5
+:ArgLoopNPC
+if i < arrsize('$ARGS'):
+	if $ARGS[i] = '':
+		$SpellArgs += ", <<ARGS[i]>>"
+	else
+		$SpellArgs += ", '<<$ARGS[i]>>'"
+	end
+	i += 1
+	jump 'ArgLoopNPC'
+end
+killvar 'i'
+
+manaCost = spellMana[$SpellID]
+casterMana = dyneval('result=<<$AGS[3]>>_mana[<<ARGS[4]>>]')
+if casterMana <= manaCost:
+	dynamic '<<$AGS[3]>>_mana[<<ARGS[4]>>] -= <<manaCost>>'
+	$SpellExec = "gs 'spell', '<<$SpellID>>', '<<spellSuccess>>', '<<$ARGS[1]>>', <<ARGS[2]>>, <<ARGS[4]>><<$SpellArgs>>"
+	dynamic $SpellExec
+else
+	'Not enough mana to cast the spell.'
+end
+
+
+killvar '$SpellID'
+killvar '$SpellExec'
+killvar 'spellSuccess'
+killvar 'manaCost'
+killvar 'casterMana'
+
+--- castSpellNPC ---------------------------------

+ 2 - 2
locations/dimalina.qsrc

@@ -399,7 +399,7 @@ if $ARGS[0] = 'cums1':
 			'"Fuck... That was great! She''s so much better than you. This is why you''re just the slut and she''s my girlfriend." Dimka laughs down at you. "It was worth it taking my time to get her to this point, definitely worth the wait." He starts to unchain you and remove the gag, but it doesn''t help much. You can barely stand, numbness in your limbs making the task nearly impossible. "Alright, get dressed and get out." Dimka doesn''t even stop to see you redress as he beings to look through his new collection.'
 		end
 		gs 'dimalina', 'bindpain'
-		if pcs_modd > 5: pcs_mood -= 5
+		if pcs_mood > 5: pcs_mood -= 5
 		if pcs_health > 20: pcs_health -= 20
 		gs 'arousal', 'voyeur_sex', 5, 'bound'
 		gs 'stat'
@@ -955,7 +955,7 @@ if $ARGS[0] = 'walklina':
 			'"Uh? What?"'
 			'"Leave me alone!"'
 			'She cries and then turns, running with all her strength and leaving you far behind.'
-			if pcs_modd > 10: pcs_mood -= 10
+			if pcs_mood > 10: pcs_mood -= 10
 			gs 'stat'
 		elseif npc_rel['A19'] < 50:
 			'Lina begins to walk towards her home. Her parent''s apartment is in the same complex as yours. As you catch up to her, she stops and gives you a questioning gaze.'

+ 1 - 1
locations/family.qsrc

@@ -213,7 +213,7 @@ end
 if $loc = 'sitrPar': act 'Sit on the sofa':gt 'family', 'sofa'
 
 if $loc = 'sitrPar' and ocpd_room = 0:
-	'No one else is here right now, so I''m free to use the room how I like.'
+	'No one else is here right now, so you''re free to use the room how you like.'
 	gs 'exercise','start'
 end
 

+ 10 - 7
locations/fight.qsrc

@@ -493,10 +493,10 @@ if $ARGS[0] = 'player':
 	else
 		TargetNumber = 2
 	end
-		
-!!	if pcs_magik > 0:
-!!		act 'Cast a Spell': gs 'fight', 'spellcast'
-!!	end
+
+	if pcs_magik > 0:
+		act 'Cast a Spell': gs 'fight', 'spellcast'
+	end
 	if opp_health[0] > 0:
 		act 'Kick <<$opp_name[0]>>':
 			gs 'fight', 'Attack', 'Kick', 'opp', 0, 0
@@ -540,6 +540,12 @@ if $ARGS[0] = 'player':
 end
 
 
+if $ARGS[0] = 'spellcast':
+	cls
+	cla
+	func('spellBook', 'targetable', '$combatSpells', 'gt ''fight'', ''main''', 'gt ''fight'', ''main''')
+end
+
 if $ARGS[0] = 'opp_spellcast':
 end
 
@@ -553,9 +559,6 @@ end
 
 
 
-
-
-
 !!--------------------------------------------------old shit--------------------------------------------------
 
 

+ 1 - 1
locations/gschool_grounds.qsrc

@@ -543,7 +543,7 @@ if $ARGS[0] = 'SchoolRun_result':
 	cla
 	if begresult <= 15:
 		grupvalue[2] -= 2
-		'You barely manage to reach the finish line at all. There''s no point in checking where you finished, you already know you were last by uite a large margin.'
+		'You barely manage to reach the finish line at all. There''s no point in checking where you finished, you already know you were last by quite a large margin.'
 	elseif begresult < 20:
 		grupvalue[2] -= 1
 		'You struggle to keep up with the other girls, and finish in last place.'

+ 1 - 1
locations/noticeboard.qsrc

@@ -59,7 +59,7 @@ if $ARGS[0] = 'advert1':
 
 	'<center><table bgcolor="#FFFF66" width="60%" cellspacing="30"><tr><th align="center"><h3>Pavlovsk police department newsletter</h3></th></tr><tr><td align="left">'+ _
 	'&nbsp;&nbsp;&nbsp;The Pavlovsk police department recently investigated the rumours that a secret prostitution ring was being run from the Pavlovsk hotel.<p>'+ _ 
-	'&nbsp;&nbsp;&nbsp;After a very thorough investigation, we found absolutely no evidence of this. The hotel manager, <b>Herman Leonidovich</b>, was interrogated and not only did we find him completely innocence he also gave a substantial donation to our department.'+ _
+	'&nbsp;&nbsp;&nbsp;After a very thorough investigation, we found absolutely no evidence of this. The hotel manager, <b>Herman Leonidovich</b>, was interrogated and not only did we find him completely innocent, he also gave a substantial donation to our department. '+ _
 	'He ensured us that any young, pretty girl could apply for a maid job in their hotel and there is absolutely no chance that they would be forced to prostitute themselves.<p><p></td></tr></table></center>'
 	minut +=2
 	gs 'stat'

+ 15 - 0
locations/preCUST.qsrc

@@ -399,6 +399,21 @@ if $ARGS[0] = 'Done':
 		swimwearB[3] = pcs_hips
 		sportsclothingnumber = 29
 		gs 'clothing', 'wear', 'cheap', 370
+	elseif goth_clothing = 1:
+		exercise[4] = 1
+		exerciseH[4] = 100
+		strainers[21] = 1
+		sgandm[43] = 1
+		shoewornnumber = 43
+		$shoeworntype = 'gandm'
+		average[70] = 1
+		averageH[70] = 100
+		averageB[70] = pcs_hips
+		cheap[60] = 1
+		cheapH[60] = 100
+		cheapB[60] = pcs_hips
+		sportsclothingnumber = 4
+		gs 'clothing', 'wear', 'average', 70
 	elseif $ARGS[1] = 'CSB':
 		cheap_panties[5] = 1
 		cheap_bras[12] = 1

+ 159 - 259
locations/spell.qsrc

@@ -18,17 +18,72 @@ SuccessValue = $ARGS[1]
 
 ! ARGS for Combat Spells if Applicable
 $TargetType = $ARGS[2]
-if $TargetType = 'pcs':
-	$CasterType = 'opp'
-elseif $TargetType = 'opp':
-	$CasterType = 'pcs'
+if $spellTarget[$ARGS[2]] = 'self':
+	! Self target spell, Caster and target are the same
+	$CasterType = $TargetType
+	TargetNumber = ARGS[3]
+	CasterNumber = ARGS[3]
+elseif $spellTarget[$ARGS[2]] = 'team':
+	! Team target spell targets person on the same team
+	$CasterType = $TargetType
+	TargetNumber = ARGS[3]
+	CasterNumber = ARGS[4]
 else
-	$CasterType = 'pcs'
-	$TargetType = 'pcs'
-end
-TargetNumber = ARGS[3]
-CasterNumber = ARGS[3]
-
+	! Others are assumed to be enemy targets
+	if $TargetType = 'pcs':
+		$CasterType = 'opp'
+	elseif $TargetType = 'opp':
+		$CasterType = 'pcs'
+	else
+		$CasterType = 'pcs'
+		$TargetType = 'pcs'
+	end
+	TargetNumber = ARGS[3]
+	CasterNumber = ARGS[4]
+end
+
+!! Helper functions.
+
+!! UpdateAttrib
+!   Apply change to Combatant array
+! $ARGS[0] = the base array (e.g.: fog, clone, shield, init)
+! $ARGS[1] = the Target type (e.g.: pcs or opp)
+! ARGS[2]  = Target Number, array number of target
+! $ARGS[3] = operation (e.g.: +, -, =)
+! ARGS[4]  = Amount to change
+$spellFunc['UpdateAttrib'] = {
+	$SpellFuncVar['BaseArray'] = $ARGS[0]
+	$SpellFuncVar['TargetType']= $ARGS[1]
+	SpellFuncVar['TargetNum']  =  ARGS[2]
+	$SpellFuncVar['Operation'] = $ARGS[3]
+	SpellFuncVar['Amount']     =  ARGS[4]
+
+	if $SpellFuncVar['Operation'] = '=':
+		!       "opp_fog[0] = 0"
+		dynamic "<<$SpellFuncVar['TargetType']>>_<<$SpellFuncVar['BaseArray']>>[<<SpellFuncVar['TargetNum']>>] = <<SpellFuncVar['Amount']>>"
+	elseif $SpellFuncVar['Operation'] = '+' or $SpellFuncVar['Operation'] = '-':
+		!       "opp_fog[0] += 10"
+		dynamic "<<$SpellFuncVar['TargetType']>>_<<$SpellFuncVar['BaseArray']>>[<<SpellFuncVar['TargetNum']>>] <<$SpellFuncVar['Operation']>>= <<SpellFuncVar['Amount']>>"
+	else
+		'Invalid Operator, must be "+", "-", or "=".  '
+	end
+
+	killvar '$SpellFuncVar'
+	killvar 'SpellFuncVar'
+}
+!!GetCombatantName
+!	Get the Name value for this combatant
+! $ARGS[0] = the Target type (e.g.: pcs or opp)
+! ARGS[1]  = Target Number, array number of target
+$spellFunc['GetCombatantName'] = {
+	$SpellFuncVar['TargetType']= $ARGS[0]
+	SpellFuncVar['TargetNum']  =  ARGS[1]
+
+	$result = dyneval("$result = $<<$SpellFuncVar['TargetType']>>_name[<<SpellFuncVar['TargetNum']>>]")
+
+	killvar '$SpellFuncVar'
+	killvar 'SpellFuncVar'
+}
 
 if $ARGS[0] = 'teleport':
 	! Do the stuff of a Teleport
@@ -302,95 +357,45 @@ if $ARGS[0] = 'cosmetica':
 	end
 end
 
-if $ARGS[0] = 'reset':
-	cla
-	!Create mist
-	'Accumulated mana <<manaReset>> units.'
-
-	act 'Absorb accumulated mana':
-		cla
-		*clr
-		pcs_mana = pcs_mana + manaReset
-		manaReset = 0
-		xgt'fight','sta'
-	end
-	act 'Physical attacks':gt'boxing'
-
-	if pcs_magik > 0:
-		act 'Magic attacks':gt'magik'
-	end
-end
 
-if $ARGS[0] = 'unmat':
-	cla
-	!Create mist
-	'You can become incorporeal at 30 moves, in exchange for 3000 Forces units Rikudo. This part of the power will be lost to you forever when you cast.'
-	'Do not allow to pass through the materiality of the body is not getting any impact damage, while slightly reduced longevity spells.'
-
-	if rikudo >= 3000:
-		act 'Become a disembodied':
-			cla
-			*clr
-			unmaterial = 31
-			rikudo = rikudo + 3000
-			manaReset = 0
-			xgt'fight','sta'
-		end
-	elseif rikudo < 3000:
-		'You have too little power Rikudo for this spell.'
-	end
-
-	act 'Physical attacks':gt'boxing'
-
-	if pcs_magik > 0:
-		act 'Magic attacks':gt'magik'
-	end
-end
+!!!!!!!!!!!!!!!!!
+!! Combat Spells
+!!!!!!!!!!!!!!!!!
 
 if $ARGS[0] = 'fog':
-	! tuman  = the amount of fog around you making you harder to hit
-	! tumanV = the amount of fog around your opponent making him harder to hit
-	if tumanV > 0:
-		'It is not possible to call your fog when an existing opponent is already fogged.'
-	else
-		if SuccessValue > 0:
-			tuman += (10 * SuccessValue)
-			'<b><font color = green>A Fog materializes around, obscuring you from your enemies.</font></b>'
-		elseif SuccessValue < 0:
-			tumanV += 10
-			'<b><font color = red>The spell backfires! A Fog materializes around your enemy, obscuring him from your view.</font></b>'
-		else
-			'<b>The spell fizzles.  Nothing seems to happen.</b>'
-		end
+	if SuccessValue > 0:
+		dynamic $spellFunc['UpdateAttrib'], 'fog', $TargetType, TargetNumber, '+', 10 * SuccessValue
+		'<b><font color = green>A Fog materializes around, obscuring <<dyneval $spellFunc["GetCombatantName"], $TargetType, TargetNumber>> from enemies.</font></b>'
+	else
+		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
 end
 
 if $ARGS[0] = 'clone':
-	! klon = the number of clones that the enemy must destroy before hitting you
 	if SuccessValue > 0:
-		klon += SuccessValue
-		'<b><font color = green><<SuccessValue>> clone<<iif(SuccessValue>1,"s","")>> of you springs from you confusing the enemy.</font></b>'
-	elseif SuccessValue < 0 and klon > 0:
-		klon -= 1
-		'<b><font color = red>The spell backfires! One of your clones disappears.</font></b>'
+		dynamic $spellFunc['UpdateAttrib'], 'clone', $TargetType, TargetNumber, '+', SuccessValue
+		'<b><font color = green><<SuccessValue>> clone<<iif(SuccessValue>1,"s","")>> springs from <<dyneval $spellFunc["GetCombatantName"], $TargetType, TargetNumber>> confusing enemies.</font></b>'
+	elseif SuccessValue < 0 and dyneval('result=<<$TargetType>>_clone[<<TargetNumber>>]') > 0:
+		dynamic $spellFunc['UpdateAttrib'], 'clone', $TargetType, TargetNumber, '-', 1
+		'<b><font color = red>The spell backfires! A <<dyneval $spellFunc["GetCombatantName"], $TargetType, TargetNumber>> clone disappears.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
 end
 
 if $ARGS[0] = 'stun':
-	! stunner = 1 stuns the enemy for 3-6 rounds
 	if SuccessValue > 0:
 		stunner = 1
-		'<b><font color = green>Your enemy is stunned.</font></b>'
+		dynamic $spellFunc['UpdateAttrib'], 'stun', $TargetType, TargetNumber, '+', rand(2,5)+ SuccessValue
+		'<b><font color = green><<dyneval $spellFunc["GetCombatantName"], $TargetType, TargetNumber>> is stunned.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
-	xgt'atak','player'
+	!xgt'atak','player'
 end
 
 if $ARGS[0] = 'weapon':
-	if SuccessValue > 0:
+	!{if SuccessValue > 0:
 		magweapbonus = weapbonus * 4 * SuccessValue
 		'<b><font color = green>Your Weapon now feels more powerful.</font></b>'
 	elseif SuccessValue < 0:
@@ -399,52 +404,46 @@ if $ARGS[0] = 'weapon':
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
-	xgt'atak','player'
+	!xgt'atak','player'}
+	"weapon"
 end
 
 if $ARGS[0] = 'wind':
-	! tuman  = the amount of fog around you making you harder to hit
-	! tumanV = the amount of fog around your opponent making him harder to hit
 	if SuccessValue = 2:
-		tumanV = 0
-		'<b><font color = green>A wind blows through the area eliminating your enemys fog from the battlefield.</font></b>'
+		dynamic $spellFunc['UpdateAttrib'], 'fog', $TargetType, TargetNumber, '=', 0
+		'<b><font color = green>A wind blows through the area eliminating the fog around <<dyneval $spellFunc["GetCombatantName"], $TargetType, TargetNumber>> from the battlefield.</font></b>'
 	elseif SuccessValue = 1:
-		tumanV = 0
-		tuman = 0
+		dynamic $spellFunc['UpdateAttrib'], 'fog', $TargetType, TargetNumber, '=', 0
+		dynamic $spellFunc['UpdateAttrib'], 'fog', $CasterType, CasterNumber, '=', 0
 		'<b><font color = green>A wind blows through the area eliminating all fog on the battlefield.</font></b>'
 	elseif SuccessValue = -1:
-		tuman = 0
-		'<b><font color = red>A wind blows through the area eliminating your fog from the battlefield.</font></b>'
+		dynamic $spellFunc['UpdateAttrib'], 'fog', $CasterType, CasterNumber, '=', 0
+		'<b><font color = red>A wind blows through the area eliminating the fog around <<dyneval $spellFunc["GetCombatantName"], $TargetType, TargetNumber>> from the battlefield.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
 end
 
 if $ARGS[0] = 'multiclone':
-	! klon = the number of clones that the enemy must destroy before hitting you
 	if SuccessValue > 0:
-		klon += SuccessValue * 3
-		'<b><font color = green><<SuccessValue * 3>> clone<<iif(SuccessValue>1,"s","")>> of you springs from you confusing the enemy.</font></b>'
+		dynamic $spellFunc['UpdateAttrib'], 'clone', $TargetType, TargetNumber, '+', SuccessValue * 3
+		'<b><font color = green><<SuccessValue * 3>> clone<<iif(SuccessValue>1,"s","")>> of <<dyneval $spellFunc["GetCombatantName"], $TargetType, TargetNumber>> springs forth confusing the enemy.</font></b>'
 	elseif SuccessValue < 0 and klon > 0:
-		if klon < 3:
-			klon = 0
+		if dyneval('result=<<$TargetType>>_clone[<<TargetNumber>>]') < 3:
+			dynamic $spellFunc['UpdateAttrib'], 'clone', $TargetType, TargetNumber, '=', 0
 		else
-			klon -= 3
+			dynamic $spellFunc['UpdateAttrib'], 'clone', $TargetType, TargetNumber, '-', 3
 		end
-		'<b><font color = red>The spell backfires! Some of your clones disappear.</font></b>'
+		'<b><font color = red>The spell backfires! Some clones of <<dyneval $spellFunc["GetCombatantName"], $TargetType, TargetNumber>> disappear.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
 end
 
 if $ARGS[0] = 'energo':
-	! defence = absorbs damage before health begins to be removed
 	if SuccessValue > 0:
-		dynamic '<<$CasterType>>_shield[<<CasterNumber>>] += (100 * SuccessValue)'
-		'<b><font color = green>An energy shield materializes around you, protecting you from your enemies.</font></b>'
-	elseif SuccessValue < 0:
-		dynamic '<<$TargetType>>_shield[<<TargetNumber>>] += 100'
-		'<b><font color = red>The spell backfires! An energy shield materializes around your enemy, protecting him from you.</font></b>'
+		dynamic $spellFunc['UpdateAttrib'], 'shield', $TargetType, TargetNumber, '+', SuccessValue * 100
+		'<b><font color = green>An energy shield materializes around <<dyneval $spellFunc["GetCombatantName"], $TargetType, TargetNumber>>, granting protection from enemies.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
@@ -452,11 +451,8 @@ end
 
 if $ARGS[0] = 'haste':
 	if SuccessValue > 0:
-		initBonus += (120 * SuccessValue)
-		'<b><font color = green>Your mind and body seem to race though a sluggish world.</font></b>'
-	elseif SuccessValue < 0:
-		initBonusV += 120
-		'<b><font color = red>The spell backfires! Your enemy seems to move faster.</font></b>'
+		dynamic $spellFunc['UpdateAttrib'], 'init', $TargetType, TargetNumber, '+', SuccessValue * 120
+		'<b><font color = green><<dyneval $spellFunc["GetCombatantName"], $TargetType, TargetNumber>> feels mind and body race though a sluggish world.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
@@ -464,8 +460,8 @@ end
 
 if $ARGS[0] = 'heal':
 	if SuccessValue > 0:
-		dynamic 'pcs_health += (400 * SuccessValue)'
-		'<b><font color = green>Your body surges with life. You feel much stronger.</font></b>'
+		dynamic $spellFunc['UpdateAttrib'], 'health', $TargetType, TargetNumber, '+', SuccessValue * 400
+		'<b><font color = green><<dyneval $spellFunc["GetCombatantName"], $TargetType, TargetNumber>> surges with life, feeling much stronger.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
@@ -473,17 +469,17 @@ end
 
 if $ARGS[0] = 'hand':
 	if SuccessValue > 0:
-		strenK = pcs_stren*20*SuccessValue/100
-		magweapbonus = RAND(pcs_stren*10 - strenK,pcs_stren*10 + strenK)
-		'<b><font color = green>Your hands now feel more powerful.</font></b>'
-	elseif SuccessValue < 0:
-		strenK = pcs_stren*20/100
-		magweapbonus = 0 - RAND(pcs_stren*10 - strenK,pcs_stren*10 + strenK)
-		'<b><font color = red>The spell backfires! Your hands seem weaker.</font></b>'
+		TargetStren = dyneval('result=<<$TargetType>>_stren[<<TargetNumber>>]')
+		TargetStrenDelta = TargetStren*20*SuccessValue/100
+		TargetStrenBase  = TargetStren*10
+		dynamic $spellFunc['UpdateAttrib'], 'stren', $TargetType, TargetNumber, '=', RAND(TargetStrenBase - TargetStrenDelta,TargetStrenBase + TargetStrenDelta)
+		'<b><font color = green>Power flows from the hands of <<dyneval $spellFunc["GetCombatantName"], $TargetType, TargetNumber>>.</font></b>'
+		killvar 'TargetStren'
+		killvar 'TargetStrenDelta'
+		killvar 'TargetStrenBase'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
-	xgt'atak','player'
 end
 
 if $ARGS[0] = 'scaldingtouch':
@@ -493,7 +489,6 @@ if $ARGS[0] = 'scaldingtouch':
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
-	xgt'atakA','atak'
 end
 
 if $ARGS[0] = 'burninghands':
@@ -508,11 +503,8 @@ end
 
 if $ARGS[0] = 'firebarrier':
 	if SuccessValue > 0:
-		defence += (750 * SuccessValue)
-		'<b><font color = green>A flaming barrier has sprung up between you and your opponent. You now have <<defence>> protection units.</font></b>'
-	elseif SuccessValue < 0:
-		defenceV += 750
-		'<b><font color = red>The spell backfires! A flaming barrier has sprung up between you and your opponent. Your enemy now has <<defence>> protection units.</font></b>'
+		dynamic $spellFunc['UpdateAttrib'], 'shield', $TargetType, TargetNumber, '+', SuccessValue * 750
+		'<b><font color = green>A flaming barrier has sprung up between you and your opponents.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
@@ -521,26 +513,20 @@ end
 if $ARGS[0] = 'firestorm':
 	if SuccessValue > 0:
 		gs 'fight', 'applyDamage', $TargetType, TargetNumber, 4250 + (2000 * SuccessValue)
-		bonusSh = 100
-		'<b><font color = green>Uncountable glowing embers steak down upon your foes.</font></b>'
+		'<b><font color = green>Uncountable glowing embers steak down upon the foes of <<dyneval $spellFunc["GetCombatantName"], $TargetType, TargetNumber>>.</font></b>'
 	elseif SuccessValue < 0:
 		gs 'fight', 'applyDamage', $TargetType, TargetNumber, 2000
 		gs 'fight', 'applyDamage', $CasterType, CasterNumber, 200
-		bonusSh = 100
 		'<b><font color = red>The spell backfires! Uncountable glowing embers steak down upon the battlefield burning everyone.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
-	xgt'atakA','atak'
 end
 
 if $ARGS[0] = 'flameshield':
 	if SuccessValue > 0:
-		defence += (2500 * SuccessValue)
-		'<b><font color = green>A Shield made of Flames interposes itself between you and your enemy. You now have <<defence>> protection units.</font></b>'
-	elseif SuccessValue < 0:
-		defenceV += 2500
-		'<b><font color = red>The spell backfires! A Shield made of Flames interposes itself between you and your enemy. Your enemy now has <<defence>> protection units.</font></b>'
+		dynamic $spellFunc['UpdateAttrib'], 'shield', $TargetType, TargetNumber, '+', SuccessValue * 2500
+		'<b><font color = green>A Shield made of Flames interposes itself between you and your enemy.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
@@ -549,7 +535,6 @@ end
 if $ARGS[0] = 'shock':
 	if SuccessValue > 0:
 		gs 'fight', 'applyDamage', $TargetType, TargetNumber, 150 * SuccessValue
-		eleSh = 1
 		'<b><font color = green>You build a static electric charge in your hand and zap your opponent.</font></b>'
 	elseif SuccessValue < 0:
 		gs 'fight', 'applyDamage', $CasterType, CasterNumber, 50
@@ -563,7 +548,6 @@ end
 if $ARGS[0] = 'lightning':
 	if SuccessValue > 0:
 		gs 'fight', 'applyDamage', $TargetType, TargetNumber, 1500 * SuccessValue
-		eleSh = 1
 		'<b><font color = green>You shoot a lightning bolt from your hand zapping your opponent.</font></b>'
 	elseif SuccessValue < 0:
 		gs 'fight', 'applyDamage', $CasterType, CasterNumber, 300
@@ -576,11 +560,8 @@ end
 
 if $ARGS[0] = 'electricbarrier':
 	if SuccessValue > 0:
-		defence += (1500 * SuccessValue)
-		'<b><font color = green>A wall of dancing lightning springs up around yourself. You now have <<defence>> protection units.</font></b>'
-	elseif SuccessValue < 0:
-		defenceV += 1500
-		'<b><font color = red>The spell backfires! A wall of dancing lightning springs up around your enemy. Your enemy now has <<defence>> protection units.</font></b>'
+		dynamic $spellFunc['UpdateAttrib'], 'shield', $TargetType, TargetNumber, '+', SuccessValue * 1500
+		'<b><font color = green>A wall of dancing lightning springs up around yourself.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
@@ -589,14 +570,10 @@ end
 if $ARGS[0] = '1000birds':
 	if SuccessValue > 0:
 		gs 'fight', 'applyDamage', $TargetType, TargetNumber, 2750 + (1000 * SuccessValue)
-		bonusSh = 30
-		eleSh = 1
 		'<b><font color = green>You shoot hundreds of small lightning bolts toward your enemy.</font></b>'
 	elseif SuccessValue < 0:
 		gs 'fight', 'applyDamage', $TargetType, TargetNumber, 2000
 		gs 'fight', 'applyDamage', $CasterType, CasterNumber, 200
-		bonusSh = 30
-		eleSh = 1
 		'<b><font color = red>The spell backfires! Hundreds of small lightning bolts curl toward the battlefield shocking everyone.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
@@ -605,11 +582,8 @@ end
 
 if $ARGS[0] = 'dancingsphere':
 	if SuccessValue > 0:
-		defence += (5000 * SuccessValue)
-		'<b><font color = green>A large field of lightning dances around you blocking attacks. You now have <<defence>> protection units.</font></b>'
-	elseif SuccessValue < 0:
-		defenceV += 5000
-		'<b><font color = red>The spell backfires! A large field of lightning dances around you blocking attacks. Your enemy now has <<defence>> protection units.</font></b>'
+		dynamic $spellFunc['UpdateAttrib'], 'shield', $TargetType, TargetNumber, '+', SuccessValue * 5000
+		'<b><font color = green>A large field of lightning dances around you blocking attacks.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
@@ -618,31 +592,20 @@ end
 if $ARGS[0] = 'quicksand':
 	if SuccessValue > 0:
 		gs 'fight', 'applyDamage', $TargetType, TargetNumber, 100 * SuccessValue
-		eleSh = 5
 		'<b><font color = green>You have trapped your opponent in quicksand.</font></b>'
 	elseif SuccessValue < 0:
 		gs 'fight', 'applyDamage', $TargetType, TargetNumber, 100
 		gs 'fight', 'applyDamage', $CasterType, CasterNumber, 50
-		eleSh = 5
 		'<b><font color = red>The spell backfires! You are both trapped in quicksand.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
-	xgt'atakA','atak'
 end
 
 if $ARGS[0] = 'earthshield':
 	if SuccessValue > 0:
-		defence += 1500 + (1000 * SuccessValue)
-		defenceM += 2500
-		defenceActPar = 1000
-		defenceActParM = 1000
-		defenceAct = 10
-		defenceActM = 10
-		'<b><font color = green>Tendrils of Earth rise to defend you. You now have <<defence>> protection units.</font></b>'
-	elseif SuccessValue < 0:
-		defenceV += 2500
-		'<b><font color = red>The spell backfires! Tendrils of Earth rise to defend your enemy. Your enemy now has <<defence>> protection units.</font></b>'
+		dynamic $spellFunc['UpdateAttrib'], 'shield', $TargetType, TargetNumber, '+', SuccessValue * 1000 + 1500
+		'<b><font color = green>Tendrils of Earth rise to defend you.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
@@ -651,35 +614,20 @@ end
 if $ARGS[0] = 'abyss':
 	if SuccessValue > 0:
 		gs 'fight', 'applyDamage', $TargetType, TargetNumber, 1500 * SuccessValue
-		eleSh = 5
 		'<b><font color = green>The Earth opens up beneath your opponents feet, slamming shut damaging him and depriving him of the ability to move.</font></b>'
 	elseif SuccessValue < 0:
 		gs 'fight', 'applyDamage', $TargetType, TargetNumber, 1500
 		gs 'fight', 'applyDamage', $CasterType, CasterNumber, 200
-		eleSh = 5
 		'<b><font color = red>The spell backfires! The Earth opens up beneath your opponents feet, slamming shut damaging him and depriving him of the ability to move.  You are also caught.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
-	xgt'atakA','atak'
 end
 
 if $ARGS[0] = 'earthguardian':
 	if SuccessValue > 0:
-		defence += 5200 + (2000 * SuccessValue)
-		defenceM += 6250
-		defenceW += 6250
-		defenceActPar = 1000
-		defenceActParM = 1000
-		defenceActParW = 1000
-		defenceAct = 15
-		defenceActM = 15
-		defenceActW = 15
-		defAtk = 15
+		dynamic $spellFunc['UpdateAttrib'], 'shield', $TargetType, TargetNumber, '+', SuccessValue * 2000 +5200
 		'<b><font color = green>The Earth itself comes alive defending you from attacks.  It draws from the power of the land to regenerate itself every round. You now have <<defence>> protection units.</font></b>'
-	elseif SuccessValue < 0:
-		defenceV += 2500
-		'<b><font color = red>The spell backfires! Tendrils of Earth rise to defend your enemy. Your enemy now has <<defence>> protection units.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
@@ -688,8 +636,6 @@ end
 if $ARGS[0] = 'sando':
 	if SuccessValue > 0:
 		gs 'fight', 'applyDamage', $TargetType, TargetNumber, 3000 + (2000 * SuccessValue)
-		bonusSh = 50
-		eleSh = 5
 		'<b><font color = green>Two huge plates of earth colapse together crushing the enemy and depriving him of the ability to move.</font></b>'
 	elseif SuccessValue < 0:
 		gs 'fight', 'applyDamage', $CasterType, CasterNumber, 200
@@ -697,52 +643,46 @@ if $ARGS[0] = 'sando':
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
-	xgt'atakA','atak'
 end
 
 if $ARGS[0] = 'windgust':
 	if SuccessValue > 0:
 		gs 'fight', 'applyDamage', $TargetType, TargetNumber, 100 * SuccessValue
-		bonusSh = 50
 		'<b><font color = green>You have created a gust of wind.</font></b>'
-		if klonV > 0:klonV = 0 & '<b><font color = green>Enemy clones are vaporized.</font></b>'
-		if tumanV > 0:tumanV = 0 & '<b><font color = green>Enemy Fog is torn to shreds by the wind.</font></b>'
-	elseif SuccessValue < 0:
-		gs 'fight', 'applyDamage', $CasterType, CasterNumber, 50
-		'<b><font color = red>The spell backfires! You have created a gust of wind, but the enemy is missed and you are instead caught.</font></b>'
-		if klon > 0:klon = 0 & '<b><font color = green>Your clones are vaporized.</font></b>'
-		if tuman > 0:tuman = 0 & '<b><font color = green>Your Fog is torn to shreds by the wind.</font></b>'
+		if dyneval('result=<<$TargetType>>_clone[<<TargetNumber>>]') > 0:
+			dynamic $spellFunc['UpdateAttrib'], 'clone', $TargetType, TargetNumber, '=', 0
+			'<b><font color = green>Enemy clones are vaporized.</font></b>'
+		end
+		if dyneval('result=<<$TargetType>>_fog[<<TargetNumber>>]') > 0:
+			dynamic $spellFunc['UpdateAttrib'], 'fog', $TargetType, TargetNumber, '=', 0
+			'<b><font color = green>Enemy Fog is torn to shreds by the wind.</font></b>'
+		end
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
-	xgt'atakA','atak'
 end
 
 if $ARGS[0] = 'pressure':
 	if SuccessValue > 0:
 		gs 'fight', 'applyDamage', $TargetType, TargetNumber, 1000 * SuccessValue
-		bonusSh = 100
 		'<b><font color = green>You dramatically raised the air pressure.</font></b>'
-		if klonV > 0:klonV = 0 & '<b><font color = green>Enemy clones are vaporized.</font></b>'
-		if tumanV > 0:tumanV = 0 & '<b><font color = green>Enemy Fog is torn to shreds by the wind.</font></b>'
-	elseif SuccessValue < 0:
-		gs 'fight', 'applyDamage', $CasterType, CasterNumber, 200
-		'<b><font color = red>The spell backfires! You dramatically raised the air pressure, but the enemy is missed and you are instead caught.</font></b>'
-		if klon > 0:klon = 0 & '<b><font color = green>Your clones are vaporized.</font></b>'
-		if tuman > 0:tuman = 0 & '<b><font color = green>Your Fog is torn to shreds by the wind.</font></b>'
+		if dyneval('result=<<$TargetType>>_clone[<<TargetNumber>>]') > 0:
+			dynamic $spellFunc['UpdateAttrib'], 'clone', $TargetType, TargetNumber, '=', 0
+			'<b><font color = green>Enemy clones are vaporized.</font></b>'
+		end
+		if dyneval('result=<<$TargetType>>_fog[<<TargetNumber>>]') > 0:
+			dynamic $spellFunc['UpdateAttrib'], 'fog', $TargetType, TargetNumber, '=', 0
+			'<b><font color = green>Enemy Fog is torn to shreds by the wind.</font></b>'
+		end
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
-	xgt'atakA','atak'
 end
 
 if $ARGS[0] = 'vacuum':
 	if SuccessValue > 0:
-		defence += (1500 * SuccessValue)
+		dynamic $spellFunc['UpdateAttrib'], 'shield', $TargetType, TargetNumber, '+', SuccessValue * 1500
 		'<b><font color = green>A turbulent sphere of vacuum surrounds you blocking incoming attacks. You now have <<defence>> protection units.</font></b>'
-	elseif SuccessValue < 0:
-		defenceV += 1500
-		'<b><font color = red>The spell backfires! A turbulent sphere of vacuum surrounds your enemy blocking your attacks. Your enemy now has <<defence>> protection units.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
@@ -751,42 +691,24 @@ end
 if $ARGS[0] = 'vacuumshells':
 	if SuccessValue > 0:
 		gs 'fight', 'applyDamage', $TargetType, TargetNumber, 2500 * SuccessValue
-		bonusSh = 100
 		'<b><font color = green>Turbulent spheres of vacuum bombard your enemy. The air is full of whistling sounds as the spheres fly by at high speeds over the battlefield.</font></b>'
-		if klonV > 0:klonV = 0 & '<b><font color = green>Enemy clones are vaporized.</font></b>'
-		if tumanV > 0:tumanV = 0 & '<b><font color = green>Enemy Fog is torn to shreds by the wind.</font></b>'
-	elseif SuccessValue < 0:
-		gs 'fight', 'applyDamage', $CasterType, CasterNumber, 200
-		'<b><font color = red>The spell backfires! Turbulent spheres of vacuum bombard your enemy. The air is full of whistling sounds as the spheres fly by at high speeds over the battlefield, but the enemy is missed and you are instead caught.</font></b>'
-		if klon > 0:klon = 0 & '<b><font color = green>Your clones are vaporized.</font></b>'
-		if tuman > 0:tuman = 0 & '<b><font color = green>Your Fog is torn to shreds by the wind.</font></b>'
+		if dyneval('result=<<$TargetType>>_clone[<<TargetNumber>>]') > 0:
+			dynamic $spellFunc['UpdateAttrib'], 'clone', $TargetType, TargetNumber, '=', 0
+			'<b><font color = green>Enemy clones are vaporized.</font></b>'
+		end
+		if dyneval('result=<<$TargetType>>_fog[<<TargetNumber>>]') > 0:
+			dynamic $spellFunc['UpdateAttrib'], 'fog', $TargetType, TargetNumber, '=', 0
+			'<b><font color = green>Enemy Fog is torn to shreds by the wind.</font></b>'
+		end
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
-	xgt'atakA','atak'
 end
 
 if $ARGS[0] = 'devouringvacuum':
 	if SuccessValue > 0:
-		defenceV = 0
-		defenceMV = 0
-		defenceWV = 0
-		defenceActParV = 0
-		defenceActParMV = 0
-		defenceActV = 0
-		defenceActMV = 0
-		defAtkMV = 0
+		dynamic $spellFunc['UpdateAttrib'], 'shield', $TargetType, TargetNumber, '=', 0
 		'<b><font color = green>A devouring vacuum sucks away your enemys defenses.</font></b>'
-	elseif SuccessValue < 0:
-		defence = 0
-		defenceM = 0
-		defenceW = 0
-		defenceActPar = 0
-		defenceActParM = 0
-		defenceAct = 0
-		defenceActM = 0
-		defAtkM = 0
-		'<b><font color = red>The spell backfires! A devouring vacuum sucks away your defenses.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
@@ -796,6 +718,7 @@ if $ARGS[0] = 'leechmana':
 	if SuccessValue > 0:
 		gs 'fight', 'applyDamage', $TargetType, TargetNumber, 100
 		damTipM = 1000
+		dynamic $spellFunc['UpdateAttrib'], 'mana', $CasterType, CasterNumber, '+', 1000
 		'<b><font color = green>You leech mana from your enemy.</font></b>'
 	elseif SuccessValue < 0:
 		gs 'fight', 'applyDamage', $CasterType, CasterNumber, 50
@@ -803,13 +726,11 @@ if $ARGS[0] = 'leechmana':
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
-	xgt'atakA','atak'
 end
 
 if $ARGS[0] = 'flood':
 	if SuccessValue > 0:
 		gs 'fight', 'applyDamage', $TargetType, TargetNumber, 1000 * SuccessValue
-		damTipM = 500
 		'<b><font color = green>A surge of water rises towards your enemy.</font></b>'
 	elseif SuccessValue < 0:
 		gs 'fight', 'applyDamage', $CasterType, CasterNumber, 100
@@ -817,22 +738,12 @@ if $ARGS[0] = 'flood':
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
-	xgt'atakA','atak'
 end
 
 if $ARGS[0] = 'blister':
 	if SuccessValue > 0:
-		defence += 1500
-		defenceM += 1500
-		defenceW += 1500
-		defenceActPar = 500
-		defenceActParM = 500
-		defenceAct = 10
-		defenceActM = 10
+		dynamic $spellFunc['UpdateAttrib'], 'shield', $TargetType, TargetNumber, '+', 1500
 		'<b><font color = green>A protective sphere of water surrounds you.</font></b>'
-	elseif SuccessValue < 0:
-		defenceV += 1500
-		'<b><font color = red>The spell backfires! A protective sphere of water surrounds your enemy.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
@@ -841,14 +752,11 @@ end
 if $ARGS[0] = 'sharkrockets':
 	if SuccessValue > 0:
 		gs 'fight', 'applyDamage', $TargetType, TargetNumber, 1500 * SuccessValue
-		damTipM = 2500
-		bonusSh = 50
 		'<b><font color = green>Blobs of Water shaped like sharks fly towards your enemy stiking them.</font></b>'
-		if klonV > 0:klonV = 0 & '<b><font color = green>Enemy clones are eliminated.</font></b>'
-	elseif SuccessValue < 0:
-		gs 'fight', 'applyDamage', $CasterType, CasterNumber, 100
-		'<b><font color = red>The spell backfires! Blobs of Water shaped like sharks fly towards your enemy, but missed and hits you.</font></b>'
-		if klon > 0:klon = 0 & '<b><font color = green>Your clones are eliminated.</font></b>'
+		if dyneval('result=<<$TargetType>>_clone[<<TargetNumber>>]') > 0:
+			dynamic $spellFunc['UpdateAttrib'], 'clone', $TargetType, TargetNumber, '=', 0
+			'<b><font color = green>Enemy clones are vaporized.</font></b>'
+		end
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
@@ -857,20 +765,12 @@ end
 
 if $ARGS[0] = 'greatflood':
 	if SuccessValue > 0:
-		defence += 5000
-		defenceM += 5000
-		defenceW += 5000
-		defenceActPar = 500
-		defenceActParM = 500
-		defenceAct = 10
-		defenceActM = 10
-		defAtkM = 10
+		dynamic $spellFunc['UpdateAttrib'], 'shield', $TargetType, TargetNumber, '+', 5000
 		'<b><font color = green>You have filled the whole neighborhood with water protecting you and devouring enemy mana.</font></b>'
-		if klonV > 0:klonV = 0 & '<b><font color = green>Clones enemy disappeared.</font></b>'
-	elseif SuccessValue < 0:
-		defenceV += 1500
-		'<b><font color = red>The spell backfires! A huge flood of water surrounds your enemy protecting him.</font></b>'
-		if klon > 0:klon = 0 & '<b><font color = green>Clones enemy disappeared.</font></b>'
+		if dyneval('result=<<$TargetType>>_clone[<<TargetNumber>>]') > 0:
+			dynamic $spellFunc['UpdateAttrib'], 'clone', $TargetType, TargetNumber, '=', 0
+			'<b><font color = green>Enemy clones are vaporized.</font></b>'
+		end
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end

+ 58 - 2
locations/spellBook.qsrc

@@ -22,7 +22,7 @@ if $spellBookVar['CodeAfterSpell'] = '':
 end
 
 ! lets the user back out if they don''t want ot cast.
-act 'Never mind':dynamic $spellBookVar['ActionCode']
+dynamic "act 'Never mind': <<$spellBookVar['ActionCode']>>"
 
 ! This just makes sure the current spellLists are loaded
 gs 'spellList'
@@ -98,6 +98,62 @@ elseif $spellBookVar['Type'] = 'cast':
 				end
 
 			end
+			$result = $tmpHTMLCode
+			spellBookVar['Counter'] += 1
+			killvar '$tmpHTMLCode'
+			killvar 'n'
+		else
+			$result = ''
+		end
+	}
+!! 'list' type is list of castable targetable spells.  This makes a table of spells for the user to cast in combat.
+elseif $spellBookVar['Type'] = 'targetable':
+	$spellBookVar['TableText'] = "
+	<center>
+		<table CELLPADDING = '5'>
+			<tr>
+				<th align='left'>Spell</th>
+				<th align='left'>Mana</th>
+				<th align='left'>Targets</th>
+				<th align='left'>Description</th>
+			</tr>"
+	$spellBookVar['RowCode'] = {
+		if spellKnown[$ThisSpellName] = 1:
+			$tmpHTMLCode = " 
+			<tr>
+				<td align='left'><<$spellName[$ThisSpellName]>></td>
+				<td align='right'><<spellMana[$ThisSpellName]>></td>
+				<td align='center'>"
+			if $spellTarget[$ThisSpellName] = 'self':
+				$tmpHTMLCode += " 
+				<a href=""EXEC: gs 'castSpell', '<<$ThisSpellName>>', 'pcs', 0, 0 & <<$spellBookVar['CodeAfterSpell']>>"">You</a>"
+			elseif $spellTarget[$ThisSpellName] = 'team':
+				n=0
+				:RowCodeLoop96
+				if n < arrsize('pcs_health'):
+					$spellBookVar['tmpName']= dyneval('$result = $pcs_name[<<n>>]')
+					$tmpHTMLCode += " 
+					<a href=""EXEC: gs 'castSpell', '<<$ThisSpellName>>', 'pcs', <<n>>, 0 & <<$spellBookVar['CodeAfterSpell']>>""><<$spellBookVar['tmpName']>></a>
+					<br>"
+					n += 1
+					jump 'RowCodeLoop96'
+				end
+			else
+				n=0
+				:RowCodeLoop97
+				if n < arrsize('opp_health'):
+					$spellBookVar['tmpName']= dyneval('$result = $opp_name[<<n>>]')
+					$tmpHTMLCode += " 
+					<a href=""EXEC: gs 'castSpell', '<<$ThisSpellName>>', 'opp', <<n>>, 0 & <<$spellBookVar['CodeAfterSpell']>>""><<$spellBookVar['tmpName']>></a>
+					<br>"
+					n += 1
+					jump 'RowCodeLoop97'
+				end
+			end
+			$tmpHTMLCode += " </td>
+				<td align='left'><<$spellDesc[$ThisSpellName]>></td>
+			</tr>"
+
 			$result = $tmpHTMLCode
 			spellBookVar['Counter'] += 1
 			killvar '$tmpHTMLCode'
@@ -180,7 +236,7 @@ $spellBookVar['TableText'] += "
 if spellBookVar['Counter'] = 0:
 	$spellBookVar['TableText'] = "<center>You have no spells in this list.</center>"
 end
-
+!*pl $spellBookVar['TableText']
 $result = func('cleanHTML',$spellBookVar['TableText'])
 
 killvar 'i'

+ 49 - 1
locations/spellList.qsrc

@@ -8,7 +8,8 @@
 !	spellTime['spellname'] = How much time will pass in the casting of the spell
 !	spellDiff['spellname'] = Difficulty to learn and cast this spell
 !	$spellName['spellname'] = Pretty name for the spell
-!	$psellDesc['spellname'] = Description of what the spell does.
+!	$spellDesc['spellname'] = Description of what the spell does.
+!	$spellTarget['spellname'] = Intended Target of Spell (e.g.: 'self', 'team', 'enemy').
 !	$spellReq['spellname'] = Prerequisite Spell needed to learn this spell
 !	$spellOptDesc['spellname'] = name of an array of Option Descriptions for this spell
 !	$spellOptVal['spellname'] = name of an array of values to pass for Spell Options
@@ -42,6 +43,7 @@ spellTime['teleport'] = 20
 spellDiff['teleport'] = 20
 $spellName['teleport'] = 'Teleport'
 $spellDesc['teleport'] = 'You can move from one Fairy Circle to another.'
+$spellTarget['teleport'] = 'self'
 $spellOptDesc['teleport'] = '$treeCircName'
 $spellOptVal['teleport'] = '$tpLocations'
 !regenerate
@@ -50,18 +52,21 @@ spellTime['regenerate'] = 1
 spellDiff['regenerate'] = 5
 $spellName['regenerate'] = 'Regenerate'
 $spellDesc['regenerate'] = 'Slowly regain health over time.'
+$spellTarget['regenerate'] = 'self'
 !curedisease
 spellMana['curedisease'] = 10000
 spellTime['curedisease'] = 30
 spellDiff['curedisease'] = 25
 $spellName['curedisease'] = 'Cure Disease'
 $spellDesc['curedisease'] = 'Your body will burn itself free of any diseases you may have.'
+$spellTarget['teleport'] = 'self'
 !curewounds
 spellMana['curewounds'] = 10000
 spellTime['curewounds'] = 30
 spellDiff['curewounds'] = 25
 $spellName['curewounds'] = 'Cure Wounds'
 $spellDesc['curewounds'] = 'You feel your bodys wounds begin to heal.'
+$spellTarget['curewounds'] = 'team'
 !curewounds2
 spellMana['curewounds2'] = 100000
 spellTime['curewounds2'] = 60
@@ -69,30 +74,35 @@ spellDiff['curewounds2'] = 75
 $spellName['curewounds2'] = 'Greater Cure Wounds'
 $spellDesc['curewounds2'] = 'You feel your body heal to perfection.'
 $spellReq['curewounds2'] = 'curewounds'
+$spellTarget['curewounds2'] = 'team'
 !painblock
 spellMana['painblock'] = 1000
 spellTime['painblock'] = 1
 spellDiff['painblock'] = 8
 $spellName['painblock'] = 'Pain Block'
 $spellDesc['painblock'] = 'Block your pain for some time.'
+$spellTarget['painblock'] = 'self'
 !berserk
 spellMana['berserk'] = 5000
 spellTime['berserk'] = 1
 spellDiff['berserk'] = 30
 $spellName['berserk'] = 'Berserker Rage'
 $spellDesc['berserk'] = 'Enrage yourself with supernatural strength, speed, and endurance.'
+$spellTarget['berserk'] = 'self'
 !shower
 spellMana['shower'] = 500
 spellTime['shower'] = 1
 spellDiff['shower'] = 1
 $spellName['shower'] = 'Shower'
 $spellDesc['shower'] = 'Clean and refresh yourself as if you have taken a shower.'
+$spellTarget['shower'] = 'self'
 !makeup
 spellMana['makeup'] = 100
 spellTime['makeup'] = 5
 spellDiff['makeup'] = 15
 $spellName['makeup'] = 'Makeup'
 $spellDesc['makeup'] = 'Apply Makeup to yourself magically.'
+$spellTarget['makeup'] = 'self'
 $spellOptDesc['makeup'] = '$MakeupSet'
 $spellOptVal['makeup'] = '$MakeupSetVal'
 if $routine1+$routine2+$routine3+$routine4 = '':
@@ -140,12 +150,14 @@ spellTime['cosmetica'] = 5
 spellDiff['cosmetica'] = 50
 $spellName['cosmetica'] = 'Cosmetica'
 $spellDesc['cosmetica'] = 'Clean and tidy yourself, completely beautifying yourself; hair, makeup, grooming of all kinds.'
+$spellTarget['cosmetica'] = 'self'
 $spellReq['cosmetica'] = 'makeup'
 !glamour
 spellMana['glamour'] = 500
 spellTime['glamour'] = 1
 spellDiff['glamour'] = 30
 $spellName['glamour'] = 'Glamour'
+$spellTarget['glamour'] = 'self'
 $spellDesc['glamour'] = 'Change your appearance.'
 !bodymod
 spellMana['bodymod'] = 40
@@ -153,6 +165,7 @@ spellTime['bodymod'] = 30
 spellDiff['bodymod'] = 0
 $spellName['bodymod'] = 'Body Modification'
 $spellDesc['bodymod'] = 'Change your appearance.'
+$spellTarget['bodymod'] = 'self'
 
 !fog
 spellMana['fog'] = 10
@@ -160,30 +173,35 @@ spellTime['fog'] = 0
 spellDiff['fog'] = 1
 $spellName['fog'] = 'Fog'
 $spellDesc['fog'] = 'Create a fog on the battlefield, obscuring the view of the enemy.'
+$spellTarget['fog'] = 'self'
 !clone
 spellMana['clone'] = 15
 spellTime['clone'] = 0
 spellDiff['clone'] = 1
 $spellName['clone'] = 'Create Clone'
 $spellDesc['clone'] = 'You can create an exact clone of yourself, and slip out of sight of the enemy.'
+$spellTarget['clone'] = 'self'
 !stun
 spellMana['stun'] = 20
 spellTime['stun'] = 0
 spellDiff['stun'] = 2
 $spellName['stun'] = 'Stun'
 $spellDesc['stun'] = 'Paralyze the enemy with a touch.'
+$spellTarget['stun'] = 'enemy'
 !weapon
 spellMana['weapon'] = 20
 spellTime['weapon'] = 0
 spellDiff['weapon'] = 0
 $spellName['weapon'] = 'Empower Weapon'
 $spellDesc['weapon'] = 'Magically power a weapon causing greater damage.'
+$spellTarget['weapon'] = 'self'
 !wind
 spellMana['wind'] = 40
 spellTime['wind'] = 0
 spellDiff['wind'] = 2
 $spellName['wind'] = 'Gust of Wind'
 $spellDesc['wind'] = 'Summon a gust of wind that will clear away fog.'
+$spellTarget['wind'] = 'enemy'
 !multiclone
 spellMana['multiclone'] = 45
 spellTime['multiclone'] = 0
@@ -191,36 +209,42 @@ spellDiff['multiclone'] = 2
 $spellName['multiclone'] = 'Multi-Clone'
 $spellDesc['multiclone'] = 'Summon three clones of yourself and slip out of the enemys sight.'
 $spellReq['multiclone'] = 'clone'
+$spellTarget['multiclone'] = 'self'
 !energo
 spellMana['energo'] = 50
 spellTime['energo'] = 0
 spellDiff['energo'] = 3
 $spellName['energo'] = 'Energy Shield'
 $spellDesc['energo'] = 'Create an energy shield to absorb incoming damage.  You gain 100 defense.'
+$spellTarget['energo'] = 'self'
 !haste
 spellMana['haste'] = 60
 spellTime['haste'] = 0
 spellDiff['haste'] = 3
 $spellName['haste'] = 'Haste'
 $spellDesc['haste'] = 'Hasten your passage through time to gain reaction speed to seize the initiative.'
+$spellTarget['haste'] = 'self'
 !heal
 spellMana['heal'] = 400
 spellTime['heal'] = 0
 spellDiff['heal'] = 4
 $spellName['heal'] = 'Heal'
 $spellDesc['heal'] = 'Exchange mana for health, healing your wounds and fortifying your body.'
+$spellTarget['heal'] = 'team'
 !hand
 spellMana['hand'] = 100
 spellTime['hand'] = 0
 spellDiff['hand'] = 0
 $spellName['hand'] = 'Quivering Palm'
 $spellDesc['hand'] = 'Add energy from your mana to your hand for a devistating strike.'
+$spellTarget['wind'] = 'enemy'
 !scaldingtouch
 spellMana['scaldingtouch'] = 10
 spellTime['scaldingtouch'] = 0
 spellDiff['scaldingtouch'] = 6
 $spellName['scaldingtouch'] = 'Scalding Touch'
 $spellDesc['scaldingtouch'] = 'Flames spring from your hands.'
+$spellTarget['scaldingtouch'] = 'enemy'
 !burninghands
 spellMana['burninghands'] = 100
 spellTime['burninghands'] = 0
@@ -228,42 +252,49 @@ spellDiff['burninghands'] = 7
 $spellName['burninghands'] = 'Burning Hands'
 $spellDesc['burninghands'] = 'A torrent of flames jets from your hands.'
 $spellReq['burninghands'] = 'scaldingtouch'
+$spellTarget['burninghands'] = 'enemy'
 !firebarrier
 spellMana['firebarrier'] = 150
 spellTime['firebarrier'] = 0
 spellDiff['firebarrier'] = 8
 $spellName['firebarrier'] = 'Fire Barrier'
 $spellDesc['firebarrier'] = 'You are shielded by a wall of flames.  Adds 750 defense.'
+$spellTarget['firebarrier'] = 'self'
 !firestorm
 spellMana['firestorm'] = 250
 spellTime['firestorm'] = 0
 spellDiff['firestorm'] = 9
 $spellName['firestorm'] = 'Fire Storm'
 $spellDesc['firestorm'] = 'Super heated embers rain down upon your enemies.'
+$spellTarget['firestorm'] = 'enemy'
 !flameshield
 spellMana['flameshield'] = 500
 spellTime['flameshield'] = 0
 spellDiff['flameshield'] = 10
 $spellName['flameshield'] = 'Flame Shield'
 $spellDesc['flameshield'] = 'A Shield made of Flames interposes itself between you and your enemy, absorbing 2500 damage to defend you.'
+$spellTarget['flameshield'] = 'self'
 !shock
 spellMana['shock'] = 10
 spellTime['shock'] = 0
 spellDiff['shock'] = 6
 $spellName['shock'] = 'Electric Shock'
 $spellDesc['shock'] = 'An electric spark shoots from your hand.'
+$spellTarget['shock'] = 'enemy'
 !lightning
 spellMana['lightning'] = 100
 spellTime['lightning'] = 0
 spellDiff['lightning'] = 7
 $spellName['lightning'] = 'Lightning'
 $spellDesc['lightning'] = 'A lightning bolt shoots from your hand.'
+$spellTarget['lightning'] = 'enemy'
 !electricbarrier
 spellMana['electricbarrier'] = 150
 spellTime['electricbarrier'] = 0
 spellDiff['electricbarrier'] = 8
 $spellName['electricbarrier'] = 'Electric Barrier'
 $spellDesc['electricbarrier'] = 'A static electric field blocks incoming attacks from reaching you.'
+$spellTarget['electricbarrier'] = 'self'
 !1000birds
 spellMana['1000birds'] = 250
 spellTime['1000birds'] = 0
@@ -271,102 +302,119 @@ spellDiff['1000birds'] = 9
 $spellName['1000birds'] = 'Dance of a Thousand Birds'
 $spellDesc['1000birds'] = 'The air is filled with small lightning bolts leaping through the air with shrieks.'
 $spellReq['1000birds'] = 'lightning'
+$spellTarget['1000birds'] = 'enemy'
 !dancingsphere
 spellMana['dancingsphere'] = 500
 spellTime['dancingsphere'] = 0
 spellDiff['dancingsphere'] = 10
 $spellName['dancingsphere'] = 'Dancing Sphere'
 $spellDesc['dancingsphere'] = 'Lightning dances around you blocking attacks coming toward you.'
+$spellTarget['dancingsphere'] = 'self'
 !quicksand
 spellMana['quicksand'] = 10
 spellTime['quicksand'] = 0
 spellDiff['quicksand'] = 6
 $spellName['quicksand'] = 'Quicksand'
 $spellDesc['quicksand'] = 'Opponent is caught in a quicksand trap.'
+$spellTarget['quicksand'] = 'enemy'
 !earthshield
 spellMana['earthshield'] = 100
 spellTime['earthshield'] = 0
 spellDiff['earthshield'] = 7
 $spellName['earthshield'] = 'Earth Shield'
 $spellDesc['earthshield'] = 'Tendrils of earth reach up to defend you. Some of the damage it absorbs is captured as mana and given to you.'
+$spellTarget['earthshield'] = 'self'
 !abyss
 spellMana['abyss'] = 150
 spellTime['abyss'] = 0
 spellDiff['abyss'] = 8
 $spellName['abyss'] = 'Abyss'
 $spellDesc['abyss'] = 'The Earth opens up beneath your opponents feet, slamming shut damaging him and depriving him of the ability to move.'
+$spellTarget['abyss'] = 'enemy'
 !earthguardian
 spellMana['earthguardian'] = 250
 spellTime['earthguardian'] = 0
 spellDiff['earthguardian'] = 9
 $spellName['earthguardian'] = 'Earth Guardian'
 $spellDesc['earthguardian'] = 'The Earth itself comes alive defending you from attacks.  It draws from the power of the land to regenerate itself every round.'
+$spellTarget['earthguardian'] = 'self'
 !sando
 spellMana['sando'] = 500
 spellTime['sando'] = 0
 spellDiff['sando'] = 10
 $spellName['sando'] = 'Sando'
 $spellDesc['sando'] = 'Two huge plates of earth colapse together crushing the enemy and depriving him of the ability to move.'
+$spellTarget['sando'] = 'enemy'
 !windgust
 spellMana['windgust'] = 10
 spellTime['windgust'] = 0
 spellDiff['windgust'] = 6
 $spellName['windgust'] = 'Wind Gust'
 $spellDesc['windgust'] = 'a huge gust of wind rips past you killing clones and removing fog.'
+$spellTarget['windgust'] = 'enemy'
 !pressure
 spellMana['pressure'] = 100
 spellTime['pressure'] = 0
 spellDiff['pressure'] = 7
 $spellName['pressure'] = 'Horrific Pressure'
 $spellDesc['pressure'] = 'Enormous air pressure surrounds your enemy causing damage as well as killing clones and removing fog.'
+$spellTarget['pressure'] = 'enemy'
 !vacuum
 spellMana['vacuum'] = 150
 spellTime['vacuum'] = 0
 spellDiff['vacuum'] = 8
 $spellName['vacuum'] = 'Vacuum Sphere'
 $spellDesc['vacuum'] = 'A turbulent sphere of vacuum surrounds you blocking incoming attacks.'
+$spellTarget['vacuum'] = 'self'
 !vacuumshells
 spellMana['vacuumshells'] = 250
 spellTime['vacuumshells'] = 0
 spellDiff['vacuumshells'] = 9
 $spellName['vacuumshells'] = 'Vacuum Shells'
 $spellDesc['vacuumshells'] = 'Turbulent spheres of vacuum bombard your enemy destroying clones and removing fog.'
+$spellTarget['vacuumshells'] = 'enemy'
 !devouringvacuum
 spellMana['devouringvacuum'] = 500
 spellTime['devouringvacuum'] = 0
 spellDiff['devouringvacuum'] = 10
 $spellName['devouringvacuum'] = 'Devouring Vacuum'
 $spellDesc['devouringvacuum'] = 'A devouring vacuum sucks away your enemys defensive shields.'
+$spellTarget['devouringvacuum'] = 'enemy'
 !leechmana
 spellMana['leechmana'] = 10
 spellTime['leechmana'] = 0
 spellDiff['leechmana'] = 6
 $spellName['leechmana'] = 'Leech Mana'
 $spellDesc['leechmana'] = 'Inflict 100 damage and absorb 100 mana from your foe.'
+$spellTarget['leechmana'] = 'enemy'
 !flood
 spellMana['flood'] = 100
 spellTime['flood'] = 0
 spellDiff['flood'] = 7
 $spellName['flood'] = 'Flood'
 $spellDesc['flood'] = 'Inflict 1000 damage and absorb 500 mana from your foe.'
+$spellTarget['flood'] = 'enemy'
 !blister
 spellMana['blister'] = 150
 spellTime['blister'] = 0
 spellDiff['blister'] = 8
 $spellName['blister'] = 'Blister'
 $spellDesc['blister'] = 'Create a protective sphere of water.  Some of the damage absorbed is converted into mana for you.'
+$spellTarget['blister'] = 'enemy'
 !sharkrockets
 spellMana['sharkrockets'] = 250
 spellTime['sharkrockets'] = 0
 spellDiff['sharkrockets'] = 9
 $spellName['sharkrockets'] = 'Shark Rockets'
 $spellDesc['sharkrockets'] = 'Blobs of Water shaped like sharks fly towards your enemy stiking them for 1500 damage and abosorbing 2500 mana for you.  Clones are destroyed'
+$spellTarget['sharkrockets'] = 'enemy'
 !greatflood
 spellMana['greatflood'] = 500
 spellTime['greatflood'] = 0
 spellDiff['greatflood'] = 10
 $spellName['greatflood'] = 'Great Flood'
 $spellDesc['greatflood'] = 'A huge flood of water fills the area absorbing mana from the enemy and giving you additional protection.'
+$spellTarget['greatflood'] = 'enemy'
 
 
 !-------------------------------------------------------------------------------------------