Purpose: Adding the run Orb
Difficulty: 1/10, if you have common sense and basic client/Java knowledge.
Assumed Knowledge: Basic client knowledge, basic Java knowledge.
Classes Modified: client.java and Sprite.java
Client Base: Galkons recent refactored base.
Step 1:
Go into sprite.java and under
Code:
} else if (img.equalsIgnoreCase("prayericon")) {
myWidth = 20;
myHeight = 20;
Add this,
Code:
} else if (img.equalsIgnoreCase("runorb") || img.equalsIgnoreCase("runclick") || img.equalsIgnoreCase("hoverorbrun")
|| img.equalsIgnoreCase("hoverorbrun2")) {
myWidth = 57;
myHeight = 34;
Save and close Sprite.java
Step 2:
In client.java Find this method.
Code:
public void drawHPOrb() {
Above it add,
Code:
public int playerEnergy = 0;
public void drawRunOrb() {
if (!runClicked) {
if (super.mouseX > 713 && super.mouseX < 765 && super.mouseY > 83 && super.mouseY < 118) {
hoverorbrun.drawSprite(185, 85);
} else {
runorb.drawSprite(185, 85);
}
} else {
if (super.mouseX > 713 && super.mouseX < 765 && super.mouseY > 83 && super.mouseY < 118) {
hoverorbrun2.drawSprite(185, 85);
} else {
runClick.drawSprite(185, 85);
}
}
smallText.method382(65280, 229, ""+playerEnergy, 111, true);
}
Step 3:
Find,
Code:
emptyOrb = new Sprite("emptyorb");
Under it add,
Code:
hoverorbrun2 = new Sprite("hoverorbrun2");
hoverorbrun = new Sprite("hoverorbrun");
runClick = new Sprite("runclick");
runorb = new Sprite("runorb");
]
Step 4:
Find this,
Code:
private Sprite hitPointsFill;
Above it add,
Code:
private Sprite hoverorbrun;
private Sprite hoverorbrun2;
private Sprite runClick;
private Sprite runorb;
Step 5:
Find this,
Code:
hitPointsFill = null;
Above it add,
Code:
hoverorbrun2 = null;
hoverorbrun = null;
runClick = null;
runorb = null;
Step 6:
Find this,
Under it add,
Step 7:
Find this,
Under,
Code:
energy = inStream.readUnsignedByte();
Add this,
Code:
playerEnergy = energy;
Step 8:
Find,
Code:
if(l == 1004) {
if(tabInterfaceIDs[10] != -1) {
needDrawTabArea = true;
tabID = 10;
tabAreaAltered = true;
}
}
Under it add,
Code:
if (l == 1051) {
if(!runClicked){
runClicked = true;
stream.createFrame(185);
stream.writeWord(153);
} else {
runClicked = false;
stream.createFrame(185);
stream.writeWord(152);
}
}
Step 9:
Delclare
Code:
public boolean runClicked = false;
Step 10:
Find this,
Code:
if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23 && tabInterfaceIDs[10] != -1) {
menuActionName[1] = "Logout";
menuActionID[1] = 1004;
menuActionRow = 2;
under it add,
Code:
} else if (super.mouseX > 713 && super.mouseX < 765 && super.mouseY > 83 && super.mouseY < 118) {
menuActionName[1] = "Run";
menuActionID[1] = 1051;
menuActionRow = 2;
}
Save and close client.java.
SERVER SIDE
Step 11:
Add this method into client.java or where you keep your niffty methods.
Code:
public void sendEnergy() {
outStream.createFrame(110);
outStream.writeByte(playerEnergy);
}
Step 12:
In the method add in there somewhere,
NOW, if you have decreasing/increasing energy you need to add in their for it to update!
Also, get rid of any WirteEnergy(); methods and replace it with sendEnergy();
EASIEST STEP
Download these spirtes and add them into the Sprites folder.
[Only registered and activated users can see links. ]
Please post errors as i probably missed something, there is no anti leech so please tell me if u get errors.
Enjoy...