Package lineage2.gameserver.model.pledge

Examples of lineage2.gameserver.model.pledge.Clan


  {
    if (charId <= 0)
    {
      return null;
    }
    Clan charClan = getClanByCharId(charId);
    return charClan == null ? null : charClan.getAlliance();
  }
View Full Code Here


   * @return Map.Entry<Clan,Alliance>
   */
  public Map.Entry<Clan, Alliance> getClanAndAllianceByCharId(int charId)
  {
    Player player = GameObjectsStorage.getPlayer(charId);
    Clan charClan = player != null ? player.getClan() : getClanByCharId(charId);
    return new SimpleEntry<>(charClan, charClan == null ? null : charClan.getAlliance());
  }
View Full Code Here

    {
      DbUtils.closeQuietly(con, statement, result);
    }
    for (int clanId : clanIds)
    {
      Clan clan = Clan.restore(clanId);
      if (clan == null)
      {
        _log.warn("Error while restoring clanId: " + clanId);
        continue;
      }
      if (clan.getAllSize() <= 0)
      {
        _log.warn("membersCount = 0 for clanId: " + clanId);
        continue;
      }
      if (clan.getLeader() == null)
      {
        _log.warn("Not found leader for clanId: " + clanId);
        continue;
      }
      _clans.put(clan.getClanId(), clan);
    }
  }
View Full Code Here

  {
    if (getClanByName(clanName) == null)
    {
      UnitMember leader = new UnitMember(player);
      leader.setLeaderOf(Clan.SUBUNIT_MAIN_CLAN);
      Clan clan = new Clan(IdFactory.getInstance().getNextId());
      SubUnit unit = new SubUnit(clan, Clan.SUBUNIT_MAIN_CLAN, leader, clanName);
      unit.addUnitMember(leader);
      clan.addSubUnit(unit, false);
      clan.store();
      player.setPledgeType(Clan.SUBUNIT_MAIN_CLAN);
      player.setClan(clan);
      player.setPowerGrade(6);
      leader.setPlayerInstance(player, false);
      _clans.put(clan.getClanId(), clan);
      return clan;
    }
    return null;
  }
View Full Code Here

   * Method dissolveClan.
   * @param player Player
   */
  public void dissolveClan(Player player)
  {
    Clan clan = player.getClan();
    long curtime = System.currentTimeMillis();
    SiegeUtils.removeSiegeSkills(player);
    for (Player clanMember : clan.getOnlineMembers(0))
    {
      clanMember.setClan(null);
      clanMember.setTitle(null);
      clanMember.sendPacket(PledgeShowMemberListDeleteAll.STATIC, Msg.YOU_HAVE_RECENTLY_BEEN_DISMISSED_FROM_A_CLAN_YOU_ARE_NOT_ALLOWED_TO_JOIN_ANOTHER_CLAN_FOR_24_HOURS);
      clanMember.broadcastCharInfo();
      clanMember.setLeaveClanTime(curtime);
    }
    clan.flush();
    deleteClanFromDb(clan.getClanId());
    _clans.remove(clan.getClanId());
    player.sendPacket(Msg.CLAN_HAS_DISPERSED);
    player.setDeleteClanTime(curtime);
  }
View Full Code Here

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

    try
    {
      con = DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT clan1, clan2 FROM clan_wars");
      rset = statement.executeQuery();
      Clan clan1;
      Clan clan2;
      while (rset.next())
      {
        clan1 = getClan(rset.getInt("clan1"));
        clan2 = getClan(rset.getInt("clan2"));
        if ((clan1 != null) && (clan2 != null))
        {
          clan1.setEnemyClan(clan2);
          clan2.setAttackerClan(clan1);
        }
      }
    }
    catch (Exception e)
    {
View Full Code Here

    face = cha.getFace();
    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();
View Full Code Here

    Player activeChar = getClient().getActiveChar();
    if (activeChar == null)
    {
      return;
    }
    Clan clan = activeChar.getClan();
    if ((activeChar.getClanPrivileges() & Clan.CP_CL_EDIT_CREST) == Clan.CP_CL_EDIT_CREST)
    {
      if (clan.getLevel() < 3)
      {
        activeChar.sendPacket(Msg.CLAN_CREST_REGISTRATION_IS_ONLY_POSSIBLE_WHEN_CLANS_SKILL_LEVELS_ARE_ABOVE_3);
        return;
      }
      int crestId = 0;
      if (_data != null)
      {
        crestId = CrestCache.getInstance().savePledgeCrest(clan.getClanId(), _data);
      }
      else if (clan.hasCrest())
      {
        CrestCache.getInstance().removePledgeCrest(clan.getClanId());
      }
      clan.setCrestId(crestId);
      clan.broadcastClanStatus(false, true, false);
    }
  }
View Full Code Here

  public String onTalk(NpcInstance npc, QuestState st)
  {
    String htmlText = "noquest";
    int cond = st.getCond();
    Player player = st.getPlayer();
    Clan clan = player.getClan();
    ClanHall clanhall = ResidenceHolder.getInstance().getResidence(63);
    if (clanhall.getSiegeEvent().isRegistrationOver())
    {
      htmlText = null;
      showHtmlFile(player, "farm_messenger_q0655_02.htm", false, "%siege_time%", TimeUtils.toSimpleFormat(clanhall.getSiegeDate()));
    }
    else if ((clan == null) || (player.getObjectId() != clan.getLeaderId()))
    {
      htmlText = "farm_messenger_q0655_03.htm";
    }
    else if ((player.getObjectId() == clan.getLeaderId()) && (clan.getLevel() < 4))
    {
      htmlText = "farm_messenger_q0655_05.htm";
    }
    else if (clanhall.getSiegeEvent().getSiegeClan(SiegeEvent.ATTACKERS, player.getClan()) != null)
    {
      htmlText = "farm_messenger_q0655_07.htm";
    }
    else if (clan.getHasHideout() > 0)
    {
      htmlText = "farm_messenger_q0655_04.htm";
    }
    else if (cond == 0)
    {
View Full Code Here

TOP

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

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.