summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/042-10/ctrl.txt28
1 files changed, 26 insertions, 2 deletions
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;