You can use an account variable - they're prefixed with #, e.g. #CASHPOINTS.
Random walking:
npcstop; // stop when clicked
stopnpctimer; // stop timer when clicked
// dialogue (the rest of the script)
initnpctimer; // resume timer before closing (do this before all "close" commands)
close;
OnInit:
initnpctimer;
end;
OnTimer3000:
getmapxy(.@map$,.@x,.@y,1); // get coordinates
npcwalkto .@x+rand(-10,10),.@y+rand(-10,10); // walk +/- 10 randomly
stopnpctimer; // restart timer
initnpctimer;
end;
Use gettimetick(2) for large delay intervals. Also, you'll have to use a permanent character/account variable to store the data, for example:
// player has finished the quest
mes "Come visit again after 24 hours for your reward.";
set quest_delay, gettimetick(2)+86400; // 86400 seconds = 1 day
close;
if (quest_delay > gettimetick(2))
mes "Please wait a little longer.";
else {
mes "Thanks for waiting!";
mes "Here's your reward.";
getitem item,amount;
}
close;