From 502bb1adfbe060d81b8bbcd6d41153170f43031c Mon Sep 17 00:00:00 2001 From: wushin Date: Tue, 8 Mar 2016 18:27:49 -0600 Subject: Add heal_gain_xp --- world/map/npc/magic/_procedures.txt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'world/map/npc/magic/_procedures.txt') 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; +} -- cgit v1.2.3-60-g2f50