Louis T Steinhil's post in Rate Selector was marked as the answer
August 8, 2024
script
- script RateSelect -1,{
OnPCLoginEvent:
switch (individual_rate) {
case 1:
.@exp_rate_multiplier = 100;
.@jexp_rate_multiplier = 100;
set .@rate_description$, "x1 (Low Rate)";
break;
case 2:
.@exp_rate_multiplier = 2500;
.@jexp_rate_multiplier = 2500;
set .@rate_description$, "x25 (Mid Rate)";
break;
case 3:
.@exp_rate_multiplier = 5000;
.@jexp_rate_multiplier = 5000;
set .@rate_description$, "x50 (High Rate)";
break;
case 4:
.@exp_rate_multiplier = 10000;
.@jexp_rate_multiplier = 10000;
set .@rate_description$, "x100 (Super High Rate)";
break;
default:
mes "[Rate Selector]";
mes "Select your preferred server rate for this character.";
mes "BE CAREFUL: YOU CAN'T CHANGE IT AFTERWARD!";
individual_rate = select("Low Rate:Mid Rate:High Rate:Super High Rate");
close2;
goto OnPCLoginEvent; // Return to case evaluation after selection
}
// Save the multipliers to the player variables
set #exp_rate_multiplier, .@exp_rate_multiplier;
set #jexp_rate_multiplier, .@jexp_rate_multiplier;
fakeIcon(getcharid(0),2002,0,1);
dispbottom "You have chosen the " + .@rate_description$ + " for your character.";
end;
OnNPCKillEvent:
// Retrieve the stored multipliers
.@exp_rate_multiplier = #exp_rate_multiplier;
.@jexp_rate_multiplier = #jexp_rate_multiplier;
.@base_exp = getmonsterinfo(killedrid, MOB_BASEEXP) * .@exp_rate_multiplier;
.@job_exp = getmonsterinfo(killedrid, MOB_JOBEXP) * .@jexp_rate_multiplier;
// Debug messages to track values
dispbottom "[Debug] Base EXP: " + .@base_exp;
dispbottom "[Debug] Job EXP: " + .@job_exp;
if (.@base_exp > 0 || .@job_exp > 0) {
// Use getcharid(0) to specify the character ID
getexp2(.@base_exp, .@job_exp);
} else {
dispbottom "[Error] Experience values are zero.";
}
end;
}
stateiconinfo.lub
StateIconList[EFST_IDs.EFST_RATE_UP] = {
haveTimeLimit = 1,
posTimeLimitStr = 2,
descript = {
{ "RATE UP", COLOR_TITLE_BUFF },
{ "%s", COLOR_TIME },
{ "Increases your Bonus EXP and Job Exp" },
{ "x1 / x25 / x50 / x100" },
{ "Grants players different rewards" },
{ "depending on what they choose." }
}
}
efstids.lub
EFST_VIPSTATE1 = 2000,
EFST_VIPSTATE2 = 2001,
EFST_RATE_UP = 2002,
__newindex = function()
error("unknown state")
end
}
setmetatable(EFST_IDs, EFST_IDs)
stateiconimginfo.lub
-- Other official effects
[EFST_IDs.EFST_VIPSTATE1] = "SI_VIP.tga",
[EFST_IDs.EFST_VIPSTATE2] = "SI_VIP2.tga",
[EFST_IDs.EFST_RATE_UP] = "RATE_UP.tga",
[EFST_IDs.EFST_YGGDRASIL_BLESS] = "vitata500.tga",
[EFST_IDs.EFST_PERIOD_RECEIVEITEM_2ND] = "ITEM_G.tga",
[EFST_IDs.EFST_PERIOD_PLUSEXP_2ND] = "EXP_G.tga"
}
}
status.hpp
/// @APIHOOK_END
/// Do not modify code above this, since it will be automatically generated by the API again
EFST_VIPSTATE1 = 2000,
EFST_VIPSTATE2 = 2001,
EFST_RATE_UP = 2002,
EFST_MAX,
script_constants.hpp
/// @APIHOOK_END
/// Do not modify code above this, since it will be automatically generated by the API again
export_constant(EFST_VIPSTATE1);
export_constant(EFST_VIPSTATE2);
export_constant(EFST_RATE_UP);
export_constant(EFST_MAX);
Install fakeicon:
https://rathena.org/board/files/file/4034-fake-icon-stats/
RATE_UP.tga
RATE_UP.tga