From 931217d3ba156cecb25fa647bc572630147e60fd Mon Sep 17 00:00:00 2001 From: mekolat Date: Fri, 24 Apr 2015 15:17:04 -0400 Subject: clean global handler --- world/map/npc/002-1/elanore.txt | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'world/map/npc/002-1/elanore.txt') diff --git a/world/map/npc/002-1/elanore.txt b/world/map/npc/002-1/elanore.txt index be14c8bc..b6cdde5a 100644 --- a/world/map/npc/002-1/elanore.txt +++ b/world/map/npc/002-1/elanore.txt @@ -17,6 +17,24 @@ function|script|ElanoreFix return; } +function|script|elanore_decrease_exp +{ + if (attachrid(@killerrid) == 0) + end; + set @Q_heal_exp, MAGIC_EXPERIENCE >> 24; + if (@Q_heal_exp < 8) goto L_OnPcKillWipe; + set @Q_heal_exp, @Q_heal_exp - 8; + goto L_OnPcKillFinish; + +L_OnPcKillWipe: + set @Q_heal_exp, 0; + goto L_OnPcKillFinish; + +L_OnPcKillFinish: + set MAGIC_EXPERIENCE, (MAGIC_EXPERIENCE & ~(255 << 24)) | (@Q_heal_exp << 24); + return; +} + 002-1,75,62,0|script|Elanore#_M|108 { set @has_magic, getskilllv(SKILL_MAGIC); @@ -155,22 +173,6 @@ L_Main: "Goodbye!", L_bye; goto L_Close; -OnPCKillEvent: - if (attachrid(@killerrid) == 0) - end; - set @Q_heal_exp, MAGIC_EXPERIENCE >> 24; - if (@Q_heal_exp < 8) goto L_OnPcKillWipe; - set @Q_heal_exp, @Q_heal_exp - 8; - goto L_OnPcKillFinish; - -L_OnPcKillWipe: - set @Q_heal_exp, 0; - goto L_OnPcKillFinish; - -L_OnPcKillFinish: - set MAGIC_EXPERIENCE, (MAGIC_EXPERIENCE & ~(255 << 24)) | (@Q_heal_exp << 24); - goto L_Close; - L_Lifestones: mes "[Elanore the Healer]"; mes "\"I always need components for my own healing spells. If you bring me ten gamboge leaves, ten alizarin leaves, ten mauve leaves and ten cobalt leaves, I can make ten lifestones; I will give you half of them.\""; -- cgit v1.2.3-60-g2f50