Package com.l2jfrozen.gameserver.model.L2Clan

Examples of com.l2jfrozen.gameserver.model.L2Clan.SubPledge


      player.sendPacket(new SystemMessage(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT));
      return;
    }
   
    final L2Clan clan = player.getClan();
    final SubPledge subPledge = player.getClan().getSubPledge(pledgeType);
   
    if (subPledge == null)
    {
      player.sendMessage("Pledge don't exists.");
      return;
    }
    if (!Util.isAlphaNumeric(pledgeName) || 2 > pledgeName.length())
    {
      player.sendPacket(new SystemMessage(SystemMessageId.CLAN_NAME_INCORRECT));
      return;
    }
    if (pledgeName.length() > 16)
    {
      player.sendPacket(new SystemMessage(SystemMessageId.CLAN_NAME_TOO_LONG));
      return;
    }
   
    subPledge.setName(pledgeName);
    clan.updateSubPledgeInDB(subPledge.getId());
    clan.broadcastClanStatus();
    player.sendMessage("Pledge name changed.");
  }
View Full Code Here


      player.sendPacket(new SystemMessage(SystemMessageId.CAPTAIN_OF_ROYAL_GUARD_CANNOT_BE_APPOINTED));
      return;
    }

    L2Clan clan = player.getClan();
    SubPledge subPledge = player.getClan().getSubPledge(clanName);
    if(null == subPledge)
    {
      player.sendPacket(new SystemMessage(SystemMessageId.CLAN_NAME_INCORRECT));
      return;
    }

    if(subPledge.getId() == L2Clan.SUBUNIT_ACADEMY)
    {
      player.sendPacket(new SystemMessage(SystemMessageId.CLAN_NAME_INCORRECT));
      return;
    }

    if(clan.getClanMember(leaderName) == null || clan.getClanMember(leaderName).getPledgeType() != 0)
    {
      if(subPledge.getId() >= L2Clan.SUBUNIT_KNIGHT1)
      {
        player.sendPacket(new SystemMessage(SystemMessageId.CAPTAIN_OF_ORDER_OF_KNIGHTS_CANNOT_BE_APPOINTED));
      }
      else if(subPledge.getId() >= L2Clan.SUBUNIT_ROYAL1)
      {
        player.sendPacket(new SystemMessage(SystemMessageId.CAPTAIN_OF_ROYAL_GUARD_CANNOT_BE_APPOINTED));
      }
      return;
    }

    subPledge.setLeaderName(leaderName);
    clan.updateSubPledgeInDB(subPledge.getId());
    L2ClanMember leaderSubPledge = clan.getClanMember(leaderName);
   
    if(leaderSubPledge.getPlayerInstance()!=null){
   
      leaderSubPledge.getPlayerInstance().setPledgeClass(leaderSubPledge.calculatePledgeClass(leaderSubPledge.getPlayerInstance()));
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.L2Clan.SubPledge

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.