// http://rathena.org/board/topic/72912-request-reward-npc-for-active-players/
- script 50Reward -1,{
OnPCLoginEvent:
if ($50claimed >= 50) {
debugmes "50 rewards all given, please disable the script.";
end;
}
if (50claimed == 0) {
attachnpctimer ""+strcharinfo(0)+"";
initnpctimer;
}
end;
OnTimer30000:
if(checkvending() >= 1 || checkchatting() == 1) {
stopnpctimer;
end;
}
getmapxy( .@map$, .@x, .@y, 0 );
if(@map$ == .@map$ && @x == .@x && @y == .@y) {
set @afk, @afk + 1;
} else {
set @afk, 0;
}
set @map$, .@map$; set @x, .@x; set @y, .@y;
if (@afk == 5) {
stopnpctimer;
end;
}
end;
OnTimer60000:
set @minute, @minute + 1;
if(@minute == 600){
set @minute,0;
getitem 7539,1
dispbottom "Congratulations!";
set $50claimed, $50claimed + 1;
set 50claimed, 1;
}
stopnpctimer;
initnpctimer;
end;
}