summaryrefslogtreecommitdiff
path: root/npc/items
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-01-25 19:15:02 -0300
committerJesusaves <cpntb1@ymail.com>2020-01-25 19:15:02 -0300
commite27a557d0ad8d1b0f97edd530554ed171bb67124 (patch)
treeac3d15243116c38786c6610bf36e0dfb2618272f /npc/items
parent4faf13f5d01874f729ab7d0d9f3954f47d3de305 (diff)
downloadserverdata-e27a557d0ad8d1b0f97edd530554ed171bb67124.tar.gz
serverdata-e27a557d0ad8d1b0f97edd530554ed171bb67124.tar.bz2
serverdata-e27a557d0ad8d1b0f97edd530554ed171bb67124.tar.xz
serverdata-e27a557d0ad8d1b0f97edd530554ed171bb67124.zip
Ugly workaround so tea works
Diffstat (limited to 'npc/items')
-rw-r--r--npc/items/rand_mp_heal.txt55
1 files changed, 55 insertions, 0 deletions
diff --git a/npc/items/rand_mp_heal.txt b/npc/items/rand_mp_heal.txt
new file mode 100644
index 000000000..d64661bea
--- /dev/null
+++ b/npc/items/rand_mp_heal.txt
@@ -0,0 +1,55 @@
+// TMW-2 Script.
+// Author:
+// Jesusalva
+// Description:
+// UGLY WORKAROUND. Legacy Method Only.
+// Variables:
+// @min
+// @max
+// @delay
+
+
+- script rand_mp_heal -1,{
+
+OnUse:
+ if (@delay <= 0) {
+ Exception("Invalid healing item, deleting without healing effect.");
+ end;
+ }
+
+ // +1 max MP per 3 Int, +1 min MP per 5 int.
+ // Original max MP will be respected
+ @max = min(@max*2, @min+(readparam2(bInt)/5));
+ @min = min(@max, @min+(readparam2(bInt)/3));
+
+ // Make these abstract % in absolute values
+ @min=max(1, MaxHp*@min/100);
+ @max=max(3, MaxHp*@max/100);
+
+ // Save the effect
+ @mp_healeffect = rand2(@min, @max);
+ @mp_healdelay = @delay;
+
+ // Apply the effect and finish
+ deltimer .name$+"::OnUpdate";
+ addtimer 1000, .name$+"::OnUpdate";
+
+ // Clear stuff
+ // @mp_healeffect and @mp_healdelay must be preserved for cross-reading
+ @delay=0;
+ @min=0;
+ @max=0;
+ end;
+
+// Script Heart
+OnUpdate:
+ deltimer .name$+"::OnUpdate";
+ heal 0, @mp_healeffect;
+ @mp_healdelay-=1;
+ if (@mp_healdelay >= 1)
+ addtimer 1000, .name$+"::OnUpdate";
+ else
+ @mp_healeffect=0;
+ end;
+}
+