summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-05-20 11:01:20 -0300
committerJesusaves <cpntb1@ymail.com>2019-05-20 11:01:20 -0300
commitcc8727b60fbcae442bc3fd0e38514733d5fab1d2 (patch)
tree6bf444e5aa2ba4f0f21f4bcbb580649b3c53c8ca /npc
parent5b6e7d9c85f3e48ce84a6fb4b14d4a59f7da086e (diff)
downloadserverdata-cc8727b60fbcae442bc3fd0e38514733d5fab1d2.tar.gz
serverdata-cc8727b60fbcae442bc3fd0e38514733d5fab1d2.tar.bz2
serverdata-cc8727b60fbcae442bc3fd0e38514733d5fab1d2.tar.xz
serverdata-cc8727b60fbcae442bc3fd0e38514733d5fab1d2.zip
Add legacy_heal, support for legacy behavior
Diffstat (limited to 'npc')
-rw-r--r--npc/items/legacy_heal.txt48
-rw-r--r--npc/items/rand_sc_heal.txt5
-rw-r--r--npc/scripts.conf1
3 files changed, 52 insertions, 2 deletions
diff --git a/npc/items/legacy_heal.txt b/npc/items/legacy_heal.txt
new file mode 100644
index 000000000..9ef8e548b
--- /dev/null
+++ b/npc/items/legacy_heal.txt
@@ -0,0 +1,48 @@
+// TMW-2 Script.
+// Evol scripts.
+// Author:
+// Reid
+// Jesusalva
+// Description:
+// Legacy Healing System
+//
+// Variables:
+// @delay Second of healing
+// @min Min amount of healing
+// @max Max amount of healing
+//
+// *getequipoption(EQI_HEAD_TOP,1,168); → Heal Bonus (should be first bonus on Chef Hat)
+
+
+- script legacy_heal -1,{
+
+OnUse:
+ if (@delay <= 0) end;
+
+ // minimum between @min and bVit / 2 * BaseLevel / 10
+ @min = min(@max, readparam(bVit) * BaseLevel / 20);
+ @val1 = rand(@min, @max);
+
+ @delay *= 1000; // Put the delay in ms
+
+ // We now have @val1 (new effect), @delay (new delay)
+ // But do we have .@v and .@d (old effect and delay)?
+ .@v=getstatus(getarg(0), 1);
+ .@d=getstatus(getarg(0), 4) * 1000;
+
+ // If there WAS an effect previously, get ponderate average
+ if (.@v > 0) {
+ @val1=ponderate_avg(@val1, @delay, .@v, .@d);
+ @delay=ponderate_avg(@delay, @val1, .@d, .@v);
+ }
+
+ // Decide the healing bonus type. We have four types: S, L, G and M
+ // By default, we use 'S'
+ .@skill = SC_S_LIFEPOTION;
+
+ // Apply the effect and finish
+ sc_end .@skill;
+ sc_start2 .@skill, @delay, @val1, 1;
+
+ end;
+}
diff --git a/npc/items/rand_sc_heal.txt b/npc/items/rand_sc_heal.txt
index 19d09f62d..fdfcb5cd2 100644
--- a/npc/items/rand_sc_heal.txt
+++ b/npc/items/rand_sc_heal.txt
@@ -110,8 +110,10 @@ OnUse:
.@d=getstatus(getarg(0), 4) * 1000;
// If there WAS an effect previously, get ponderate average
- if (.@v > 0)
+ if (.@v > 0) {
@val1=ponderate_avg(@val1, @delay, .@v, .@d);
+ @delay=ponderate_avg(@delay, @val1, .@d, .@v);
+ }
// Decide the healing bonus type. We have four types: S, L, G and M
// By default, we use 'S'
@@ -120,7 +122,6 @@ OnUse:
// Apply the effect and finish
sc_end .@skill;
sc_start2 .@skill, @delay, @val1, 1;
- }
end;
}
diff --git a/npc/scripts.conf b/npc/scripts.conf
index a816b45f1..e48b7b55a 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -27,6 +27,7 @@
"npc/functions/scoreboards.txt",
"npc/functions/random-talk.txt",
"npc/items/rand_sc_heal.txt",
+"npc/items/legacy_heal.txt",
"npc/items/inc_sc_bonus.txt",
"npc/commands/event.txt",
"npc/commands/kami.txt",