summaryrefslogtreecommitdiff
path: root/npc/magic/level1-lesser-heal.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/magic/level1-lesser-heal.txt')
-rw-r--r--npc/magic/level1-lesser-heal.txt49
1 files changed, 49 insertions, 0 deletions
diff --git a/npc/magic/level1-lesser-heal.txt b/npc/magic/level1-lesser-heal.txt
new file mode 100644
index 00000000..bf515062
--- /dev/null
+++ b/npc/magic/level1-lesser-heal.txt
@@ -0,0 +1,49 @@
+// The Mana World script
+// Author: Jesusalva <jesusalva@themanaworld.org>
+//
+// Magic Script: SKILL_LUM (Level 1)
+// School: Life 1
+
+function script SK_Lum {
+ // In some cases it is... aborted
+ if (getunittype(@skillTarget) == UNITTYPE_PC) {
+ .@me=getcharid(3);
+ .@ok=true;
+ attachrid(@skillTarget);
+ // Kill the GM Event
+ if (isequipped(MagicGMTopHat))
+ .@ok=false;
+ // Ailments cannot prevent this one because the Lifestione, so...
+ // Already dead
+ if (Hp < 1)
+ .@ok=false;
+ // Finished
+ .@limit=MaxHp-Hp;
+ detachrid();
+ attachrid(.@me);
+ if (!.@ok) return;
+ } else {
+ if (getunitdata(@skillTarget, UDT_HP) < 1) return;
+ .@limit=getunitdata(@skillTarget, UDT_MAXHP)-
+ getunitdata(@skillTarget, UDT_HP);
+ }
+
+ // No need for healing?
+ if (.@limit <= 0) return;
+
+ // Real healing happens here
+ .@PW=90+(10*@skillLv);
+ .@dmg=AdjustSpellpower(.@PW);
+ sc_start(SC_G_LIFEPOTION, 5000, 1+.@dmg/5, 10000,
+ SCFLAG_NOAVOID|SCFLAG_FIXEDTICK|SCFLAG_FIXEDRATE, @skillTarget);
+
+ // Specifics
+ if (getskilllv(SKILL_MAGIC_DARK) >= 1)
+ SC_Bonus(2, SC_BLOODING, 1); // FIXME SC_REBOUND? SC_MAGICMUSHROOM?
+
+ // Gives EXP according to how much you healed
+ getexp min(.@dmg, .@limit)*getskilllv(SKILL_MAGIC_LIFE), .@PW/10;
+ GetManaExp(@skillId, 1);
+ return;
+}
+