Package com.l2jfrozen.gameserver.model

Examples of com.l2jfrozen.gameserver.model.L2Clan


    L2PcInstance activeChar = getClient().getActiveChar();
    if(activeChar == null)
      return;

    //do we need powers to do that??
    L2Clan clan = activeChar.getClan();
    if(clan == null)
      return;

    L2ClanMember member = clan.getClanMember(_memberName);
    if(member == null)
      return;

    member.setPledgeType(_newPledgeType);
    clan.broadcastToOnlineMembers(new PledgeShowMemberListUpdate(member));
  }
View Full Code Here


    //System.out.println("C5: RequestPledgeMemberInfo S:"+_player);
    L2PcInstance activeChar = getClient().getActiveChar();
    if(activeChar == null)
      return;
    //do we need powers to do that??
    L2Clan clan = activeChar.getClan();
    if(clan == null)
      return;
    L2ClanMember member = clan.getClanMember(_player);
    if(member == null)
      return;
    activeChar.sendPacket(new PledgeReceiveMemberInfo(member));
  }
View Full Code Here

      activeChar.sendMessage("You do not meet the required condition to equip that item.");
      activeChar.sendMessage("You are unable to equip this item when your PK count is greater than or equal to one.");
      return;
    }
   
    L2Clan cl = activeChar.getClan();
    // A shield that can only be used by the members of a clan that owns a castle.
    if ((cl == null || cl.getHasCastle() == 0) && itemId == 7015 && Config.CASTLE_SHIELD)
    {
      activeChar.sendMessage("You can't equip that");
      return;
    }
   
    // A shield that can only be used by the members of a clan that owns a clan hall.
    if ((cl == null || cl.getHasHideout() == 0) && itemId == 6902 && Config.CLANHALL_SHIELD)
    {
      activeChar.sendMessage("You can't equip that");
      return;
    }
   
    // Apella armor used by clan members may be worn by a Baron or a higher level Aristocrat.
    if (itemId >= 7860 && itemId <= 7879 && Config.APELLA_ARMORS && (cl == null || activeChar.getPledgeClass() < 5))
    {
      activeChar.sendMessage("You can't equip that");
      return;
    }
   
    // Clan Oath armor used by all clan members
    if (itemId >= 7850 && itemId <= 7859 && Config.OATH_ARMORS && cl == null)
    {
      activeChar.sendMessage("You can't equip that");
      return;
    }
   
    // The Lord's Crown used by castle lords only
    if (itemId == 6841 && Config.CASTLE_CROWN && (cl == null || cl.getHasCastle() == 0 || !activeChar.isClanLeader()))
    {
      activeChar.sendMessage("You can't equip that");
      return;
    }
   
    // Scroll of resurrection like L2OFF if you are casting you can't use them
    if ((itemId == 737 || itemId == 3936 || itemId == 3959 || itemId == 6387) && activeChar.isCastingNow())
      return;
   
    // Castle circlets used by the members of a clan that owns a castle, academy members are excluded.
    if (Config.CASTLE_CIRCLETS && (itemId >= 6834 && itemId <= 6840 || itemId == 8182 || itemId == 8183))
    {
      if (cl == null)
      {
        activeChar.sendMessage("You can't equip that");
        return;
      }
     
      int circletId = CastleManager.getInstance().getCircletByCastleId(cl.getHasCastle());
      if (activeChar.getPledgeType() == -1 || circletId != itemId)
      {
        activeChar.sendMessage("You can't equip that");
        return;
      }
View Full Code Here

  @Override
  protected void runImpl()
  {
    L2PcInstance activeChar = getClient().getActiveChar();
    L2Clan clan = activeChar.getClan();

    if(clan == null)
      return;

    if((activeChar.getClanPrivileges() & L2Clan.CP_CL_MASTER_RIGHTS) != L2Clan.CP_CL_MASTER_RIGHTS)
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.YOU_DO_NOT_HAVE_THE_RIGHT_TO_DISMISS_AN_APPRENTICE));
      return;
    }

    L2ClanMember currentMember = clan.getClanMember(_currPlayerName);
    L2ClanMember targetMember = clan.getClanMember(_targetPlayerName);

    if(currentMember == null || targetMember == null)
      return;

    L2ClanMember apprenticeMember, sponsorMember;
View Full Code Here

  {
    L2PcInstance activeChar = getClient().getActiveChar();
    if(activeChar == null)
      return;

    L2Clan clan = activeChar.getClan();
    if(clan == null)
      return;

    L2ClanMember member = clan.getClanMember(_member);
    if(member == null)
      return;

    if(member.getPledgeType() == L2Clan.SUBUNIT_ACADEMY)
    {
      // also checked from client side
      activeChar.sendMessage("You cannot change academy member grade");
      return;
    }

    member.setPowerGrade(_powerGrade);
    clan.broadcastClanStatus();
  }
View Full Code Here

    L2PcInstance activeChar = getClient().getActiveChar();

    if(activeChar == null)
      return;

    L2Clan clan = activeChar.getClan();
    if(clan == null)
      return;

    if(clan.getDissolvingExpiryTime() > System.currentTimeMillis())
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.CANNOT_SET_CREST_WHILE_DISSOLUTION_IN_PROGRESS));
      return;
    }

    if(_length < 0)
    {
      activeChar.sendMessage("File transfer error.");
      return;
    }

    if(_length > 256)
    {
      activeChar.sendMessage("The clan crest file size was too big (max 256 bytes).");
      return;
    }

    if(_length == 0 || _data.length == 0)
    {
      CrestCache.getInstance().removePledgeCrest(clan.getCrestId());

      clan.setHasCrest(false);
      activeChar.sendPacket(new SystemMessage(SystemMessageId.CLAN_CREST_HAS_BEEN_DELETED));

      for(L2PcInstance member : clan.getOnlineMembers(""))
      {
        member.broadcastUserInfo();
      }

      return;
    }

    if((activeChar.getClanPrivileges() & L2Clan.CP_CL_REGISTER_CREST) == L2Clan.CP_CL_REGISTER_CREST)
    {
      if(clan.getLevel() < 3)
      {
        activeChar.sendPacket(new SystemMessage(SystemMessageId.CLAN_LVL_3_NEEDED_TO_SET_CREST));
        return;
      }

      CrestCache crestCache = CrestCache.getInstance();

      int newId = IdFactory.getInstance().getNextId();

      if(clan.hasCrest())
      {
        crestCache.removePledgeCrest(newId);
      }

      if(!crestCache.savePledgeCrest(newId, _data))
      {
        _log.log(Level.INFO, "Error loading crest of clan:" + clan.getName());
        return;
      }

      Connection con = null;

      try
      {
        con = L2DatabaseFactory.getInstance().getConnection(false);
        PreparedStatement statement = con.prepareStatement("UPDATE clan_data SET crest_id = ? WHERE clan_id = ?");
        statement.setInt(1, newId);
        statement.setInt(2, clan.getClanId());
        statement.executeUpdate();
        statement.close();

        statement = null;
      }
      catch(SQLException e)
      {
        if(Config.ENABLE_ALL_EXCEPTIONS)
          e.printStackTrace();
       
        _log.warning("could not update the crest id:" + e.getMessage());
      }
      finally
      {
        CloseUtil.close(con);
        con = null;
      }

      clan.setCrestId(newId);
      clan.setHasCrest(true);

      for(L2PcInstance member : clan.getOnlineMembers(""))
      {
        member.broadcastUserInfo();
      }

    }
View Full Code Here

        {
          activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
          return true;
        }

        L2Clan clan = player.getClan();
        if(clan == null)
        {
          activeChar.sendMessage("Player is not in a clan.");
          teleportCharacter(player, x, y, z, activeChar, "Admin is teleporting you.");

          return true;
        }

        L2PcInstance[] members = clan.getOnlineMembers("");

        for(L2PcInstance member : members)
        {
          teleportCharacter(member, x, y, z, activeChar, "Your clan is being teleported by an Admin.");
        }
View Full Code Here

    writeD(_tab); // type : 0 = Declared, 1 = Under Attack
    writeD(0x00); // page
    writeD(_tab == 0 ? _clan.getWarList().size() : _clan.getAttackerList().size());
    for(Integer i : _tab == 0 ? _clan.getWarList() : _clan.getAttackerList())
    {
      L2Clan clan = ClanTable.getInstance().getClan(i);
      if(clan == null)
      {
        continue;
      }

      writeS(clan.getName());
      writeD(_tab); //??
      writeD(_tab); //??
    }
  }
View Full Code Here

    writeD(_castle.getCastleId());
    writeD(_castle.getOwnerId() == activeChar.getClanId() && activeChar.isClanLeader() ? 0x01 : 0x00);
    writeD(_castle.getOwnerId());
    if(_castle.getOwnerId() > 0)
    {
      L2Clan owner = ClanTable.getInstance().getClan(_castle.getOwnerId());
      if(owner != null)
      {
        writeS(owner.getName()); // Clan Name
        writeS(owner.getLeaderName()); // Clan Leader Name
        writeD(owner.getAllyId()); // Ally ID
        writeS(owner.getAllyName()); // Ally Name
      }
      else
      {
        _log.warning("Null owner for castle: " + _castle.getName());
      }
View Full Code Here

      try
      {
        if(_isFree)
          return;

        L2Clan Clan = ClanTable.getInstance().getClan(getOwnerId());

        if(ClanTable.getInstance().getClan(getOwnerId()).getWarehouse().getAdena() >= getLease())
        {
          if(_paidUntil != 0)
          {
            while(_paidUntil < System.currentTimeMillis())
            {
              _paidUntil += _chRate;
            }
          }
          else
          {
            _paidUntil = System.currentTimeMillis() + _chRate;
          }

          ClanTable.getInstance().getClan(getOwnerId()).getWarehouse().destroyItemByItemId("CH_rental_fee", 57, getLease(), null, null);

          if(Config.DEBUG)
          {
            _log.warning("deducted " + getLease() + " adena from " + getName() + " owner's cwh for ClanHall _paidUntil" + _paidUntil);
          }

          ThreadPoolManager.getInstance().scheduleGeneral(new FeeTask(), _paidUntil - System.currentTimeMillis());
          _paid = true;
          updateDb();
        }
        else
        {
          _paid = false;
          if(System.currentTimeMillis() > _paidUntil + _chRate)
          {
            if(ClanHallManager.loaded())
            {
              AuctionManager.getInstance().initNPC(getId());
              ClanHallManager.getInstance().setFree(getId());
              Clan.broadcastToOnlineMembers(new SystemMessage(SystemMessageId.THE_CLAN_HALL_FEE_IS_ONE_WEEK_OVERDUE_THEREFORE_THE_CLAN_HALL_OWNERSHIP_HAS_BEEN_REVOKED));
            }
            else
            {
              ThreadPoolManager.getInstance().scheduleGeneral(new FeeTask(), 3000);
            }
          }
          else
          {
            updateDb();
            SystemMessage sm = new SystemMessage(SystemMessageId.PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_MAKE_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW);
            sm.addNumber(getLease());
            Clan.broadcastToOnlineMembers(sm);
            sm = null;

            if(System.currentTimeMillis() + 1000 * 60 * 60 * 24 <= _paidUntil + _chRate)
            {
              ThreadPoolManager.getInstance().scheduleGeneral(new FeeTask(), System.currentTimeMillis() + 1000 * 60 * 60 * 24);
 
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.L2Clan

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.