Package lineage2.gameserver.model.pledge

Examples of lineage2.gameserver.model.pledge.Clan


      Player activeChar = getClient().getActiveChar();
      if (activeChar == null)
      {
        return;
      }
      Clan clan = activeChar.getClan();
      if (clan == null)
      {
        return;
      }
      if ((activeChar.getClanPrivileges() & Clan.CP_CL_EDIT_CREST) == Clan.CP_CL_EDIT_CREST)
      {
        if ((clan.getCastle() == 0) && (clan.getHasHideout() == 0))
        {
          activeChar.sendPacket(Msg.THE_CLANS_EMBLEM_WAS_SUCCESSFULLY_REGISTERED__ONLY_A_CLAN_THAT_OWNS_A_CLAN_HALL_OR_A_CASTLE_CAN_GET_THEIR_EMBLEM_DISPLAYED_ON_CLAN_RELATED_ITEMS);
          return;
        }
        int crestId = 0;
        crestId = CrestCache.getInstance().savePledgeCrestLarge(clan.getClanId(), CrestCache.getInstance().crestLargeTmp);
        activeChar.sendPacket(Msg.THE_CLANS_EMBLEM_WAS_SUCCESSFULLY_REGISTERED__ONLY_A_CLAN_THAT_OWNS_A_CLAN_HALL_OR_A_CASTLE_CAN_GET_THEIR_EMBLEM_DISPLAYED_ON_CLAN_RELATED_ITEMS);
        clan.setCrestLargeId(crestId);
        clan.broadcastClanStatus(false, true, false);
      }
    }
    else if (_request == 0 && _data == null)
    {
      Player activeChar = getClient().getActiveChar();
      if (activeChar == null)
      {
        return;
      }
      Clan clan = activeChar.getClan();
      if (clan == null)
      {
        return;
      }
      if ((activeChar.getClanPrivileges() & Clan.CP_CL_EDIT_CREST) == Clan.CP_CL_EDIT_CREST)
      {
        if ((clan.getCastle() == 0) && (clan.getHasHideout() == 0))
        {
          activeChar.sendPacket(Msg.THE_CLANS_EMBLEM_WAS_SUCCESSFULLY_REGISTERED__ONLY_A_CLAN_THAT_OWNS_A_CLAN_HALL_OR_A_CASTLE_CAN_GET_THEIR_EMBLEM_DISPLAYED_ON_CLAN_RELATED_ITEMS);
          return;
        }
        int crestId = 0;
        if (clan.hasCrestLarge())
        {
          CrestCache.getInstance().removePledgeCrestLarge(clan.getClanId());
          activeChar.sendMessage("Large Crest Deleted.");
        }
        clan.setCrestLargeId(crestId);
        clan.broadcastClanStatus(false, true, false);
      }
    }
  }
View Full Code Here


    Fortress fort = ResidenceHolder.getInstance().getResidenceByObject(Fortress.class, player);
    if (fort == null)
    {
      return false;
    }
    Clan clan = player.getClan();
    if (clan == null)
    {
      return false;
    }
    if (clan.getClanId() != fort.getOwnerId())
    {
      return false;
    }
    if (fort.getContractState() != 1)
    {
View Full Code Here

    if (activeChar.isInCombat())
    {
      activeChar.sendPacket(Msg.ONE_CANNOT_LEAVE_ONES_CLAN_DURING_COMBAT);
      return;
    }
    Clan clan = activeChar.getClan();
    if (clan == null)
    {
      return;
    }
    UnitMember member = clan.getAnyMember(activeChar.getObjectId());
    if (member == null)
    {
      activeChar.sendActionFailed();
      return;
    }
    if (member.isClanLeader())
    {
      activeChar.sendMessage("A clan leader may not be dismissed.");
      return;
    }
    int subUnitType = activeChar.getPledgeType();
    clan.removeClanMember(subUnitType, activeChar.getObjectId());
    clan.broadcastToOnlineMembers(new SystemMessage2(SystemMsg.S1_HAS_WITHDRAWN_FROM_THE_CLAN).addString(activeChar.getName()), new PledgeShowMemberListDelete(activeChar.getName()));
    if (subUnitType == Clan.SUBUNIT_ACADEMY)
    {
      activeChar.setLvlJoinedAcademy(0);
    }
    activeChar.setClan(null);
View Full Code Here

    Player player = st.getPlayer();
    if (player == null)
    {
      return null;
    }
    Clan clan = player.getClan();
    if (clan == null)
    {
      return null;
    }
    return clan.getLeader().getPlayer();
  }
View Full Code Here

    }
    catch (Exception e)
    {
      return -1;
    }
    Clan clan = st.getPlayer().getClan();
    if (clan == null)
    {
      return -1;
    }
    int leaderId = clan.getLeaderId();
    ResultSet rs = null;
    try (
        Connection con = DatabaseFactory.getInstance().getConnection();
        PreparedStatement offline = con.prepareStatement("SELECT value FROM character_quests WHERE char_id=? AND var=? AND name=?");
    )
View Full Code Here

    }
  }
 
  public void setLeaderVar(QuestState st, String var, String value)
  {
    Clan clan = st.getPlayer().getClan();
    if (clan == null)
    {
      return;
    }
    Player leader = clan.getLeader().getPlayer();
    if (leader != null)
    {
      if ("cond".equalsIgnoreCase(var))
      {
        leader.getQuestState(getName()).setCond(Integer.parseInt(value));
View Full Code Here

    currentColRadius = cha.getColRadius();
    _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();
View Full Code Here

    Player activeChar = getClient().getActiveChar();
    if (activeChar == null)
    {
      return;
    }
    Clan clan = activeChar.getClan();
    if (clan != null)
    {
      UnitMember cm = clan.getAnyMember(_target);
      if (cm != null)
      {
        activeChar.sendPacket(new PledgeReceiveMemberInfo(cm));
      }
    }
View Full Code Here

   * @return Location
   */
  public static Location defaultLoc(RestartType restartType, Player activeChar)
  {
    Location loc = null;
    Clan clan = activeChar.getClan();
    switch (restartType)
    {
      case TO_CLANHALL:
        if ((clan != null) && (clan.getHasHideout() != 0))
        {
          ClanHall clanHall = activeChar.getClanHall();
          loc = TeleportUtils.getRestartLocation(activeChar, RestartType.TO_CLANHALL);
          if (clanHall.getFunction(ResidenceFunction.RESTORE_EXP) != null)
          {
            activeChar.restoreExp(clanHall.getFunction(ResidenceFunction.RESTORE_EXP).getLevel());
          }
        }
        break;
      case TO_CASTLE:
        if ((clan != null) && (clan.getCastle() != 0))
        {
          Castle castle = activeChar.getCastle();
          loc = TeleportUtils.getRestartLocation(activeChar, RestartType.TO_CASTLE);
          if (castle.getFunction(ResidenceFunction.RESTORE_EXP) != null)
          {
            activeChar.restoreExp(castle.getFunction(ResidenceFunction.RESTORE_EXP).getLevel());
          }
        }
        break;
      case TO_FORTRESS:
        if ((clan != null) && (clan.getHasFortress() != 0))
        {
          Fortress fort = activeChar.getFortress();
          loc = TeleportUtils.getRestartLocation(activeChar, RestartType.TO_FORTRESS);
          if (fort.getFunction(ResidenceFunction.RESTORE_EXP) != null)
          {
View Full Code Here

   * @param clanId int
   * @return String
   */
  public String getClanName(int clanId)
  {
    Clan c = getClan(clanId);
    return c != null ? c.getName() : StringUtils.EMPTY;
  }
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.