Package lineage2.gameserver.model.entity.events.objects

Examples of lineage2.gameserver.model.entity.events.objects.SiegeClanObject


        targetPlayer.sendPacket(SystemMsg.IT_IS_NOT_POSSIBLE_TO_RESURRECT_IN_BATTLEFIELDS_WHERE_A_SIEGE_WAR_IS_TAKING_PLACE);
      }
      resurrectPlayer.sendPacket(force ? SystemMsg.IT_IS_NOT_POSSIBLE_TO_RESURRECT_IN_BATTLEFIELDS_WHERE_A_SIEGE_WAR_IS_TAKING_PLACE : SystemMsg.INVALID_TARGET);
      return false;
    }
    SiegeClanObject targetSiegeClan = siegeEvent.getSiegeClan(ATTACKERS, targetPlayer.getClan());
    if (targetSiegeClan.getFlag() == null)
    {
      if (force)
      {
        targetPlayer.sendPacket(SystemMsg.IF_A_BASE_CAMP_DOES_NOT_EXIST_RESURRECTION_IS_NOT_POSSIBLE);
      }
View Full Code Here


    {
      player.sendActionFailed();
      return;
    }
    CastleSiegeEvent siegeEvent = castle.getSiegeEvent();
    SiegeClanObject siegeClan = siegeEvent.getSiegeClan(CastleSiegeEvent.DEFENDERS_WAITING, _clanId);
    if (siegeClan == null)
    {
      siegeClan = siegeEvent.getSiegeClan(SiegeEvent.DEFENDERS, _clanId);
    }
    if (siegeClan == null)
    {
      return;
    }
    if ((player.getClanPrivileges() & Clan.CP_CS_MANAGE_SIEGE) != Clan.CP_CS_MANAGE_SIEGE)
    {
      player.sendPacket(SystemMsg.YOU_DO_NOT_HAVE_THE_AUTHORITY_TO_MODIFY_THE_CASTLE_DEFENDER_LIST);
      return;
    }
    if (siegeEvent.isRegistrationOver())
    {
      player.sendPacket(SystemMsg.THIS_IS_NOT_THE_TIME_FOR_SIEGE_REGISTRATION_AND_SO_REGISTRATIONS_CANNOT_BE_ACCEPTED_OR_REJECTED);
      return;
    }
    int allSize = siegeEvent.getObjects(SiegeEvent.DEFENDERS).size();
    if (allSize >= CastleSiegeEvent.MAX_SIEGE_CLANS)
    {
      player.sendPacket(SystemMsg.NO_MORE_REGISTRATIONS_MAY_BE_ACCEPTED_FOR_THE_DEFENDER_SIDE);
      return;
    }
    siegeEvent.removeObject(siegeClan.getType(), siegeClan);
    if (_approved)
    {
      siegeClan.setType(SiegeEvent.DEFENDERS);
    }
    else
    {
      siegeClan.setType(CastleSiegeEvent.DEFENDERS_REFUSED);
    }
    siegeEvent.addObject(siegeClan.getType(), siegeClan);
    SiegeClanDAO.getInstance().update(castle, siegeClan);
    player.sendPacket(new CastleSiegeDefenderList(castle));
  }
View Full Code Here

    else if (actualCommand.equalsIgnoreCase("info"))
    {
      String fileName = null;
     
      ClanHall clanHall = null;
      SiegeClanObject siegeClan = null;
      if (tokenizer.hasMoreTokens())
      {
        int id = Integer.parseInt(tokenizer.nextToken());
        clanHall = ResidenceHolder.getInstance().getResidence(id);
       
        fileName = "residence2/clanhall/auction_clanhall_info_main.htm";
      }
      else
      {
        clanHall = player.getClan() == null ? null : player.getClan().getHasHideout() > 0 ? ResidenceHolder.getInstance().<ClanHall> getResidence(player.getClan().getHasHideout()) : null;
        if ((clanHall != null) && (clanHall.getSiegeEvent().getClass() == ClanHallAuctionEvent.class))
        {
          if (clanHall.getSiegeEvent().isInProgress())
          {
            fileName = "residence2/clanhall/auction_clanhall_info_owner_sell.htm";
          }
          else
          {
            fileName = "residence2/clanhall/auction_clanhall_info_owner.htm";
          }
        }
        else
        {
          for (ClanHall ch : ResidenceHolder.getInstance().getResidenceList(ClanHall.class))
          {
            if ((ch.getSiegeEvent().getClass() == ClanHallAuctionEvent.class) && ((siegeClan = ch.getSiegeEvent().getSiegeClan(SiegeEvent.ATTACKERS, player.getClan())) != null))
            {
              clanHall = ch;
              break;
            }
          }
         
          if (siegeClan == null)
          {
            player.sendPacket(SystemMsg.THERE_ARE_NO_OFFERINGS_I_OWN_OR_I_MADE_A_BID_FOR);
            showChatWindow(player, 0);
            return;
          }
         
          fileName = "residence2/clanhall/auction_clanhall_info_bidded.htm";
        }
      }
     
      ClanHallAuctionEvent auctionEvent = clanHall.getSiegeEvent();
      List<AuctionSiegeClanObject> attackers = auctionEvent.getObjects(SiegeEvent.ATTACKERS);
     
      NpcHtmlMessage msg = new NpcHtmlMessage(player, this);
      msg.setFile(fileName);
      msg.replace("%id%", String.valueOf(clanHall.getId()));
      msg.replace("%bigger_size%", String.valueOf(attackers.size()));
      msg.replace("%grade%", String.valueOf(clanHall.getGrade()));
      msg.replace("%rental_fee%", String.valueOf(clanHall.getRentalFee()));
     
      Clan owner = clanHall.getOwner();
     
      msg.replace("%owner%", owner == null ? StringUtils.EMPTY : owner.getName());
      msg.replace("%owner_leader%", owner == null ? StringUtils.EMPTY : owner.getLeaderName());
      msg.replace("%description%", clanHall.getAuctionDescription());
      msg.replace("%min_bid%", String.valueOf(clanHall.getAuctionMinBid()));
     
      Calendar c = auctionEvent.getEndSiegeDate();
     
      msg.replace("%date%", DATE_FORMAT.format(c.getTimeInMillis()));
      msg.replace("%hour%", String.valueOf(c.get(Calendar.HOUR_OF_DAY)));
     
      int remainingTime = (int) ((c.getTimeInMillis() - System.currentTimeMillis()) / 60000L);
     
      msg.replace("%remaining_hour%", String.valueOf(remainingTime / 60));
      msg.replace("%remaining_minutes%", String.valueOf(remainingTime % 60));
     
      if (siegeClan != null)
      {
        msg.replace("%my_bid%", String.valueOf(siegeClan.getParam()));
      }
     
      player.sendPacket(msg);
    }
    else if (actualCommand.equalsIgnoreCase("bidder_list"))
    {
      int id = Integer.parseInt(tokenizer.nextToken());
      int page = Integer.parseInt(tokenizer.nextToken());
     
      ClanHall clanHall = ResidenceHolder.getInstance().getResidence(id);
      ClanHallAuctionEvent auctionEvent = clanHall.getSiegeEvent();
      List<AuctionSiegeClanObject> attackers = auctionEvent.getObjects(SiegeEvent.ATTACKERS);
     
      if (!auctionEvent.isInProgress())
      {
        return;
      }
     
      int min = BIDDER_PAGE_SIZE * page;
      int max = min + BIDDER_PAGE_SIZE;
      if (min > attackers.size())
      {
        min = 0;
        max = min + BIDDER_PAGE_SIZE;
      }
     
      if (max > attackers.size())
      {
        max = attackers.size();
      }
     
      NpcHtmlMessage msg = new NpcHtmlMessage(player, this);
      msg.setFile("residence2/clanhall/auction_bidder_list.htm");
      msg.replace("%id%", String.valueOf(id));
     
      StringBuilder b = new StringBuilder();
      for (int i = min; i < max; i++)
      {
        AuctionSiegeClanObject siegeClan = attackers.get(i);
        String t = BIDDER_IN_LIST.replace("%id%", String.valueOf(id)).replace("%clan_name%", siegeClan.getClan().getName()).replace("%date%", DATE_FORMAT.format(siegeClan.getDate()));
        b.append(t);
      }
      msg.replace("%list%", b.toString());
     
      if (attackers.size() > max)
      {
        msg.replace("%next_button%", "<td>" + HtmlUtils.NEXT_BUTTON + "</td>");
        msg.replace("%next_bypass%", "-h npc_%objectId%_bidder_list " + id + " " + (page + 1));
      }
      else
      {
        msg.replace("%next_button%", StringUtils.EMPTY);
      }
     
      if (page != 0)
      {
        msg.replace("%prev_button%", "<td>" + HtmlUtils.PREV_BUTTON + "</td>");
        msg.replace("%prev_bypass%", "-h npc_%objectId%_bidder_list " + id + " " + (page - 1));
      }
      else
      {
        msg.replace("%prev_button%", StringUtils.EMPTY);
      }
     
      player.sendPacket(msg);
    }
    else if (actualCommand.equalsIgnoreCase("bid_start"))
    {
      if (!firstChecks(player))
      {
        showChatWindow(player, 0);
        return;
      }
     
      int id = Integer.parseInt(tokenizer.nextToken());
     
      ClanHall clanHall = ResidenceHolder.getInstance().getResidence(id);
      ClanHallAuctionEvent auctionEvent = clanHall.getSiegeEvent();
     
      if (!auctionEvent.isInProgress())
      {
        return;
      }
     
      long minBid = clanHall.getAuctionMinBid();
      AuctionSiegeClanObject siegeClan = auctionEvent.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
      if (siegeClan != null)
      {
        minBid = siegeClan.getParam();
      }
     
      NpcHtmlMessage msg = new NpcHtmlMessage(player, this);
      msg.setFile("residence2/clanhall/auction_bid_start.htm");
      msg.replace("%id%", String.valueOf(id));
      msg.replace("%min_bid%", String.valueOf(minBid));
      msg.replace("%clan_adena%", String.valueOf(player.getClan().getWarehouse().getCountOf(ItemTemplate.ITEM_ID_ADENA)));
     
      player.sendPacket(msg);
    }
    else if (actualCommand.equalsIgnoreCase("bid_next"))
    {
      if (!firstChecks(player))
      {
        showChatWindow(player, 0);
        return;
      }
     
      int id = Integer.parseInt(tokenizer.nextToken());
      long bid = 0;
      if (tokenizer.hasMoreTokens())
      {
        try
        {
          bid = NUMBER_FORMAT.parse(tokenizer.nextToken()).longValue();
        }
        catch (ParseException e)
        {
          //
        }
      }
     
      ClanHall clanHall = ResidenceHolder.getInstance().getResidence(id);
      ClanHallAuctionEvent auctionEvent = clanHall.getSiegeEvent();
     
      if (!auctionEvent.isInProgress())
      {
        return;
      }
     
      if (!checkBid(player, auctionEvent, bid))
      {
        return;
      }
     
      long minBid = clanHall.getAuctionMinBid();
      AuctionSiegeClanObject siegeClan = auctionEvent.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
      if (siegeClan != null)
      {
        minBid = siegeClan.getParam();
      }
     
      NpcHtmlMessage msg = new NpcHtmlMessage(player, this);
      msg.setFile("residence2/clanhall/auction_bid_confirm.htm");
      msg.replace("%id%", String.valueOf(id));
      msg.replace("%bid%", String.valueOf(bid));
      msg.replace("%min_bid%", String.valueOf(minBid));
     
      Calendar c = auctionEvent.getEndSiegeDate();
     
      msg.replace("%date%", DATE_FORMAT.format(c.getTimeInMillis()));
      msg.replace("%hour%", String.valueOf(c.get(Calendar.HOUR_OF_DAY)));
     
      player.sendPacket(msg);
    }
    else if (actualCommand.equalsIgnoreCase("bid_confirm"))
    {
      if (!firstChecks(player))
      {
        showChatWindow(player, 0);
        return;
      }
     
      int id = Integer.parseInt(tokenizer.nextToken());
      final long bid = Long.parseLong(tokenizer.nextToken());
     
      ClanHall clanHall = ResidenceHolder.getInstance().getResidence(id);
      ClanHallAuctionEvent auctionEvent = clanHall.getSiegeEvent();
     
      if (!auctionEvent.isInProgress())
      {
        return;
      }
     
      for (ClanHall ch : ResidenceHolder.getInstance().getResidenceList(ClanHall.class))
      {
        if ((clanHall != ch) && (ch.getSiegeEvent().getClass() == ClanHallAuctionEvent.class) && ch.getSiegeEvent().isInProgress() && (ch.getSiegeEvent().getSiegeClan(SiegeEvent.ATTACKERS, player.getClan()) != null))
        {
          player.sendPacket(SystemMsg.SINCE_YOU_HAVE_ALREADY_SUBMITTED_A_BID_YOU_ARE_NOT_ALLOWED_TO_PARTICIPATE_IN_ANOTHER_AUCTION_AT_THIS_TIME);
          onBypassFeedback(player, "bid_start " + id);
          return;
        }
      }
     
      if (!checkBid(player, auctionEvent, bid))
      {
        return;
      }
     
      long consumeBid = bid;
      AuctionSiegeClanObject siegeClan = auctionEvent.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
      if (siegeClan != null)
      {
        consumeBid -= siegeClan.getParam();
        if (bid <= siegeClan.getParam())
        {
          player.sendPacket(SystemMsg.THE_BID_AMOUNT_MUST_BE_HIGHER_THAN_THE_PREVIOUS_BID);
          onBypassFeedback(player, "bid_start " + auctionEvent.getId());
          return;
        }
      }
     
      player.getClan().getWarehouse().destroyItemByItemId(ItemTemplate.ITEM_ID_ADENA, consumeBid);
     
      if (siegeClan != null)
      {
        siegeClan.setParam(bid);
       
        SiegeClanDAO.getInstance().update(clanHall, siegeClan);
      }
      else
      {
        siegeClan = new AuctionSiegeClanObject(SiegeEvent.ATTACKERS, player.getClan(), bid);
        auctionEvent.addObject(SiegeEvent.ATTACKERS, siegeClan);
       
        SiegeClanDAO.getInstance().insert(clanHall, siegeClan);
      }
     
      player.sendPacket(SystemMsg.YOUR_BID_HAS_BEEN_SUCCESSFULLY_PLACED);
     
      onBypassFeedback(player, "info");
    }
    else if (actualCommand.equalsIgnoreCase("cancel_bid"))
    {
      if (!firstChecks(player))
      {
        showChatWindow(player, 0);
        return;
      }
      int id = Integer.parseInt(tokenizer.nextToken());
     
      ClanHall clanHall = ResidenceHolder.getInstance().getResidence(id);
      ClanHallAuctionEvent auctionEvent = clanHall.getSiegeEvent();
     
      if (!auctionEvent.isInProgress())
      {
        return;
      }
     
      AuctionSiegeClanObject siegeClan = auctionEvent.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
      if (siegeClan == null)
      {
        return;
      }
     
      long returnVal = siegeClan.getParam() - (long) (siegeClan.getParam() * 0.1);
      NpcHtmlMessage msg = new NpcHtmlMessage(player, this);
      msg.setFile("residence2/clanhall/auction_bid_cancel.htm");
      msg.replace("%id%", String.valueOf(id));
      msg.replace("%bid%", String.valueOf(siegeClan.getParam()));
      msg.replace("%return%", String.valueOf(returnVal));
     
      player.sendPacket(msg);
    }
    else if (actualCommand.equalsIgnoreCase("cancel_bid_confirm"))
    {
      if (!firstChecks(player))
      {
        showChatWindow(player, 0);
        return;
      }
      int id = Integer.parseInt(tokenizer.nextToken());
     
      ClanHall clanHall = ResidenceHolder.getInstance().getResidence(id);
      ClanHallAuctionEvent auctionEvent = clanHall.getSiegeEvent();
     
      if (!auctionEvent.isInProgress())
      {
        return;
      }
     
      AuctionSiegeClanObject siegeClan = auctionEvent.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
      if (siegeClan == null)
      {
        return;
      }
     
      long returnVal = siegeClan.getParam() - (long) (siegeClan.getParam() * 0.1);
     
      player.getClan().getWarehouse().addItem(ItemTemplate.ITEM_ID_ADENA, returnVal);
      auctionEvent.removeObject(SiegeEvent.ATTACKERS, siegeClan);
      SiegeClanDAO.getInstance().delete(clanHall, siegeClan);
     
View Full Code Here

  {
    Clan clan = player.getClan();
    ClanHall clanHall = getClanHall();
    ClanHallTeamBattleEvent siegeEvent = clanHall.getSiegeEvent();
    List<CTBSiegeClanObject> siegeClans = siegeEvent.getObjects(SiegeEvent.ATTACKERS);
    SiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, clan);
    if (siegeEvent.isRegistrationOver())
    {
      showChatWindow(player, "quests/_655_AGrandPlanForTamingWildBeasts/farm_messenger_q0655_11.htm", "%siege_time%", TimeUtils.toSimpleFormat(clanHall.getSiegeDate()));
      return false;
    }
View Full Code Here

  {
    Clan clan = player.getClan();
    ClanHall clanHall = getClanHall();
    ClanHallTeamBattleEvent siegeEvent = clanHall.getSiegeEvent();
    List<CTBSiegeClanObject> siegeClans = siegeEvent.getObjects(SiegeEvent.ATTACKERS);
    SiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, clan);
    if (siegeEvent.isRegistrationOver())
    {
      showChatWindow(player, "quests/_504_CompetitionForTheBanditStronghold/azit_messenger_q0504_03.htm", "%siege_time%", TimeUtils.toSimpleFormat(clanHall.getSiegeDate()));
      return false;
    }
View Full Code Here

    {
      return;
    }
    final SiegeEvent<?, ?> siegeEvent1 = actor.getEvent(SiegeEvent.class);
    final SiegeEvent<?, ?> siegeEvent2 = player.getEvent(SiegeEvent.class);
    final SiegeClanObject siegeClan = siegeEvent1.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
    if ((siegeEvent2 == null) || ((siegeEvent1.equals(siegeEvent2)) && (siegeClan != null)))
    {
      ThreadPoolManager.getInstance().schedule(new notifyGuard(player), 1000);
    }
  }
View Full Code Here

      if (clan.getLeaderId() != player.getObjectId())
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti010.htm");
        return;
      }
      SiegeClanObject siegeClanObject = miniGameEvent.getSiegeClan(SiegeEvent.ATTACKERS, clan);
      if (siegeClanObject == null)
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti016.htm");
      }
      else
      {
        miniGameEvent.removeObject(SiegeEvent.ATTACKERS, siegeClanObject);
        SiegeClanDAO.getInstance().delete(clanHall, siegeClanObject);
        ItemFunctions.addItem(player, ITEM_ID, siegeClanObject.getParam() / 2L, true);
        showChatWindow(player, "residence2/clanhall/messenger_yetti005.htm");
      }
    }
    else if (command.equalsIgnoreCase("refund"))
    {
      if (miniGameEvent.isRegistrationOver())
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti010.htm");
        return;
      }
      Clan clan = player.getClan();
      if ((clan == null) || (clan.getLevel() < 3))
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti011.htm");
        return;
      }
      if (clan.getLeaderId() != player.getObjectId())
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti010.htm");
        return;
      }
      SiegeClanObject siegeClanObject = miniGameEvent.getSiegeClan(ClanHallMiniGameEvent.REFUND, clan);
      if (siegeClanObject == null)
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti020.htm");
      }
      else
      {
        miniGameEvent.removeObject(ClanHallMiniGameEvent.REFUND, siegeClanObject);
        SiegeClanDAO.getInstance().delete(clanHall, siegeClanObject);
        ItemFunctions.addItem(player, ITEM_ID, siegeClanObject.getParam(), true);
        showChatWindow(player, "residence2/clanhall/messenger_yetti019.htm");
      }
    }
    else
    {
View Full Code Here

        if (!inZone)
        {
          player.sendPacket(SystemMsg.YOU_CANNOT_SET_UP_A_BASE_HERE, new SystemMessage2(SystemMsg.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS).addSkillName(this));
          return false;
        }
        SiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
        if (siegeClan == null)
        {
          player.sendPacket(SystemMsg.YOU_CANNOT_SUMMON_THE_ENCAMPMENT_BECAUSE_YOU_ARE_NOT_A_MEMBER_OF_THE_SIEGE_CLAN_INVOLVED_IN_THE_CASTLE__FORTRESS__HIDEOUT_SIEGE, new SystemMessage2(SystemMsg.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS).addSkillName(this));
          return false;
        }
        if (siegeClan.getFlag() != null)
        {
          player.sendPacket(SystemMsg.AN_OUTPOST_OR_HEADQUARTERS_CANNOT_BE_BUILT_BECAUSE_ONE_ALREADY_EXISTS, new SystemMessage2(SystemMsg.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS).addSkillName(this));
          return false;
        }
        break;
View Full Code Here

    SiegeEvent<?, ?> siegeEvent = activeChar.getEvent(SiegeEvent.class);
    if (siegeEvent == null)
    {
      return;
    }
    SiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, clan);
    if (siegeClan == null)
    {
      return;
    }
    switch (_flagType)
    {
      case DESTROY:
        siegeClan.deleteFlag();
        break;
      default:
        if (siegeClan.getFlag() != null)
        {
          return;
        }
        SiegeFlagInstance flag = (SiegeFlagInstance) NpcHolder.getInstance().getTemplate(_flagType == FlagType.OUTPOST ? 36590 : 35062).getNewInstance();
        flag.setClan(siegeClan);
        flag.addEvent(siegeEvent);
        if (_flagType == FlagType.ADVANCED)
        {
          flag.addStatFunc(new FuncMul(Stats.MAX_HP, 0x50, flag, _advancedMult));
        }
        flag.setCurrentHpMp(flag.getMaxHp(), flag.getMaxMp(), true);
        flag.setHeading(player.getHeading());
        int x = (int) (player.getX() + (100 * Math.cos(player.headingToRadians(player.getHeading() - 32768))));
        int y = (int) (player.getY() + (100 * Math.sin(player.headingToRadians(player.getHeading() - 32768))));
        flag.spawnMe(GeoEngine.moveCheck(player.getX(), player.getY(), player.getZ(), x, y, player.getGeoIndex()));
        siegeClan.setFlag(flag);
        break;
    }
  }
View Full Code Here

          showChatWindow(player, "residence2/fortress/fortress_ordery003.htm");
          return;
        }
      }
     
      SiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, clan);
      if (siegeClan != null)
      {
        showChatWindow(player, "residence2/fortress/fortress_ordery007.htm");
        return;
      }
     
      for (Fortress $ : ResidenceHolder.getInstance().getResidenceList(Fortress.class))
      {
        if ($.getSiegeEvent().getSiegeClan(SiegeEvent.ATTACKERS, clan) != null)
        {
          showChatWindow(player, "residence2/fortress/fortress_ordery006.htm");
          return;
        }
      }
     
      if ((clan.getHasFortress() > 0) && (fortress.getSiegeDate().getTimeInMillis() > 0))
      {
        showChatWindow(player, "residence2/fortress/fortress_ordery006.htm");
        return;
      }
     
      siegeClan = new SiegeClanObject(SiegeEvent.ATTACKERS, clan, 0);
      siegeEvent.addObject(SiegeEvent.ATTACKERS, siegeClan);
      SiegeClanDAO.getInstance().insert(fortress, siegeClan);
     
      siegeEvent.reCalcNextTime(false);
     
      player.sendPacket(new SystemMessage2(SystemMsg.YOUR_CLAN_HAS_BEEN_REGISTERED_TO_S1S_FORTRESS_BATTLE).addResidenceName(fortress));
      showChatWindow(player, "residence2/fortress/fortress_ordery005.htm");
    }
    else if (command.equalsIgnoreCase("cancel"))
    {
      Clan clan = player.getClan();
      if ((clan == null) || !player.hasPrivilege(Privilege.CS_FS_SIEGE_WAR))
      {
        showChatWindow(player, "residence2/fortress/fortress_ordery010.htm");
        return;
      }
     
      SiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, clan);
      if (siegeClan != null)
      {
        siegeEvent.removeObject(SiegeEvent.ATTACKERS, siegeClan);
        SiegeClanDAO.getInstance().delete(fortress, siegeClan);
       
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.entity.events.objects.SiegeClanObject

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.