Пример #1
0
 public static final void processLunarSpell(Player player, int spellId, int packetId) {
   player.stopAll(false);
   switch (spellId) {
     case 37:
       if (player.getSkills().getLevel(Skills.MAGIC) < 94) {
         player
             .getPackets()
             .sendGameMessage("Your Magic level is not high enough for this spell.");
         return;
       } else if (player.getSkills().getLevel(Skills.DEFENCE) < 40) {
         player.getPackets().sendGameMessage("You need a Defence level of 40 for this spell");
         return;
       }
       Long lastVeng = (Long) player.getTemporaryAttributtes().get("LAST_VENG");
       if (lastVeng != null && lastVeng + 30000 > Utils.currentTimeMillis()) {
         player
             .getPackets()
             .sendGameMessage("Players may only cast vengeance once every 30 seconds.");
         return;
       }
       if (!checkRunes(player, true, ASTRAL_RUNE, 4, DEATH_RUNE, 2, EARTH_RUNE, 10)) return;
       player.setNextGraphics(new Graphics(726, 0, 100));
       player.setNextAnimation(new Animation(4410));
       player.setCastVeng(true);
       player.getTemporaryAttributtes().put("LAST_VENG", Utils.currentTimeMillis());
       player.getPackets().sendGameMessage("You cast a vengeance.");
       break;
     case 39:
       useHomeTele(player);
       break;
   }
 }
Пример #2
0
 /**
  * Entering in boat.
  *
  * @param player The player to add.
  */
 private void enterInBoat() {
   player.getTemporaryAttributtes().put("priority1", false);
   player.getTemporaryAttributtes().put("priority2", false);
   if (waitingPlayers.size() > 25) player.getTemporaryAttributtes().put("priority1", true);
   if (waitingPlayers.size() > 50) player.getTemporaryAttributtes().put("priority2", true);
   waitingPlayers.add(player);
   player.setNextWorldTile(new WorldTile(2661, 2639, 0));
   player.getPackets().sendGameMessage("You board the lander.", true);
   sendInterfaces();
   startGame();
 }
Пример #3
0
 /** Starting the game and controler. */
 public void startGame() {
   playersInGame.addAll(waitingPlayers);
   waitingPlayers.remove(playersInGame);
   for (Player players : waitingPlayers) {
     if ((Boolean) players.getTemporaryAttributtes().get("priority1"))
       players
           .getPackets()
           .sendGameMessage(
               "You have been given priority level 1 over other players in joining the next game.");
     if ((Boolean) players.getTemporaryAttributtes().get("priority2"))
       players
           .getPackets()
           .sendGameMessage(
               "You have been given priority level 2 over other players in joining the next game.");
   }
   // player.getControllerManager().startControler("PestControler");
 }
Пример #4
0
 public static void openPartyChest(final Player player) {
   player.getTemporaryAttributtes().put("PartyRoomInventory", Boolean.TRUE);
   player.getInterfaceManager().sendInterface(PARTY_CHEST_INTERFACE);
   player.getInterfaceManager().sendInventoryInterface(INVENTORY_INTERFACE);
   sendOptions(player);
   player.setCloseInterfacesEvent(
       new Runnable() {
         @Override
         public void run() {
           player.getTemporaryAttributtes().remove("PartyRoomInventory");
         }
       });
 }
Пример #5
0
 public static final boolean checkCombatSpell(
     Player player, int spellId, int set, boolean delete) {
   if (spellId == 65535) return true;
   switch (player.getCombatDefinitions().getSpellBook()) {
     case 193:
       switch (spellId) {
         case 28:
           if (!checkSpellRequirements(
               player, 50, delete, CHAOS_RUNE, 2, DEATH_RUNE, 2, FIRE_RUNE, 1, AIR_RUNE, 1))
             return false;
           break;
         case 32:
           if (!checkSpellRequirements(
               player, 52, delete, CHAOS_RUNE, 2, DEATH_RUNE, 2, AIR_RUNE, 1, SOUL_RUNE, 1))
             return false;
           break;
         case 24:
           if (!checkSpellRequirements(
               player, 56, delete, CHAOS_RUNE, 2, DEATH_RUNE, 2, BLOOD_RUNE, 1)) return false;
           break;
         case 20:
           if (!checkSpellRequirements(
               player, 58, delete, CHAOS_RUNE, 2, DEATH_RUNE, 2, WATER_RUNE, 2)) return false;
           break;
         case 30:
           if (!checkSpellRequirements(
               player, 62, delete, CHAOS_RUNE, 4, DEATH_RUNE, 2, FIRE_RUNE, 2, AIR_RUNE, 2))
             return false;
           break;
         case 34:
           if (!checkSpellRequirements(
               player, 64, delete, CHAOS_RUNE, 4, DEATH_RUNE, 2, AIR_RUNE, 1, SOUL_RUNE, 2))
             return false;
           break;
         case 26:
           if (!checkSpellRequirements(
               player, 68, delete, CHAOS_RUNE, 4, DEATH_RUNE, 2, BLOOD_RUNE, 2)) return false;
           break;
         case 22:
           if (!checkSpellRequirements(
               player, 70, delete, CHAOS_RUNE, 4, DEATH_RUNE, 2, WATER_RUNE, 4)) return false;
           break;
         case 29:
           if (!checkSpellRequirements(
               player, 74, delete, DEATH_RUNE, 2, BLOOD_RUNE, 2, FIRE_RUNE, 2, AIR_RUNE, 2))
             return false;
           break;
         case 33:
           if (!checkSpellRequirements(
               player, 76, delete, DEATH_RUNE, 2, BLOOD_RUNE, 2, AIR_RUNE, 2, SOUL_RUNE, 2))
             return false;
           break;
         case 25:
           if (!checkSpellRequirements(player, 80, delete, DEATH_RUNE, 2, BLOOD_RUNE, 4))
             return false;
           break;
         case 21:
           if (!checkSpellRequirements(
               player, 82, delete, DEATH_RUNE, 2, BLOOD_RUNE, 2, WATER_RUNE, 3)) return false;
           break;
         case 31:
           if (!checkSpellRequirements(
               player, 86, delete, DEATH_RUNE, 4, BLOOD_RUNE, 2, FIRE_RUNE, 4, AIR_RUNE, 4))
             return false;
           break;
         case 35:
           if (!checkSpellRequirements(
               player, 88, delete, DEATH_RUNE, 4, BLOOD_RUNE, 2, AIR_RUNE, 4, SOUL_RUNE, 3))
             return false;
           break;
         case 27:
           if (!checkSpellRequirements(
               player, 92, delete, DEATH_RUNE, 4, BLOOD_RUNE, 4, SOUL_RUNE, 1)) return false;
           break;
         case 23:
           if (!checkSpellRequirements(
               player, 94, delete, DEATH_RUNE, 4, BLOOD_RUNE, 2, WATER_RUNE, 6)) return false;
           break;
         case 36: // Miasmic rush.
           if (!checkSpellRequirements(
               player, 61, delete, CHAOS_RUNE, 2, EARTH_RUNE, 1, SOUL_RUNE, 1)) {
             return false;
           }
           int weaponId = player.getEquipment().getWeaponId();
           if (weaponId != 13867
               && weaponId != 13869
               && weaponId != 13941
               && weaponId != 13943
               && !player.isExtremeDonator()) {
             player.getPackets().sendGameMessage("You need a Zuriel's staff to cast this spell.");
             player
                 .getPackets()
                 .sendGameMessage(
                     "Extreme donators can cast Miasmic spells without Zuriel's staff.");
             return false;
           }
           break;
         case 38: // Miasmic burst.
           if (!checkSpellRequirements(
               player, 73, delete, CHAOS_RUNE, 4, EARTH_RUNE, 2, SOUL_RUNE, 2)) {
             return false;
           }
           weaponId = player.getEquipment().getWeaponId();
           if (weaponId != 13867
               && weaponId != 13869
               && weaponId != 13941
               && weaponId != 13943
               && !player.isExtremeDonator()) {
             player.getPackets().sendGameMessage("You need a Zuriel's staff to cast this spell.");
             player
                 .getPackets()
                 .sendGameMessage(
                     "Extreme donators can cast Miasmic spells without Zuriel's staff.");
             return false;
           }
           break;
         case 37: // Miasmic blitz.
           if (!checkSpellRequirements(
               player, 85, delete, BLOOD_RUNE, 2, EARTH_RUNE, 3, SOUL_RUNE, 3)) {
             return false;
           }
           weaponId = player.getEquipment().getWeaponId();
           if (weaponId != 13867
               && weaponId != 13869
               && weaponId != 13941
               && weaponId != 13943
               && !player.isExtremeDonator()) {
             player.getPackets().sendGameMessage("You need a Zuriel's staff to cast this spell.");
             player
                 .getPackets()
                 .sendGameMessage(
                     "Extreme donators can cast Miasmic spells without Zuriel's staff.");
             return false;
           }
           break;
         case 39: // Miasmic barrage.
           if (!checkSpellRequirements(
               player, 97, delete, BLOOD_RUNE, 4, EARTH_RUNE, 4, SOUL_RUNE, 4)) {
             return false;
           }
           weaponId = player.getEquipment().getWeaponId();
           if (weaponId != 13867
               && weaponId != 13869
               && weaponId != 13941
               && weaponId != 13943
               && !player.isExtremeDonator()) {
             player.getPackets().sendGameMessage("You need a Zuriel's staff to cast this spell.");
             player
                 .getPackets()
                 .sendGameMessage(
                     "Extreme donators can cast Miasmic spells without Zuriel's staff.");
             return false;
           }
           break;
         default:
           return false;
       }
       break;
     case 192:
       switch (spellId) {
         case 25:
           if (!checkSpellRequirements(player, 1, delete, AIR_RUNE, 1, MIND_RUNE, 1)) return false;
           break;
         case 28:
           if (!checkSpellRequirements(
               player, 5, delete, WATER_RUNE, 1, AIR_RUNE, 1, MIND_RUNE, 1)) return false;
           break;
         case 30:
           if (!checkSpellRequirements(
               player, 9, delete, EARTH_RUNE, 2, AIR_RUNE, 1, MIND_RUNE, 1)) return false;
           break;
         case 32:
           if (!checkSpellRequirements(
               player, 13, delete, FIRE_RUNE, 3, AIR_RUNE, 2, MIND_RUNE, 1)) return false;
           break;
         case 34: // air bolt
           if (!checkSpellRequirements(player, 17, delete, AIR_RUNE, 2, CHAOS_RUNE, 1))
             return false;
           break;
         case 36: // bind
           if (!checkSpellRequirements(
               player, 20, delete, EARTH_RUNE, 3, WATER_RUNE, 3, NATURE_RUNE, 2)) return false;
           break;
         case 55: // snare
           if (!checkSpellRequirements(
               player, 50, delete, EARTH_RUNE, 4, WATER_RUNE, 4, NATURE_RUNE, 3)) return false;
           break;
         case 81: // entangle
           if (!checkSpellRequirements(
               player, 79, delete, EARTH_RUNE, 5, WATER_RUNE, 5, NATURE_RUNE, 4)) return false;
           break;
         case 39: // water bolt
           if (!checkSpellRequirements(
               player, 23, delete, WATER_RUNE, 2, AIR_RUNE, 2, CHAOS_RUNE, 1)) return false;
           break;
         case 42: // earth bolt
           if (!checkSpellRequirements(
               player, 29, delete, EARTH_RUNE, 3, AIR_RUNE, 2, CHAOS_RUNE, 1)) return false;
           break;
         case 45: // fire bolt
           if (!checkSpellRequirements(
               player, 35, delete, FIRE_RUNE, 4, AIR_RUNE, 3, CHAOS_RUNE, 1)) return false;
           break;
         case 49: // air blast
           if (!checkSpellRequirements(player, 41, delete, AIR_RUNE, 3, DEATH_RUNE, 1))
             return false;
           break;
         case 52: // water blast
           if (!checkSpellRequirements(
               player, 47, delete, WATER_RUNE, 3, AIR_RUNE, 3, DEATH_RUNE, 1)) return false;
           break;
         case 58: // earth blast
           if (!checkSpellRequirements(
               player, 53, delete, EARTH_RUNE, 4, AIR_RUNE, 3, DEATH_RUNE, 1)) return false;
           break;
         case 63: // fire blast
           if (!checkSpellRequirements(
               player, 59, delete, FIRE_RUNE, 5, AIR_RUNE, 4, DEATH_RUNE, 1)) return false;
           break;
         case 70: // air wave
           if (!checkSpellRequirements(player, 62, delete, AIR_RUNE, 5, BLOOD_RUNE, 1))
             return false;
           break;
         case 73: // water wave
           if (!checkSpellRequirements(
               player, 65, delete, WATER_RUNE, 7, AIR_RUNE, 5, BLOOD_RUNE, 1)) return false;
           break;
         case 77: // earth wave
           if (!checkSpellRequirements(
               player, 70, delete, EARTH_RUNE, 7, AIR_RUNE, 5, BLOOD_RUNE, 1)) return false;
           break;
         case 80: // fire wave
           if (!checkSpellRequirements(
               player, 75, delete, FIRE_RUNE, 7, AIR_RUNE, 5, BLOOD_RUNE, 1)) return false;
           break;
         case 84:
           if (!checkSpellRequirements(
               player, 81, delete, AIR_RUNE, 7, DEATH_RUNE, 1, BLOOD_RUNE, 1)) return false;
           break;
         case 87:
           if (!checkSpellRequirements(
               player, 85, delete, WATER_RUNE, 10, AIR_RUNE, 7, DEATH_RUNE, 1, BLOOD_RUNE, 1))
             return false;
           break;
         case 89:
           if (!checkSpellRequirements(
               player, 85, delete, EARTH_RUNE, 10, AIR_RUNE, 7, DEATH_RUNE, 1, BLOOD_RUNE, 1))
             return false;
           break;
         case 66: // Sara Strike
           if (player.getEquipment().getWeaponId() != 2415) {
             player
                 .getPackets()
                 .sendGameMessage(
                     "You need to be equipping a Saradomin staff to cast this spell.", true);
             return false;
           }
           if (!checkSpellRequirements(
               player, 60, delete, AIR_RUNE, 4, FIRE_RUNE, 1, BLOOD_RUNE, 2)) return false;
           break;
         case 67: // Guthix Claws
           if (player.getEquipment().getWeaponId() != 2416) {
             player
                 .getPackets()
                 .sendGameMessage(
                     "You need to be equipping a Guthix Staff or Void Mace to cast this spell.",
                     true);
             return false;
           }
           if (!checkSpellRequirements(
               player, 60, delete, AIR_RUNE, 4, FIRE_RUNE, 1, BLOOD_RUNE, 2)) return false;
           break;
         case 68: // Flame of Zammy
           if (player.getEquipment().getWeaponId() != 2417) {
             player
                 .getPackets()
                 .sendGameMessage(
                     "You need to be equipping a Zamorak Staff to cast this spell.", true);
             return false;
           }
           if (!checkSpellRequirements(
               player, 60, delete, AIR_RUNE, 4, FIRE_RUNE, 4, BLOOD_RUNE, 2)) return false;
           break;
         case 91:
           if (!checkSpellRequirements(
               player, 85, delete, FIRE_RUNE, 10, AIR_RUNE, 7, DEATH_RUNE, 1, BLOOD_RUNE, 1))
             return false;
           break;
         case 86: // teleblock
           if (!checkSpellRequirements(
               player, 85, delete, CHAOS_RUNE, 1, LAW_RUNE, 1, DEATH_RUNE, 1)) return false;
           break;
         case 99: // Storm of Armadyl
           if (!checkSpellRequirements(player, 77, delete, ARMADYL_RUNE, 1)) return false;
           break;
         default:
           return false;
       }
       break;
     default:
       return false;
   }
   if (set >= 0) {
     if (set == 0) player.getCombatDefinitions().setAutoCastSpell(spellId);
     else player.getTemporaryAttributtes().put("tempCastSpell", spellId);
   }
   return true;
 }