Jelajahi Sumber

Added Spell "Berserker Rage"

KeyMasterOfGozer 5 tahun lalu
induk
melakukan
8fae12e9b1
3 mengubah file dengan 64 tambahan dan 3 penghapusan
  1. 54 1
      locations/spell.qsrc
  2. 8 0
      locations/spellList.qsrc
  3. 2 2
      locations/spellTimer.qsrc

+ 54 - 1
locations/spell.qsrc

@@ -77,6 +77,7 @@ if $ARGS[0] = 'regenerate':
 
 		'<b><font color = green>Your body surges with life. You feel better already.</font></b>'
 		killvar 'regenVal'
+		killvar 'regenArrIdx'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
@@ -84,13 +85,65 @@ end
 
 if $ARGS[0] = 'painblock':
 	if SuccessValue > 0:
-		pain['killer'] += 1
+		pain['killer'] = 1
 		'<b><font color = green>Your pain recedes into a dull throb.</font></b>'
 	else
 		'<b>The spell fizzles.  Nothing seems to happen.</b>'
 	end
 end
 
+if $ARGS[0] = 'berserk':
+	if SuccessValue > 0:
+		spellArrIdx = arrpos('$spellTimeName','berserk')
+		pain['killer'] = 1
+		if spellArrIdx > -1:
+			! if it''s found, then update only
+			spellComplete[spellArrIdx] = totminut + 120
+		else
+			! Save current Health percentage, since changing these stats will change healthmax
+			healthPercent = pcs_health * 100 / healthmax
+			staminPercent = pcs_stam * 100 / stammax
+			! Boost Stats
+			stren_lvl += 200
+			stren_lvlst += 200
+			stren_muta += 4
+			agil_lvl += 200
+			agil_lvlst += 200
+			agil_muta += 4
+			vital_lvl += 200
+			vital_lvlst += 200
+			vital_muta += 4
+			!gs 'stat_sklattrib'
+			! Run stats to recalculate max health
+			gs 'stat'
+			! Update health to be appropiate percentage of new healthmax
+			pcs_health = (healthPercent * healthmax / 100) + 1
+			pcs_stam = (staminPercent * stammax) + 1
+			! Add Timer to remove this effect after tiem period
+			$berserkCode={
+				! Return Stats to normal
+				stren_lvl -= 200
+				stren_lvlst -= 200
+				stren_muta -= 4
+				agil_lvl -= 200
+				agil_lvlst -= 200
+				agil_muta -= 4
+				vital_lvl -= 200
+				vital_lvlst -= 200
+				vital_muta -= 4
+			}
+			gs 'spellTimer', 'add', 'berserk', 120, $berserkCode, ''
+		end
+		'<b><font color = green>You feel a huge adrenalin surge. You begin looking for someone to battle.</font></b>'
+	else
+		'<b>The spell fizzles.  Nothing seems to happen.</b>'
+	end
+	killvar 'spellArrIdx'
+	killvar 'berserkCode'
+	killvar 'healthPercent'
+	killvar 'staminPercent'
+end
+
 if $ARGS[0] = 'reset':
 	cla
 	!Create mist

+ 8 - 0
locations/spellList.qsrc

@@ -41,6 +41,12 @@ spellTime['painblock'] = 1
 spellDiff['painblock'] = 8
 $spellName['painblock'] = "Pain Block"
 $spellDesc['painblock'] = "Block your pain for some time."
+!berserk
+spellMana['berserk'] = 5000
+spellTime['berserk'] = 1
+spellDiff['berserk'] = 30
+$spellName['berserk'] = "Berserker Rage"
+$spellDesc['berserk'] = "Enrage yourself with supernatural strength, speed, and endurance."
 !glamour
 spellMana['glamour'] = 500
 spellTime['glamour'] = 1
@@ -307,6 +313,7 @@ $combatSpells[34] = 'greatflood'
 $nonComSpells[0] = 'heal'
 $nonComSpells[1] = 'regenerate'
 $nonComSpells[2] = 'painblock'
+$nonComSpells[3] = 'berserk'
 
 
 ! Basic Spells
@@ -319,6 +326,7 @@ $basicSpells[5] = 'energo'
 $basicSpells[6] = 'haste'
 $basicSpells[7] = 'regenerate'
 $basicSpells[8] = 'painblock'
+$basicSpells[9] = 'berserk'
 
 
 ! Elemental Spell Groups

+ 2 - 2
locations/spellTimer.qsrc

@@ -59,10 +59,10 @@ else
 		else
 			SpellEnds = 0
 		end
-		if NumTicks > 0:
+		if NumTicks > 0 and $spellTickExec[i] ! '':
 			j=0
 			:SpellTickLoop
-			if j < NumTicks and $spellTickExec[i] ! '':
+			if j < NumTicks:
 				dynamic $spellTickExec[i]
 				j += 1
 				jump 'SpellTickLoop'