Magic numbers & removed some dead specials (#574)

* Replace Magic Numbers in Specials.java

* Removed Dbow, Hand Cannon & Morrigans Ranged Specs

Released after 2006

* RangeData.java Convert Magic Numbers

* DwarfCannon.java Convert Magic Numbers
This commit is contained in:
Josh Shippam
2023-02-02 06:56:44 +00:00
committed by GitHub
parent 209dae48a6
commit 628d8b98da
6 changed files with 300 additions and 399 deletions
@@ -104,16 +104,6 @@ public class CombatAssistant {
damage2 = 0; damage2 = 0;
} }
} }
if (player.dbowSpec) {
NpcHandler.npcs[i].gfx100(1100);
if (damage < 8) {
damage = 8;
}
if (damage2 < 8) {
damage2 = 8;
}
player.dbowSpec = false;
}
if (damage > 0 && Misc.random(5) == 1 && player.lastArrowUsed == 9244) { if (damage > 0 && Misc.random(5) == 1 && player.lastArrowUsed == 9244) {
damage *= 1.45; damage *= 1.45;
NpcHandler.npcs[i].gfx0(756); NpcHandler.npcs[i].gfx0(756);
@@ -1165,16 +1155,6 @@ public class CombatAssistant {
damage2 = 0; damage2 = 0;
} }
} }
if (player.dbowSpec) {
o.gfx100(1100);
if (damage < 8) {
damage = 8;
}
if (damage2 < 8) {
damage2 = 8;
}
player.dbowSpec = false;
}
if (damage > 0 && Misc.random(5) == 1 && player.lastArrowUsed == 9244) { if (damage > 0 && Misc.random(5) == 1 && player.lastArrowUsed == 9244) {
damage *= 1.45; damage *= 1.45;
o.gfx0(756); o.gfx0(756);
@@ -3,6 +3,8 @@ package com.rs2.game.content.combat;
import java.util.HashMap; import java.util.HashMap;
import com.rs2.GameConstants; import com.rs2.GameConstants;
import com.rs2.game.content.StaticItemList;
import com.rs2.game.content.StaticNpcList;
import com.rs2.game.content.combat.range.RangeData; import com.rs2.game.content.combat.range.RangeData;
import com.rs2.game.content.music.sound.CombatSounds; import com.rs2.game.content.music.sound.CombatSounds;
import com.rs2.game.npcs.NpcHandler; import com.rs2.game.npcs.NpcHandler;
@@ -24,18 +26,18 @@ public class Specials {
// ItemName(ItemId, SpecDamage, SpecAccuracy, SpecAmount, Anim, GFX0, // ItemName(ItemId, SpecDamage, SpecAccuracy, SpecAmount, Anim, GFX0,
// GFX100, DoubleHit, SsSpec, SpecEffect) // GFX100, DoubleHit, SsSpec, SpecEffect)
ABYSSAL_WHIP(4151, 1, 1.25, 5, 1658, 341, -1, false, 0), ABYSSAL_WHIP(StaticItemList.ABYSSAL_WHIP, 1, 1.25, 5, 1658, 341, -1, false, 0),
DRAGON_DAGGER(1215, 1.15, 1.25, 2.5, 1062, -1, 252, true, 0), DRAGON_DAGGER(StaticItemList.DRAGON_DAGGER, 1.15, 1.25, 2.5, 1062, -1, 252, true, 0),
DRAGON_DAGGER_P(1231, 1.15, 1.25, 2.5, 1062, -1, 252, true, 0), DRAGON_DAGGER_P(StaticItemList.DRAGON_DAGGERP, 1.15, 1.25, 2.5, 1062, -1, 252, true, 0),
DRAGON_DAGGER_PP(5698, 1.15, 1.25, 2.5, 1062, -1, 252, true, 0), DRAGON_DAGGER_PP(StaticItemList.DRAGON_DAGGERS, 1.15, 1.25, 2.5, 1062, -1, 252, true, 0),
DRAGON_DAGGER_PPP(5680, 1.15, 1.25, 2.5, 1062, -1, 252, true, 0), DRAGON_DAGGER_PPP(StaticItemList.DRAGON_DAGGER_5680, 1.15, 1.25, 2.5, 1062, -1, 252, true, 0),
DRAGON_LONG(1305, 1.20, 1.10, 2.5, 1058, -1, 248, false, 0), DRAGON_LONG(StaticItemList.DRAGON_LONGSWORD, 1.20, 1.10, 2.5, 1058, -1, 248, false, 0),
DRAGON_MACE(1434, 1.55, 1.25, 2.5, 1060, -1, 251, false, 0), DRAGON_MACE(StaticItemList.DRAGON_MACE, 1.55, 1.25, 2.5, 1060, -1, 251, false, 0),
DRAGON_SCIMITAR(4587, 1, 1.25, 5.5, 1872, -1, 347, false, 1), DRAGON_SCIMITAR(StaticItemList.DRAGON_SCIMITAR, 1, 1.25, 5.5, 1872, -1, 347, false, 1),
DRAGON_HALBERD(3204, 1.25, .85, 3, 1203, -1, 282, true, 0), DRAGON_HALBERD(StaticItemList.DRAGON_HALBERD, 1.25, .85, 3, 1203, -1, 282, true, 0),
GRANITE_MAUL(4153, 1.10, .85, 5, 1667, -1, 337, false, 0), GRANITE_MAUL(StaticItemList.GRANITE_MAUL, 1.10, .85, 5, 1667, -1, 337, false, 0),
MAGIC_SHORTBOW(861, 1.05, .95, 5.5, 1074, -1, -1, true, 0), MAGIC_SHORTBOW(StaticItemList.MAGIC_SHORTBOW, 1.05, .95, 5.5, 1074, -1, -1, true, 0),
MAGIC_LONGBOW(859, 1.20, 1.05, 5.5, 426, -1, -1, false, 0); MAGIC_LONGBOW(StaticItemList.MAGIC_LONGBOW, 1.20, 1.05, 5.5, 426, -1, -1, false, 0);
private int weapon, anim, gfx1, gfx2, specEffect; private int weapon, anim, gfx1, gfx2, specEffect;
private double specDamage, specAccuracy, specAmount; private double specDamage, specAccuracy, specAmount;
@@ -132,66 +134,7 @@ public class Specials {
return; return;
} }
if (equippedWeapon == SA.getWeapon()) { if (equippedWeapon == SA.getWeapon()) {
if (SA.getWeapon() == 11235) { if (SA.getWeapon() == StaticItemList.MAGIC_LONGBOW || SA.getWeapon() == StaticItemList.MAGIC_SHORTBOW) {
player.usingBow = true;
player.dbowSpec = true;
player.rangeItemUsed = player.playerEquipment[player.playerArrows];
player.getItemAssistant().deleteArrow();
player.getItemAssistant().deleteArrow();
player.lastWeaponUsed = weapon;
player.hitDelay = 3;
player.startAnimation(426);
player.projectileStage = 1;
player.gfx100(RangeData.getRangeStartGFX(player));
player.hitDelay = player.getCombatAssistant().getHitDelay();
if (player.fightMode == 2) {
player.attackTimer--;
}
if (player.playerIndex > 0) {
player.getCombatAssistant().fireProjectilePlayer();
} else if (player.npcIndex > 0) {
player.getCombatAssistant().fireProjectileNpc();
}
player.specAccuracy = SA.getSpecAccuracy();
player.specDamage = SA.getSpecDamage();
} else if (SA.getWeapon() == 15241) {
player.usingBow = true;
player.rangeItemUsed = player.playerEquipment[player.playerArrows];
player.getItemAssistant().deleteArrow();
player.lastWeaponUsed = weapon;
player.startAnimation(12175);
player.specAccuracy = SA.getSpecAccuracy();
player.specDamage = SA.getSpecDamage();
player.hitDelay = 5;
player.attackTimer -= 7;
player.hitDelay = player.getCombatAssistant().getHitDelay();
if (player.fightMode == 2) {
if (player.playerIndex > 0) {
player.getCombatAssistant().fireProjectilePlayer();
} else if (player.npcIndex > 0) {
player.getCombatAssistant().fireProjectileNpc();
}
}
} else if (SA.getWeapon() == 13879 || SA.getWeapon() == 13883) {
player.usingRangeWeapon = true;
player.rangeItemUsed = player.playerEquipment[player.playerWeapon];
player.getItemAssistant().deleteArrow();
player.lastWeaponUsed = weapon;
player.startAnimation(SA.getAnim());
player.gfx0(SA.getGfx1());
player.specAccuracy = SA.getSpecAccuracy();
player.specDamage = SA.getSpecDamage();
player.projectileStage = 1;
player.hitDelay = player.getCombatAssistant().getHitDelay();
if (player.fightMode == 2) {
player.attackTimer--;
}
if (player.playerIndex > 0) {
player.getCombatAssistant().fireProjectilePlayer();
} else if (player.npcIndex > 0) {
player.getCombatAssistant().fireProjectileNpc();
}
} else if (SA.getWeapon() == 859 || SA.getWeapon() == 861) {
player.usingBow = true; player.usingBow = true;
player.bowSpecShot = 1; player.bowSpecShot = 1;
player.rangeItemUsed = player.playerEquipment[player.playerArrows]; player.rangeItemUsed = player.playerEquipment[player.playerArrows];
@@ -241,7 +184,7 @@ public class Specials {
public void handleGmaul() { public void handleGmaul() {
if (player.npcIndex > 0 && NpcHandler.npcs[player.npcIndex] != null) { if (player.npcIndex > 0 && NpcHandler.npcs[player.npcIndex] != null) {
if (player.goodDistance(player.getX(), player.getY(), NpcHandler.npcs[player.npcIndex].getX(), NpcHandler.npcs[player.npcIndex].getY(), player.getCombatAssistant().getRequiredDistance())) { if (player.goodDistance(player.getX(), player.getY(), NpcHandler.npcs[player.npcIndex].getX(), NpcHandler.npcs[player.npcIndex].getY(), player.getCombatAssistant().getRequiredDistance())) {
if (player.getCombatAssistant().checkSpecAmount(4153)) { if (player.getCombatAssistant().checkSpecAmount(StaticItemList.GRANITE_MAUL)) {
boolean hit = Misc.random(player.getCombatAssistant().calcAtt()) > Misc.random(NpcHandler.npcs[player.npcIndex].defence); boolean hit = Misc.random(player.getCombatAssistant().calcAtt()) > Misc.random(NpcHandler.npcs[player.npcIndex].defence);
int damage = 0; int damage = 0;
if (hit) { if (hit) {
@@ -260,7 +203,7 @@ public class Specials {
if (player.goodDistance(player.getX(), player.getY(), o.getX(), o.getY(), player if (player.goodDistance(player.getX(), player.getY(), o.getX(), o.getY(), player
.getCombatAssistant().getRequiredDistance())) { .getCombatAssistant().getRequiredDistance())) {
if (player.getCombatAssistant().checkReqs()) { if (player.getCombatAssistant().checkReqs()) {
if (player.getCombatAssistant().checkSpecAmount(4153)) { if (player.getCombatAssistant().checkSpecAmount(StaticItemList.GRANITE_MAUL)) {
boolean hit = Misc.random(player.getCombatAssistant().calcAtt()) > Misc.random(o.getCombatAssistant().calcDef()); boolean hit = Misc.random(player.getCombatAssistant().calcAtt()) > Misc.random(o.getCombatAssistant().calcDef());
int damage = 0; int damage = 0;
if (hit) { if (hit) {
@@ -296,7 +239,7 @@ public class Specials {
public static void specialClicking(Player player2, int actionButtonId) { public static void specialClicking(Player player2, int actionButtonId) {
switch (actionButtonId) { switch (actionButtonId) {
case 29188: case 29188:
if (player2.playerEquipment[player2.playerWeapon] == 1434) { if (player2.playerEquipment[player2.playerWeapon] == StaticItemList.DRAGON_MACE) {
player2.specBarId = 7636; player2.specBarId = 7636;
player2.usingSpecial = !player2.usingSpecial; player2.usingSpecial = !player2.usingSpecial;
player2.getItemAssistant().updateSpecialBar(); player2.getItemAssistant().updateSpecialBar();
@@ -304,7 +247,7 @@ public class Specials {
break; break;
case 29163: case 29163:
if (player2.playerEquipment[player2.playerWeapon] == 4587) { if (player2.playerEquipment[player2.playerWeapon] == StaticItemList.DRAGON_SCIMITAR) {
player2.specBarId = 7611; player2.specBarId = 7611;
player2.usingSpecial = !player2.usingSpecial; player2.usingSpecial = !player2.usingSpecial;
player2.getItemAssistant().updateSpecialBar(); player2.getItemAssistant().updateSpecialBar();
@@ -312,7 +255,7 @@ public class Specials {
break; break;
case 33033: case 33033:
if (player2.playerEquipment[player2.playerWeapon] == 4153) { if (player2.playerEquipment[player2.playerWeapon] == StaticItemList.GRANITE_MAUL) {//TODO should this be here twice?
player2.specBarId = 8505; player2.specBarId = 8505;
player2.usingSpecial = !player2.usingSpecial; player2.usingSpecial = !player2.usingSpecial;
player2.getItemAssistant().updateSpecialBar(); player2.getItemAssistant().updateSpecialBar();
@@ -320,7 +263,7 @@ public class Specials {
break; break;
case 29038: case 29038:
if (player2.playerEquipment[player2.playerWeapon] == 4153) { if (player2.playerEquipment[player2.playerWeapon] == StaticItemList.GRANITE_MAUL) {
player2.specBarId = 7486; player2.specBarId = 7486;
player2.getSpecials().handleGmaul(); player2.getSpecials().handleGmaul();
player2.usingSpecial = !player2.usingSpecial; player2.usingSpecial = !player2.usingSpecial;
@@ -329,7 +272,7 @@ public class Specials {
break; break;
case 29063: case 29063:
if (player2.playerEquipment[player2.playerWeapon] == 1377) { if (player2.playerEquipment[player2.playerWeapon] == StaticItemList.DRAGON_BATTLEAXE) {
if (player2.specAmount >= 5) { if (player2.specAmount >= 5) {
player2.gfx0(246); player2.gfx0(246);
player2.forcedChat("Raarrrrrgggggghhhhhhh!"); player2.forcedChat("Raarrrrrgggggghhhhhhh!");
@@ -345,7 +288,7 @@ public class Specials {
break; break;
case 48023: case 48023:
if (player2.playerEquipment[player2.playerWeapon] == 4151) { if (player2.playerEquipment[player2.playerWeapon] == StaticItemList.ABYSSAL_WHIP) {
player2.specBarId = 12335; player2.specBarId = 12335;
player2.usingSpecial = !player2.usingSpecial; player2.usingSpecial = !player2.usingSpecial;
player2.getItemAssistant().updateSpecialBar(); player2.getItemAssistant().updateSpecialBar();
@@ -353,9 +296,9 @@ public class Specials {
break; break;
case 29138: case 29138:
if (player2.playerEquipment[player2.playerWeapon] == 1215 || player2.playerEquipment[player2.playerWeapon] == 1231 if (player2.playerEquipment[player2.playerWeapon] == StaticItemList.DRAGON_DAGGER || player2.playerEquipment[player2.playerWeapon] == StaticItemList.DRAGON_DAGGERP
|| player2.playerEquipment[player2.playerWeapon] == 5680 || player2.playerEquipment[player2.playerWeapon] == 5698 || player2.playerEquipment[player2.playerWeapon] == StaticItemList.DRAGON_DAGGER_5680 || player2.playerEquipment[player2.playerWeapon] == StaticItemList.DRAGON_DAGGERS
|| player2.playerEquipment[player2.playerWeapon] == 1305) { || player2.playerEquipment[player2.playerWeapon] == StaticItemList.DRAGON_LONGSWORD) {
player2.specBarId = 7586; player2.specBarId = 7586;
player2.usingSpecial = !player2.usingSpecial; player2.usingSpecial = !player2.usingSpecial;
player2.getItemAssistant().updateSpecialBar(); player2.getItemAssistant().updateSpecialBar();
@@ -363,7 +306,7 @@ public class Specials {
break; break;
case 29113: case 29113:
if (player2.playerEquipment[player2.playerWeapon] == 861 || player2.playerEquipment[player2.playerWeapon] == 859) { if (player2.playerEquipment[player2.playerWeapon] == StaticItemList.MAGIC_SHORTBOW || player2.playerEquipment[player2.playerWeapon] == StaticItemList.MAGIC_LONGBOW) {
player2.specBarId = 7561; player2.specBarId = 7561;
player2.usingSpecial = !player2.usingSpecial; player2.usingSpecial = !player2.usingSpecial;
player2.getItemAssistant().updateSpecialBar(); player2.getItemAssistant().updateSpecialBar();
@@ -453,9 +453,7 @@ public class MeleeData {
if (weaponName.contains("cross") || weaponName.contains("c'bow")) { if (weaponName.contains("cross") || weaponName.contains("c'bow")) {
return 4; return 4;
} }
if (weaponName.contains("bow") && !c.dbowSpec) { if (weaponName.contains("bow")) {
return 4;
} else if (c.dbowSpec) {
return 4; return 4;
} }
@@ -14,6 +14,9 @@ import com.rs2.util.Misc;
import com.rs2.world.Boundary; import com.rs2.world.Boundary;
import com.rs2.world.clip.Region; import com.rs2.world.clip.Region;
import com.rs2.game.content.StaticItemList;
import com.rs2.game.content.StaticObjectList;
/** /**
* Cannon * Cannon
* @author Andrew (Mr Extremez) * @author Andrew (Mr Extremez)
@@ -27,13 +30,9 @@ public class DwarfCannon {
private Player player; private Player player;
public final int[] ITEM_PARTS = {6, 8, 10, 12}; public final int[] ITEM_PARTS = {StaticItemList.CANNON_BASE, StaticItemList.CANNON_STAND, StaticItemList.CANNON_BARRELS, StaticItemList.CANNON_FURNACE};
private final int[] OBJECT_PARTS = {7, 8, 9, 6}; private final int[] OBJECT_PARTS = {StaticObjectList.CANNON_BASE, StaticObjectList.CANNON_STAND, StaticObjectList.CANNON_BASE_9, StaticObjectList.DWARF_MULTICANNON};
private final int ballsID = 2;
public final int steelBarID = 2353;
public boolean settingUp = false; public boolean settingUp = false;
@@ -58,7 +57,7 @@ public class DwarfCannon {
public static void makeBall(Player player) public static void makeBall(Player player)
{ {
//An interface could be added instead of making all. //An interface could be added instead of making all.
if (!player.getItemAssistant().playerHasItem(2353) || !player.getItemAssistant().playerHasItem(4)) if (!player.getItemAssistant().playerHasItem(StaticItemList.STEEL_BAR) || !player.getItemAssistant().playerHasItem(StaticItemList.AMMO_MOULD))
{ {
player.getPacketSender().sendMessage("You need an ammo mould and steel bars to make cannonballs."); player.getPacketSender().sendMessage("You need an ammo mould and steel bars to make cannonballs.");
return; return;
@@ -69,7 +68,7 @@ public class DwarfCannon {
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() { CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
@Override @Override
public void execute(CycleEventContainer container) { public void execute(CycleEventContainer container) {
if (player.isWoodcutting || player.isCrafting || player.isFletching || player.isMoving || player.isMining || player.isBusy || player.isShopping || player.isFiremaking || player.isSpinning || player.isPotionMaking || player.playerIsFishing || player.isBanking || player.isSmelting || player.isTeleporting || player.isHarvesting || player.playerIsCooking || player.isPotCrafting ||!player.isSmithing || !player.getItemAssistant().playerHasItem(2353) || !player.getItemAssistant().playerHasItem(4)) if (player.isWoodcutting || player.isCrafting || player.isFletching || player.isMoving || player.isMining || player.isBusy || player.isShopping || player.isFiremaking || player.isSpinning || player.isPotionMaking || player.playerIsFishing || player.isBanking || player.isSmelting || player.isTeleporting || player.isHarvesting || player.playerIsCooking || player.isPotCrafting ||!player.isSmithing || !player.getItemAssistant().playerHasItem(StaticItemList.STEEL_BAR) || !player.getItemAssistant().playerHasItem(StaticItemList.AMMO_MOULD))
{ {
container.stop(); container.stop();
return; return;
@@ -77,7 +76,7 @@ public class DwarfCannon {
else else
{ {
player.startAnimation(899); player.startAnimation(899);
player.getItemAssistant().deleteItem(2353, 1); player.getItemAssistant().deleteItem(StaticItemList.STEEL_BAR, 1);
player.getItemAssistant().addItem(2, 4); player.getItemAssistant().addItem(2, 4);
player.getPacketSender().sendMessage("You make some cannonballs."); player.getPacketSender().sendMessage("You make some cannonballs.");
player.getPlayerAssistant().addSkillXP(26, GameConstants.SMITHING); player.getPlayerAssistant().addSkillXP(26, GameConstants.SMITHING);
@@ -152,7 +151,7 @@ public class DwarfCannon {
*/ */
int cballs = getBalls(); int cballs = getBalls();
int amount = cballs - myBalls; int amount = cballs - myBalls;
player.getItemAssistant().deleteItem(ballsID, player.getItemAssistant().getItemSlot(ballsID), amount); player.getItemAssistant().deleteItem(StaticItemList.CANNONBALL, player.getItemAssistant().getItemSlot(StaticItemList.CANNONBALL), amount);
myBalls = cballs; myBalls = cballs;
} }
}, 2); }, 2);
@@ -193,7 +192,7 @@ public class DwarfCannon {
} }
public int getBalls() { public int getBalls() {
int cannonBalls = player.getItemAssistant().getItemAmount(ballsID); int cannonBalls = player.getItemAssistant().getItemAmount(StaticItemList.CANNONBALL);
if (cannonBalls >= maxBalls) { if (cannonBalls >= maxBalls) {
return maxBalls; return maxBalls;
} }
@@ -225,9 +224,9 @@ public class DwarfCannon {
} }
if (myBalls <= 29) { if (myBalls <= 29) {
int amount = cballs - myBalls; int amount = cballs - myBalls;
player.getItemAssistant().deleteItem(ballsID, player.getItemAssistant().getItemSlot(ballsID), amount); player.getItemAssistant().deleteItem(StaticItemList.CANNONBALL, player.getItemAssistant().getItemSlot(StaticItemList.CANNONBALL), amount);
myBalls = cballs; myBalls = cballs;
if (player.getItemAssistant().playerHasItem(ballsID)) { if (player.getItemAssistant().playerHasItem(StaticItemList.CANNONBALL)) {
player.getPacketSender().sendMessage(amount > 1 ? "You load the cannon with " + amount + " cannonballs." : "You load the cannon with 1 cannonball."); player.getPacketSender().sendMessage(amount > 1 ? "You load the cannon with " + amount + " cannonballs." : "You load the cannon with 1 cannonball.");
} else { } else {
player.getPacketSender().sendMessage("You have no cannonballs to load into the cannon."); player.getPacketSender().sendMessage("You have no cannonballs to load into the cannon.");
@@ -371,7 +370,7 @@ public class DwarfCannon {
player.getPacketSender().sendMessage("You don't have enough free inventory slots to do that."); player.getPacketSender().sendMessage("You don't have enough free inventory slots to do that.");
} }
if (myBalls > 0) { if (myBalls > 0) {
player.getItemAssistant().addItem(ballsID, myBalls); player.getItemAssistant().addItem(StaticItemList.CANNONBALL, myBalls);
myBalls = 0; myBalls = 0;
} }
removeObject(player.cannonX, player.cannonY); removeObject(player.cannonX, player.cannonY);
@@ -2,23 +2,23 @@ package com.rs2.game.content.combat.range;
import com.rs2.game.players.Player; import com.rs2.game.players.Player;
import static com.rs2.game.content.StaticItemList.*;
public class RangeData { public class RangeData {
public final static int[] BOWS = { 9185, 839, 845, 847, 851, 855, 859, 841, public final static int[] BOWS = { 9185,LONGBOW,OAK_LONGBOW,WILLOW_LONGBOW,MAPLE_LONGBOW,YEW_LONGBOW,MAGIC_LONGBOW,SHORTBOW,OAK_SHORTBOW,WILLOW_SHORTBOW,MAPLE_SHORTBOW,YEW_SHORTBOW,MAGIC_SHORTBOW,NEW_CRYSTAL_BOW,CRYSTAL_BOW_FULL,CRYSTAL_BOW_910,CRYSTAL_BOW_810,CRYSTAL_BOW_710,CRYSTAL_BOW_610,CRYSTAL_BOW_510,CRYSTAL_BOW_410,CRYSTAL_BOW_310,CRYSTAL_BOW_210,CRYSTAL_BOW_110,SEERCULL,KARILS_CROSSBOW,KARILS_XBOW_100,KARILS_XBOW_75,KARILS_XBOW_50,KARILS_XBOW_25
843, 849, 853, 857, 861, 4212, 4214, 4215, 11235, 4216, 4217, 4218,
4219, 4220, 4221, 4222, 4223, 6724, 4734, 4934, 4935, 4936, 4937 };
public final static int[] ARROWS = { 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 4740, };
11212, 9140, 9141, 4142, 9143, 9144, 9240, 9241, 9242, 9243, 9244, public final static int[] ARROWS = { BRONZE_ARROW,BRONZE_ARROWP,IRON_ARROW,IRON_ARROWP,STEEL_ARROW,STEEL_ARROWP,MITHRIL_ARROW,MITHRIL_ARROWP,ADAMANT_ARROW,ADAMANT_ARROWP,RUNE_ARROW,RUNE_ARROWP,BOLT_RACK,9140,9141,9142,9143,9144,9240,9241,9242,9243,9244,9245,BROAD_ARROWS,BROAD_ARROWS_4160,BROAD_ARROWS_4172
9245, 4150, 4160, 4172 }; };
public final static int[] NO_ARROW_DROP = { 4212, 4214, 4215, 4216, 4217, public final static int[] NO_ARROW_DROP = { NEW_CRYSTAL_BOW,CRYSTAL_BOW_FULL,CRYSTAL_BOW_910,CRYSTAL_BOW_810,CRYSTAL_BOW_710,CRYSTAL_BOW_610,CRYSTAL_BOW_510,CRYSTAL_BOW_410,CRYSTAL_BOW_310,CRYSTAL_BOW_210,CRYSTAL_BOW_110,KARILS_CROSSBOW,KARILS_XBOW_100,KARILS_XBOW_75,KARILS_XBOW_50,KARILS_XBOW_25
4218, 4219, 4220, 4221, 4222, 4223, 4734, 4934, 4935, 4936, 4937 }; };
public final static int[] OTHER_RANGE_WEAPONS = { 863, 864, 865, 866, 867, public final static int[] OTHER_RANGE_WEAPONS = { IRON_KNIFE,BRONZE_KNIFE,STEEL_KNIFE,MITHRIL_KNIFE,ADAMANT_KNIFE,RUNE_KNIFE,BLACK_KNIFE,BRONZE_DART,IRON_DART,STEEL_DART,MITHRIL_DART,ADAMANT_DART,RUNE_DART,BRONZE_JAVELIN,IRON_JAVELIN,STEEL_JAVELIN,MITHRIL_JAVELIN,ADAMANT_JAVELIN,RUNE_JAVELIN,BRONZE_THROWNAXE,IRON_THROWNAXE,STEEL_THROWNAXE,MITHRIL_THROWNAXE,ADAMNT_THROWNAXE,RUNE_THROWNAXE,TOKTZXILUL };
868, 869, 806, 807, 808, 809, 810, 811, 825, 826, 827, 828, 829,
830, 800, 801, 802, 803, 804, 805, 6522 };
public static boolean usingCrystalBow(Player c) { public static boolean usingCrystalBow(Player c) {
return c.playerEquipment[c.playerWeapon] >= 4212 return c.playerEquipment[c.playerWeapon] >= NEW_CRYSTAL_BOW
&& c.playerEquipment[c.playerWeapon] <= 4223; && c.playerEquipment[c.playerWeapon] <= CRYSTAL_BOW_110;
} }
public static boolean usingBolts(Player c) { public static boolean usingBolts(Player c) {
@@ -34,91 +34,90 @@ public class RangeData {
|| c.playerEquipment[c.playerArrows] >= 9240 || c.playerEquipment[c.playerArrows] >= 9240
&& c.playerEquipment[c.playerArrows] <= 9244; && c.playerEquipment[c.playerArrows] <= 9244;
} }
public static boolean usingHally(Player c) { public static boolean usingHally(Player c) {
switch (c.playerEquipment[c.playerWeapon]) { switch (c.playerEquipment[c.playerWeapon]) {
case 3190: case BRONZE_HALBERD:
case 3192: case IRON_HALBERD:
case 3194: case STEEL_HALBERD:
case 3196: case BLACK_HALBERD:
case 3198: case MITHRIL_HALBERD:
case 3200: case ADAMANT_HALBERD:
case 3202: case RUNE_HALBERD:
case 3204: case DRAGON_HALBERD:
return true; return true;
} }
return false; return false;
} }
public static boolean usingDart(Player player) { public static boolean usingDart(Player player) {
switch (player.playerEquipment[player.playerWeapon]) { switch (player.playerEquipment[player.playerWeapon]) {
case 806: case BRONZE_DART:
case 807: case IRON_DART:
case 808: case STEEL_DART:
case 809: case MITHRIL_DART:
case 810: case ADAMANT_DART:
case 811: case RUNE_DART:
return true; return true;
} }
return false; return false;
} }
public static boolean usingLongbow(Player player) { public static boolean usingLongbow(Player player) {
if (usingCrystalBow(player)) { if (usingCrystalBow(player)) {
return true; return true;
} }
switch (player.playerEquipment[player.playerWeapon]) { switch (player.playerEquipment[player.playerWeapon]) {
case 839: case LONGBOW:
case 845: case OAK_LONGBOW:
case 847: case WILLOW_LONGBOW:
case 851: case MAPLE_LONGBOW:
case 855: case YEW_LONGBOW:
case 859: case MAGIC_LONGBOW:
return true; return true;
} }
return false; return false;
} }
public static int correctBowAndArrows(Player c) { public static int correctBowAndArrows(Player c) {
if (usingBolts(c)) { if (usingBolts(c)) {
return -1; return -1;
} }
switch (c.playerEquipment[c.playerWeapon]) { switch (c.playerEquipment[c.playerWeapon]) {
case 839://longbow case LONGBOW:
case 841: case SHORTBOW:
return 882; return BRONZE_ARROW;
case 843: case OAK_SHORTBOW:
case 845://longbow case OAK_LONGBOW:
return 884; return IRON_ARROW;
case 847://longbow case WILLOW_LONGBOW:
case 849: case WILLOW_SHORTBOW:
return 886; return STEEL_ARROW;
case 851://longbow case MAPLE_LONGBOW:
case 853: case MAPLE_SHORTBOW:
return 888; return MITHRIL_ARROW;
case 855://longbow case YEW_LONGBOW:
case 857: case YEW_SHORTBOW:
return 890; return ADAMANT_ARROW;
case 859://longbow case MAGIC_LONGBOW:
case 861: case MAGIC_SHORTBOW:
if (c.playerEquipment[c.playerArrows] == 892) { if (c.playerEquipment[c.playerArrows] == RUNE_ARROW) {
return 892; return RUNE_ARROW;
} else if (c.playerEquipment[c.playerArrows] == 4172) { } else if (c.playerEquipment[c.playerArrows] == BROAD_ARROWS_4172) {
return 4172; return BROAD_ARROWS_4172;
} }
//karils case KARILS_CROSSBOW:
case 4734: case KARILS_XBOW_75:
case 4935: case KARILS_XBOW_50:
case 4936: case KARILS_XBOW_25:
case 4937: return BOLT_RACK;
return 4740;
} }
return -1; return -1;
} }
@@ -126,261 +125,244 @@ public class RangeData {
public static int getRangeStartGFX(Player c) { public static int getRangeStartGFX(Player c) {
switch (c.rangeItemUsed) { switch (c.rangeItemUsed) {
case 863: case IRON_KNIFE:
return 220; return 220;
case 864: case BRONZE_KNIFE:
return 219; return 219;
case 865: case STEEL_KNIFE:
return 221; return 221;
case 866: // knives case MITHRIL_KNIFE:
return 223; return 223;
case 867: case ADAMANT_KNIFE:
return 224; return 224;
case 868: case RUNE_KNIFE:
return 225; return 225;
case 869: case BLACK_KNIFE:
return 222; return 222;
case 806: case BRONZE_DART:
return 232; return 232;
case 807: case IRON_DART:
return 233; return 233;
case 808: case STEEL_DART:
return 234; return 234;
case 809: // darts case MITHRIL_DART:
return 235; return 235;
case 810: case ADAMANT_DART:
return 236; return 236;
case 811: case RUNE_DART:
return 237; return 237;
case 825: case BRONZE_JAVELIN:
return 206; return 206;
case 826: case IRON_JAVELIN:
return 207; return 207;
case 827: // javelin case STEEL_JAVELIN:
return 208; return 208;
case 828: case MITHRIL_JAVELIN:
return 209; return 209;
case 829: case ADAMANT_JAVELIN:
return 210; return 210;
case 830: case RUNE_JAVELIN:
return 211; return 211;
case 800: case BRONZE_THROWNAXE:
return 42; return 42;
case 801: case IRON_THROWNAXE:
return 43; return 43;
case 802: case STEEL_THROWNAXE:
return 44; // axes return 44;
case 803: case MITHRIL_THROWNAXE:
return 45; return 45;
case 804: case ADAMNT_THROWNAXE:
return 46; return 46;
case 805: case RUNE_THROWNAXE:
return 48; return 48;
case 882: case BRONZE_ARROW:
return 19; return 19;
case IRON_ARROW:
return 18;
case STEEL_ARROW:
return 20;
case MITHRIL_ARROW:
return 21;
case ADAMANT_ARROW:
return 22;
case RUNE_ARROW:
return 24;
case 884: case NEW_CRYSTAL_BOW:
return 18; case CRYSTAL_BOW_FULL:
case CRYSTAL_BOW_910:
case 886: case CRYSTAL_BOW_810:
return 20; case CRYSTAL_BOW_710:
case CRYSTAL_BOW_610:
case 888: case CRYSTAL_BOW_510:
return 21; case CRYSTAL_BOW_410:
case CRYSTAL_BOW_310:
case 890: case CRYSTAL_BOW_210:
return 22; case CRYSTAL_BOW_110:
return 250;
case 892:
return 24;
case 11212:
return 26;
case 4212:
case 4214:
case 4215:
case 4216:
case 4217:
case 4218:
case 4219:
case 4220:
case 4221:
case 4222:
case 4223:
return 250;
} }
return -1; return -1;
} }
public static int getRangeProjectileGFX(Player c) { public static int getRangeProjectileGFX(Player c) {
if (c.dbowSpec) {
return 672;
}
if (c.bowSpecShot > 0) { if (c.bowSpecShot > 0) {
switch (c.rangeItemUsed) { switch (c.rangeItemUsed) {
default: default:
return 249; return 249;
} }
} }
if (c.playerEquipment[c.playerWeapon] == 9185) { if (c.playerEquipment[c.playerWeapon] == 9185) { //TODO magic numbwr rune cbow
return 27; return 27;
} }
switch (c.rangeItemUsed) { switch (c.rangeItemUsed) {
case 863: case IRON_KNIFE:
return 213; return 213;
case 864: case BRONZE_KNIFE:
return 212; return 212;
case 865: case STEEL_KNIFE:
return 214; return 214;
case 866: // knives case MITHRIL_KNIFE:
return 216; return 216;
case 867: case ADAMANT_KNIFE:
return 217; return 217;
case 868: case RUNE_KNIFE:
return 218; return 218;
case 869: case BLACK_KNIFE:
return 215; return 215;
case 806: case BRONZE_DART:
return 226; return 226;
case 807: case IRON_DART:
return 227; return 227;
case 808: case STEEL_DART:
return 228; return 228;
case 809: // darts case MITHRIL_DART:
return 229; return 229;
case 810: case ADAMANT_DART:
return 230; return 230;
case 811: case RUNE_DART:
return 231; return 231;
case 825: case BRONZE_JAVELIN:
return 200; return 200;
case 826: case IRON_JAVELIN:
return 201; return 201;
case 827: // javelin case STEEL_JAVELIN:
return 202; return 202;
case 828: case MITHRIL_JAVELIN:
return 203; return 203;
case 829: case ADAMANT_JAVELIN:
return 204; return 204;
case 830: case RUNE_JAVELIN:
return 205; return 205;
case 6522: // Toktz-xil-ul case TOKTZXILUL:
return 442; return 442;
case 800: case BRONZE_THROWNAXE:
return 36; return 36;
case 801: case IRON_THROWNAXE:
return 35; return 35;
case 802: case STEEL_THROWNAXE:
return 37; // axes return 37;
case 803: case MITHRIL_THROWNAXE:
return 38; return 38;
case 804: case ADAMNT_THROWNAXE:
return 39; return 39;
case 805: case RUNE_THROWNAXE:
return 40; return 40;
case 882: case BRONZE_ARROW:
return 10; return 10;
case 884: case IRON_ARROW:
return 9; return 9;
case 886: case STEEL_ARROW:
return 11; return 11;
case 888: case MITHRIL_ARROW:
return 12; return 12;
case 890: case ADAMANT_ARROW:
return 13; return 13;
case 892: case RUNE_ARROW:
return 15; return 15;
case 11212: case BOLT_RACK:
return 17; return 27;
case 4740: // bolt rack case NEW_CRYSTAL_BOW:
return 27; case CRYSTAL_BOW_FULL:
case CRYSTAL_BOW_910:
case 4212: case CRYSTAL_BOW_810:
case 4214: case CRYSTAL_BOW_710:
case 4215: case CRYSTAL_BOW_610:
case 4216: case CRYSTAL_BOW_510:
case 4217: case CRYSTAL_BOW_410:
case 4218: case CRYSTAL_BOW_310:
case 4219: case CRYSTAL_BOW_210:
case 4220: case CRYSTAL_BOW_110:
case 4221: return 249;
case 4222:
case 4223:
return 249;
} }
return -1; return -1;
} }
public static int getProjectileSpeed(Player c) { public static int getProjectileSpeed(Player c) {
if (c.dbowSpec) {
return 100;
}
return 70; return 70;
} }
public static int getProjectileShowDelay(Player c) { public static int getProjectileShowDelay(Player c) {
switch (c.playerEquipment[c.playerWeapon]) { switch (c.playerEquipment[c.playerWeapon]) {
case 863: case IRON_KNIFE:
case 864: case BRONZE_KNIFE:
case 865: case STEEL_KNIFE:
case 866: // knives case MITHRIL_KNIFE:
case 867: case ADAMANT_KNIFE:
case 868: case RUNE_KNIFE:
case 869: case BLACK_KNIFE:
case 806: case BRONZE_DART:
case 807: case IRON_DART:
case 808: case STEEL_DART:
case 809: // darts case MITHRIL_DART:
case 810: case ADAMANT_DART:
case 811: case RUNE_DART:
case 825: case BRONZE_JAVELIN:
case 826: case IRON_JAVELIN:
case 827: // javelin case STEEL_JAVELIN:
case 828: case MITHRIL_JAVELIN:
case 829: case ADAMANT_JAVELIN:
case 830: case RUNE_JAVELIN:
case 800: case BRONZE_THROWNAXE:
case 801: case IRON_THROWNAXE:
case 802: case STEEL_THROWNAXE:
case 803: // axes case MITHRIL_THROWNAXE:
case 804: case ADAMNT_THROWNAXE:
case 805: case RUNE_THROWNAXE:
case 4734: case KARILS_CROSSBOW:
case 9185: case 9185: //TODO Rune cbow Magic Number
case 4935: case KARILS_XBOW_75:
case 4936: case KARILS_XBOW_50:
case 4937: case KARILS_XBOW_25:
return 15; return 15;
default: default:
return 5; return 5;
} }
} }
public static boolean fullVoidRange(Player c) { public static boolean fullVoidRange(Player c) {
return c.playerEquipment[c.playerHat] == 11664 return c.playerEquipment[c.playerHat] == 11664
&& c.playerEquipment[c.playerLegs] == 8840 && c.playerEquipment[c.playerLegs] == 8840
@@ -388,4 +370,4 @@ public class RangeData {
&& c.playerEquipment[c.playerHands] == 8842; && c.playerEquipment[c.playerHands] == 8842;
} }
} }
@@ -1350,8 +1350,7 @@ public abstract class Player {
hasMultiSign, saveCharacter, mouseButton, hasMultiSign, saveCharacter, mouseButton,
chatEffects = true, acceptAid, recievedMask, chatEffects = true, acceptAid, recievedMask,
nextDialogue, autocasting, usedSpecial, nextDialogue, autocasting, usedSpecial,
mageFollow, dbowSpec, craftingLeather, mageFollow, craftingLeather, properLogout, isNpc,
properLogout, secDbow, isNpc,
addStarter, accountFlagged, inPartyRoom, msbSpec, addStarter, accountFlagged, inPartyRoom, msbSpec,
hasBankPin, enterdBankpin, firstPinEnter, requestPinDelete, hasBankPin, enterdBankpin, firstPinEnter, requestPinDelete,
secondPinEnter, thirdPinEnter, fourthPinEnter, hasBankpin, secondPinEnter, thirdPinEnter, fourthPinEnter, hasBankpin,