I try to explain it on this custom script. You have several options to customize it. Please read the comments. Also added @happy and @endhappy. Duration is always 2 hours. Card rates are not affected by this.
Be aware this script won't work if loaded with @loadnpc. It needs to start with your server.
- script Happy Hour FAKE_NPC,{
OnInit: // fetch your basic rates on server start
bindatcmd("happy", strnpcinfo(0) +"::OnAtcommand", 93, 99);
bindatcmd("endhappy", strnpcinfo(0) +"::OnAtcommand2", 93, 99);
// BaseExp
.base_exp_rate = getbattleflag("base_exp_rate");
// JobExp
.job_exp_rate = getbattleflag("job_exp_rate");
// Drops
.item_rate_common = getbattleflag("item_rate_common");
.item_rate_heal = getbattleflag("item_rate_heal");
.item_rate_use = getbattleflag("item_rate_use");
.item_rate_equip = getbattleflag("item_rate_equip");
end;
OnAtcommand:
OnClock0900: // you can add more times to trigger using https://github.com/HerculesWS/Hercules/blob/857650c4f58d347455b0d075b49a53f69e6d0c51/doc/script_commands.txt#L1013
//OnWed1500: // would start at Wednesday, 3pm server time
announce("Happy Hour has started!", bc_blue|bc_all); // Announce Happy Hour
callsub(L_rate, 2); // L_rate, 2 = your basic rate *2, L_rate,3 = your basic rate *3. You said basic is 25 and you want happy hour to be 50. So 25*2 = 50x rates
end;
OnAtcommand2:
OnTimer7200000: // When the Timer from line 49 reaches 7200000ms (2 hours) reset the rates to 1x
stopnpctimer(); // stop the timer
announce("Happy Hour has ended!", bc_blue|bc_all); // Announce Happy Hour
callsub(L_rate, 1); // L_rate, 25*1 = 25x
end;
L_rate:
.@rate = getarg(0);
.@base_exp_rate = (.@rate * .base_exp_rate);
.@job_exp_rate = (.@rate * .job_exp_rate);
.@item_rate_common = (.@rate * .item_rate_common);
.@item_rate_heal = (.@rate * .item_rate_heal);
.@item_rate_use = (.@rate * .item_rate_use);
.@item_rate_equip = (.@rate * .item_rate_equip);
setbattleflag("base_exp_rate",.@base_exp_rate);
setbattleflag("job_exp_rate",.@job_exp_rate);
setbattleflag("item_rate_common",.@item_rate_common);
setbattleflag("item_rate_heal",.@item_rate_heal);
setbattleflag("item_rate_use",.@item_rate_use);
setbattleflag("item_rate_equip",.@item_rate_equip);
atcommand("@reloadmobdb");
initnpctimer(); // start the timer
announce(sprintf("Current rates are: Base %dx, Job %dx, Drop %dx.", (.@base_exp_rate/100), (.@job_exp_rate/100), (.@item_rate_common/100)), bc_blue|bc_all); // Announce the rates
end;
}
View attachment 5512