Package l2p.gameserver.clientpackets

Source Code of l2p.gameserver.clientpackets.RequestDismissAlly

package l2p.gameserver.clientpackets;

import l2p.gameserver.cache.Msg;
import l2p.gameserver.model.L2Alliance;
import l2p.gameserver.model.L2Clan;
import l2p.gameserver.model.L2Player;
import l2p.gameserver.tables.ClanTable;

public class RequestDismissAlly extends L2GameClientPacket
{
  @Override
  public void readImpl()
  {
  }

  @Override
  public void runImpl()
  {
    L2Player activeChar = getClient().getActiveChar();
    if(activeChar == null)
    {
      return;
    }
    L2Clan clan = activeChar.getClan();
    if(clan == null)
    {
      activeChar.sendActionFailed();
      return;
    }
    L2Alliance alliance = clan.getAlliance();
    if(alliance == null)
    {
      activeChar.sendPacket(Msg.YOU_ARE_NOT_CURRENTLY_ALLIED_WITH_ANY_CLANS);
      return;
    }
    if(!activeChar.isAllyLeader())
    {
      activeChar.sendPacket(Msg.FEATURE_AVAILABLE_TO_ALLIANCE_LEADERS_ONLY);
      return;
    }
    if(alliance.getMembersCount() > 1)
    {
      activeChar.sendPacket(Msg.YOU_HAVE_FAILED_TO_DISSOLVE_THE_ALLIANCE);
      return;
    }
    ClanTable.getInstance().dissolveAlly(activeChar);
  }
}
TOP

Related Classes of l2p.gameserver.clientpackets.RequestDismissAlly

TOP
Copyright © 2018 www.massapi.com. 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.