Package lineage2.gameserver.model.pledge

Examples of lineage2.gameserver.model.pledge.Clan


  {
    if ((id != COMMAND_IDS[0]) && (id != COMMAND_IDS[1]) && (id != COMMAND_IDS[2]))
    {
      return false;
    }
    Clan clan = activeChar.getClan();
    if (clan == null)
    {
      activeChar.sendPacket(Msg.NOT_JOINED_IN_ANY_CLAN);
      return false;
    }
    SystemMessage sm;
    List<Clan> data = new ArrayList<>();
    if (id == 88)
    {
      activeChar.sendPacket(Msg._ATTACK_LIST_);
      data = clan.getEnemyClans();
    }
    else if (id == 89)
    {
      activeChar.sendPacket(Msg._UNDER_ATTACK_LIST_);
      data = clan.getAttackerClans();
    }
    else
    {
      activeChar.sendPacket(Msg._WAR_LIST_);
      for (Clan c : clan.getEnemyClans())
      {
        if (clan.getAttackerClans().contains(c))
        {
          data.add(c);
        }
      }
    }
View Full Code Here


    }
    else
    {
      _name = player.getName();

      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

    }
    if ((_powerGrade < Clan.RANK_FIRST) || (_powerGrade > Clan.RANK_LAST))
    {
      return;
    }
    Clan clan = activeChar.getClan();
    if (clan == null)
    {
      return;
    }
    if ((activeChar.getClanPrivileges() & Clan.CP_CL_MANAGE_RANKS) == Clan.CP_CL_MANAGE_RANKS)
    {
      UnitMember member = activeChar.getClan().getAnyMember(_name);
      if (member != null)
      {
        if (Clan.isAcademy(member.getPledgeType()))
        {
          activeChar.sendMessage("You cannot change academy member grade.");
          return;
        }
        if (_powerGrade > 5)
        {
          member.setPowerGrade(clan.getAffiliationRank(member.getPledgeType()));
        }
        else
        {
          member.setPowerGrade(_powerGrade);
        }
View Full Code Here

    if (ally == null)
    {
      return;
    }
    int clancount = 0;
    Clan leaderclan = player.getAlliance().getLeader();
    clancount = ClanTable.getInstance().getAlliance(leaderclan.getAllyId()).getMembers().length;
    int[] online = new int[clancount + 1];
    int[] count = new int[clancount + 1];
    Clan[] clans = player.getAlliance().getMembers();
    for (int i = 0; i < clancount; i++)
    {
      online[i + 1] = clans[i].getOnlineMembers(0).size();
      count[i + 1] = clans[i].getAllSize();
      online[0] += online[i + 1];
      count[0] += count[i + 1];
    }
    List<L2GameServerPacket> packets = new ArrayList<>(7 + (5 * clancount));
    packets.add(Msg._ALLIANCE_INFORMATION_);
    packets.add(new SystemMessage(SystemMessage.ALLIANCE_NAME_S1).addString(player.getClan().getAlliance().getAllyName()));
    packets.add(new SystemMessage(SystemMessage.CONNECTION_S1_TOTAL_S2).addNumber(online[0]).addNumber(count[0]));
    packets.add(new SystemMessage(SystemMessage.ALLIANCE_LEADER_S2_OF_S1).addString(leaderclan.getName()).addString(leaderclan.getLeaderName()));
    packets.add(new SystemMessage(SystemMessage.AFFILIATED_CLANS_TOTAL_S1_CLAN_S).addNumber(clancount));
    packets.add(Msg._CLAN_INFORMATION_);
    for (int i = 0; i < clancount; i++)
    {
      packets.add(new SystemMessage(SystemMessage.CLAN_NAME_S1).addString(clans[i].getName()));
View Full Code Here

  public void stopEvent(boolean step)
  {
    spawnAction(COMBAT_FLAGS, false);
    updateParticles(false, ATTACKERS, DEFENDERS);
    broadcastTo(new SystemMessage2(SystemMsg.THE_FORTRESS_BATTLE_OF_S1_HAS_FINISHED).addResidenceName(getResidence()), ATTACKERS, DEFENDERS);
    Clan ownerClan = getResidence().getOwner();
    if (ownerClan != null)
    {
      if (_oldOwner != ownerClan)
      {
        ownerClan.broadcastToOnlineMembers(PlaySound.SIEGE_VICTORY);
        ownerClan.incReputation(1700, false, toString());
        broadcastTo(new SystemMessage2(SystemMsg.S1_IS_VICTORIOUS_IN_THE_FORTRESS_BATTLE_OF_S2).addString(ownerClan.getName()).addResidenceName(getResidence()), ATTACKERS, DEFENDERS);
        getResidence().getOwnDate().setTimeInMillis(System.currentTimeMillis());
        getResidence().startCycleTask();
        spawnEnvoy();
      }
    }
View Full Code Here

   * Method notifyClanMembers.
   * @param activeChar Player
   */
  private static void notifyClanMembers(Player activeChar)
  {
    Clan clan = activeChar.getClan();
    SubUnit subUnit = activeChar.getSubUnit();
    if ((clan == null) || (subUnit == null))
    {
      return;
    }
    UnitMember member = subUnit.getUnitMember(activeChar.getObjectId());
    if (member == null)
    {
      return;
    }
    member.setPlayerInstance(activeChar, false);
    int sponsor = activeChar.getSponsor();
    int apprentice = activeChar.getApprentice();
    L2GameServerPacket msg = new SystemMessage2(SystemMsg.CLAN_MEMBER_S1_HAS_LOGGED_INTO_GAME).addName(activeChar);
    PledgeShowMemberListUpdate memberUpdate = new PledgeShowMemberListUpdate(activeChar);
    for (Player clanMember : clan.getOnlineMembers(activeChar.getObjectId()))
    {
      clanMember.sendPacket(memberUpdate);
      if (clanMember.getObjectId() == sponsor)
      {
        clanMember.sendPacket(new SystemMessage2(SystemMsg.YOUR_APPRENTICE_C1_HAS_LOGGED_OUT).addName(activeChar));
      }
      else if (clanMember.getObjectId() == apprentice)
      {
        clanMember.sendPacket(new SystemMessage2(SystemMsg.YOUR_SPONSOR_C1_HAS_LOGGED_IN).addName(activeChar));
      }
      else
      {
        clanMember.sendPacket(msg);
      }
    }
    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

   */
  @Override
  public void stopEvent(boolean step)
  {
    removeBanishItems();
    Clan newOwner = getResidence().getOwner();
    if (newOwner != null)
    {
      if (_oldOwner != newOwner)
      {
        newOwner.broadcastToOnlineMembers(PlaySound.SIEGE_VICTORY);
        newOwner.incReputation(1700, false, toString());
      }
      broadcastTo(new SystemMessage2(SystemMsg.S1_CLAN_HAS_DEFEATED_S2).addString(newOwner.getName()).addResidenceName(getResidence()), ATTACKERS, DEFENDERS);
      broadcastTo(new SystemMessage2(SystemMsg.THE_SIEGE_OF_S1_IS_FINISHED).addResidenceName(getResidence()), ATTACKERS, DEFENDERS);
    }
    else
    {
      broadcastTo(new SystemMessage2(SystemMsg.THE_SIEGE_OF_S1_HAS_ENDED_IN_A_DRAW).addResidenceName(getResidence()), ATTACKERS);
View Full Code Here

   * @return CMGSiegeClanObject
   */
  @Override
  public CMGSiegeClanObject newSiegeClan(String type, int clanId, long param, long date)
  {
    Clan clan = ClanTable.getInstance().getClan(clanId);
    return clan == null ? null : new CMGSiegeClanObject(type, clan, param, date);
  }
View Full Code Here

  @Override
  public String onTalk(NpcInstance npc, QuestState st)
  {
    String htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>";
    Player player = st.getPlayer();
    Clan clan = player.getClan();
    if ((player.getClan() == null) || !player.isClanLeader())
    {
      st.exitCurrentQuest(true);
      htmltext = "31331-0.htm";
    }
    else if (player.getClan().getLevel() < 5)
    {
      st.exitCurrentQuest(true);
      htmltext = "31331-0.htm";
    }
    else
    {
      int cond = st.getCond();
      int id = st.getState();
      if ((id == CREATED) && (cond == 0))
      {
        htmltext = "31331-1.htm";
      }
      else if ((id == STARTED) && (cond == 1))
      {
        long count = st.getQuestItemsCount(CLAW);
        if (count == 0)
        {
          htmltext = "31331-4.htm";
        }
        else if (count >= 1)
        {
          htmltext = "31331-7.htm";
          st.takeItems(CLAW, -1);
          int pointsCount = CLAN_POINTS_REWARD * (int) count;
          if (count > 10)
          {
            pointsCount += (count % 10) * 118;
          }
          int increasedPoints = clan.incReputation(pointsCount, true, "_510_AClansReputation");
          player.sendPacket(new SystemMessage(SystemMessage.YOU_HAVE_SUCCESSFULLY_COMPLETED_A_CLAN_QUEST_S1_POINTS_HAVE_BEEN_ADDED_TO_YOUR_CLAN_REPUTATION_SCORE).addNumber(increasedPoints));
        }
      }
    }
    return htmltext;
View Full Code Here

   * @param step boolean
   */
  @Override
  public void stopEvent(boolean step)
  {
    Clan newOwner = getResidence().getOwner();
    if (newOwner != null)
    {
      if (_oldOwner != newOwner)
      {
        newOwner.broadcastToOnlineMembers(PlaySound.SIEGE_VICTORY);
        newOwner.incReputation(1700, false, toString());
      }
      broadcastTo(new SystemMessage2(SystemMsg.S1_CLAN_HAS_DEFEATED_S2).addString(newOwner.getName()).addResidenceName(getResidence()), ATTACKERS, DEFENDERS);
      broadcastTo(new SystemMessage2(SystemMsg.THE_SIEGE_OF_S1_IS_FINISHED).addResidenceName(getResidence()), ATTACKERS, DEFENDERS);
    }
    else
    {
      broadcastTo(new SystemMessage2(SystemMsg.THE_PRELIMINARY_MATCH_OF_S1_HAS_ENDED_IN_A_DRAW).addResidenceName(getResidence()), ATTACKERS);
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.