public static boolean fullDharok(Player player) { return player.getEquipment() != null && player.getEquipment().contains(4716) && player.getEquipment().contains(4718) && player.getEquipment().contains(4720) && player.getEquipment().contains(4722); }
public static boolean hasRuneAsStaff(Player player, int rune) { Item weapon = player.getEquipment().get(3); if (weapon == null) { return false; } switch (rune) { case 556: // Air rune if (weapon.getIndex() == 1381) { return true; } break; case 555: // Water rune if (weapon.getIndex() == 1383) { return true; } break; case 557: // Earth rune if (weapon.getIndex() == 1385) { return true; } break; case 554: // Fire rune if (weapon.getIndex() == 1387) { return true; } break; } return false; }
public static boolean isUsingRanged(Player player) { for (int i : RANGED_WEAPONS) { Item weapon = player.getEquipment().get(WEAPON_SLOT); if (weapon != null && weapon.getIndex() == i) { return true; } } return false; }
public static boolean hasCorrectArrows(Player player, int weapon) { Item arrows = player.getEquipment().get(AMMUNITION_SLOT); if (arrows == null) { return false; } switch (weapon) { case 839: case 841: if (arrows.getIndex() > 881 && arrows.getIndex() < 886) { return true; } break; case 843: case 845: if (arrows.getIndex() > 881 && arrows.getIndex() < 888) { return true; } break; case 847: case 849: if (arrows.getIndex() > 881 && arrows.getIndex() < 890) { return true; } break; case 851: case 853: if (arrows.getIndex() > 881 && arrows.getIndex() < 892) { return true; } break; case 855: case 857: if (arrows.getIndex() > 881 && arrows.getIndex() < 894) { return true; } break; case 859: case 861: if (arrows.getIndex() > 881 && arrows.getIndex() < 894) { return true; } break; case 4734: if (arrows.getIndex() > 4739 && arrows.getIndex() < 4741) { return true; } break; case 9185: if (arrows.getIndex() == 9244) { return true; } break; } return false; }
public Equipment sendWeapon(Player player) { Item weapon = player.getEquipment().get(3); int id = -1; String name = "Unarmed"; if (weapon.getIndex() > -1) { name = ItemDefinition.get(weapon.getIndex()).name(); id = weapon.getIndex(); } String name2 = filterWeaponName(name).trim(); sendWeapon(player, id, name, name2); sendSpecialBar(player, id, name); return this; }
/** * Sets the equipment bonuses * * @param player The player instance * @return The equipment container */ public Equipment setBonus(Player player) { player.resetBonuses(); for (Item item : player.getEquipment().items()) { for (int i = 0; i < player.getBonuses().length; i++) { if (item != null && item.getIndex() < 8000) { player.setBonuses( i, player.getBonuses()[i] + ItemDefinition.get(item.getIndex()).bonus(i)); } } } sendBonusToInterface(player); return this; }