[size=14pt]Different modes[/size]
Well what are we exactly adding is Different exp modes.
- Easy 5K xp rate
- medium 500xp rate hit higher then easy
- Hard 50 xp rate, hit higher then easy and medium + infinity prayer
- Extreme 10 xp rate, hit higher then easy,medium,hard + infinity prayer
Now let's start.
First we are going to add that the mode will save if u click it.
We going to add the save method in playersave.java
First search for
Code:
p.playerRights = Integer.parseInt(token2);
And add this under
Code:
} else if (token.equals("easyMode")) {
p.easyMode = Boolean.parseBoolean(token2);
} else if (token.equals("mediumMode")) {
p.mediumMode = Boolean.parseBoolean(token2);
} else if (token.equals("hardMode")) {
p.hardMode = Boolean.parseBoolean(token2);
} else if (token.equals("extremeMode")) {
p.extremeMode = Boolean.parseBoolean(token2);
} else if (token.equals("finishTut")) {
p.finishedTut = Boolean.parseBoolean(token2);
Now search for
Code:
characterfile.write("character-rights = ", 0, 19);
under the newline add this.
Code:
characterfile.write("easyMode = ", 0, 11);
characterfile.write(Boolean.toString(p.easyMode), 0, Boolean.toString(p.easyMode).length());
characterfile.newLine();
characterfile.write("mediumMode = ", 0, 13);
characterfile.write(Boolean.toString(p.mediumMode), 0, Boolean.toString(p.mediumMode).length());
characterfile.newLine();
characterfile.write("hardMode = ", 0, 11);
characterfile.write(Boolean.toString(p.hardMode), 0, Boolean.toString(p.hardMode).length());
characterfile.newLine();
characterfile.write("extremeMode = ", 0, 14);
characterfile.write(Boolean.toString(p.extremeMode), 0, Boolean.toString(p.extremeMode).length());
characterfile.newLine();
characterfile.write("finishTut = ", 0, 12);
characterfile.write(Boolean.toString(p.finishedTut), 0, Boolean.toString(p.finishedTut).length());
characterfile.newLine();
The Finishedtut will make the player can't walk when selecting you will see it later this code.
This code will make 4 lines in you're character map like
Easymode = false
mediumMode = false
HardMode = false
ExtremeMode = False
When you select a code when u login the false of the mode that u chosed gonna be = true
Save and close.
Now we gonna decleare the Finnishtut and the modes in player.java
If u don't do this u will get errors.
This part is needed so it can read the codes.
Go to player.java and add these
Code:
public boolean finishedTut;
public boolean easyMode, mediumMode, hardMode, extremeMode;
save and close.
Now we are going to add that hard mode and extreme mode doesn't lose prayer only by smithing or soulsplit
ok search in client.java for this.
This will make it so dialogue 850 ( the dialogue with the options) shows up you can't walk
And the declaring os easymode || MediumMode above prayerdrain
Will be that easymode and mediumode prayer goes down like normal and hard and extreme would get infinity prayer.
search for
Code:
getPA().handleWeaponStyle();
above it add
Code:
if (!finishedTut) {
getDH().sendDialogues(850, -1);
}
Code:
getFishing().FishingProcess();
and under that add this
Code:
if (easyMode || mediumMode)
So it would look like this
Code:
getFishing().FishingProcess();
if (easyMode || mediumMode)
getCombat().handlePrayerDrain();
Save and close
Now we are adding the dialogue on login so where u can chose you're options
go to dialoguehandler.java and add this
Code:
case 850:
sendOption4("Easy Mode 5000 xp rate", "Medium Mode 500 xp rate", "Hard Mode 50 xp rate", "Extreme Mode 10 xp rate");
c.dialogueAction = 850;
break;
save and close
Now we gonna add so you can click on the rates and it will save.
go to clickingbuttons.java and search for
c.finishedTut = true;
This means that when u click the option it will change in you character map to true so you able to walk.
add this under it
Code:
if (c.dialogueAction == 850) {
if (System.currentTimeMillis() - c.lastButton > 600) {
c.easyMode = true;
c.finishedTut = true;
c.getPA().removeAllWindows();
c.lastButton = System.currentTimeMillis();
}
}
then search for
add this under it
Code:
if (c.dialogueAction == 850) {
if (System.currentTimeMillis() - c.lastButton > 600) {
c.mediumMode = true;
c.finishedTut = true;
c.getPA().removeAllWindows();
c.lastButton = System.currentTimeMillis();
}
}
then search for
add this under it
Code:
if (c.dialogueAction == 850) {
if (System.currentTimeMillis() - c.lastButton > 600) {
c.hardMode = true;
c.finishedTut = true;
c.getPA().removeAllWindows();
c.lastButton = System.currentTimeMillis();
}
}
Then search for
under it add this
Code:
if (c.dialogueAction == 850) {
if (System.currentTimeMillis() - c.lastButton > 600) {
c.extremeMode = true;
c.finishedTut = true;
c.getPA().removeAllWindows();
c.lastButton = System.currentTimeMillis();
}
}
save and close
i explain the code.
(c.dialogueAction == 850) {
This means what dialogue will come up so it's 850.
now we gonna add the different experience rate.
Go to combatassistant.java and add this above
Code:
private int combatExp() {
int amount = 0;
if (c.easyMode) {
amount = 5000;
} else if (c.mediumMode) {
amount = 500;
} else if (c.hardMode) {
amount = 50;
} else if (c.extremeMode) {
amount = 10;
}
return amount;
}
The amount is the experience that u will get each hit.
you can change it if you want.
Now we gonna add that each mode hit a little bit better.
Search in combatassistant.java for
Code:
if(c.prayerActive[25]) {
strength += (int)(lvlForXP * .23);
}
add under that add this
Code:
if (c.easyMode) {
strength += (int) (lvlForXP * .03);
} else if (c.mediumMode) {
strength += (int) (lvlForXP * .06);
} else if (c.hardMode) {
strength += (int) (lvlForXP * .09);
} else if (c.extremeMode) {
strength += (int) (lvlForXP * .12);
}
lvlforxp means how much higher you will hit by the mode that you have selected easy to change.
save and close
Now for the last part go to walking.java
This will make so you can't walk when you select the mode.
Add this in walking.java
Code:
if (!c.finishedTut) {
c.sendMessage("You must first select a difficulty mode.");
return;
}