Package com.l2jfrozen.gameserver.model.entity.siege

Examples of com.l2jfrozen.gameserver.model.entity.siege.Castle


  public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
  {
    if(command.startsWith("open doors") && target.equals("castle") && activeChar.isClanLeader())
    {
      L2DoorInstance door = (L2DoorInstance) activeChar.getTarget();
      Castle castle = CastleManager.getInstance().getCastleById(activeChar.getClan().getHasCastle());

      if(door == null || castle == null)
        return false;

      if(castle.checkIfInZone(door.getX(), door.getY(), door.getZ()))
      {
        door.openMe();
      }

      door = null;
      castle = null;
    }
    else if(command.startsWith("close doors") && target.equals("castle") && activeChar.isClanLeader())
    {
      L2DoorInstance door = (L2DoorInstance) activeChar.getTarget();
      Castle castle = CastleManager.getInstance().getCastleById(activeChar.getClan().getHasCastle());

      if(door == null || castle == null)
        return false;

      if(castle.checkIfInZone(door.getX(), door.getY(), door.getZ()))
      {
        door.closeMe();
      }
      door = null;
      castle = null;
View Full Code Here


      if (targetPlayer != null || targetPet != null)
      {
        boolean condGood = true;
       
        // check target is not in a active siege zone
        Castle castle = null;
       
        if (targetPlayer != null)
        {
          castle = CastleManager.getInstance().getCastle(targetPlayer.getX(), targetPlayer.getY(), targetPlayer.getZ());
        }
        else if (targetPet != null)
        {
          castle = CastleManager.getInstance().getCastle(targetPet.getX(), targetPet.getY(), targetPet.getZ());
        }
       
        if (castle != null && castle.getSiege().getIsInProgress())
        {
          condGood = false;
          activeChar.sendPacket(new SystemMessage(SystemMessageId.CANNOT_BE_RESURRECTED_DURING_SIEGE));
        }
       
View Full Code Here

    if(_canTeleport && _clan != null)
    {
      L2SiegeClan siegeClan = null;
      Boolean isInDefense = false;
      Castle castle = CastleManager.getInstance().getCastle(_activeChar);
      Fort fort = FortManager.getInstance().getFort(_activeChar);

      if(castle != null && castle.getSiege().getIsInProgress())
      {
        //siege in progress
        siegeClan = castle.getSiege().getAttackerClan(_clan);
        if(siegeClan == null && castle.getSiege().checkIsDefender(_clan))
        {
          isInDefense = true;
        }
      }
      else if(fort != null && fort.getSiege().getIsInProgress())
View Full Code Here

    L2Clan clan = player.getClan();
    if(clan != null)
    {
      if(CastleManager.getInstance().getCastleByOwner(clan) != null)
      {
        Castle castle = CastleManager.getInstance().getCastleByOwner(clan);
        if(player.isCastleLord(castle.getCastleId()))
        {
          //please note clan gate expires in two minutes WHATEVER happens to the clan leader.
          ThreadPoolManager.getInstance().scheduleGeneral(new RemoveClanGate(castle.getCastleId(), player), skill.getTotalLifeTime());
          castle.createClanGate(player.getX(), player.getY(), player.getZ() + 20);
          player.getClan().broadcastToOnlineMembers(new SystemMessage(SystemMessageId.THE_PORTAL_HAS_BEEN_CREATED));
          player.setIsParalyzed(true);
        }
        castle = null;
      }
View Full Code Here

      return;

    if(!(player.getTarget() instanceof L2DoorInstance))
      return;

    Castle castle = CastleManager.getInstance().getCastle(player);
    Fort fort = FortManager.getInstance().getFort(player);
    if((castle == null) && (fort == null))
      return;

    if(castle != null)
View Full Code Here

   * @param isCheckOnly if false, it will send a notification to the player telling him why it failed
   * @return
   */
  public static boolean checkIfOkToUseStriderSiegeAssault(L2Character activeChar, boolean isCheckOnly)
  {
    Castle castle = CastleManager.getInstance().getCastle(activeChar);
    Fort fort = FortManager.getInstance().getFort(activeChar);

    if((castle == null) && (fort == null))
      return false;

View Full Code Here

    if(!player.isClanLeader())
      return;

    if(_castleId < 100)
    {
      final Castle castle = CastleManager.getInstance().getCastleById(_castleId);

      if(castle == null)
        return;

      if(_isJoining == 1)
      {
        if(System.currentTimeMillis() < player.getClan().getDissolvingExpiryTime())
        {
          player.sendPacket(new SystemMessage(SystemMessageId.CANT_PARTICIPATE_IN_SIEGE_WHILE_DISSOLUTION_IN_PROGRESS));
          return;
        }

        if(_isAttacker == 1)
        {
          castle.getSiege().registerAttacker(player);
        }
        else
        {
          castle.getSiege().registerDefender(player);
        }
      }
      else
      {
        castle.getSiege().removeSiegeClan(player);
      }

      castle.getSiege().listRegisterClan(player);
    }
    else
    {
      final Fort fort = FortManager.getInstance().getFortById(_castleId);
View Full Code Here

    // player has clan and is the clan leader, check the castle info
    if(clan != null && clan.getLeader().getPlayerInstance() == this)
    {
      // if the clan has a castle and it is actually the queried castle, return true
      Castle castle = CastleManager.getInstance().getCastleByOwner(clan);
      if(castle != null && castle == CastleManager.getInstance().getCastleById(castleId))
      {
        castle = null;
        return true;
      }
View Full Code Here

    }
    // Kill the L2PcInstance
    if (!super.doDie(killer))
      return false;
   
    Castle castle = null;
    if (getClan() != null)
    {
      castle = CastleManager.getInstance().getCastleByOwner(getClan());
      if (castle != null)
      {
        castle.destroyClanGate();
        castle = null;
      }
    }
   
    if (killer != null)
View Full Code Here

            e.printStackTrace();
           }
           onTeleported();
          }

    Castle castle = null;
    if(getClan() != null)
    {
      castle = CastleManager.getInstance().getCastleByOwner(getClan());
      if(castle != null)
      {
        castle.destroyClanGate();
      }
    }

    // Set the online Flag to True or False and update the characters table of the database with online status and lastAccess (called when login and logout)
    try
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.entity.siege.Castle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.