- script HourlyPoint -1,{
OnInit:
setarray .item_get, 7539, 7711;
setarray .item_amt, 1, 5;
// How many cash point given?
.cashpoints = 100;
// How many minute for hourly event to be paused when player being idle
.idle_timer = 59;
// do not touch this
.idle_debug = .idle_timer *60;
end;
OnPCLoginEvent:
attachnpctimer ""+strcharinfo(0);
initnpctimer;
end;
OnTimer60000:
if(checkvending() || checkchatting() || checkidle() > .idle_debug) {
if (checkvending()) .@reason$ = " vending or has has a buyingstore";
else if (checkchatting()) .@reason$ = " in a chatroom";
else if (checkidle()) .@reason$ = " been idle more than "+.idle_timer+" minute";
dispbottom "Hourly Point Event has been paused, Reason: "+.@reason$;
} else {
@minute++;
if (@minute == 60) {
@minute = 0;
.@rand = getarraysize(.item_get)+1;
.@reward = rand(.@rand);
if (.@reward == (.@rand-1)) {
#CASHPOINTS += .cashpoints;
dispbottom "Hourly Point Event: You recived 100 CASHPOINTS,for staying in game for 1 hour.";
} else {
.@itm = !.item_get[.@reward] ? 501 : .item_get[.@reward];
.@qty = !.item_amt[.@reward] ? 1 : .item_amt[.@reward];
getitem .@itm, .@qty;
dispbottom "Hourly Point Event: You received "+.@qty+"x "+getitemname(.@itm)+" as reward for staying in game for 1 hour.";
}
}
}
stopnpctimer;
initnpctimer;
end;
}