Package l2p.gameserver.model

Examples of l2p.gameserver.model.L2ClanMember


    L2Clan clan = activeChar.getClan();
    if(clan == null)
    {
      return;
    }
    L2ClanMember member = clan.getClanMember(activeChar.getObjectId());
    if(member == null)
    {
      activeChar.sendActionFailed();
      return;
    }
    if(member.isClanLeader())
    {
      activeChar.sendMessage("A clan leader may not be dismissed.");
      return;
    }
    // this also updated the database
View Full Code Here


    {
      activeChar.sendMessage(new CustomMessage("l2p.gameserver.clientpackets.RequestPledgeReorganizeMember.ChangeAffiliations", activeChar));
      activeChar.sendActionFailed();
      return;
    }
    L2ClanMember subject = clan.getClanMember(_subjectName);
    if(subject == null)
    {
      activeChar.sendMessage(new CustomMessage("l2p.gameserver.clientpackets.RequestPledgeReorganizeMember.NotInYourClan", activeChar));
      activeChar.sendActionFailed();
      return;
    }
    if(subject.getPledgeType() == _targetUnit)
    {
      activeChar.sendMessage(new CustomMessage("l2p.gameserver.clientpackets.RequestPledgeReorganizeMember.AlreadyInThatCombatUnit", activeChar));
      activeChar.sendActionFailed();
      return;
    }
    if(_targetUnit != 0 && clan.getSubPledge(_targetUnit) == null)
    {
      activeChar.sendMessage(new CustomMessage("l2p.gameserver.clientpackets.RequestPledgeReorganizeMember.NoSuchCombatUnit", activeChar));
      activeChar.sendActionFailed();
      return;
    }
    if(clan.isAcademy(_targetUnit))
    {
      activeChar.sendMessage(new CustomMessage("l2p.gameserver.clientpackets.RequestPledgeReorganizeMember.AcademyViaInvitation", activeChar));
      activeChar.sendActionFailed();
      return;
    }
    /*
     * unsure for next check, but anyway as workaround before academy refactoring
     * (needs LvlJoinedAcademy to be put on L2ClanMember if so, to be able relocate from academy correctly)
     */
    if(clan.isAcademy(subject.getPledgeType()))
    {
      activeChar.sendMessage(new CustomMessage("l2p.gameserver.clientpackets.RequestPledgeReorganizeMember.CantMoveAcademyMember", activeChar));
      activeChar.sendActionFailed();
      return;
    }
    L2ClanMember replacement = null;
    if(_replace > 0)
    {
      replacement = clan.getClanMember(_replaceName);
      if(replacement == null)
      {
        activeChar.sendMessage(new CustomMessage("l2p.gameserver.clientpackets.RequestPledgeReorganizeMember.CharacterNotBelongClan", activeChar));
        activeChar.sendActionFailed();
        return;
      }
      if(replacement.getPledgeType() != _targetUnit)
      {
        activeChar.sendMessage(new CustomMessage("l2p.gameserver.clientpackets.RequestPledgeReorganizeMember.CharacterNotBelongCombatUnit", activeChar));
        activeChar.sendActionFailed();
        return;
      }
      if(replacement.isSubLeader() != 0)
      {
        activeChar.sendMessage(new CustomMessage("l2p.gameserver.clientpackets.RequestPledgeReorganizeMember.CharacterLeaderAnotherCombatUnit", activeChar));
        activeChar.sendActionFailed();
        return;
      }
    }
    else
    {
      if(clan.getSubPledgeMembersCount(_targetUnit) >= clan.getSubPledgeLimit(_targetUnit))
      {
        if(_targetUnit == 0)
        {
          activeChar.sendPacket(new SystemMessage(SystemMessage.S1_IS_FULL_AND_CANNOT_ACCEPT_ADDITIONAL_CLAN_MEMBERS_AT_THIS_TIME).addString(clan.getName()));
        }
        else
        {
          activeChar.sendPacket(Msg.THE_ACADEMY_ROYAL_GUARD_ORDER_OF_KNIGHTS_IS_FULL_AND_CANNOT_ACCEPT_NEW_MEMBERS_AT_THIS_TIME);
        }
        activeChar.sendActionFailed();
        return;
      }
      if(subject.isSubLeader() != 0)
      {
        activeChar.sendMessage(new CustomMessage("l2p.gameserver.clientpackets.RequestPledgeReorganizeMember.MemberLeaderAnotherUnit", activeChar));
        activeChar.sendActionFailed();
        return;
      }
    }
    if(replacement != null)
    {
      replacement.setPledgeType(subject.getPledgeType());
      if(replacement.getPowerGrade() > 5)
      {
        replacement.setPowerGrade(clan.getAffiliationRank(replacement.getPledgeType()));
      }
      clan.broadcastToOnlineMembers(new PledgeShowMemberListUpdate(replacement));
      if(replacement.isOnline())
      {
        replacement.getPlayer().updatePledgeClass();
        replacement.getPlayer().broadcastUserInfo(true);
      }
    }
    subject.setPledgeType(_targetUnit);
    if(subject.getPowerGrade() > 5)
    {
View Full Code Here

      return;
    }
    L2Clan clan = activeChar.getClan();
    if(clan != null)
    {
      L2ClanMember cm = clan.getClanMember(_target);
      if(cm != null)
      {
        activeChar.sendPacket(new PledgeReceiveMemberInfo(cm));
      }
    }
View Full Code Here

    {
      return;
    }
    if((activeChar.getClanPrivileges() & L2Clan.CP_CL_MANAGE_RANKS) == L2Clan.CP_CL_MANAGE_RANKS)
    {
      L2ClanMember member = activeChar.getClan().getClanMember(_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);
        }
        if(member.isOnline())
        {
          member.getPlayer().sendUserInfo(false);
        }
      }
      else
      {
        activeChar.sendMessage(new CustomMessage("l2p.gameserver.clientpackets.RequestPledgeSetMemberPowerGrade.NotBelongClan", activeChar));
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.L2ClanMember

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.