From fae2c31992c2be878ab9f0c3eed509ecdf4beb55 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 2 May 2020 02:42:59 -0300 Subject: Katazuli now regains power based on guild member count --- npc/042-10/ctrl.txt | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'npc') diff --git a/npc/042-10/ctrl.txt b/npc/042-10/ctrl.txt index d1abd2585..c65a0ebbb 100644 --- a/npc/042-10/ctrl.txt +++ b/npc/042-10/ctrl.txt @@ -241,9 +241,21 @@ OnInstanceInit: // Every minute, recover some energy OnTimer60000: + explode(.@map$, .map$, "@"); + .@g=atoi(.@map$[1]); + if (.@g < 1) { + debugmes "[ERROR] [KAMELOT] Unable to recharge katazuli for Kamelot %s", .map$; + .@g=0; + } + + // Estimate + .@pc=$KAMELOT_PC[.@g]+1; + .@pow=rand2(.@pc); + + // Recover energy .@id=.kataId; .@m$=instance_mapname("042-10"); - .@power=min(0, getd("$@GTEMP_"+.@id+"_"+.@m$)-rand2(5)); + .@power=min(0, getd("$@GTEMP_"+.@id+"_"+.@m$)-.@pow); setd("$@GTEMP_"+.@id+"_"+.@m$, .@power); initnpctimer; end; @@ -297,9 +309,21 @@ OnInstanceInit: // Every minute, recover some energy OnTimer60000: + explode(.@map$, .map$, "@"); + .@g=atoi(.@map$[1]); + if (.@g < 1) { + debugmes "[ERROR] [KAMELOT] Unable to recharge katazuli for Kamelot %s", .map$; + .@g=0; + } + + // Estimate + .@pc=$KAMELOT_PC[.@g]+1; + .@pow=rand2(.@pc); + + // Recover energy .@id=.kataId; .@m$=instance_mapname("042-10"); - .@power=min(0, getd("$@GTEMP_"+.@id+"_"+.@m$)-rand2(5)); + .@power=min(0, getd("$@GTEMP_"+.@id+"_"+.@m$)-.@pow); setd("$@GTEMP_"+.@id+"_"+.@m$, .@power); initnpctimer; end; -- cgit v1.2.3-70-g09d2