From 7e0479a8cef1e63f79ed00c06a8fe8c93ce7ed60 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 12 Apr 2021 11:48:24 -0300 Subject: Healing items now have a delayed healing --- npc/functions/main.txt | 21 +++++++++++++++++++++ npc/magic/config.txt | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'npc') diff --git a/npc/functions/main.txt b/npc/functions/main.txt index 25d20edc..bb1887d2 100644 --- a/npc/functions/main.txt +++ b/npc/functions/main.txt @@ -633,6 +633,27 @@ function script learnskill { return; } +// Delayed healing. Takes 3~5 seconds. Variates with Vit up to +100%. +// The vit can have an additional 20% bonus as well. +function script itheal { + .@bas=getarg(0); + .@vit=readbattleparam(getcharid(3), UDT_VIT); + .@vit=cap_value(.@vit-1, 0, 100); + if (getargcount() > 2) + .@tim=getarg(3); + else + .@tim=rand2(3,5); + .@min=.@bas*(100+.@vit)/100; + .@max=.@bas*(100+.@vit*120/100)/100; + // Now divide the HP values by the time + .@min=max(1, .@min/.@tim); + .@max=max(1, .@max/.@tim); + callfunc("SC_Bonus", .@tim, SC_S_LIFEPOTION, .@min, .@max); + if (getarg(1,0) > 0) + heal 0, getarg(1, 0); + return; +} + // sqldate({day variation, month variation}) function script sqldate { .@d=gettime(GETTIME_DAYOFMONTH)+getarg(0, 0); diff --git a/npc/magic/config.txt b/npc/magic/config.txt index 6286c2a6..c0f00cec 100644 --- a/npc/magic/config.txt +++ b/npc/magic/config.txt @@ -23,7 +23,7 @@ function script AdjustSpellpower { // Calculation FIX if (.@type == HARM_MAGI) { - .@power+=(readparam2(bInt)/2); + .@power+=(readparam2(UDT_INT)/2); .@dmg=rand2( getunitdata(getcharid(3), UDT_MATKMIN), getunitdata(getcharid(3), UDT_MATKMAX)); @@ -31,7 +31,7 @@ function script AdjustSpellpower { //if (.@target) // .@dmg=max(0, .@dmg-getunitdata(.@target, UDT_MDEF)); } else if (.@type == HARM_PHYS) { - .@power+=(readparam2(bStr)/2); + .@power+=(readparam2(UDT_STR)/2); .@dmg=rand2( getunitdata(getcharid(3), UDT_ATKMIN), getunitdata(getcharid(3), UDT_ATKMAX)); -- cgit v1.2.3-60-g2f50