Package l2p.gameserver.model

Examples of l2p.gameserver.model.L2Alliance


    if(!player.getClan().canCreateAlly())
    {
      player.sendPacket(Msg.YOU_CANNOT_CREATE_A_NEW_ALLIANCE_WITHIN_1_DAY_AFTER_DISSOLUTION);
      return;
    }
    L2Alliance alliance = ClanTable.getInstance().createAlliance(player, allyName);
    if(alliance == null)
    {
      return;
    }
    player.broadcastUserInfo(true);
View Full Code Here


      {
        String clanName = rs.getString("clan_name");
        String allyName = "Нет альянса";
        String rep = Integer.toString(rs.getInt("reputation_score"));
        String level = Integer.toString(rs.getInt("clan_level"));
        L2Alliance a = ClanTable.getInstance().getAlliance(rs.getInt("ally_id"));
        if(a != null)
        {
          allyName = a.getAllyName();
        }
        sb.append("<tr>");
        sb.append("<td width=250>").append(clanName).append("</td>");
        sb.append("<td width=250>").append(allyName).append("</td>");
        sb.append("<td width=120>").append(rep).append("</td>");
View Full Code Here

    if(leaderClan == null)
    {
      activeChar.sendActionFailed();
      return;
    }
    L2Alliance alliance = leaderClan.getAlliance();
    if(alliance == null)
    {
      activeChar.sendPacket(Msg.YOU_ARE_NOT_CURRENTLY_ALLIED_WITH_ANY_CLANS);
      return;
    }
    L2Clan clan;
    if(!activeChar.isAllyLeader())
    {
      activeChar.sendPacket(Msg.FEATURE_AVAILABLE_TO_ALLIANCE_LEADERS_ONLY);
      return;
    }
    if(_clanName == null)
    {
      return;
    }
    clan = ClanTable.getInstance().getClanByName(_clanName);
    if(clan != null)
    {
      if(!alliance.isMember(clan.getClanId()))
      {
        activeChar.sendActionFailed();
        return;
      }
      if(alliance.getLeader().equals(clan))
      {
        activeChar.sendPacket(Msg.YOU_HAVE_FAILED_TO_WITHDRAW_FROM_THE_ALLIANCE);
        return;
      }
      clan.broadcastToOnlineMembers(new SystemMessage("Your clan has been expelled from " + alliance.getAllyName() + " alliance."), new SystemMessage(SystemMessage.A_CLAN_THAT_HAS_WITHDRAWN_OR_BEEN_EXPELLED_CANNOT_ENTER_INTO_AN_ALLIANCE_WITHIN_ONE_DAY_OF_WITHDRAWAL_OR_EXPULSION));
      clan.setAllyId(0);
      clan.setLeavedAlly();
      alliance.broadcastAllyStatus(true);
      alliance.removeAllyMember(clan.getClanId());
      alliance.setExpelledMember();
      activeChar.sendMessage(new CustomMessage("l2p.gameserver.clientpackets.RequestOustAlly.ClanDismissed", activeChar).addString(clan.getName()).addString(alliance.getAllyName()));
    }
  }
View Full Code Here

    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);
View Full Code Here

    {
      activeChar.sendPacket(Msg.ALLIANCE_LEADERS_CANNOT_WITHDRAW);
      return;
    }
    clan.broadcastToOnlineMembers(Msg.YOU_HAVE_WITHDRAWN_FROM_THE_ALLIANCE, Msg.A_CLAN_THAT_HAS_WITHDRAWN_OR_BEEN_EXPELLED_CANNOT_ENTER_INTO_AN_ALLIANCE_WITHIN_ONE_DAY_OF_WITHDRAWAL_OR_EXPULSION);
    L2Alliance alliance = clan.getAlliance();
    clan.setAllyId(0);
    clan.setLeavedAlly();
    alliance.broadcastAllyStatus(true);
    alliance.removeAllyMember(clan.getClanId());
  }
View Full Code Here

    L2Player activeChar = getClient().getActiveChar();
    if(activeChar == null)
    {
      return;
    }
    L2Alliance ally = activeChar.getAlliance();
    if(ally != null && activeChar.isAllyLeader())
    {
      if(ally.hasAllyCrest())
      {
        CrestCache.removeAllyCrest(ally);
      }
      if(_data.length != 0)
      {
        CrestCache.saveAllyCrest(ally, _data);
      }
      ally.broadcastAllyStatus(false);
    }
  }
View Full Code Here

      {
        _ownerName = owner.getName();
        _leaderName = owner.getLeaderName();
        if(owner.getAllyId() != 0)
        {
          L2Alliance alliance = ClanTable.getInstance().getAlliance(owner.getAllyId());
          _allyId = alliance.getAllyId();
          _allyNname = alliance.getAllyName();
        }
      }
      else
      {
        _log.warning("Null owner for unit: " + unit.getName());
View Full Code Here

    L2Player _cha = getClient().getActiveChar();
    if(_cha == null)
    {
      return;
    }
    L2Alliance ally = _cha.getAlliance();
    if(ally == null)
    {
      return;
    }
    int clancount;
View Full Code Here

    {
      DatabaseUtils.closeDatabaseCSR(con, statement, result);
    }
    for(int allyId : allyIds)
    {
      L2Alliance ally = new L2Alliance(allyId);
      if(ally.getMembersCount() <= 0)
      {
        _log.warning("membersCount = 0 for allyId: " + allyId);
        continue;
      }
      if(ally.getLeader() == null)
      {
        _log.warning("Not found leader for allyId: " + allyId);
        continue;
      }
      _alliances.put(ally.getAllyId(), ally);
    }
  }
View Full Code Here

    }
  }

  public L2Alliance createAlliance(L2Player player, String allyName)
  {
    L2Alliance alliance = null;
    if(getAllyByName(allyName) == null)
    {
      L2Clan leader = player.getClan();
      alliance = new L2Alliance(IdFactory.getInstance().getNextId(), allyName, leader);
      alliance.store();
      _alliances.put(alliance.getAllyId(), alliance);
      player.getClan().setAllyId(alliance.getAllyId());
      for(L2Player temp : player.getClan().getOnlineMembers(0))
      {
        temp.broadcastUserInfo(true);
      }
    }
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.L2Alliance

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.