summaryrefslogtreecommitdiff
path: root/world
diff options
context:
space:
mode:
Diffstat (limited to 'world')
-rw-r--r--world/map/npc/functions/global_event_handler.txt1
-rw-r--r--world/map/npc/magic/level2-lightning-strike.txt4
2 files changed, 3 insertions, 2 deletions
diff --git a/world/map/npc/functions/global_event_handler.txt b/world/map/npc/functions/global_event_handler.txt
index 915423e8..d169f3c7 100644
--- a/world/map/npc/functions/global_event_handler.txt
+++ b/world/map/npc/functions/global_event_handler.txt
@@ -37,6 +37,7 @@ OnMobKillEvent:
OnPCDieEvent:
set @necromancer, 0;
addtimer 0, "Magic Timer::OnClear"; // reset magic block on death
+ addtimer 0, "::OnDischarge"; // seeks OnDischarge in ALL npcs (discharge chargeable spells on PC death)
callfunc "SpawnGhost";
callfunc "MiriamExpire"; // force the speed skill quest to expire
set @killerrid, 0; // reset killer rid
diff --git a/world/map/npc/magic/level2-lightning-strike.txt b/world/map/npc/magic/level2-lightning-strike.txt
index bdd311a6..0a97dc63 100644
--- a/world/map/npc/magic/level2-lightning-strike.txt
+++ b/world/map/npc/magic/level2-lightning-strike.txt
@@ -30,12 +30,11 @@
OnAttack:
if (target(BL_ID, @target_id, 0x36) != 0x36) goto L_FreeRecast; // 0x10 | 0x02 | 0x04 | 0x20
-
set .@p, get(.max_radius, "rain") + 1;
set @ingravspell[5], @target_id; // store it because foreach overwrites it
foreach 1, getmap(), POS_X-.@p, POS_Y-.@p, POS_X+.@p, POS_Y+.@p, strnpcinfo(0)+"::OnNpc";
set @target_id, @ingravspell[5]; // now restore it
-
+ if (@ingravspell[2] <= 0) overrideattack; // workaround for caster in rain death case
set @ingravspell[2], @ingravspell[2] - 1;
if (@ingravspell[4] & 1) goto L_InRain;
void call("elt_damage", @ingravspell[0], (@ingravspell[0]/2)+1, ELT_EARTH, ELT_WIND, FX_LIGHTNING1 + rand(3));
@@ -49,6 +48,7 @@ L_FreeRecast:
OnDischarge:
if (@ingravspell[2] < 1) end;
set @ingravspell[2], 0;
+ set @ingravspell[4], 0; // Clean up "in rain" flag, it caused funny bugs.
misceffect FX_MAGIC_DISCHARGE, strcharinfo(0);
overrideattack;
end;