I'm working on a system to select the game mode, but I'm encountering some errors. The first one is that it's not working; I select the rate, and the script doesn't change the rate. However, I have no idea what I might have done wrong or forgotten. Can someone please help me?
First, I made the NPC that gives the selection:
- script RateSelect -1,{
OnSetRate:
OnPCLoginEvent:
switch(individual_rate) {
case 1:
.@clan_level = .low_rate_clan_level;
.@exp_rate_bonus = .low_rate_exp_bonus;
.@drop_rate_bonus = .low_rate_drop_bonus;
break;
case 2:
.@clan_level = .mid_rate_clan_level;
.@exp_rate_bonus = .mid_rate_exp_bonus;
.@drop_rate_bonus = .mid_rate_drop_bonus;
break;
case 3:
.@clan_level = .high_rate_clan_level;
.@exp_rate_bonus = .high_rate_exp_bonus;
.@drop_rate_bonus = .high_rate_drop_bonus;
break;
default:
mes "Select your game mode, for more information about bonuses, visit our discord:";
mes "BE CAREFUL: YOU CANNOT CHANGE LATER!";
mes "[Rates EXP/Drop %]";
mes "- Low Rates:" + .low_rate_exp_bonus + ", " + .low_rate_drop_bonus + ".";
mes "- Mid Rates:" + .mid_rate_exp_bonus + ", " + .mid_rate_drop_bonus + ".";
mes "- High Rates:" + .high_rate_exp_bonus + ", " + .high_rate_drop_bonus + ".";
individual_rate = select("- Low Rate:- Mid Rate:- High Rate");
close2;
goto OnSetRate;
}
sc_start .@clan_level, INFINITE_TICK, .@exp_rate_bonus ;
end;
OnInit:
.low_rate_exp_bonus = 250;
.mid_rate_exp_bonus = 50;
.high_rate_exp_bonus = 1; // EXP 1x in God mode
.low_rate_drop_bonus = 250;
.mid_rate_drop_bonus = 50;
.high_rate_drop_bonus = 1; // Drop Rate 1x in God mode
.low_rate_clan_level = SC_CLAN_EASY;
.mid_rate_clan_level = SC_CLAN_NORMAL;
.high_rate_clan_level = SC_CLAN_GOD;
}
Then I added the SC_ in status.cpp following the expboost:
case SC_CLAN_EASY:
tick = INFINITE_TICK;
val1 = 0; // EXP and Drop Rate 250x
break;
case SC_CLAN_NORMAL:
tick = INFINITE_TICK;
val1 = 0; // EXP and Drop Rate 50x
break;
case SC_CLAN_GOD:
tick = INFINITE_TICK;
val1 = 0; // EXP and Drop Rate 1x
if (sd->status.base_level >= 260) {
pc_bonus(sd, SP_ATK_RATE, 10);
pc_bonus(sd, SP_MATK_RATE, 10);
}
break;
Question
Gaspar145
I'm working on a system to select the game mode, but I'm encountering some errors. The first one is that it's not working; I select the rate, and the script doesn't change the rate. However, I have no idea what I might have done wrong or forgotten. Can someone please help me?
First, I made the NPC that gives the selection:
- script RateSelect -1,{ OnSetRate: OnPCLoginEvent: switch(individual_rate) { case 1: .@clan_level = .low_rate_clan_level; .@exp_rate_bonus = .low_rate_exp_bonus; .@drop_rate_bonus = .low_rate_drop_bonus; break; case 2: .@clan_level = .mid_rate_clan_level; .@exp_rate_bonus = .mid_rate_exp_bonus; .@drop_rate_bonus = .mid_rate_drop_bonus; break; case 3: .@clan_level = .high_rate_clan_level; .@exp_rate_bonus = .high_rate_exp_bonus; .@drop_rate_bonus = .high_rate_drop_bonus; break; default: mes "Select your game mode, for more information about bonuses, visit our discord:"; mes "BE CAREFUL: YOU CANNOT CHANGE LATER!"; mes "[Rates EXP/Drop %]"; mes "- Low Rates:" + .low_rate_exp_bonus + ", " + .low_rate_drop_bonus + "."; mes "- Mid Rates:" + .mid_rate_exp_bonus + ", " + .mid_rate_drop_bonus + "."; mes "- High Rates:" + .high_rate_exp_bonus + ", " + .high_rate_drop_bonus + "."; individual_rate = select("- Low Rate:- Mid Rate:- High Rate"); close2; goto OnSetRate; } sc_start .@clan_level, INFINITE_TICK, .@exp_rate_bonus ; end; OnInit: .low_rate_exp_bonus = 250; .mid_rate_exp_bonus = 50; .high_rate_exp_bonus = 1; // EXP 1x in God mode .low_rate_drop_bonus = 250; .mid_rate_drop_bonus = 50; .high_rate_drop_bonus = 1; // Drop Rate 1x in God mode .low_rate_clan_level = SC_CLAN_EASY; .mid_rate_clan_level = SC_CLAN_NORMAL; .high_rate_clan_level = SC_CLAN_GOD; }
Then I added the SC_ in status.cpp following the expboost:
case SC_CLAN_EASY: tick = INFINITE_TICK; val1 = 0; // EXP and Drop Rate 250x break; case SC_CLAN_NORMAL: tick = INFINITE_TICK; val1 = 0; // EXP and Drop Rate 50x break; case SC_CLAN_GOD: tick = INFINITE_TICK; val1 = 0; // EXP and Drop Rate 1x if (sd->status.base_level >= 260) { pc_bonus(sd, SP_ATK_RATE, 10); pc_bonus(sd, SP_MATK_RATE, 10); } break;
Next, I added them to script_constants:
cpp
Copy code
Then I added them to status.hpp as expboost:
Then I added them, I believe, so that when using an expboost, the effect is cumulative, that is, it does not interfere with them:
Then I added them to status.yml:
- Status: claneasy Icon: EFST_GOLDENMACECLAN Flags: NoRemoveOnDead: true NoClearbuff: true NoDispell: true NoBanishingBuster: true NoClearance: true EndOnEnd: Clan_Info: true - Status: clannormal Icon: EFST_CROSSBOWCLAN Flags: NoRemoveOnDead: true NoClearbuff: true NoDispell: true NoBanishingBuster: true NoClearance: true EndOnEnd: Clan_Info: true - Status: clangod Icon: EFST_ARCWANDCLAN Flags: NoRemoveOnDead: true NoClearbuff: true NoDispell: true NoBanishingBuster: true NoClearance: true EndOnEnd: Clan_Info: true
However, when selecting the rates, it does not set the rates, it simply does not work, I believe I did something wrong.
Link to comment
Share on other sites
3 answers 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.