summaryrefslogtreecommitdiff
path: root/npc/magic/level1-lesser-heal.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-04-14 04:08:13 -0300
committerJesusaves <cpntb1@ymail.com>2021-04-14 04:08:13 -0300
commitf5d6ff098ed47775147826d3b0becb5934876021 (patch)
treeb4689631cb75d3886ca709d3e9bfa2caf392ec0c /npc/magic/level1-lesser-heal.txt
parent5e9bd903948c5d1a07524c32c3d32459241ba20f (diff)
downloadserverdata-f5d6ff098ed47775147826d3b0becb5934876021.tar.gz
serverdata-f5d6ff098ed47775147826d3b0becb5934876021.tar.bz2
serverdata-f5d6ff098ed47775147826d3b0becb5934876021.tar.xz
serverdata-f5d6ff098ed47775147826d3b0becb5934876021.zip
Lesser Heal and Lay On Hands took me almost a whole hour to finish.
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;
+}
+