Examples of ClanHall


Examples of com.l2jfrozen.gameserver.model.entity.ClanHall

        }

        L2DoorInstance door = parseList(line);
        _staticItems.put(door.getDoorId(), door);
        door.spawnMe(door.getX(), door.getY(), door.getZ());
        ClanHall clanhall = ClanHallManager.getInstance().getNearbyClanHall(door.getX(), door.getY(), 500);
        if(clanhall != null)
        {
          clanhall.getDoors().add(door);
          door.setClanHall(clanhall);
          if(Config.DEBUG)
          {
            _log.warning("door " + door.getDoorName() + " attached to ch " + clanhall.getName());
          }
        }
     
      }
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.entity.ClanHall

          break;
        }
      }

      // Add message at connexion if clanHall not paid. Possibly this is custom...
      ClanHall clanHall = ClanHallManager.getInstance().getClanHallByOwner(activeChar.getClan());

      if (clanHall != null)
        if (!clanHall.getPaid())
          activeChar.sendPacket(new SystemMessage(SystemMessageId.PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_MAKE_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW));
    }

    if (!activeChar.isGM() && activeChar.getSiegeState() < 2 && activeChar.isInsideZone(L2Character.ZONE_SIEGE))
    {
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.entity.ClanHall

      if(player.isInsideZone(L2Character.ZONE_MONSTERTRACK))
        return new Location(12661, 181687, -3560);

      Castle castle = null;
      Fort fort = null;
      ClanHall clanhall = null;

      if(player.getClan() != null)
      {
        // If teleport to clan hall
        if(teleportWhere == TeleportWhereType.ClanHall)
        {

          clanhall = ClanHallManager.getInstance().getClanHallByOwner(player.getClan());
          if(clanhall != null)
          {
            L2ClanHallZone zone = clanhall.getZone();
            if(zone != null)
              return zone.getSpawn();
          }
        }
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.entity.ClanHall

        Location = rs.getString("location");
        paidUntil = rs.getLong("paidUntil");
        grade = rs.getInt("Grade");
        paid = rs.getBoolean("paid");

        ClanHall ch = new ClanHall(id, Name, ownerId, lease, Desc, Location, paidUntil, grade, paid);
        if(ownerId == 0)
        {
          _freeClanHall.put(id, ch);
        }
        else
        {
          L2Clan clan = ClanTable.getInstance().getClan(ownerId);
          if(clan != null)
          {
            _clanHall.put(id, ch);
            clan.setHasHideout(id);
          }
          else
          {
            _freeClanHall.put(id, ch);
            ch.free();
            AuctionManager.getInstance().initNPC(id);
          }
        }
      }
      rs.close();
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.entity.ClanHall

  public final ClanHall getNearbyClanHall(int x, int y, int maxDist)
  {

    for(Integer ch_id:_clanHall.keySet()){
     
      ClanHall ch = _clanHall.get(ch_id);
     
      if(ch == null){
        _log.warning("ATTENTION: Clah Hall "+ch_id+" is not defined.");
        _clanHall.remove(ch_id);
        continue;
      }
     
      if(ch.getZone().getDistanceToZone(x, y) < maxDist)
        return ch;
     
    }
   
    for(Integer ch_id:_freeClanHall.keySet()){
     
      ClanHall ch = _freeClanHall.get(ch_id);
     
      if(ch == null){
        _log.warning("ATTENTION: Clah Hall "+ch_id+" is not defined.");
        _freeClanHall.remove(ch_id);
        continue;
      }
     
      if(ch.getZone().getDistanceToZone(x, y) < maxDist)
        return ch;
     
    }
   
    return null;
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.entity.ClanHall

      if(player.isInsideZone(L2Character.ZONE_CLANHALL) && player.getClan() != null)
      {
        int clanHallIndex = player.getClan().getHasHideout();
        if(clanHallIndex > 0)
        {
          ClanHall clansHall = ClanHallManager.getInstance().getClanHallById(clanHallIndex);
          if(clansHall != null)
            if(clansHall.getFunction(ClanHall.FUNC_RESTORE_HP) != null)
            {
              hpRegenMultiplier *= 1 + clansHall.getFunction(ClanHall.FUNC_RESTORE_HP).getLvl() / 100;
            }
        }
      }

      // Mother Tree effect is calculated at last
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.entity.ClanHall

      if(player.isInsideZone(L2Character.ZONE_CLANHALL) && player.getClan() != null)
      {
        int clanHallIndex = player.getClan().getHasHideout();
        if(clanHallIndex > 0)
        {
          ClanHall clansHall = ClanHallManager.getInstance().getClanHallById(clanHallIndex);
          if(clansHall != null)
            if(clansHall.getFunction(ClanHall.FUNC_RESTORE_MP) != null)
            {
              mpRegenMultiplier *= 1 + clansHall.getFunction(ClanHall.FUNC_RESTORE_MP).getLvl() / 100;
            }
        }
      }

      // Calculate Movement bonus
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.entity.ClanHall

    {
      //  startSiege=FortResistSiegeManager.getInstance().getSiegeDate().getTimeInMillis();
    }
    else if(npcId == 35437 || npcId == 35627)
    {
      ClanHall clanhall = null;
      String clans = "";
      clans += "<table width=280 border=0>";
      int clanCount = 0;

      switch(npcId)
      {
        case 35437:
          clanhall = ClanHallManager.getInstance().getClanHallById(35);
          startSiege = BanditStrongholdSiege.getInstance().getSiegeDate().getTimeInMillis();
          for(String a : BanditStrongholdSiege.getInstance().getRegisteredClans())
          {
            clanCount++;
            clans += "<tr><td><font color=\"LEVEL\">" + a + "</font>  (Number :" + BanditStrongholdSiege.getInstance().getPlayersCount(a) + "people.)</td></tr>";
          }
          break;
        /*case 35627:
          clanhall = ClanHallManager.getInstance().getClanHallById(63);
          startSiege=WildBeastFarmSiege.getInstance().getSiegeDate().getTimeInMillis();
          for (String a : WildBeastFarmSiege.getInstance().getRegisteredClans())
          {
            clanCount++;
            clans+="<tr><td><font color=\"LEVEL\">"+a+"</font>  (Number :"+BanditStrongholdSiege.getInstance().getPlayersCount(a)+"people.)</td></tr>";
          }
          break;*/
      }
      while(clanCount < 5)
      {
        clans += "<tr><td><font color=\"LEVEL\">**Not logged**</font>  (Quantity : people.)</td></tr>";
        clanCount++;
      }
      clans += "</table>";
      html.replace("%clan%", String.valueOf(clans));
      L2Clan clan = clanhall == null ? null : clanhall.getOwnerClan();
      String clanName;
      if(clan == null)
      {
        clanName = "NPC";
      }
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.entity.ClanHall

    if(character instanceof L2PcInstance)
    {
      // Set as in clan hall
      character.setInsideZone(L2Character.ZONE_CLANHALL, true);

      ClanHall clanHall = ClanHallManager.getInstance().getClanHallById(_clanHallId);

      if(clanHall == null)
        return;

      // Send decoration packet
      ClanHallDecoration deco = new ClanHallDecoration(clanHall);
      ((L2PcInstance) character).sendPacket(deco);

      // Send a message
      if(clanHall.getOwnerId() != 0 && clanHall.getOwnerId() == ((L2PcInstance) character).getClanId())
      {
        ((L2PcInstance) character).sendMessage("You have entered your clan hall");
      }

      clanHall = null;
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.entity.ClanHall

    StringTokenizer st = new StringTokenizer(command, " ");
    command = st.nextToken(); // Get actual command

    // Get castle
    Castle castle = null;
    ClanHall clanhall = null;

    if(command.startsWith("admin_clanhall"))
    {
      clanhall = ClanHallManager.getInstance().getClanHallById(Integer.parseInt(st.nextToken()));
    }
    else if(st.hasMoreTokens())
    {
      castle = CastleManager.getInstance().getCastle(st.nextToken());
    }

    // Get castle
    String val = "";

    if(st.hasMoreTokens())
    {
      val = st.nextToken();
    }

    if((castle == null || castle.getCastleId() < 0) && clanhall == null)
    {
      // No castle specified
      showCastleSelectPage(activeChar);
    }
    else
    {
      L2Object target = activeChar.getTarget();
      L2PcInstance player = null;

      if(target instanceof L2PcInstance)
      {
        player = (L2PcInstance) target;
      }

      if(command.equalsIgnoreCase("admin_add_attacker"))
      {
        if(player == null)
        {
          activeChar.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
        }
        else if(SiegeManager.getInstance().checkIsRegistered(player.getClan(), castle.getCastleId()))
        {
          activeChar.sendMessage("Clan is already registered!");
        }
        else
        {
          castle.getSiege().registerAttacker(player, true);
        }
      }
      else if(command.equalsIgnoreCase("admin_add_defender"))
      {
        if(player == null)
        {
          activeChar.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
        }
        else
        {
          castle.getSiege().registerDefender(player, true);
        }
      }
      else if(command.equalsIgnoreCase("admin_add_guard"))
      {
        try
        {
          int npcId = Integer.parseInt(val);
          castle.getSiege().getSiegeGuardManager().addSiegeGuard(activeChar, npcId);
        }
        catch(Exception e)
        {
          if(Config.ENABLE_ALL_EXCEPTIONS)
            e.printStackTrace();
         
          activeChar.sendMessage("Usage: //add_guard npcId");
        }
      }
      else if(command.equalsIgnoreCase("admin_clear_siege_list"))
      {
        castle.getSiege().clearSiegeClan();
      }
      else if(command.equalsIgnoreCase("admin_endsiege"))
      {
        castle.getSiege().endSiege();
      }
      else if(command.equalsIgnoreCase("admin_list_siege_clans"))
      {
        castle.getSiege().listRegisterClan(activeChar);

        return true;
      }
      else if(command.equalsIgnoreCase("admin_move_defenders"))
      {
        activeChar.sendPacket(SystemMessage.sendString("Not implemented yet."));
      }
      else if(command.equalsIgnoreCase("admin_setcastle"))
      {
        if(player == null || player.getClan() == null)
        {
          activeChar.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
        }
        else
        {
          castle.setOwner(player.getClan());
        }
      }
      else if(command.equalsIgnoreCase("admin_removecastle"))
      {
        L2Clan clan = ClanTable.getInstance().getClan(castle.getOwnerId());

        if(clan != null)
        {
          castle.removeOwner(clan);
        }
        else
        {
          activeChar.sendMessage("Unable to remove castle");
        }

        clan = null;
      }
      else if(command.equalsIgnoreCase("admin_clanhallset"))
      {
        if(player == null || player.getClan() == null)
        {
          activeChar.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
        }
        else if(!ClanHallManager.getInstance().isFree(clanhall.getId()))
        {
          activeChar.sendMessage("This ClanHall isn't free!");
        }
        else if(player.getClan().getHasHideout() == 0)
        {
          ClanHallManager.getInstance().setOwner(clanhall.getId(), player.getClan());

          if(AuctionManager.getInstance().getAuction(clanhall.getId()) != null)
          {
            AuctionManager.getInstance().getAuction(clanhall.getId()).deleteAuctionFromDB();
          }
        }
        else
        {
          activeChar.sendMessage("You have already a ClanHall!");
        }
      }
      else if(command.equalsIgnoreCase("admin_clanhalldel"))
      {
        if(!ClanHallManager.getInstance().isFree(clanhall.getId()))
        {
          ClanHallManager.getInstance().setFree(clanhall.getId());
          AuctionManager.getInstance().initNPC(clanhall.getId());
        }
        else
        {
          activeChar.sendMessage("This ClanHall is already Free!");
        }
      }
      else if(command.equalsIgnoreCase("admin_clanhallopendoors"))
      {
        clanhall.openCloseDoors(true);
      }
      else if(command.equalsIgnoreCase("admin_clanhallclosedoors"))
      {
        clanhall.openCloseDoors(false);
      }
      else if(command.equalsIgnoreCase("admin_clanhallteleportself"))
      {
        L2ClanHallZone zone = clanhall.getZone();

        if(zone != null)
        {
          activeChar.teleToLocation(zone.getSpawn(), true);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.