Package net.sf.l2j.gameserver.model

Examples of net.sf.l2j.gameserver.model.L2Clan$RankPrivs


    if (!player.isClanLeader())
    {
      player.sendPacket(new SystemMessage(SystemMessageId.ONLY_CLAN_LEADER_WITHDRAW_ALLY));
      return;
    }
        L2Clan clan = player.getClan();
    if (clan.getAllyId() == 0)
    {
      player.sendPacket(new SystemMessage(SystemMessageId.NO_CURRENT_ALLIANCES));
      return;
    }
    if (clan.getClanId() == clan.getAllyId())
    {
      player.sendPacket(new SystemMessage(SystemMessageId.ALLIANCE_LEADER_CANT_WITHDRAW));
      return;
    }

    long currentTime = System.currentTimeMillis();
        clan.setAllyId(0);
        clan.setAllyName(null);
        clan.setAllyPenaltyExpiryTime(
            currentTime + Config.ALT_ALLY_JOIN_DAYS_WHEN_LEAVED * 86400000L,
            L2Clan.PENALTY_TYPE_CLAN_LEAVED); //24*60*60*1000 = 86400000
        clan.updateClanInDB();

        player.sendPacket(new SystemMessage(SystemMessageId.YOU_HAVE_WITHDRAWN_FROM_ALLIANCE));
    }
View Full Code Here


    //Connection
    sm = new SystemMessage(SystemMessageId.CONNECTION_S1_TOTAL_S2);
    sm.addString(""+online);
    sm.addString(""+count);
    _cha.sendPacket(sm);
    L2Clan leaderclan = ClanTable.getInstance().getClan(_cha.getAllyId());
    sm = new SystemMessage(SystemMessageId.ALLIANCE_LEADER_S2_OF_S1);
        sm.addString(leaderclan.getName());
    sm.addString(leaderclan.getLeaderName());
    _cha.sendPacket(sm);
    //clan count
    sm = new SystemMessage(SystemMessageId.ALLIANCE_CLAN_TOTAL_S1);
    sm.addString(""+clancount);
    _cha.sendPacket(sm);
View Full Code Here

  /**
   * @param activeChar
   */
  private void notifyClanMembers(L2PcInstance activeChar)
  {
    L2Clan clan = activeChar.getClan();
    if (clan != null)
    {
      clan.getClanMember(activeChar.getName()).setPlayerInstance(activeChar);
      SystemMessage msg = new SystemMessage(SystemMessageId.CLAN_MEMBER_S1_LOGGED_IN);
      msg.addString(activeChar.getName());
      clan.broadcastToOtherOnlineMembers(msg, activeChar);
      msg = null;
      clan.broadcastToOtherOnlineMembers(new PledgeShowMemberListUpdate(activeChar), activeChar);
    }
  }
View Full Code Here

        if(player == null)
        {
          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(int i = 0; i < members.length; i++)
          teleportCharacter(members[i], x, y, z, activeChar, "Your clan is being teleported by an Admin.");
      }
      catch (Exception e){}
    }
View Full Code Here

        writeD(0x01); //1
        writeD(0x00); //0
        int size = _castle.getSiege().getAttackerClans().size();
        if (size > 0)
        {
            L2Clan clan;

            writeD(size);
            writeD(size);
            for(L2SiegeClan siegeclan : _castle.getSiege().getAttackerClans())
            {
                clan = ClanTable.getInstance().getClan(siegeclan.getClanId());
                if (clan == null) continue;

                writeD(clan.getClanId());
                writeS(clan.getName());
                writeS(clan.getLeaderName());
                writeD(clan.getCrestId());
                writeD(0x00); //signed time (seconds) (not storated by L2J)
                writeD(clan.getAllyId());
                writeS(clan.getAllyName());
                writeS(""); //AllyLeaderName
                writeD(clan.getAllyCrestId());
            }
        }
        else
        {
            writeD(0x00);
View Full Code Here

  public void setNextPeriod() {
    for (Castle c: CastleManager.getInstance().getCastles()) {
      if (c.getOwnerId() <= 0)
        continue;
      L2Clan clan = ClanTable.getInstance().getClan(c.getOwnerId());
      if (clan == null)
        continue;

      ItemContainer cwh = clan.getWarehouse();
      if (!(cwh instanceof ClanWarehouse)) {
        _log.info("Can't get clan warehouse for clan " + ClanTable.getInstance().getClan(c.getOwnerId()));
        return;
      }

      for (CropProcure crop: c.getCropProcure(PERIOD_CURRENT)) {
        if (crop.getStartAmount() == 0)
          continue;
        // adding bought crops to clan warehouse
        if (crop.getStartAmount() - crop.getAmount() > 0) {
          int count = crop.getStartAmount() - crop.getAmount();
          count = count * 90 / 100;
          if (count < 1) {
            if (Rnd.nextInt(99) < 90)
              count = 1;
          }
          if (count > 0) {
            cwh.addItem("Manor", L2Manor.getInstance().getMatureCrop(crop.getId()), count, null, null);
          }
        }
        // reserved and not used money giving back to treasury
        if (crop.getAmount() > 0) {
          c.addToTreasuryNoTax(crop.getAmount() * crop.getPrice());
        }
      }

      c.setSeedProduction(c.getSeedProduction(PERIOD_NEXT), PERIOD_CURRENT);
      c.setCropProcure(c.getCropProcure(PERIOD_NEXT), PERIOD_CURRENT);

      if (c.getTreasury() < c.getManorCost(PERIOD_CURRENT)) {
        c.setSeedProduction(getNewSeedsList(c.getCastleId()), PERIOD_NEXT);
        c.setCropProcure(getNewCropsList(c.getCastleId()), PERIOD_NEXT);
      } else {
        FastList<SeedProduction> production = new FastList<SeedProduction>();
        for (SeedProduction s : c.getSeedProduction(PERIOD_CURRENT)) {
          s.setCanProduce(s.getStartProduce());
          production.add(s);
        }
        c.setSeedProduction(production, PERIOD_NEXT);

        FastList<CropProcure> procure = new FastList<CropProcure>();
        for (CropProcure cr : c.getCropProcure(PERIOD_CURRENT)) {
          cr.setAmount(cr.getStartAmount());
          procure.add(cr);
        }
        c.setCropProcure(procure, PERIOD_NEXT);
      }
      if (Config.ALT_MANOR_SAVE_ALL_ACTIONS) {
        c.saveCropData();
        c.saveSeedData();
      }

      // Sending notification to a clan leader
      L2PcInstance clanLeader = L2World.getInstance().getPlayer(clan.getLeader().getName());
      if (clanLeader != null)
        clanLeader.sendPacket(new SystemMessage(SystemMessageId.THE_MANOR_INFORMATION_HAS_BEEN_UPDATED));

      c.setNextPeriodApproved(false);
    }
View Full Code Here

      }
      c.setNextPeriodApproved(true);
      c.addToTreasuryNoTax( (-1)*c.getManorCost(PERIOD_NEXT) );

      if (notFunc) {
        L2Clan clan = ClanTable.getInstance().getClan(c.getOwnerId());
        L2PcInstance clanLeader = null;
        if (clan != null)
           clanLeader = L2World.getInstance().getPlayer(clan.getLeader().getName());
        if (clanLeader != null)
          clanLeader.sendPacket(new SystemMessage(SystemMessageId.THE_AMOUNT_IS_NOT_SUFFICIENT_AND_SO_THE_MANOR_IS_NOT_IN_OPERATION));
      }
    }

View Full Code Here

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

    L2Clan clan = activeChar.getClan();
    if (clan != null)
    {
      PledgeShowMemberListAll pm = new PledgeShowMemberListAll(clan, activeChar);
      activeChar.sendPacket(pm);
    }
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());
        }
        else
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.model.L2Clan$RankPrivs

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.