summaryrefslogtreecommitdiff
path: root/npc/items/rand_sc_heal.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-04-09 13:33:57 -0300
committerJesusaves <cpntb1@ymail.com>2021-04-09 13:33:57 -0300
commitcf18ce071c79ae37e14ea38943e0b1d88da70a7b (patch)
treef9159c9b60b3018300dd22ffba0d797bc5e828e5 /npc/items/rand_sc_heal.txt
parent8a4bf716002a017de77fe7df301ef8e4aaf00a2e (diff)
downloadserverdata-cf18ce071c79ae37e14ea38943e0b1d88da70a7b.tar.gz
serverdata-cf18ce071c79ae37e14ea38943e0b1d88da70a7b.tar.bz2
serverdata-cf18ce071c79ae37e14ea38943e0b1d88da70a7b.tar.xz
serverdata-cf18ce071c79ae37e14ea38943e0b1d88da70a7b.zip
Override
Diffstat (limited to 'npc/items/rand_sc_heal.txt')
-rw-r--r--npc/items/rand_sc_heal.txt85
1 files changed, 0 insertions, 85 deletions
diff --git a/npc/items/rand_sc_heal.txt b/npc/items/rand_sc_heal.txt
deleted file mode 100644
index e4b0875a..00000000
--- a/npc/items/rand_sc_heal.txt
+++ /dev/null
@@ -1,85 +0,0 @@
-// Evol scripts.
-// Author:
-// 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,{
-
- // Add remaning bonus if the last one hasn't finished
- function remaining_bonus
- {
- if (getstatus(getarg(0)))
- {
- .@old_val1 = getstatus(getarg(0), 1);
- .@old_delay = getstatus(getarg(0), 4) * 1000;
-
- // change the delay to prevent fast healing
- if (.@old_delay > @delay)
- {
- @delay = .@old_delay;
- @val1 += .@old_val1;
- }
- else
- {
- @val1 += (.@old_val1 * .@old_delay) / @delay;
- }
- }
- else
- {
- @val1 = @val3;
- }
- return;
- }
-
-OnUse:
- if (@delay <= 0) close;
-
- // minimum between @min and bVit / 2 * BaseLevel / 10
- .@vitality_bonus = min(@min, readparam(bVit) * BaseLevel / 20);
- .@rand_heal_val = rand(@min, @max);
-
- // val1 is the heal value without the vitality bonus
- @val1 = .@rand_heal_val / @delay;
- @val3 = (.@rand_heal_val + .@vitality_bonus) / @delay;
-
- if (@val1 <= 0) close;
-
- @delay *= 1000; // Put the delay in ms
-
- switch (@type)
- {
- case 1:
- .@skill = SC_S_LIFEPOTION;
- break;
- case 2:
- .@skill = SC_L_LIFEPOTION;
- break;
- case 3:
- .@skill = SC_G_LIFEPOTION;
- break;
- case 4:
- .@skill = SC_M_LIFEPOTION;
- break;
- default :
- .@skill = 0;
- break;
- }
- if (.@skill != 0)
- {
- remaining_bonus(.@skill);
- sc_end .@skill;
- sc_start2 .@skill, @delay, @val1, 1;
- }
-
- close;
-}