Purpose: To add a real workinbg vengeance , no bugs in it ! That also workz on NPC and Players !
Classes Modified: all client.java
Credits: 85% I loot I ( me on moparscape ... if you don't believe me add me and i'll talk to you k ? [Only registered and activated users can see links. ])
& 15% for zenzie for the booleans ...
Procedure:
open up client.java
This is if your server is based on memberschip , check lower on how to add for non members !
add this with your other voids :
Code:
public boolean vegeance = false;
public void vengNPC(int maxDamage) { // vengeance on npc by I loot I
if(server.npcHandler.npcs[attacknpc] != null)
{
if (server.npcHandler.npcs[attacknpc].IsDead == false) {
int damage = misc.random(maxDamage);
if (server.npcHandler.npcs[attacknpc].HP - hitDiff < 0)
damage = server.npcHandler.npcs[attacknpc].HP;
server.npcHandler.npcs[attacknpc].StartKilling = playerId;
server.npcHandler.npcs[attacknpc].RandomWalk = false;
server.npcHandler.npcs[attacknpc].IsUnderAttack = true;
server.npcHandler.npcs[attacknpc].hitDiff = damage;
server.npcHandler.npcs[attacknpc].updateRequired = true;
server.npcHandler.npcs[attacknpc].hitUpdateRequired = true;
}
}
}
public void warnplayer() { // warn players for the vengeance spell :p I loot I
client vengOnPlayer = (client) server.playerHandler.players[AttackingOn];
vengOnPlayer.sendMessage("A Vengeance Spell Has Been Cast On You");
}
public void warnplayer2() { // warn players for the vengeance spell :p I loot I
client vengOnPlayer = (client) server.playerHandler.players[AttackingOn];
vengOnPlayer.sendMessage("The Recoil Of Vengeance Has Effected You !");
}
public void castvengeancenpc() // improved vengeance by I loot I on npc
{
if(IsAttackingNPC && VenganceTimer == 0 && vegeance == true && playerIsMember == 1) {
txt4 = "Taste vengeance !";
string4UpdateRequired = true;
startAnimation(1979);
staticAnimation(401, absX, absY, 100);
sendMessage("You have cast a perfect Vengeance !");
vengNPC(30);
addSkillXP((3700 * hitDiff), 6);
addSkillXP((3700 * hitDiff), playerHitpoints);
waittimer = 30;
VenganceTimer = 25;
vegeance = false;
teleportToX = absX;
teleportToY = absY;
} else {
sendMessage("An Error Has Occured In Ur Vengeance !");
}
}
public void castvengeance() // improved vengeance by I loot I on players
{
if(IsAttacking && !nonWild() && VenganceTimer == 0 && vegeance == true && PlayerHandler.players[AttackingOn] != null && playerIsMember == 1) {
txt4 = "Taste vengeance !";
string4UpdateRequired = true;
startAnimation(1979);
staticAnimation(401, absX, absY, 100);
sendMessage("You have cast a perfect Vengeance !");
warnplayer2();
PlayerHandler.players[AttackingOn].hitDiff = misc.random(30);
PlayerHandler.players[AttackingOn].updateRequired = true;
PlayerHandler.players[AttackingOn].hitUpdateRequired = true;
waittimer = 30;
VenganceTimer = 25;
vegeance = false;
teleportToX = absX;
teleportToY = absY;
} else {
sendMessage("An Error Has Occured In Ur Vengeance !");
}
}
public int VenganceTimer = 0;
public int waittimer = 0;
now i added vengeance in place of a ancients tele ( the second last tele ! )
so change the case if u want
Code:
case 51031: // Vengeance
if(playerLevel[6] >= 115 && playerIsMember == 1 && waittimer == 0 && (IsAttacking || IsAttackingNPC))
{
vegeance = true;
if(IsAttacking) {
warnplayer();
}
VenganceTimer = 4;
} else if(playerLevel[6] < 115) {
sendMessage("You need a magic lvl of 115 to cast this Lunar Spell !");
} else if(playerIsMember != 1) {
sendMessage("Only Members Can Cast This Spell !");
} else if(waittimer > 0) {
sendMessage("You can only cast this spell every 15 secs !");
} else {
sendMessage("You need to be in a battle with a person or a monster !");
}
break;
oke you need to add this to to make the timer workz .. (in boolean process
now add this in case 185 , its an ancients teleport so u probably need to delete the tele case !
Code:
case 51031: // Vengeance
if(playerLevel[6] >= 115 && waittimer == 0 && (IsAttacking || IsAttackingNPC))
{
vegeance = true;
if(IsAttacking) {
warnplayer();
}
VenganceTimer = 4;
} else if(playerLevel[6] < 115) {
sendMessage("You need a magic lvl of 115 to cast this Lunar Spell !");
} else if(waittimer > 0) {
sendMessage("You can only cast this spell every 15 secs !");
} else {
sendMessage("You need to be in a battle with a person or a monster !");
}
break;
oke you need to add this to to make the timer workz .. (in boolean process
add this in both servers if you don't have those voids yet !
Code:
public void staticAnimation(int graphicID, int playerX, int playerY, int heightLevel) { /*Used from phates old stuff*/ // credits to phate for this bit :P
outStream.createFrame(85);
outStream.writeByteC(playerY - (mapRegionY * 8));
outStream.writeByteC(playerX - (mapRegionX * 8));
outStream.createFrame(4);
outStream.writeByte(0);
outStream.writeWord(graphicID); // Graphic ID
outStream.writeByte(heightLevel); // Height above gorund
outStream.writeWord(0); // Pause before casting
}
and if you get the startanimation error then just change 'start' to 'set' ...
your done
if this get some good comments , i'll release my other lunar spell to , nobody has it and it has no bugs to ...
and thnx i'll probably add my healing group lunar spell to xD
If you're going to post a code make sure you use proper grammer.
Cast is not Casted, it is just plain Cast and Effected is not Effect, it is just Effected. This isn't pre-school (Though most times you'd swear it is).
thnx for the comments ,
i want to post some pics , but it seems my laptop has some troubles with rune-server cause i can't see yet what ive posted , i'm now on my slow pc ... and doesn't has private server or anything on it
so ... and i'll probably add my healing group lunar spell
also i've edited the post , and srry for my english i'm dutch u know so i've some troubles in some tenses ...
i've added the vengeance timer u need to add in boolean process i forgot -_-"
You Don't Have Txt4 Or The Txt4updateboolean
you Dont Have NonWild (Prolly Safezones), Add Startanimation Voids And Staticanim From Other Sources, Then That Should Do It