Package lineage2.gameserver.model.pledge

Examples of lineage2.gameserver.model.pledge.Clan


  public void showChatWindow(Player player, int val, Object... arg)
  {
    ClanHall clanHall = getClanHall();
    if (clanHall != null)
    {
      Clan playerClan = player.getClan();
      if ((playerClan != null) && (playerClan.getHasHideout() == clanHall.getId()))
      {
        showChatWindow(player, _elite ? "residence2/clanhall/WyvernAgitJanitorHi.htm" : "residence2/clanhall/AgitJanitorHi.htm", "%owner%", playerClan.getName());
      }
      else
      {
        if ((playerClan != null) && (playerClan.getCastle() > 0))
        {
          Castle castle = ResidenceHolder.getInstance().getResidence(playerClan.getCastle());
          NpcHtmlMessage html = new NpcHtmlMessage(player, this);
          html.setFile("merchant/territorystatus.htm");
          html.replace("%npcname%", getName());
          html.replace("%castlename%", HtmlUtils.htmlResidenceName(castle.getId()));
          html.replace("%taxpercent%", String.valueOf(castle.getTaxPercent()));
          html.replace("%clanname%", playerClan.getName());
          html.replace("%clanleadername%", playerClan.getLeaderName());
          player.sendPacket(html);
        }
        else
        {
          showChatWindow(player, "residence2/clanhall/noAgitInfo.htm");
View Full Code Here


  @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))
      {
        return;
      }
      showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_1.htm");
    }
    else if (command.equalsIgnoreCase("registerAsClan"))
    {
      if (!checkCond(player, false))
      {
        return;
      }
      List<CTBSiegeClanObject> siegeClans = siegeEvent.getObjects(SiegeEvent.ATTACKERS);
      CTBSiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, clan);
      if (siegeClan != null)
      {
        showFlagInfo(player, siegeClans.indexOf(siegeClan));
        return;
      }
      QuestState questState = player.getQuestState(_504_CompetitionForTheBanditStronghold.class);
      if ((questState == null) || (questState.getQuestItemsCount(5009) != 1))
      {
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_24.htm");
        return;
      }
      questState.exitCurrentQuest(true);
      register(player);
    }
    else if (command.equalsIgnoreCase("registerByOffer"))
    {
      if (!checkCond(player, false))
      {
        return;
      }
      List<CTBSiegeClanObject> siegeClans = siegeEvent.getObjects(SiegeEvent.ATTACKERS);
      CTBSiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, clan);
      if (siegeClan != null)
      {
        showFlagInfo(player, siegeClans.indexOf(siegeClan));
        return;
      }
      if (!player.consumeItem(ItemTemplate.ITEM_ID_ADENA, 200000))
      {
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_26.htm");
        return;
      }
      register(player);
    }
    else if (command.equalsIgnoreCase("viewNpc"))
    {
      CTBSiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
      if (siegeClan == null)
      {
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_7.htm");
        return;
      }
      String file;
      switch ((int) siegeClan.getParam())
      {
        case 0:
          file = "residence2/clanhall/agit_oel_mahum_messeger_10.htm";
          break;
        case 35428:
          file = "residence2/clanhall/agit_oel_mahum_messeger_11.htm";
          break;
        case 35429:
          file = "residence2/clanhall/agit_oel_mahum_messeger_12.htm";
          break;
        case 35430:
          file = "residence2/clanhall/agit_oel_mahum_messeger_13.htm";
          break;
        case 35431:
          file = "residence2/clanhall/agit_oel_mahum_messeger_14.htm";
          break;
        case 35432:
          file = "residence2/clanhall/agit_oel_mahum_messeger_15.htm";
          break;
        default:
          return;
      }
      showChatWindow(player, file);
    }
    else if (command.startsWith("formAlliance"))
    {
      CTBSiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
      if (siegeClan == null)
      {
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_7.htm");
        return;
      }
      if (siegeClan.getClan().getLeaderId() != player.getObjectId())
      {
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_10.htm");
        return;
      }
      StringTokenizer t = new StringTokenizer(command);
      t.nextToken();
      int npcId = Integer.parseInt(t.nextToken());
      siegeClan.setParam(npcId);
      SiegeClanDAO.getInstance().update(clanHall, siegeClan);
      showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_9.htm");
    }
    else if (command.equalsIgnoreCase("registerAsMember"))
    {
      CTBSiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
      if (siegeClan == null)
      {
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_7.htm");
        return;
      }
      if (siegeClan.getClan().getLeaderId() == player.getObjectId())
      {
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_5.htm");
        return;
      }
      if (siegeClan.getPlayers().contains(player.getObjectId()))
      {
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_9.htm");
      }
      else
      {
        if (siegeClan.getPlayers().size() >= 18)
        {
          showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_8.htm");
          return;
        }
        siegeClan.getPlayers().add(player.getObjectId());
        SiegePlayerDAO.getInstance().insert(clanHall, clan.getClanId(), player.getObjectId());
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_9.htm");
      }
    }
    else if (command.equalsIgnoreCase("listClans"))
    {
View Full Code Here

   * @param regMenu boolean
   * @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/_504_CompetitionForTheBanditStronghold/azit_messenger_q0504_03.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/_504_CompetitionForTheBanditStronghold/azit_messenger_q0504_05.htm");
      return false;
    }
    if ((player.getObjectId() == clan.getLeaderId()) && (clan.getLevel() < 4))
    {
      showChatWindow(player, "quests/_504_CompetitionForTheBanditStronghold/azit_messenger_q0504_04.htm");
      return false;
    }
    if (clan.getHasHideout() == clanHall.getId())
    {
      showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_22.htm");
      return false;
    }
    if (clan.getHasHideout() > 0)
    {
      showChatWindow(player, "quests/_504_CompetitionForTheBanditStronghold/azit_messenger_q0504_10.htm");
      return false;
    }
    if (siegeClans.size() >= 5)
View Full Code Here

   * Method register.
   * @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());
    List<CTBSiegeClanObject> siegeClans = siegeEvent.getObjects(SiegeEvent.ATTACKERS);
    showFlagInfo(player, siegeClans.indexOf(siegeClan));
  }
View Full Code Here

   * @param arg Object[]
   */
  @Override
  public void showChatWindow(Player player, int val, Object... arg)
  {
    Clan clan = getClanHall().getOwner();
    if (clan != null)
    {
      showChatWindow(player, "residence2/clanhall/azit_messenger001.htm", "%owner_name%", clan.getName());
    }
    else
    {
      showChatWindow(player, "residence2/clanhall/azit_messenger002.htm");
    }
View Full Code Here

      if (miniGameEvent.isRegistrationOver())
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti014.htm");
        return;
      }
      Clan clan = player.getClan();
      if ((clan == null) || (clan.getLevel() < 3) || (clan.getAllSize() <= 5))
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti011.htm");
        return;
      }
      if (clan.getLeaderId() != player.getObjectId())
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti010.htm");
        return;
      }
      if (clan.getHasHideout() > 0)
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti012.htm");
        return;
      }
      if (miniGameEvent.getSiegeClan(SiegeEvent.ATTACKERS, clan) != null)
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti013.htm");
        return;
      }
      long count = player.getInventory().getCountOf(ITEM_ID);
      if (count == 0)
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti008.htm");
      }
      else
      {
        if (!player.consumeItem(ITEM_ID, count))
        {
          return;
        }
        CMGSiegeClanObject siegeClanObject = new CMGSiegeClanObject(SiegeEvent.ATTACKERS, clan, count);
        miniGameEvent.addObject(SiegeEvent.ATTACKERS, siegeClanObject);
        SiegeClanDAO.getInstance().insert(clanHall, siegeClanObject);
        showChatWindow(player, "residence2/clanhall/messenger_yetti009.htm");
      }
    }
    else if (command.equalsIgnoreCase("cancel"))
    {
      if (miniGameEvent.isRegistrationOver())
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti017.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(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);
View Full Code Here

    if (!activeChar.isPlayer())
    {
      return;
    }
    Player player = (Player) activeChar;
    Clan clan = player.getClan();
    clan.broadcastToOtherOnlineMembers(Msg.COURT_MAGICIAN__THE_PORTAL_HAS_BEEN_CREATED, player);
    getEffects(activeChar, activeChar, getActivateRate() > 0, true);
  }
View Full Code Here

   */
  @Override
  public void showChatWindow(Player player, int val, Object... arg)
  {
    ClanHall clanHall = getClanHall();
    Clan clan = clanHall.getOwner();
    NpcHtmlMessage msg = new NpcHtmlMessage(player, this);
    if (clan != null)
    {
      msg.setFile("residence2/clanhall/messenger_yetti001.htm");
      msg.replace("%owner_name%", clan.getName());
    }
    else
    {
      msg.setFile("residence2/clanhall/messenger_yetti001a.htm");
    }
View Full Code Here

      {
        _title = player.getTitle();
        _title_color = player.getTitleColor();
      }

      Clan clan = player.getClan();
      Alliance alliance = clan == null ? null : clan.getAlliance();
      //
      clan_id = clan == null ? 0 : clan.getClanId();
      clan_crest_id = clan == null ? 0 : clan.getCrestId();
      large_clan_crest_id = clan == null ? 0 : clan.getCrestLargeId();
      //
      ally_id = alliance == null ? 0 : alliance.getAllyId();
      ally_crest_id = alliance == null ? 0 : alliance.getAllyCrestId();

      cw_level = 0;
View Full Code Here

    writeD(_clans.size());
    writeD(_clans.size());

    for (SiegeClanObject siegeClan : _clans)
    {
      Clan clan = siegeClan.getClan();

      writeD(clan.getClanId());
      writeS(clan.getName());
      writeS(clan.getLeaderName());
      writeD(clan.getCrestId());
      writeD((int) (siegeClan.getDate() / 1000L));

      Alliance alliance = clan.getAlliance();
      writeD(clan.getAllyId());
      if (alliance != null)
      {
        writeS(alliance.getAllyName());
        writeS(alliance.getAllyLeaderName());
        writeD(alliance.getAllyCrestId());
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.pledge.Clan

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.