@Override
  public boolean onDie(Player player, Creature lastAttacker) {
    PacketSendUtility.broadcastPacket(
        player,
        new SM_EMOTION(
            player,
            EmotionType.DIE,
            0,
            player.equals(lastAttacker) ? 0 : lastAttacker.getObjectId()),
        true);

    PacketSendUtility.sendPacket(player, new SM_DIE(false, false, 0, 8));
    return true;
  }
 @Override
 public boolean onDie(final Player player, Creature lastAttacker) {
   PacketSendUtility.broadcastPacket(
       player,
       new SM_EMOTION(
           player,
           EmotionType.DIE,
           0,
           player.equals(lastAttacker) ? 0 : lastAttacker.getObjectId()),
       true);
   PacketSendUtility.sendPacket(
       player, new SM_DIE(player.haveSelfRezEffect(), player.haveSelfRezItem(), 0, 8));
   return true;
 }
Exemple #3
0
  public void executeCommand(Player admin, String[] params) {
    if (params == null || params.length < 1) {
      PacketSendUtility.sendMessage(admin, "syntax //bind < all | elyos | asmos >");
      return;
    }

    if (params[0].equals("all")) {
      if (admin.getAccessLevel() < AdminConfig.COMMAND_MOVETOMEALLALL) {
        PacketSendUtility.sendMessage(admin, "You dont have enough rights to execute this command");
        return;
      }

      World world = admin.getActiveRegion().getWorld();
      Iterator<Player> players = world.getPlayersIterator();
      while (players.hasNext()) {
        Player p = players.next();
        if (!p.equals(admin)) {
          teleportService.teleportTo(
              p,
              admin.getWorldId(),
              admin.getInstanceId(),
              admin.getX(),
              admin.getY(),
              admin.getZ(),
              admin.getHeading(),
              5);
          PacketSendUtility.sendPacket(p, new SM_PLAYER_SPAWN(p));

          PacketSendUtility.sendMessage(admin, "Player " + p.getName() + " teleported.");
          PacketSendUtility.sendMessage(p, "Vous avez ete teleporte par " + admin.getName() + ".");
        }
      }
    }

    if (params[0].equals("elyos")) {
      if (admin.getAccessLevel() < AdminConfig.COMMAND_MOVETOMEALLELYOS) {
        PacketSendUtility.sendMessage(admin, "You dont have enough rights to execute this command");
        return;
      }

      World world = admin.getActiveRegion().getWorld();
      Iterator<Player> players = world.getPlayersIterator();
      while (players.hasNext()) {
        Player p = players.next();
        if (!p.equals(admin)) {
          if (p.getCommonData().getRace() == Race.ELYOS) {
            teleportService.teleportTo(
                p,
                admin.getWorldId(),
                admin.getInstanceId(),
                admin.getX(),
                admin.getY(),
                admin.getZ(),
                admin.getHeading(),
                5);
            PacketSendUtility.sendPacket(p, new SM_PLAYER_SPAWN(p));

            PacketSendUtility.sendMessage(admin, "Player " + p.getName() + " teleported.");
            PacketSendUtility.sendMessage(
                p, "Vous avez ete teleporte par " + admin.getName() + ".");
          }
        }
      }
    }

    if (params[0].equals("asmos")) {
      if (admin.getAccessLevel() < AdminConfig.COMMAND_MOVETOMEALLASMOS) {
        PacketSendUtility.sendMessage(admin, "You dont have enough rights to execute this command");
        return;
      }

      World world = admin.getActiveRegion().getWorld();
      Iterator<Player> players = world.getPlayersIterator();
      while (players.hasNext()) {
        Player p = players.next();
        if (!p.equals(admin)) {
          if (p.getCommonData().getRace() == Race.ASMODIANS) {
            teleportService.teleportTo(
                p,
                admin.getWorldId(),
                admin.getInstanceId(),
                admin.getX(),
                admin.getY(),
                admin.getZ(),
                admin.getHeading(),
                5);
            PacketSendUtility.sendPacket(p, new SM_PLAYER_SPAWN(p));

            PacketSendUtility.sendMessage(admin, "Player " + p.getName() + " teleported.");
            PacketSendUtility.sendMessage(
                p, "Vous avez ete teleporte par " + admin.getName() + ".");
          }
        }
      }
    }
  }