Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //===== rAthena Script =======================================
- //= Weekend level up bonus
- //===== By: ==================================================
- //= Sehrentos
- //===== Current Version: =====================================
- //= 1.0
- //===== Compatible With: =====================================
- //= rAthena Project
- //===== Description: =========================================
- //= On weekends boost base exp, job exp and drop rates.
- //= Can stack up to <.max_stack>
- //===== Additional Comments: =================================
- //= For Flags (bitmask) settings see: doc/script_commands.txt
- //= 1.0 Initial script.
- //============================================================
- - script #onpclvup -1,{
- OnInit:
- .duration = 60*60; // Duration in seconds
- .flags = 1024; // Flags (bitmask) 1024=Replace duplicate
- .type = 1; // Type 0)ignore 1)buff or 2)debuff
- .exp_rate = 100; // Bonus experience rates 0)disable
- .drop_rate = 10; // Bonus drop rates 0)disable
- .max_stack = 10; // Stack amount (10=1000%)
- .exp_icon = EFST_OVERSEAEXPUP; // Status Icon EFST_BLANK=None
- .drop_icon = EFST_PERIOD_RECEIVEITEM; // Status Icon EFST_BLANK=None
- end;
- OnPCLoginEvent:
- // Only on specific date
- if (gettime(DT_DAYOFWEEK) == FRIDAY
- || gettime(DT_DAYOFWEEK) == SATURDAY
- || gettime(DT_DAYOFWEEK) == SUNDAY)
- {
- .@str$ = "";
- if (.exp_rate > 0) {
- .@str$ += " "+ .exp_rate +"% experience bonus when killing monsters" +
- " for "+ (.duration / 60) +" minutes!" +
- " This effect can stack up-to "+ (.max_stack * .exp_rate) +"% max!!";
- }
- if (.drop_rate > 0) {
- .@str$ += " "+ .drop_rate +"% drop rate from monsters" +
- " for "+ (.duration / 60) +" minutes!" +
- " This effect can stack up-to "+ (.max_stack * .drop_rate) +"% max!!";
- }
- // Announce player about the bonuses
- if (getstrlen(.@str$) > 0) {
- message strcharinfo(0), "Good weekend to you!"+
- " If you level up this weekend,"+
- " you will gain" + .@str$;
- }
- debugmes "Strlen: "+ getstrlen(.@str$);
- }
- end;
- OnPCBaseLvUpEvent:
- OnPCJobLvUpEvent:
- // Only on specific dates
- if (gettime(DT_DAYOFWEEK) == FRIDAY
- || gettime(DT_DAYOFWEEK) == SATURDAY
- || gettime(DT_DAYOFWEEK) == SUNDAY)
- {
- // Max stack
- if (@onpclvup_active < .max_stack) {
- @onpclvup_active++;
- }
- // Reset if expired
- if (gettimetick(2) > @onpclvup_delay) {
- @onpclvup_active = 1;
- bonus_script_clear .flags;
- }
- @onpclvup_delay = gettimetick(2) + .duration;
- .@str$ = "";
- // Increase exp rates
- if (.exp_rate > 0) {
- .@min = .duration / 60;
- .@rate = @onpclvup_active * .exp_rate;
- bonus_script "{ bonus2 bExpAddRace,RC_ALL,"+ .@rate +"; }", .duration, .flags, .type, .exp_icon;
- .@str$ += " Your experience gained by killing monsters is now increased by "+ .@rate +"% for "+ .@min +" minutes!";
- }
- // Increase drop rates
- if (.drop_rate > 0) {
- .@min = .duration / 60;
- .@rate = @onpclvup_active * .drop_rate;
- bonus_script "{ bonus2 bDropAddRace,RC_ALL,"+ .@rate +"; }", .duration, .flags, .type, .drop_icon;
- .@str$ += " Your drop rate is now increased by "+ .@rate +"% for "+ .@min +" minutes!";
- }
- // Announce player untill at max stack
- if (@onpclvup_active < .max_stack) {
- message strcharinfo(0), "Congratulations!!"+ .@str$;
- }
- }
- end;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement