summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorReid <reidyaro@gmail.com>2016-03-07 03:00:10 +0100
committerReid <reidyaro@gmail.com>2016-03-07 03:22:44 +0100
commit428292f193c37d96c98f7795908c71e6da01b869 (patch)
treef4e352c62ae86eb81580a2f74842e92eb7eb11bd /npc
parentf7724f3d5b2cddb69dfd605b46d625528c5f6071 (diff)
downloadserverdata-428292f193c37d96c98f7795908c71e6da01b869.tar.gz
serverdata-428292f193c37d96c98f7795908c71e6da01b869.tar.bz2
serverdata-428292f193c37d96c98f7795908c71e6da01b869.tar.xz
serverdata-428292f193c37d96c98f7795908c71e6da01b869.zip
Add new function to manage delayed healing with 4 different life potion status effect.
Diffstat (limited to 'npc')
-rw-r--r--npc/items/rand_sc_heal.txt44
-rw-r--r--npc/scripts.conf1
2 files changed, 45 insertions, 0 deletions
diff --git a/npc/items/rand_sc_heal.txt b/npc/items/rand_sc_heal.txt
new file mode 100644
index 00000000..3e02e236
--- /dev/null
+++ b/npc/items/rand_sc_heal.txt
@@ -0,0 +1,44 @@
+// Evol scripts.
+// Authors:
+// Reid
+// Description:
+// Random heal every x seconds.
+//
+// Variables:
+// @delay Second of healing
+// @min Min amount of healing
+// @max Max amount of healing
+// @type 1 Heal
+// 2 Other
+// 3 Special 1
+// 4 Special 2
+
+- script rand_sc_heal -1,{
+ close;
+
+OnUse:
+ if (@delay <= 0) close;
+
+ .@rand = rand (@min, @max) / @delay;
+ if (.@rand <= 0) close;
+
+ switch (@type)
+ {
+ case 1:
+ sc_start2 SC_S_LIFEPOTION, @delay * 1000, .@rand, 1;
+ break;
+ case 2:
+ sc_start2 SC_L_LIFEPOTION, @delay * 1000, .@rand, 1;
+ break;
+ case 3:
+ sc_start2 SC_G_LIFEPOTION, @delay * 1000, .@rand, 1;
+ break;
+ case 4:
+ sc_start2 SC_M_LIFEPOTION, @delay * 1000, .@rand, 1;
+ break;
+ default :
+ break;
+ }
+
+ close;
+}
diff --git a/npc/scripts.conf b/npc/scripts.conf
index 84053fde..10f8ab69 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -4,6 +4,7 @@
npc: npc/items/croconut.txt
npc: npc/items/oldbook.txt
npc: npc/items/shovel.txt
+npc: npc/items/rand_sc_heal.txt
// Script functions
npc: npc/functions/input.txt