예제 #1
0
 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);
 }
예제 #2
0
  /** Special attack text and what to highlight or blackout */
  public void updateSpecialBar(Player player) {

    if (isUsingSpecial()) {
      player
          .getPacketDispatcher()
          .sendString(player.getSpecialBarId(), "@yel@S P E C I A L  A T T A C K");
    } else {
      player
          .getPacketDispatcher()
          .sendString(player.getSpecialBarId(), "@bla@S P E C I A L  A T T A C K");
    }
  }
예제 #3
0
 /**
  * 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;
 }
예제 #4
0
 public Equipment sendSpecialBar(Player player, int id, String name) {
   name = name.toLowerCase();
   if (name.endsWith("whip")) {
     player.getPacketDispatcher().interfaceConfig(0, 12323);
     specialAmount(player, id, player.getSpecialAmount(), 12335);
   }
   for (int i = 0; i < weaponSpecials.length; i++) {
     if (id == weaponSpecials[i][0]) {
       player.getPacketDispatcher().interfaceConfig(0, weaponSpecials[i][1]);
       specialAmount(player, id, player.getSpecialAmount(), weaponSpecials[i][2]);
     }
   }
   return this;
 }
예제 #5
0
 /**
  * Sends to bonus to the equipment interface
  *
  * @param player The player instance
  * @return The equipment container
  */
 public Equipment sendBonusToInterface(Player player) {
   int offset = 0;
   String toSend = null;
   String operator = null;
   for (int i = 0; i < player.getBonuses().length; i++) {
     if (i == 10) {
       offset = 1;
     }
     operator = player.getBonuses()[i] > 0 ? " +" : " -";
     toSend = BONUS_NAME[i] + operator + " " + player.getBonuses()[i];
     player.getPacketDispatcher().sendString((1675 + i + offset), toSend);
   }
   return this;
 }
예제 #6
0
 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;
 }
예제 #7
0
 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;
 }
예제 #8
0
 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;
 }
예제 #9
0
 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;
 }
예제 #10
0
 public void specialAmount(Player player, int weapon, double specAmount, int barId) {
   player.setSpecialBarId(barId);
   player.getPacketDispatcher().moveComponent(specAmount >= 100 ? 150 : 0, 0, (--barId));
   player.getPacketDispatcher().moveComponent(specAmount >= 90 ? 150 : 0, 0, (--barId));
   player.getPacketDispatcher().moveComponent(specAmount >= 80 ? 150 : 0, 0, (--barId));
   player.getPacketDispatcher().moveComponent(specAmount >= 70 ? 150 : 0, 0, (--barId));
   player.getPacketDispatcher().moveComponent(specAmount >= 60 ? 150 : 0, 0, (--barId));
   player.getPacketDispatcher().moveComponent(specAmount >= 50 ? 150 : 0, 0, (--barId));
   player.getPacketDispatcher().moveComponent(specAmount >= 40 ? 150 : 0, 0, (--barId));
   player.getPacketDispatcher().moveComponent(specAmount >= 30 ? 150 : 0, 0, (--barId));
   player.getPacketDispatcher().moveComponent(specAmount >= 20 ? 150 : 0, 0, (--barId));
   player.getPacketDispatcher().moveComponent(specAmount >= 10 ? 150 : 0, 0, (--barId));
   updateSpecialBar(player);
 }
예제 #11
0
 private void sendWeapon(Player player, int id, String name, String name2) {
   name = name.toLowerCase();
   if (name.equalsIgnoreCase("unarmed")) {
     player.getPacketDispatcher().sendSidebar(0, 5855);
     player.getPacketDispatcher().sendString(5857, name2);
   } else if (name.endsWith("whip")) {
     player.getPacketDispatcher().sendSidebar(0, 12290);
     player.getPacketDispatcher().sendItemOnInterface(12291, 200, id);
     player.getPacketDispatcher().sendString(12293, name2);
   } else if (name.contains("2h")) {
     player.getPacketDispatcher().sendSidebar(0, 4705);
     player.getPacketDispatcher().sendItemOnInterface(4706, 200, id);
     player.getPacketDispatcher().sendString(4708, name2);
   } else if (name.contains("bow")) {
     player.getPacketDispatcher().sendSidebar(0, 1764);
     player.getPacketDispatcher().sendItemOnInterface(1765, 200, id);
     player.getPacketDispatcher().sendString(1767, name2);
   } else if (name.contains("dagger") || name.contains("longsword")) {
     player.getPacketDispatcher().sendSidebar(0, 2276);
     player.getPacketDispatcher().sendItemOnInterface(2277, 200, id);
     player.getPacketDispatcher().sendString(2279, name2);
   } else if (name.contains("maul")) {
     player.getPacketDispatcher().sendSidebar(0, 425);
     player.getPacketDispatcher().sendItemOnInterface(426, 200, id);
     player.getPacketDispatcher().sendString(428, name2);
   } else if (name.contains("staff")) {
     player.getPacketDispatcher().sendSidebar(0, 328);
     player.getPacketDispatcher().sendItemOnInterface(329, 200, id);
     player.getPacketDispatcher().sendString(331, name2);
   } else if (name.contains("knife")) {
     player.getPacketDispatcher().sendSidebar(0, 4446);
     player.getPacketDispatcher().sendItemOnInterface(4447, 200, id);
     player.getPacketDispatcher().sendString(4449, name2);
   } else if (name.contains("pickaxe")) {
     player.getPacketDispatcher().sendSidebar(0, 5570);
     player.getPacketDispatcher().sendItemOnInterface(5571, 200, id);
     player.getPacketDispatcher().sendString(5573, name2);
   } else if (name.contains("axe")) {
     player.getPacketDispatcher().sendSidebar(0, 1698);
     player.getPacketDispatcher().sendItemOnInterface(1699, 200, id);
     player.getPacketDispatcher().sendString(1701, name2);
   } else if (name.contains("halberd")) {
     player.getPacketDispatcher().sendSidebar(0, 8460);
     player.getPacketDispatcher().sendItemOnInterface(8461, 200, id);
     player.getPacketDispatcher().sendString(8463, name2);
   } else if (name.contains("claws")) {
     player.getPacketDispatcher().sendSidebar(0, 7762);
     player.getPacketDispatcher().sendItemOnInterface(7763, 200, id);
     player.getPacketDispatcher().sendString(7765, name2);
   } else if (name.contains("spear")) {
     player.getPacketDispatcher().sendSidebar(0, 4679);
     player.getPacketDispatcher().sendItemOnInterface(4680, 200, id);
     player.getPacketDispatcher().sendString(4682, name2);
   } else if (name.contains("mace")) {
     player.getPacketDispatcher().sendSidebar(0, 3796);
     player.getPacketDispatcher().sendItemOnInterface(3797, 200, id);
     player.getPacketDispatcher().sendString(3799, name2);
   } else {
     player.getPacketDispatcher().sendSidebar(0, 2423);
     player.getPacketDispatcher().sendItemOnInterface(2424, 200, id);
     player.getPacketDispatcher().sendString(2426, name2);
   }
 }