Hi, I'm tryng to make a NPC that can lock the max level of a player when asked so, but it's reversable. The max level o the server is 250/130, but the NPC would cap that to 99/70 if the player want. The easiest way I found was to make the player go back to 99/70 everytime he level up above that.
This is the script I'm trying to work on:
prontera,150,150,5 script test 714,{
mes "[Level Cap Setter]";
mes "Hello, adventurer!";
mes "Would you like to cap your base level at 99 and job level at 70?";
mes "Or, if you want to remove the cap, I can help with that too.";
next;
if (#BaseLevelCap == 99 && #JobLevelCap == 70) {
switch(select("Uncap my levels:Cancel")) {
case 1:
mes "[Level Cap Setter]";
set #BaseLevelCap, 0;
set #JobLevelCap, 0;
mes "Your levels are now uncapped.";
close;
case 2:
mes "[Level Cap Setter]";
mes "No problem, feel free to come back anytime!";
close;
}
} else {
switch(select("Cap my levels:Cancel")) {
case 1:
mes "[Level Cap Setter]";
set #BaseLevelCap, 99;
set #JobLevelCap, 70;
mes "Your base level will now be capped at 99 and job level at 70.";
mes "If you reach level 99/70, you will be reset to level 99/70 and lose any excess experience.";
close;
case 2:
mes "[Level Cap Setter]";
mes "No problem, feel free to come back anytime!";
close;
}
}
OnInit:
// Initialize global variables to zero
set #BaseLevelCap, 0;
set #JobLevelCap, 0;
end;
}
OnPCBaseLevelUpEvent:
if (#BaseLevelCap == 99 && BaseLevel > #BaseLevelCap) {
set BaseLevel, #BaseLevelCap;
set BaseExp, 0;
mes "[Level Cap Setter]";
mes "You have reached the base level cap. Your base level is now reset to 99.";
end;
}
OnPCJobLevelUpEvent:
if (#JobLevelCap == 70 && JobLevel > #JobLevelCap) {
set JobLevel, #JobLevelCap;
set JobExp, 0;
mes "[Level Cap Setter]";
mes "You have reached the job level cap. Your job level is now reset to 70.";
end;
}
And those are the errors I'm getting:
I have try to change to "OnPcBaseLVUpEvent" too, but still gives the same errors.
I'll be really greatfull if someone could give me a hand on this. Thanks!
Question
SovietBR
Hi, I'm tryng to make a NPC that can lock the max level of a player when asked so, but it's reversable. The max level o the server is 250/130, but the NPC would cap that to 99/70 if the player want. The easiest way I found was to make the player go back to 99/70 everytime he level up above that.
This is the script I'm trying to work on:
prontera,150,150,5 script test 714,{ mes "[Level Cap Setter]"; mes "Hello, adventurer!"; mes "Would you like to cap your base level at 99 and job level at 70?"; mes "Or, if you want to remove the cap, I can help with that too."; next; if (#BaseLevelCap == 99 && #JobLevelCap == 70) { switch(select("Uncap my levels:Cancel")) { case 1: mes "[Level Cap Setter]"; set #BaseLevelCap, 0; set #JobLevelCap, 0; mes "Your levels are now uncapped."; close; case 2: mes "[Level Cap Setter]"; mes "No problem, feel free to come back anytime!"; close; } } else { switch(select("Cap my levels:Cancel")) { case 1: mes "[Level Cap Setter]"; set #BaseLevelCap, 99; set #JobLevelCap, 70; mes "Your base level will now be capped at 99 and job level at 70."; mes "If you reach level 99/70, you will be reset to level 99/70 and lose any excess experience."; close; case 2: mes "[Level Cap Setter]"; mes "No problem, feel free to come back anytime!"; close; } } OnInit: // Initialize global variables to zero set #BaseLevelCap, 0; set #JobLevelCap, 0; end; } OnPCBaseLevelUpEvent: if (#BaseLevelCap == 99 && BaseLevel > #BaseLevelCap) { set BaseLevel, #BaseLevelCap; set BaseExp, 0; mes "[Level Cap Setter]"; mes "You have reached the base level cap. Your base level is now reset to 99."; end; } OnPCJobLevelUpEvent: if (#JobLevelCap == 70 && JobLevel > #JobLevelCap) { set JobLevel, #JobLevelCap; set JobExp, 0; mes "[Level Cap Setter]"; mes "You have reached the job level cap. Your job level is now reset to 70."; end; }
And those are the errors I'm getting:
I have try to change to "OnPcBaseLVUpEvent" too, but still gives the same errors.
I'll be really greatfull if someone could give me a hand on this. Thanks!
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.