From 4196c9f78f2e05ae832bc4be7d3b3c9b2b01f113 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 19 May 2022 19:00:05 -0300 Subject: Fix more bugs on healing items --- npc/items/legacy_heal.txt | 5 +++-- npc/items/rand_sc_heal.txt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/npc/items/legacy_heal.txt b/npc/items/legacy_heal.txt index f9e737234..2f3484080 100644 --- a/npc/items/legacy_heal.txt +++ b/npc/items/legacy_heal.txt @@ -30,11 +30,12 @@ function script ItHeal { .@skill = SC_S_LIFEPOTION; // Vitality can improve the healing amount - .@min = max(.@max, .@min + (.@min * readparam2(bVit) / 100)); + .@min = min(.@max, .@min + (.@min * readparam2(bVit) / 100)); .@max = .@max + (.@max * readparam2(bVit) / 240); // Obtain the real healing - @val1 = rand2(.@min, .@max); + @val1 = rand2(.@min, .@max) / .@delay; + debugmes "Heal %d-%d/%d = %d", .@min, .@max, .@delay, @val1; .@delay *= 1000; // Put the delay in ms diff --git a/npc/items/rand_sc_heal.txt b/npc/items/rand_sc_heal.txt index 1bf582444..41ea3b3a7 100644 --- a/npc/items/rand_sc_heal.txt +++ b/npc/items/rand_sc_heal.txt @@ -57,7 +57,7 @@ function script ItHeal2 { @val1 = rand2(.@min, .@max); // Calculate delay if it was not given - if (.@delay < 0) { + if (.@delay <= 0) { .@delay=1 + ((.@type*3)/2); } -- cgit v1.2.3-60-g2f50