This new method goes into
NPCHandler.java :
Code:
/**
@param c , the Client , the player that got hit.
@param i , the NPC that hit the player and will receive the rebound damage.
@param damage , the damage the NPC has dealt to the player.
*/
public void appendNPCVeng(Client c, int i, int damage) {
if (damage <= 0)
return;
c.forcedText = "Taste Vengeance!";
c.forcedChatUpdateRequired = true;
c.updateRequired = true;
c.vengOn = false;
if ((c.playerLevel[3] - damage) > 0) {
int rebound = (int)(damage*0.75);
if (rebound > npcs[i].HP) {
rebound = npcs[i].HP;
}
npcs[i].HP -= rebound;
npcs[i].hitDiff2 = rebound;
npcs[i].hitUpdateRequired2 = true;
}
npcs[i].updateRequired = true;
}
And now to call that method directly from where the NPC deals damage to the player...
In the NPCHandler class go to the
applyDamage method.
Go to the end of that method and you should see a line of code that lowers the players HP by the damage calculated in that method...
( the line is
c.playerLevel[3] -= damage; )
After that line we are going to call our new method if the player's vengeance is on , so we have to use an IF - statement like so :
Code:
if (c.vengOn) {
appendNPCVeng(c, i, damage);
}
and that should do it.
NOTE
You still have to add a way to activate Vengeance in your source.
There are tutorials for the lunar interface out there , but the method used to activate vengeance is : ( has to be added in clickingButtons class )
Code:
case xxxx:
if (c.playerLevel[6] >= 94){
if (System.currentTimeMillis() - c.lastVeng > 30000) {
if (c.getItems().playerHasItem(557,10) && c.getItems().playerHasItem(9075,4) && c.getItems().playerHasItem(560,2)) {
c.vengOn = true;
c.lastVeng = System.currentTimeMillis();
c.startAnimation(4410);
.getItems().deleteItem(557,c.getItems().getItemSlot(557),10);
c.getItems().deleteItem(560,c.getItems().getItemSlot(560),2);
c.getItems().deleteItem(9075,c.getItems().getItemSlot(9075),4);
} else {
c.sendMessage("You don't have the runes required to cast this spell.");
}
} else {
c.sendMessage("You must wait 30 seconds before casting Vengeance again.");
}
} else {
c.sendMessage("Your magic level isn't high enough to cast this spell.");
}
break;
Done
If you saw this on another site that rhymes with bune bocus.
I posted this on there as-well.