summaryrefslogtreecommitdiff
path: root/world/map/npc/magic/level1-lesser-heal.txt
diff options
context:
space:
mode:
Diffstat (limited to 'world/map/npc/magic/level1-lesser-heal.txt')
-rw-r--r--world/map/npc/magic/level1-lesser-heal.txt20
1 files changed, 14 insertions, 6 deletions
diff --git a/world/map/npc/magic/level1-lesser-heal.txt b/world/map/npc/magic/level1-lesser-heal.txt
index 6b728e81..22aec370 100644
--- a/world/map/npc/magic/level1-lesser-heal.txt
+++ b/world/map/npc/magic/level1-lesser-heal.txt
@@ -15,16 +15,23 @@
callfunc "adjust_spellpower";
set Sp, Sp - 6;
misceffect FX_MAGIC_WHITE, strcharinfo(0);
- if (@target_id != BL_ID) misceffect FX_MAGIC_WHITE, @target_id;
- // TODO gain_heal_exp
- // TODO magic_exp
+ set .@heal_value, (get(MaxHp, @target_id) - get(Hp, @target_id));
+ set @mexp, .exp_gain;
+ if (.@heal_value < 200)
+ set .@heal_value, 200;
if (@args$ == "Mouboo" || @args$ == "mouboo") goto L_Mouboo;
+ if (@target_id != BL_ID) goto L_NotMe;
+ goto L_Continue;
- if (getskilllv(SKILL_MAGIC_DARK) >= 1) sc_start SC_HALT_REGENERATE, 2000, 0;
+L_NotMe:
+ misceffect FX_MAGIC_WHITE, @target_id;
+ callfunc "gain_heal_xp";
+ goto L_Continue;
- set @heal_amount, 200, @target_id;
+L_Continue:
+ if (getskilllv(SKILL_MAGIC_DARK) >= 1) sc_start SC_HALT_REGENERATE, 2000, 0;
if (attachrid(@target_id) != 1) end; // XXX: to avoid the ugly attachrid method we would need some kind of `run_as` builtin
- if (!(isdead())) heal @heal_amount, 0, 1;
+ if (!(isdead())) heal .@heal_value, 1, 1;
end;
L_Mouboo:
@@ -37,5 +44,6 @@ OnInit:
void call("magic_register");
set .level, 1;
set .exp_gain, 1;
+ set .heal_xp_value_divisor, 2;
end;
}