Well, this is what ive got and it works fine for me:
Declare these in Player.java
Code:
/**
* veng.
*/
public long lastVeng;
public boolean vengOn = false;
Save and close.
In Actionbuttons.java, search for
in case 430, add this:
Code:
if(buttonId == 14) {
if(p.skillLvl[6] >= 94) {
if (Engine.playerItems.invItemCount(p, 557) > 10 && Engine.playerItems.invItemCount(p, 560) > 2 && Engine.playerItems.invItemCount(p, 9075) > 4) {
if(!p.vengOn) {
if(System.currentTimeMillis() - p.lastVeng >= 30000) {
p.requestAnim(4410, 0);
p.requestGFX(726, 100);
p.vengOn = true;
p.lastVeng = System.currentTimeMillis();
Engine.playerItems.deleteItem(p, 557, Engine.playerItems.getItemSlot(p, 557), 10);
Engine.playerItems.deleteItem(p, 560, Engine.playerItems.getItemSlot(p, 560), 2);
Engine.playerItems.deleteItem(p, 9075, Engine.playerItems.getItemSlot(p, 9075), 4);
}
else {
p.frames.sendMessage(p, "You can only cast vengeance spells every 30 seconds.");
}
}
else {
p.frames.sendMessage(p, "You already have vengeance casted.");
}
}
else {
p.frames.sendMessage(p, "You don't have enough runes to cast this spell.");
}
}
else {
p.frames.sendMessage(p, "You need a magic level of 94 to cast this spell.");
}
}
Save and close.
Replace your appendhit method with this:
Code:
int hitDamage = Misc.random(maxMeleeHit(p));
if(p2.vengOn) {
p.appendHit((int)((hitDamage/4)*3), 0);
p2.chatText = "Taste Vengeance!";
p.chatTextUpdateReq = true;
p.updateReq = true;
p2.vengOn = false;
}
p2.appendHit(hitDamage, 0);
Here, for example is mine:
Code:
if(p2.vengOn) {
p.appendHit((int)((hitDamage/4)*3), 0);
p2.chatText = "Taste Vengeance!";
p2.chatTextUpdateReq = true;
p.updateReq = true;
p2.vengOn = false;
}
if(rangedAtk > rangedDef) {
p2.appendHit(hitDamage, 0);
} else {
p2.appendHit(0, 0);
}
Here is the maxMeleeHit method if you dont have it:
Code:
public int maxMeleeHit(Player p) {
int a = p.skillLvl[2];
int b = p.equipmentBonus[10];
double c = (double)a;
double d = (double)b;
double f = 0;
double h = 0;
f = (d*0.00175)+0.1;
h = Math.floor(c*f+2.05);
return (int) h;
}
That should work. Hope i helped.