summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/magic/final.txt29
-rw-r--r--npc/magic/level1-lesser-heal.txt49
-rw-r--r--npc/magic/level2-lay-on-hands.txt68
-rw-r--r--npc/scripts.conf2
4 files changed, 125 insertions, 23 deletions
diff --git a/npc/magic/final.txt b/npc/magic/final.txt
index 1cd93e40..92fb65a4 100644
--- a/npc/magic/final.txt
+++ b/npc/magic/final.txt
@@ -48,34 +48,17 @@ function script HUB_SkillInvoke {
case SKILL_MODRISUMP:
case SKILL_MODRIYIKAM:
case SKILL_MODRILAX:
- SK_GrowPlants(); break;
+ SK_GrowPlants(); break; // FIXME: Unreleased/cannot be learned
+ case SKILL_LUM:
+ SK_Lum(); break;
// Level 2
+ case SKILL_INMA:
+ SK_Inma(); break;
// Level 3
// Level 4
// Level 5
////////////////////////////////
- /* / XXX: Healing Class
- case TMW2_FIRSTAID:
- .@PW=90+(10*@skillLv);
- // First aid only works on you, so
- .@heal=max(AdjustSpellpower(.@PW), AdjustAttackpower(.@PW));
- heal .@heal, 0;
- GetManaExp(TMW2_HEALING, 1);
- break;
- case TMW2_HEALING:
- .@PW=130+(20*@skillLv);
- harm(@skillTarget, -AdjustSpellpower(.@PW), HARM_MISC);
- GetManaExp(TMW2_HEALING, 2);
- break;
- case TMW2_MAGNUSHEAL:
- // Area healing
- .@PW=200+(20*@skillLv);
- .@RG=4+(@skillLv/5);
- areaharm(@skillTarget, .@RG, -AdjustSpellpower(.@PW), HARM_MISC, "filter_friendly");
- GetManaExp(TMW2_HEALING, 3);
- break;
- ////////////////////////////////
- // XXX: Fire Class
+ /* XXX: Fire Class
// (May burn targets for damage over time)
case TMW2_FIREARROW:
.@PW=140+(10*@skillLv);
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;
+}
+
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;
+}
+
diff --git a/npc/scripts.conf b/npc/scripts.conf
index 6a0c79b8..a625b547 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -72,6 +72,8 @@
"npc/magic/level1-experience.txt",
"npc/magic/level1-flare-dart.txt",
"npc/magic/level1-grow-plants.txt",
+"npc/magic/level1-lesser-heal.txt",
+"npc/magic/level2-lay-on-hands.txt",
"npc/magic/final.txt",
// Commands