Package lineage2.gameserver.model.entity.residence

Examples of lineage2.gameserver.model.entity.residence.ClanHall


    public void onZoneEnter(Zone zone, Creature cha)
    {
      if (zone.getParams() == null || !cha.isPlayer())
        return;

      Castle castle = ResidenceHolder.getInstance().getResidence(zone.getTemplate().getIndex());

      if (castle != null)
      { 
        if(_side.ordinal()==1 || _side.ordinal()==0)
        {
View Full Code Here


    activeChar.getClan().startNotifyClanEnterWorld(activeChar);
    if (!activeChar.isClanLeader())
    {
      return;
    }
    ClanHall clanHall = clan.getHasHideout() > 0 ? ResidenceHolder.getInstance().getResidence(ClanHall.class, clan.getHasHideout()) : null;
    if ((clanHall == null) || (clanHall.getAuctionLength() != 0))
    {
      return;
    }
    if (clanHall.getSiegeEvent().getClass() != ClanHallAuctionEvent.class)
    {
      return;
    }
    if (clan.getWarehouse().getCountOf(ItemTemplate.ITEM_ID_ADENA) < clanHall.getRentalFee())
    {
      activeChar.sendPacket(new SystemMessage2(SystemMsg.PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_ME_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW).addLong(clanHall.getRentalFee()));
    }
  }
View Full Code Here

  {
    if (!canBypassCheck(player, this))
    {
      return;
    }
    ClanHall clanHall = getClanHall();
    ClanHallMiniGameEvent miniGameEvent = clanHall.getSiegeEvent();
    if (miniGameEvent == null)
    {
      return;
    }
    if (miniGameEvent.isArenaClosed())
View Full Code Here

   * @param arg Object[]
   */
  @Override
  public void showChatWindow(Player player, int val, Object... arg)
  {
    ClanHall clanhall = ResidenceHolder.getInstance().getResidence(ClanHall.class, 21);
    if (clanhall == null)
    {
      return;
    }
    NpcHtmlMessage html = new NpcHtmlMessage(player, this);
    html.setFile("residence2/clanhall/partisan_ordery_brakel001.htm");
    html.replace("%next_siege%", TimeUtils.toSimpleFormat(clanhall.getSiegeDate().getTimeInMillis()));
    player.sendPacket(html);
  }
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);
     
      player.sendPacket(SystemMsg.YOU_HAVE_CANCELED_YOUR_BID);
      showChatWindow(player, 0);
    }
    else if (actualCommand.equalsIgnoreCase("register_start"))
    {
      if (!firstChecks(player))
      {
        showChatWindow(player, 0);
        return;
      }
     
      ClanHall clanHall = ResidenceHolder.getInstance().getResidence(player.getClan().getHasHideout());
      if ((clanHall.getSiegeEvent().getClass() != ClanHallAuctionEvent.class) || clanHall.getSiegeEvent().isInProgress())
      {
        return;
      }
     
      if ((clanHall.getLastSiegeDate().getTimeInMillis() + WEEK) > System.currentTimeMillis())
      {
        player.sendPacket(SystemMsg.IT_HAS_NOT_YET_BEEN_SEVEN_DAYS_SINCE_CANCELING_AN_AUCTION);
        onBypassFeedback(player, "info");
        return;
      }
     
      NpcHtmlMessage msg = new NpcHtmlMessage(player, this);
      msg.setFile("residence2/clanhall/auction_clanhall_register_start.htm");
      msg.replace("%id%", String.valueOf(player.getClan().getHasHideout()));
      msg.replace("%adena%", String.valueOf(player.getClan().getWarehouse().getCountOf(ItemTemplate.ITEM_ID_ADENA)));
      msg.replace("%deposit%", String.valueOf(clanHall.getDeposit()));
     
      player.sendPacket(msg);
    }
    else if (actualCommand.equalsIgnoreCase("register_next"))
    {
      if (!firstChecks(player))
      {
        showChatWindow(player, 0);
        return;
      }
     
      ClanHall clanHall = ResidenceHolder.getInstance().getResidence(player.getClan().getHasHideout());
      if ((clanHall.getSiegeEvent().getClass() != ClanHallAuctionEvent.class) || clanHall.getSiegeEvent().isInProgress())
      {
        showChatWindow(player, 0);
        return;
      }
     
      if (player.getClan().getWarehouse().getCountOf(ItemTemplate.ITEM_ID_ADENA) < clanHall.getDeposit())
      {
        player.sendPacket(SystemMsg.THERE_IS_NOT_ENOUGH_ADENA_IN_THE_CLAN_HALL_WAREHOUSE);
        onBypassFeedback(player, "register_start");
        return;
      }
     
      NpcHtmlMessage msg = new NpcHtmlMessage(player, this);
      msg.setFile("residence2/clanhall/auction_clanhall_register_next.htm");
      msg.replace("%min_bid%", String.valueOf(clanHall.getBaseMinBid()));
      msg.replace("%last_bid%", String.valueOf(clanHall.getBaseMinBid())); // TODO [VISTALL] get last bid
     
      player.sendPacket(msg);
    }
    else if (actualCommand.equalsIgnoreCase("register_next2"))
    {
      if (!firstChecks(player))
      {
        showChatWindow(player, 0);
        return;
      }
     
      ClanHall clanHall = ResidenceHolder.getInstance().getResidence(player.getClan().getHasHideout());
      if ((clanHall.getSiegeEvent().getClass() != ClanHallAuctionEvent.class) || clanHall.getSiegeEvent().isInProgress())
      {
        showChatWindow(player, 0);
        return;
      }
     
      int day = Integer.parseInt(tokenizer.nextToken());
      long bid = -1;
      String comment = StringUtils.EMPTY;
      if (tokenizer.hasMoreTokens())
      {
        try
        {
          bid = Long.parseLong(tokenizer.nextToken());
        }
        catch (Exception e)
        {
        }
      }
     
      if (tokenizer.hasMoreTokens())
      {
        comment = tokenizer.nextToken();
        while (tokenizer.hasMoreTokens())
        {
          comment += " " + tokenizer.nextToken();
        }
      }
     
      comment = comment.substring(0, Math.min(comment.length(), Byte.MAX_VALUE));
      if (bid <= -1)
      {
        onBypassFeedback(player, "register_next");
        return;
      }
     
      Calendar cal = Calendar.getInstance();
      cal.add(Calendar.HOUR_OF_DAY, day);
     
      NpcHtmlMessage msg = new NpcHtmlMessage(player, this);
      msg.setFile("residence2/clanhall/auction_clanhall_register_confirm.htm");
      msg.replace("%description%", comment);
      msg.replace("%day%", String.valueOf(day));
      msg.replace("%bid%", String.valueOf(bid));
      msg.replace("%base_bid%", String.valueOf(clanHall.getBaseMinBid()));
      msg.replace("%hour%", String.valueOf(cal.get(Calendar.HOUR_OF_DAY)));
      msg.replace("%date%", DATE_FORMAT.format(cal.getTimeInMillis()));
     
      player.sendPacket(msg);
    }
    else if (actualCommand.equalsIgnoreCase("register_confirm"))
    {
      if (!firstChecks(player))
      {
        showChatWindow(player, 0);
        return;
      }
     
      ClanHall clanHall = ResidenceHolder.getInstance().getResidence(player.getClan().getHasHideout());
      if ((clanHall.getSiegeEvent().getClass() != ClanHallAuctionEvent.class) || clanHall.getSiegeEvent().isInProgress())
      {
        showChatWindow(player, 0);
        return;
      }
     
      if ((clanHall.getLastSiegeDate().getTimeInMillis() + WEEK) > System.currentTimeMillis())
      {
        player.sendPacket(SystemMsg.IT_HAS_NOT_YET_BEEN_SEVEN_DAYS_SINCE_CANCELING_AN_AUCTION);
        onBypassFeedback(player, "info");
        return;
      }
     
      int day = Integer.parseInt(tokenizer.nextToken());
      long bid = Long.parseLong(tokenizer.nextToken());
      String comment = StringUtils.EMPTY;
     
      if (tokenizer.hasMoreTokens())
      {
        comment = tokenizer.nextToken();
        while (tokenizer.hasMoreTokens())
        {
          comment += " " + tokenizer.nextToken();
        }
      }
     
      if (bid <= -1)
      {
        onBypassFeedback(player, "register_next");
        return;
      }
     
      clanHall.setAuctionMinBid(bid);
      clanHall.setAuctionDescription(comment);
      clanHall.setAuctionLength(day);
      clanHall.getSiegeDate().setTimeInMillis(System.currentTimeMillis());
      clanHall.setJdbcState(JdbcEntityState.UPDATED);
      clanHall.update();
     
      clanHall.getSiegeEvent().reCalcNextTime(false);
     
      onBypassFeedback(player, "info");
      player.sendPacket(SystemMsg.YOU_HAVE_REGISTERED_FOR_A_CLAN_HALL_AUCTION);
    }
    else if (actualCommand.equals("cancel_start"))
    {
      if (!firstChecks(player))
      {
        showChatWindow(player, 0);
        return;
      }
     
      ClanHall clanHall = ResidenceHolder.getInstance().getResidence(player.getClan().getHasHideout());
      if ((clanHall.getSiegeEvent().getClass() != ClanHallAuctionEvent.class) || !clanHall.getSiegeEvent().isInProgress())
      {
        showChatWindow(player, 0);
        return;
      }
     
      NpcHtmlMessage msg = new NpcHtmlMessage(player, this);
      msg.setFile("residence2/clanhall/auction_clanhall_cancel_confirm.htm");
      msg.replace("%deposit%", String.valueOf(clanHall.getDeposit()));
     
      player.sendPacket(msg);
    }
    else if (actualCommand.equals("cancel_confirm"))
    {
      if (!firstChecks(player))
      {
        showChatWindow(player, 0);
        return;
      }
     
      ClanHall clanHall = ResidenceHolder.getInstance().getResidence(player.getClan().getHasHideout());
      if ((clanHall.getSiegeEvent().getClass() != ClanHallAuctionEvent.class) || !clanHall.getSiegeEvent().isInProgress())
      {
        showChatWindow(player, 0);
        return;
      }
     
      clanHall.getSiegeEvent().setInProgress(false);
     
      clanHall.getSiegeDate().setTimeInMillis(0);
      clanHall.getLastSiegeDate().setTimeInMillis(System.currentTimeMillis());
      clanHall.setAuctionDescription(StringUtils.EMPTY);
      clanHall.setAuctionLength(0);
      clanHall.setAuctionMinBid(0);
      clanHall.setJdbcState(JdbcEntityState.UPDATED);
      clanHall.update();
     
      ClanHallAuctionEvent auctionEvent = clanHall.getSiegeEvent();
      List<AuctionSiegeClanObject> siegeClans = auctionEvent.removeObjects(SiegeEvent.ATTACKERS);
      SiegeClanDAO.getInstance().delete(clanHall);
     
      for (AuctionSiegeClanObject $siegeClan : siegeClans)
      {
        long returnBid = $siegeClan.getParam() - (long) ($siegeClan.getParam() * 0.1);
       
        $siegeClan.getClan().getWarehouse().addItem(ItemTemplate.ITEM_ID_ADENA, returnBid);
      }
     
      clanHall.getSiegeEvent().reCalcNextTime(false);
      onBypassFeedback(player, "info");
    }
    else
    {
      super.onBypassFeedback(player, command);
View Full Code Here

   * @return L2GameServerPacket
   */
  @Override
  public L2GameServerPacket decoPacket()
  {
    ClanHall clanHall = getClanHall();
    if (clanHall != null)
    {
      return new AgitDecoInfo(clanHall);
    }
    return null;
View Full Code Here

  {
    String htmltext = "noquest";
    int cond = st.getCond();
    Player player = st.getPlayer();
    Clan clan = player.getClan();
    ClanHall clanhall = ResidenceHolder.getInstance().getResidence(35);
    if (clanhall.getSiegeEvent().isRegistrationOver())
    {
      htmltext = null;
      showHtmlFile(player, "azit_messenger_q0504_03.htm", false, "%siege_time%", TimeUtils.toSimpleFormat(clanhall.getSiegeDate()));
    }
    else if ((clan == null) || (player.getObjectId() != clan.getLeaderId()))
    {
      htmltext = "azit_messenger_q0504_05.htm";
    }
    else if ((player.getObjectId() == clan.getLeaderId()) && (clan.getLevel() < 4))
    {
      htmltext = "azit_messenger_q0504_04.htm";
    }
    else if (clanhall.getSiegeEvent().getSiegeClan(SiegeEvent.ATTACKERS, player.getClan()) != null)
    {
      htmltext = "azit_messenger_q0504_06.htm";
    }
    else if (clan.getHasHideout() > 0)
    {
View Full Code Here

   * @param command String
   */
  @Override
  public void onBypassFeedback(final Player player, final String command)
  {
    ClanHall clanHall = getClanHall();
    ClanHallTeamBattleEvent siegeEvent = clanHall.getSiegeEvent();
    Clan clan = player.getClan();
    if (command.equalsIgnoreCase("registrationMenu"))
    {
      if (!checkCond(player, true))
      {
View Full Code Here

   * @param player Player
   */
  private void register(Player player)
  {
    Clan clan = player.getClan();
    ClanHall clanHall = getClanHall();
    ClanHallTeamBattleEvent siegeEvent = clanHall.getSiegeEvent();
    CTBSiegeClanObject siegeClan = new CTBSiegeClanObject(SiegeEvent.ATTACKERS, clan, 0);
    siegeClan.getPlayers().add(player.getObjectId());
    siegeEvent.addObject(SiegeEvent.ATTACKERS, siegeClan);
    SiegeClanDAO.getInstance().insert(clanHall, siegeClan);
    SiegePlayerDAO.getInstance().insert(clanHall, clan.getClanId(), player.getObjectId());
View Full Code Here

   * @return boolean
   */
  private boolean checkCond(Player player, boolean regMenu)
  {
    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;
    }
    if (regMenu && (siegeClan != null))
    {
      return true;
    }
    if ((clan == null) || (player.getObjectId() != clan.getLeaderId()))
    {
      showChatWindow(player, "quests/_655_AGrandPlanForTamingWildBeasts/farm_messenger_q0655_03.htm");
      return false;
    }
    if ((player.getObjectId() == clan.getLeaderId()) && (clan.getLevel() < 4))
    {
      showChatWindow(player, "quests/_655_AGrandPlanForTamingWildBeasts/farm_messenger_q0655_05.htm");
      return false;
    }
    if (clan.getHasHideout() == clanHall.getId())
    {
      showChatWindow(player, "residence2/clanhall/farm_kel_mahum_messenger_22.htm");
      return false;
    }
    if (clan.getHasHideout() > 0)
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.entity.residence.ClanHall

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.