- script apple -1,{
OnWhisperGlobal:
set .@item_id, 512; // Apple
if (countitem(.@item_id)) {
if (Hp) {
dispbottom "You don't require resurrection at this moment.";
} else {
set .@count, callsub(S_getrevivecount);
// if they have less than 3 revives this hour
if (.@count < 3) {
callsub S_setrevivecount, .@count +1;
dispbottom "Your Acolytes are now praying in Prontera, please wait 10 seconds for the final judgement.";
sleep2 10000;
recovery 0;
dispbottom "You have "+(3 - (.@count+1))+" revives left for this hour.";
} else {
dispbottom "You can only be revived 3x every hour.";
}
}
} else {
dispbottom "You need to have a "+getitemname(.@item_id)+" in your inventory.";
}
end;
S_getrevivecount:
set .@now_hour, atoi(gettimestr("%y%m%d%H",9)); // YYMMDDHH
if (atoi(delchar(revive+"",8)) < .@now_hour)
return 0; // if their last revive was not this hour, then they have used 0 revives this hour
else
return atoi(charat(revive+"",8));
S_setrevivecount:
set revive, atoi(gettimestr("%y%m%d%H",9) + getarg(0));
return;
}