Hey guys!
In this tutorial, I'm going to be showing you how to implement Orpheus' Overdrive mode.
Overdrive mode is a feature that allows you to do extra damage after acquiring a certain amount of points. You get points by attacking NPCs and other players. You get 5 points per hit, and you lose one point per second.
Difficulty: 1 (possibly more if you have to do any converting)
Classes modified: Client
First, add these (they'll go at the top of your Client class):
public int overdriveBar = 0;
public int overdriveTime = (getRageLevel() * 240);
public int[] overdriveLevel = new int[25];
public int[] overdriveXP = new int[25];
public boolean overdriveOn = false;
public boolean overdriveWas = false;
public int overdriveXer = 2;
Then declare this int:
public int getoverdriveLevel() {
if (combat <= 50) {
return 1;
} else if (combat <= 75) {
return 2;
} else if (combat <= 100) {
return 3;
} else if (combat >= 100) {
return 4;
}
return 0;
}
This dictates how powerful the Overdrive is based on their combat level.
Then add these under your process() void:
overdriveXer--;
if (overdriveXer <= 0) {
if (overdriveBar > 0) {
overdriveBar--;
}
overdriveXer = 2;
}
if (overdriveBar >= 2500) {
overdriveOn = true;
overdriveWas = true;
overdriveBar = 0;
Send("@red@Overdrive activated!");
}
if (overdriveOn) {
overdriveTime--;
if (overdriveTime <= 0) {
overdriveTime = getoverdriveLevel() * 120;
overdriveOn = false;
}
}
if (overdriveOn) {
stillgfx(383, absY, absX);
startAnimation(1500);
playerSE = 1501;
playerSEW = 1851;
playerSER = 1851;
playerSEA = 1851;
} else if (overdriveWas) {
playerSE = 0x328;
playerSEW = 0x333;
playerSER = 0x338;
playerSEA = 0x326;
}
Then add this under your addSkillXP boolean, under int Runecrafting:
if (skill == 0 || skill == 1 || skill == 2 || skill == 3 || skill == 4) {
overdriveBar += getoverdriveLevel();
}
Then, find something that has to do with Dharok's effect, and add this under the closing bracket:
if (overdriveOn) {
MaxHit = MaxHit * (getoverdriveLevel() + 1);
}
I understand that using process() isn't a good idea, but this isn't
a lot of code. It won't be a problem unless your process() is already
stuffed with code.
The only think I'm going to leave up to you is making an interface
that shows how many Overdrive points you've accumulated.
If I forgot anything, let me know! I'll be happy to help out with adding this, too.