summaryrefslogtreecommitdiff
path: root/npc/magic/level2-lay-on-hands.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/magic/level2-lay-on-hands.txt')
-rw-r--r--npc/magic/level2-lay-on-hands.txt68
1 files changed, 68 insertions, 0 deletions
diff --git a/npc/magic/level2-lay-on-hands.txt b/npc/magic/level2-lay-on-hands.txt
new file mode 100644
index 00000000..fe9af4cd
--- /dev/null
+++ b/npc/magic/level2-lay-on-hands.txt
@@ -0,0 +1,68 @@
+// The Mana World script
+// Author: Jesusalva <jesusalva@themanaworld.org>
+//
+// Magic Script: SKILL_INMA (Level 1)
+// School: Life 2
+
+function script SK_Inma {
+ // FIXME: #inma Mouboo
+ // In some cases it is... aborted
+ if (getunittype(@skillTarget) == UNITTYPE_PC) {
+ .@me=getcharid(3);
+ .@ok=true;
+ attachrid(@skillTarget);
+ // TODO: detect if is a bot...
+ // FIXME: 099-4 and 099-5 special rules
+ // Kill the GM Event
+ if (isequipped(MagicGMTopHat))
+ .@ok=false;
+ // Ailments which prevent inma from working
+ if (getstatus(SC_BLOODING))
+ .@ok=false;
+ if (getstatus(SC_CURSE))
+ .@ok=false;
+ if (getstatus(SC_POISON) && !getstatus(SC_SLOWPOISON))
+ .@ok=false;
+ if (getstatus(SC_DPOISON) && !getstatus(SC_SLOWPOISON))
+ .@ok=false;
+ // 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);
+ }
+ if (@skillTarget == getcharid(3)) return; // No self casting
+ if (isequipped(MagicGMTopHat)) return; // Kill the GM event
+ if (.@limit <= 0) return; // No need for healing
+ // Apply effects
+ .@PW=130+(20*@skillLv);
+ .@dmg=AdjustSpellpower(.@PW);
+
+ // Capped to what you need or your own health - the smallest of them
+ .@dmg = min(.@dmg, .@limit, Hp);
+
+ // Pay with 20% of your healing total
+ heal -(.@dmg/5), 0;
+
+ // Heal the target instantly
+ harm(@skillTarget, -(.@dmg), HARM_MISC);
+
+ // Specifics
+ if (getskilllv(SKILL_MAGIC_DARK) >= 2)
+ SC_Bonus(10, SC_BLOODING, 1); // FIXME SC_REBOUND? SC_MAGICMUSHROOM?
+ else
+ SC_Bonus(5, SC_BLOODING, 1); // FIXME SC_REBOUND? SC_MAGICMUSHROOM?
+
+ // Gives EXP according to how much you healed
+ getexp .@dmg*getskilllv(SKILL_MAGIC_LIFE), .@PW/10;
+ GetManaExp(@skillId, 2);
+ return;
+}
+