From 428292f193c37d96c98f7795908c71e6da01b869 Mon Sep 17 00:00:00 2001 From: Reid Date: Mon, 7 Mar 2016 03:00:10 +0100 Subject: Add new function to manage delayed healing with 4 different life potion status effect. --- npc/items/rand_sc_heal.txt | 44 ++++++++++++++++++++++++++++++++++++++++++++ npc/scripts.conf | 1 + 2 files changed, 45 insertions(+) create mode 100644 npc/items/rand_sc_heal.txt (limited to 'npc') 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 -- cgit v1.2.3-70-g09d2