Exemplo n.º 1
0
    /**
     * Method onZoneEnter.
     *
     * @param zone Zone
     * @param cha Creature
     * @see lineage2.gameserver.listener.zone.OnZoneEnterLeaveListener#onZoneEnter(Zone, Creature)
     */
    @Override
    public void onZoneEnter(Zone zone, Creature cha) {
      if ((zone.getParams() == null) || !cha.isPlayable() || cha.getPlayer().isGM()) {
        return;
      }

      if (cha.getLevel() > zone.getParams().getInteger("levelLimit")) {
        if (cha.isPlayer()) {
          cha.getPlayer()
              .sendMessage("Your level is too high to access this zone. You've been banished out.");
        }

        cha.teleToLocation(Location.parseLoc(zone.getParams().getString("tele")));
      }
    }
 /**
  * Constructor for CastleMassTeleporterInstance.
  *
  * @param objectId int
  * @param template NpcTemplate
  */
 public CastleMassTeleporterInstance(int objectId, NpcTemplate template) {
   super(objectId, template);
   _teleportLoc = Location.parseLoc(template.getAIParams().getString("teleport_loc"));
 }