Part 1: Adding in Attack Npc Weapon DelaysOpen up client.java and search for this
- Code:
-
public boolean AttackNPC() {
You should see this
- Code:
-
public boolean AttackNPC() {
int EnemyX = server.npcHandler.npcs[attacknpc].absX;
int EnemyY = server.npcHandler.npcs[attacknpc].absY;
int offsetX = (absX - EnemyX) * -1;
int offsetY = (absY - EnemyY) * -1;
int EnemyHP = server.npcHandler.npcs[attacknpc].HP;
int hitDiff = 0;
int Npchitdiff = 0;
int wepdelay = 0;
CalculateMaxHit();
hitDiff = misc.random(playerMaxHit);
faceNPC(attacknpc);
//viewTo(server.npcHandler.npcs[attacknpc].absX, server.npcHandler.npcs[attacknpc].absY);
if(server.npcHandler.npcs[attacknpc].followPlayer < 1 || server.npcHandler.npcs[attacknpc].followPlayer == playerId || inwildy2 == true) {
if(playerEquipment[playerWeapon] == (1333)) //rune scimi here
Or something related to that than below that add in a statement like this
- Code:
-
if(playerEquipment[playerWeapon] == (ItemID)) // Note
{
PkingDelay = 3;
wepdelay = 3;
resetanim = 3;
}
this is the basic one Where it says ItemID you add in the id of the weapon you want to have these delays while attacking npcs than after the (ItemId)) there is a //Note that is just a note next to the weapon so you can know what weapon that is so for example if you had a whip there you would say in the note //Whip Delay or something like that. But you do not need to have the note, if you do not delete both the // and the note next to it
Than the PkingDelay, wepdelay, resetanim = 3;'s you change the 3s to change the delays easy
Part 2: Changing Delays while attacking peopleSearch client.java for
- Code:
-
public boolean Attack() {
You should see a code set like this
- Code:
-
public boolean Attack() {
int EnemyX = PlayerHandler.players[AttackingOn].absX;
int EnemyY = PlayerHandler.players[AttackingOn].absY;
int offsetX = (absX - EnemyX) * -1;
int offsetY = (absY - EnemyY) * -1;
int EnemyHP = PlayerHandler.players[AttackingOn].playerLevel[playerHitpoints];
int EnemyHPExp = PlayerHandler.players[AttackingOn].playerXP[playerHitpoints];
client AttackingOn2 = (client) server.playerHandler.players[AttackingOn];
boolean RingOfLife = false;
if (PlayerHandler.players[AttackingOn].playerEquipment[playerRing] == 2570) {
RingOfLife = true;
}
int hitDiff = 0;
int wepdelay = 0;
CalculateMaxHit();
hitDiff = misc.random(playerMaxHit);
//viewTo(server.playerHandler.players[AttackingOn].absX, server.playerHandler.players[AttackingOn].absY);
Below that add in a if statement like this
- Code:
-
if(playerEquipment[playerWeapon] == (ItemID)) // Note
{
PkingDelay = 30;
wepdelay = 30;
}
Once again the same rules apply
Part 3: adding more weapon/Items for delay to workIf you want to make the if statement for example need Full dharoks and than it has a certain delay you would do something like this
- Code:
-
if(playerEquipment[playerWeapon] == (ItemId)) //Note
if(playerEquipment[playerChest] == (ItemId))
if(playerEquipment[playerLegs] == (ItemId))
{
PkingDelay = 20;
wepdelay = 20;
}
Again put the item id in the ItemId slot and the note part again
IF you wanted them to need a certain ring, Amulet, Shield, cape, arrows, hands, or feet to have the delay the ifs would be like this
- Code:
-
if(playerEquipment[playerShield] == (ItemId)) //Shield
if(playerEquipment[playerRing] == (ItemId)) //Ring
if(playerEquipment[playerHands] == (ItemId)) //Hands
if(playerEquipment[playerFeet] == (ItemId)) //Feet
if(playerEquipment[playerCape] == (ItemId)) //Cape
if(playerEquipment[playerAmulet] == (ItemId)) //Amulet
if(playerEquipment[playerArrows] == (ItemId)) //Arrows
Hope this Helped you out and taught you something related to Java
Thanks Purez/wangdoodle