prontera,155,150,3 script Hourly Reward 4_M_KHMAN,{
if(!#HOURLYCLAIM) {
[email protected] = #Daily_Timer + .minutes_required * 60; // 1 hour
message strcharinfo(0),"You still have "+callfunc("Time2Str",[email protected])+" left before you can receive a reward.";
end;
}
#HOURLYCLAIM = 0;
#Minute_Online = 0;
dispbottom "----- [ UniteRO Hourly Rewards ] -----------------",0xFFFFFF;
if(.EnableItemRewards) {
set [email protected], getarraysize(.rewards) - 1;
set [email protected], rand(0, [email protected] / 2) * 2;
[email protected] = .rewards[[email protected]];
[email protected] = .rewards[[email protected] + 1];
[email protected] = getcharid(0);
[email protected]$ = strnpcinfo(0);
[email protected]$ = "** Hourly Reward **";
[email protected]$ = "You have received your hourly reward.";
[email protected] = 0;
if (!checkweight2([email protected],[email protected])) {
dispbottom "The rewards has been sent to your mail.",0x00FFFF;
mail [email protected], [email protected]$, [email protected]$, [email protected]$, [email protected], [email protected], [email protected];
}else{
getitem [email protected], [email protected];
}
}
if(.EnableVarRewards) {
#ACTIVITYPOINTS += 1;
dispbottom "You've received 1 Activity Point and your hourly reward item.",0x00FFFF;
dispbottom "Total Activity Points: "+#ACTIVITYPOINTS+"!",0x00FFFF;
}
end;
OnCheck:
#Minute_Online += 1;
if (#Minute_Online >= .minutes_required) {
#HOURLYCLAIM = 1;
#Minute_Online = 0;
#Daily_Timer = gettimetick(2) - (#Minute_Online*60);
dispbottom "You have been online for an hour. Talk to the Hourly Reward NPC to get your rewards!",0x00FFFF;
}
addtimer 60000, strnpcinfo(3)+"::OnCheck";
end;
OnPCLoginEvent:
sleep2 1250;
addtimer 60000,strnpcinfo(3)+"::OnCheck";
#Daily_Timer = gettimetick(2) - (#Minute_Online*60);
end;
OnCheckHourly:
[email protected] = #Daily_Timer + .minutes_required * 60; // 1 hour
message strcharinfo(0),"You still have "+callfunc("Time2Str",[email protected])+" left before you can receive a reward.";
end;
OnInit:
// Removed (Check the minutes/seconds left via NPC)
//bindatcmd "hourly",strnpcinfo(3)+"::OnCheckHourly";
// Configuration
.minutes_required = 60; // Minutes Required (60 = 60 minutes)
// Toggle Rewards
.EnableItemRewards = 1; // Enable item rewards? (0 = Disabled | 1 = Enabled).
.EnableVarRewards = 1; // Enable item rewards? (0 = Disabled | 1 = Enabled).
// Reward Sets (This only gives 1 Random ID with the Designated Amount)
// <ItemID, Amount>
setarray .rewards[0], 3550, 2, //
3551, 2, //
3552, 2, //
3553, 2, //
12083, 2, // Giant Burito
12093, 2, // Special Toast
12073, 2, // Bearfoot Special
12072, 3, // Whole Roast
12082, 3, // Sumptuous Feast
12094, 3, // Heavenly Fruit Juice
12088, 3, // Incredibly Spicy Curry
12078, 3, //
12092, 3, //
12089, 3, //
12077, 3, //
12087, 3, //
12098, 3, //
12082, 3, //
12079, 3; //
end;
}