Package lineage2.gameserver.model.pledge

Examples of lineage2.gameserver.model.pledge.Alliance


      writeS(clan.getName());
      writeS(clan.getLeaderName());
      writeD(clan.getCrestId());
      writeD((int) (siegeClan.getDate() / 1000L));

      Alliance alliance = clan.getAlliance();
      writeD(clan.getAllyId());
      if (alliance != null)
      {
        writeS(alliance.getAllyName());
        writeS(alliance.getAllyLeaderName());
        writeD(alliance.getAllyCrestId());
      }
      else
      {
        writeS(StringUtils.EMPTY);
        writeS(StringUtils.EMPTY);
View Full Code Here


    _npcObjId = cha.getObjectId();
    _loc = cha.getLoc();
    _mAtkSpd = cha.getMAtkSpd();
    //
    Clan clan = cha.getClan();
    Alliance alliance = clan == null ? null : clan.getAlliance();
    //
    clan_id = clan == null ? 0 : clan.getClanId();
    clan_crest_id = clan == null ? 0 : clan.getCrestId();
    //
    ally_id = alliance == null ? 0 : alliance.getAllyId();
    ally_crest_id = alliance == null ? 0 : alliance.getAllyCrestId();

    _runSpd = cha.getRunSpeed();
    _walkSpd = cha.getWalkSpeed();
    karma = cha.getKarma();
    pvp_flag = cha.getPvpFlag();
View Full Code Here

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

   * @param allyName String
   * @return Alliance
   */
  public Alliance createAlliance(Player player, String allyName)
  {
    Alliance alliance = null;
    if (getAllyByName(allyName) == null)
    {
      Clan leader = player.getClan();
      alliance = new Alliance(IdFactory.getInstance().getNextId(), allyName, leader);
      alliance.store();
      _alliances.put(alliance.getAllyId(), alliance);
      player.getClan().setAllyId(alliance.getAllyId());
      for (Player temp : player.getClan().getOnlineMembers(0))
      {
        temp.broadcastCharInfo();
      }
    }
View Full Code Here

    gm_commands = cha.isGM() ? 1 : 0;
    title = cha.getTitle();
    _expPercent = Experience.getExpPercent(cha.getLevel(), cha.getExp());
    //
    Clan clan = cha.getClan();
    Alliance alliance = clan == null ? null : clan.getAlliance();
    //
    clan_id = clan == null ? 0 : clan.getClanId();
    clan_crest_id = clan == null ? 0 : clan.getCrestId();
    //
    ally_id = alliance == null ? 0 : alliance.getAllyId();
    // ally_crest_id = alliance == null ? 0 : alliance.getAllyCrestId();

    private_store = cha.isInObserverMode() ? Player.STORE_OBSERVING_GAMES : cha.getPrivateStoreType();
    DwarvenCraftLevel = Math.max(cha.getSkillLevel(1320), 0);
    pk_kills = cha.getPkKills();
View Full Code Here

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

    Player activeChar = getClient().getActiveChar();
    if (activeChar == null)
    {
      return;
    }
    Alliance ally = activeChar.getAlliance();
    if ((ally != null) && activeChar.isAllyLeader())
    {
      int crestId = 0;
      if (_data != null)
      {
        crestId = CrestCache.getInstance().saveAllyCrest(ally.getAllyId(), _data);
      }
      else if (ally.hasAllyCrest())
      {
        CrestCache.getInstance().removeAllyCrest(ally.getAllyId());
      }
      ally.setAllyCrestId(crestId);
      ally.broadcastAllyStatus();
    }
  }
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);
    Alliance alliance = clan.getAlliance();
    clan.setAllyId(0);
    clan.setLeavedAlly();
    alliance.broadcastAllyStatus();
    alliance.removeAllyMember(clan.getClanId());
  }
View Full Code Here

    if (leaderClan == null)
    {
      activeChar.sendActionFailed();
      return;
    }
    Alliance alliance = leaderClan.getAlliance();
    if (alliance == null)
    {
      activeChar.sendPacket(Msg.YOU_ARE_NOT_CURRENTLY_ALLIED_WITH_ANY_CLANS);
      return;
    }
    Clan 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();
      alliance.removeAllyMember(clan.getClanId());
      alliance.setExpelledMember();
      activeChar.sendMessage(new CustomMessage("lineage2.gameserver.clientpackets.RequestOustAlly.ClanDismissed", activeChar).addString(clan.getName()).addString(alliance.getAllyName()));
    }
  }
View Full Code Here

        if (castle.getOwnerId() == playerClan.getClanId())
        {
          player.sendPacket(SystemMsg.CASTLE_OWNING_CLANS_ARE_AUTOMATICALLY_REGISTERED_ON_THE_DEFENDING_SIDE);
          return;
        }
        Alliance alliance = playerClan.getAlliance();
        if (alliance != null)
        {
          for (Clan clan : alliance.getMembers())
          {
            if (clan.getCastle() == castle.getId())
            {
              player.sendPacket(SystemMsg.YOU_CANNOT_REGISTER_AS_AN_ATTACKER_BECAUSE_YOU_ARE_IN_AN_ALLIANCE_WITH_THE_CASTLE_OWNING_CLAN);
              return;
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.pledge.Alliance

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.