Package lineage2.gameserver.model.pledge

Examples of lineage2.gameserver.model.pledge.Clan


     * @see lineage2.gameserver.listener.actor.player.OnPlayerEnterListener#onPlayerEnter(Player)
     */
    @Override
    public void onPlayerEnter(Player player)
    {
      Clan clan = player.getClan();
      if ((clan == null) || (clan.getLevel() < 2))
      {
        return;
      }
      if (clan.getNotice() == null)
      {
        Connection con = null;
        PreparedStatement statement = null;
        ResultSet rset = null;
        String notice = "";
        int type = 0;
        try
        {
          con = DatabaseFactory.getInstance().getConnection();
          statement = con.prepareStatement("SELECT * FROM `bbs_clannotice` WHERE `clan_id` = ? and type != 2");
          statement.setInt(1, clan.getClanId());
          rset = statement.executeQuery();
          if (rset.next())
          {
            notice = rset.getString("notice");
            type = rset.getInt("type");
          }
        }
        catch (Exception e)
        {
        }
        finally
        {
          DbUtils.closeQuietly(con, statement, rset);
        }
        clan.setNotice(type == 1 ? notice.replace("\n", "<br1>\n") : "");
      }
      if (!clan.getNotice().isEmpty())
      {
        String html = HtmCache.getInstance().getNotNull(Config.BBS_HOME_DIR + "clan_popup.htm", player);
        html = html.replace("%pledge_name%", clan.getName());
        html = html.replace("%content%", clan.getNotice());
        player.sendPacket(new NpcHtmlMessage(0).setHtml(html));
      }
    }
View Full Code Here


    @Override
    public int compare(Object o1, Object o2)
    {
      if ((o1 instanceof Clan) && (o2 instanceof Clan))
      {
        Clan p1 = (Clan) o1;
        Clan p2 = (Clan) o2;
        return p1.getName().compareTo(p2.getName());
      }
      return 0;
    }
View Full Code Here

      else if (counter <= 100)
      {
        reward = 25;
      }
      Player player = GameObjectsStorage.getPlayer(playerId);
      Clan clan = null;
      if (player != null)
      {
        clan = player.getClan();
      }
      else
      {
        clan = ClanTable.getInstance().getClan(mysql.simple_get_int("clanid", "characters", "obj_Id=" + playerId));
      }
      if (clan != null)
      {
        clan.incReputation(reward, true, "RaidPoints");
      }
      counter++;
    }
    _points.clear();
    updatePointsDb();
View Full Code Here

   * @return int
   */
  protected int getCond(Player player)
  {
    Residence residence = getResidence();
    Clan residenceOwner = residence.getOwner();
    if ((residenceOwner != null) && (player.getClan() == residenceOwner))
    {
      if (residence.getSiegeEvent().isInProgress())
      {
        return COND_SIEGE;
View Full Code Here

    {
      return false;
    }
    SiegeEvent<?, ?> siegeEvent = getEvent(SiegeEvent.class);
    SiegeEvent<?, ?> siegeEvent2 = attacker.getEvent(SiegeEvent.class);
    Clan clan = player.getClan();
    if (siegeEvent == null)
    {
      return false;
    }
    if ((clan != null) && (siegeEvent == siegeEvent2) && (siegeEvent.getSiegeClan(SiegeEvent.DEFENDERS, clan) != null))
View Full Code Here

    if (killer != null)
    {
      Player player = killer.getPlayer();
      if ((siegeEvent != null) && (player != null))
      {
        Clan clan = player.getClan();
        SiegeEvent<?, ?> siegeEvent2 = killer.getEvent(SiegeEvent.class);
        if ((clan != null) && (siegeEvent == siegeEvent2) && (siegeEvent.getSiegeClan(SiegeEvent.DEFENDERS, clan) == null))
        {
          Creature topdam = getAggroList().getTopDamager();
          if (topdam == null)
View Full Code Here

   * @param type AcquireType
   * @return boolean
   */
  public boolean isSkillPossible(Player player, Skill skill, AcquireType type)
  {
    Clan clan = null;
    GArray<SkillLearn> skills = new GArray<SkillLearn>();
    switch (type)
    {
      case NORMAL:
        skills.addAll(_normalSkillTree.get(player.getActiveClassId()));
View Full Code Here

   * @return int
   */
  protected int getCond(Player player)
  {
    Residence residence = getResidence();
    Clan residenceOwner = residence.getOwner();
    if ((residenceOwner != null) && (player.getClan() == residenceOwner) && ((player.getClanPrivileges() & getOpenPriv()) == getOpenPriv()))
    {
      if (residence.getSiegeEvent().isInProgress())
      {
        return COND_SIEGE;
View Full Code Here

 
  @Override
  public String onTalk(NpcInstance npc, QuestState st)
  {
    String htmltext = "noquest";
    Clan clan = st.getPlayer().getClan();
    if (clan == null)
    {
      st.exitCurrentQuest(true);
      htmltext = "31331-0a.htm";
    }
    else if (clan.getLeader().getPlayer() != st.getPlayer())
    {
      st.exitCurrentQuest(true);
      htmltext = "31331-0a.htm";
    }
    else if (clan.getLevel() < 6)
    {
      st.exitCurrentQuest(true);
      htmltext = "31331-0b.htm";
    }
    else
    {
      int cond = st.getCond();
      int raid = st.getInt("raid");
      int id = st.getState();
      if ((id == CREATED) && (cond == 0))
      {
        htmltext = "31331-0c.htm";
      }
      else if ((id == STARTED) && (cond == 1))
      {
        int item = REWARDS_LIST[raid][1];
        long count = st.getQuestItemsCount(item);
        if (count == 0)
        {
          htmltext = "31331-" + raid + "a.htm";
        }
        else if (count == 1)
        {
          htmltext = "31331-" + raid + "b.htm";
          int increasedPoints = clan.incReputation(REWARDS_LIST[raid][2], true, "_509_TheClansPrestige");
          st.getPlayer().sendPacket(new SystemMessage(SystemMessage.YOU_HAVE_SUCCESSFULLY_COMPLETED_A_CLAN_QUEST_S1_POINTS_HAVE_BEEN_ADDED_TO_YOUR_CLAN_REPUTATION_SCORE).addNumber(increasedPoints));
          st.takeItems(item, 1);
        }
      }
    }
View Full Code Here

 
  @Override
  public String onKill(NpcInstance npc, QuestState st)
  {
    QuestState id = null;
    Clan clan = st.getPlayer().getClan();
    if (clan == null)
    {
      return null;
    }
    Player clan_leader = clan.getLeader().getPlayer();
    if (clan_leader == null)
    {
      return null;
    }
    if (clan_leader.equals(st.getPlayer()) || (clan_leader.getDistance(npc) <= 1600))
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.