Example #1
0
 public static void enterDonatorzone(final Player player) {
   Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2140, 5101, 0));
   for (int regionId : player.getMapRegionsIds()) {
     List<Integer> npcIndexes = World.getRegion(regionId).getNPCsIndexes();
     if (npcIndexes != null) {
       for (int npcIndex : npcIndexes) {
         final NPC n = World.getNPCs().get(npcIndex);
         if (n == null || n.getId() != 5445) continue;
         WorldTasksManager.schedule(
             new WorldTask() {
               @Override
               public void run() {
                 final int random = Utils.getRandom(3);
                 if (random == 0)
                   n.setNextForceTalk(
                       new ForceTalk(
                           "Everyone welcome "
                               + player.getDisplayName()
                               + " to the donator zone."));
                 else if (random == 1)
                   n.setNextForceTalk(
                       new ForceTalk(
                           player.getDisplayName() + " has just joined the penguin zone."));
                 else if (random == 2)
                   n.setNextForceTalk(
                       new ForceTalk(
                           "Ma boi "
                               + player.getDisplayName()
                               + " has just joined the penguin zone."));
                 else if (random == 3)
                   n.setNextForceTalk(
                       new ForceTalk(
                           "Who else wouldnt want "
                               + player.getDisplayName()
                               + " from joining the penguin zone."));
               }
             },
             4);
       }
     }
   }
 }
Example #2
0
 @Override
 public ArrayList<Entity> getPossibleTargets() {
   ArrayList<Entity> possibleTarget = new ArrayList<Entity>();
   for (int regionId : getMapRegionsIds()) {
     List<Integer> playerIndexes = World.getRegion(regionId).getPlayerIndexes();
     if (playerIndexes != null) {
       for (int npcIndex : playerIndexes) {
         Player player = World.getPlayers().get(npcIndex);
         if (player == null
             || player.isDead()
             || player.hasFinished()
             || !player.isRunning()
             || !player.withinDistance(this, 64)
             || ((!isAtMultiArea() || !player.isAtMultiArea())
                 && player.getAttackedBy() != this
                 && player.getAttackedByDelay() > System.currentTimeMillis())
             || !clipedProjectile(player, false)) continue;
         possibleTarget.add(player);
       }
     }
   }
   return possibleTarget;
 }
Example #3
0
 public void setPlayer(Player player) {
   this.player = player;
   playingMusic = World.getRegion(player.getRegionId()).getMusicId();
 }
Example #4
0
 public void reset() {
   settedMusic = false;
   player.getMusicsManager().checkMusic(World.getRegion(player.getRegionId()).getMusicId());
 }