hey I'm having crossbow problems I have coded in Royal Crossbow and it all works fine on npc range long range far away shooting the works.
but when I use in PVP I can't shoot some 1 from faraway it makes me walk next to my opponent.
here is my Combatassistance.java the item id is 18358 so please help me and show me were I have gone wrong.
here is all the bits were my cross bow is
Code:
if(c.attackTimer <= 0) {
boolean usingBow = false;
boolean usingArrows = false;
boolean usingOtherRangeWeapons = false;
boolean usingCross = c.playerEquipment[c.playerWeapon] == 9185 && c.playerEquipment[c.playerWeapon] == 18357 || c.playerEquipment[c.playerWeapon] == 18358;
c.bonusAttack = 0;
c.rangeItemUsed = 0;
c.projectileStage = 0;
//c.SaveGame();
if (c.autocasting) {
c.spellId = c.autocastId;
c.usingMagic = true;
}
if(!c.castingMagic && c.projectileStage > 0) { // range hit damage
int damage = Misc.random(rangeMaxHit());
int damage2 = -1;
if (c.lastWeaponUsed == 11235 || c.lastWeaponUsed == 14481 || c.lastWeaponUsed == 14482 || c.bowSpecShot == 1)
damage2 = Misc.random(rangeMaxHit());
boolean ignoreDef = false;
if (Misc.random(5) == 1 && c.lastArrowUsed == 9243 && c.playerEquipment[c.playerWeapon] == 9185 && c.playerEquipment[c.playerWeapon] == 18357 && c.playerEquipment[c.playerWeapon] == 18358) {
ignoreDef = true;
Server.npcHandler.npcs[i].gfx0(758);
}
c.getPA().followPlayer(i);
if(c.attackTimer <= 0) {
c.usingBow = false;
c.specEffect = 0;
c.usingRangeWeapon = false;
c.rangeItemUsed = 0;
boolean usingBow = false;
boolean usingArrows = false;
boolean usingOtherRangeWeapons = false;
boolean usingCross = c.playerEquipment[c.playerWeapon] == 9185 && c.playerEquipment[c.playerWeapon] == 18357 || c.playerEquipment[c.playerWeapon] == 18358;
c.projectileStage = 0;
if (c.absX == Server.playerHandler.players[i].absX && c.absY == Server.playerHandler.players[i].absY) {
if (c.freezeTimer > 0) {
resetPlayerAttack();
return;
}
c.attackTimer = 0;
return;
}
thats the areas the main ones