From 5b27aad922f1dddb5dff09d62c9b9623419cca48 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 24 May 2019 08:19:34 -0300 Subject: Fix healing bugs and disregard item stacking --- npc/items/rand_sc_heal.txt | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'npc/items/rand_sc_heal.txt') diff --git a/npc/items/rand_sc_heal.txt b/npc/items/rand_sc_heal.txt index 533a92d1b..83b19e0b6 100644 --- a/npc/items/rand_sc_heal.txt +++ b/npc/items/rand_sc_heal.txt @@ -90,13 +90,22 @@ OnUse: @delay=1 + (@type*2); } - // Put the delay in ms - @delay *= 1000; + // Decide the healing bonus type. We have four types: S, L, G and M + // By default, we use 'S' + .@skill = SC_S_LIFEPOTION; // 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; + //Meh, just override it + /* + if (getstatus(.@skill)) { + .@v=getstatus(.@skill, 1); + .@d=getstatus(.@skill, 4); + } + */ + + debugmes "PDAVG: %d/%d", .@v, .@d; + debugmes "Pre PD: %d/%d", @val1, @delay; // If there WAS an effect previously, get ponderate average if (.@v > 0) { @@ -104,13 +113,21 @@ OnUse: @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; + debugmes "Post PD: %d/%d", @val1, @delay; + + // Put the delay in ms + @delay *= 1000; + + debugmes "Ready"; // Apply the effect and finish sc_end .@skill; sc_start2 .@skill, @delay, @val1, 1; + debugmes "Done"; + + @delay=0; + @type=0; + @rarity=0; end; } -- cgit v1.2.3-60-g2f50