diff options
author | wushin <pasekei@gmail.com> | 2016-03-08 18:27:49 -0600 |
---|---|---|
committer | mekolat <mekolat@users.noreply.github.com> | 2016-03-30 11:22:50 -0400 |
commit | 502bb1adfbe060d81b8bbcd6d41153170f43031c (patch) | |
tree | 8f3f9c992a07d83e0063e67974442190ff747a7a /world/map/npc/magic/_procedures.txt | |
parent | afb8f6982d9a6458197faeb9c035b0a882b5b7fa (diff) | |
download | serverdata-502bb1adfbe060d81b8bbcd6d41153170f43031c.tar.gz serverdata-502bb1adfbe060d81b8bbcd6d41153170f43031c.tar.bz2 serverdata-502bb1adfbe060d81b8bbcd6d41153170f43031c.tar.xz serverdata-502bb1adfbe060d81b8bbcd6d41153170f43031c.zip |
Add heal_gain_xp
Diffstat (limited to 'world/map/npc/magic/_procedures.txt')
-rw-r--r-- | world/map/npc/magic/_procedures.txt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/world/map/npc/magic/_procedures.txt b/world/map/npc/magic/_procedures.txt index b2a734c2..3fe0ed34 100644 --- a/world/map/npc/magic/_procedures.txt +++ b/world/map/npc/magic/_procedures.txt @@ -126,3 +126,31 @@ function|script|adjust_spellpower L_Return: return; } + +function|script|gain_heal_xp +{ + set @last_heal_xp, ((SCRIPT_XP & SCRIPT_HEALSPELL_MASK) >> SCRIPT_HEALSPELL_SHIFT); + if ((@target_id != BL_ID) && ((.@heal_value / .heal_xp_value_divisor) > (((10 + @last_heal_xp) + rand(@last_heal_xp + 1)) + rand(@last_heal_xp + 1)))) + goto L_Block; + goto L_Return; + +L_Block: + set @heal_xp, (@last_heal_xp + @mexp); + if (@heal_xp > SCRIPT_HEALSPELL_MASK) + set @heal_xp, SCRIPT_HEALSPELL_MASK; + set XMASTIME, (XMASTIME & ~(NIBBLE_0_MASK) | (@xmas_state << NIBBLE_0_SHIFT)); + set SCRIPT_XP, (SCRIPT_XP & ~(SCRIPT_HEALSPELL_MASK) | (@heal_xp << SCRIPT_HEALSPELL_SHIFT)); + goto L_Gain_Xp; + +L_Gain_Xp: + set @target_heal_xp, (get(MaxHp, @target_id) - get(HEALXP, @target_id)); + set @heal_exp, .@heal_value; + if (@target_heal_xp < .@heal_value) + set @heal_exp, @target_heal_xp; + getexp (.base_exp_factor * @heal_exp), 0; + set HEALXP, (get(HEALXP, @target_id) + @heal_exp), @target_id; + goto L_Return; + +L_Return: + return; +} |