Package lineage2.gameserver.model.pledge

Examples of lineage2.gameserver.model.pledge.Clan$ClanReputationComparator


   * @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/_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)
    {
      showChatWindow(player, "quests/_655_AGrandPlanForTamingWildBeasts/farm_messenger_q0655_04.htm");
      return false;
    }
    if (siegeClans.size() >= 5)
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/farm_messenger001.htm", "%owner_name%", clan.getName());
    }
    else
    {
      showChatWindow(player, "residence2/clanhall/farm_messenger002.htm");
    }
View Full Code Here

 
  @Override
  public String onTalk(NpcInstance npc, QuestState st)
  {
    String htmltext = "noquest";
    Clan clan = st.getPlayer().getClan();
    if (clan == null)
    {
      st.exitCurrentQuest(true);
      htmltext = "30868-0a.htm";
    }
    else if (clan.getLeader().getPlayer() != st.getPlayer())
    {
      st.exitCurrentQuest(true);
      htmltext = "30868-0a.htm";
    }
    else if (clan.getLevel() < 5)
    {
      st.exitCurrentQuest(true);
      htmltext = "30868-0b.htm";
    }
    else
    {
      int cond = st.getCond();
      int raid = st.getInt("raid");
      int id = st.getState();
      if ((id == CREATED) && (cond == 0))
      {
        htmltext = "30868-0c.htm";
      }
      else if ((id == STARTED) && (cond == 1))
      {
        int item = REWARDS_LIST[raid][1];
        long count = st.getQuestItemsCount(item);
        if (count == 0)
        {
          htmltext = "30868-" + raid + "a.htm";
        }
        else if (count == 1)
        {
          htmltext = "30868-" + raid + "b.htm";
          int increasedPoints = clan.incReputation(REWARDS_LIST[raid][2], true, "_508_TheClansReputation");
          st.getPlayer().sendPacket(new SystemMessage(SystemMessage.YOU_HAVE_SUCCESSFULLY_COMPLETED_A_CLAN_QUEST_S1_POINTS_HAVE_BEEN_ADDED_TO_YOUR_CLAN_REPUTATION_SCORE).addNumber(increasedPoints));
          st.takeItems(item, 1);
        }
      }
    }
View Full Code Here

    Castle castle = ResidenceHolder.getInstance().getResidenceByObject(Castle.class, player);
    if (castle == null)
    {
      return false;
    }
    Clan clan = player.getClan();
    if (clan == null)
    {
      return false;
    }
    if (clan.getClanId() != castle.getOwnerId())
    {
      return false;
    }
    return true;
  }
View Full Code Here

   * @param clan Clan
   */
  @Override
  public void changeOwner(Clan clan)
  {
    Clan oldOwner = getOwner();
    if ((oldOwner != null) && ((clan == null) || (clan.getClanId() != oldOwner.getClanId())))
    {
      removeSkills();
      oldOwner.setHasHideout(0);
      cancelCycleTask();
    }
    updateOwnerInDB(clan);
    rewardSkills();
    update();
View Full Code Here

      Player player = (Player) cha;
      put(RestartType.FIXED, player.getPlayerAccess().ResurectFixed || (player.getInventory().getCountOf(10649) > 0 || player.getInventory().getCountOf(13300) > 0) && !player.isOnSiegeField());
      put(RestartType.AGATHION, player.isAgathionResAvailable());
      put(RestartType.TO_VILLAGE, true);

      Clan clan = null;
      if (get(RestartType.TO_VILLAGE))
        clan = player.getClan();
      if (clan != null)
      {
        put(RestartType.TO_CLANHALL, clan.getHasHideout() > 0);
        put(RestartType.TO_CASTLE, clan.getCastle() > 0);
        put(RestartType.TO_FORTRESS, clan.getHasFortress() > 0);
      }

      for (GlobalEvent e : cha.getEvents())
        e.checkRestartLocs(player, _types);
    }
View Full Code Here

  public String onTalk(NpcInstance npc, QuestState st)
  {
    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)
    {
      htmltext = "azit_messenger_q0504_10.htm";
    }
    else
    {
View Full Code Here

   */
  @Override
  protected int getCond(Player player)
  {
    Residence residence = getResidence();
    Clan residenceOwner = residence.getOwner();
    if ((residenceOwner != null) && (player.getClan() == residenceOwner))
    {
      if (residence.getSiegeEvent().isInProgress())
      {
        return COND_SIEGE;
View Full Code Here

    Residence residence = getFortress();
    if (residence == null)
    {
      throw new IllegalArgumentException("Not find fortress: " + getNpcId() + "; loc: " + getLoc());
    }
    Clan residenceOwner = residence.getOwner();
    if ((residenceOwner != null) && (player.getClan() == residenceOwner) && (residenceOwner.getLeaderId() == player.getObjectId()))
    {
      return COND_LEADER;
    }
    return COND_FAIL;
  }
View Full Code Here

   */
  @Override
  protected int getCond(Player player)
  {
    Residence residence = getResidence();
    Clan residenceOwner = residence.getOwner();
    if ((residenceOwner != null) && (player.getClan() == residenceOwner))
    {
      return COND_OWNER;
    }
    return COND_FAIL;
View Full Code Here

TOP

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

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.