Package l2p.gameserver.model

Examples of l2p.gameserver.model.L2Zone


      if(player.getParty() != null)
      {
        L2Party party = player.getParty();
        party.oustPartyMember(player);
      }
      L2Zone zone = ZoneManager.getInstance().getZoneById(L2Zone.ZoneType.OlympiadStadia, 3001 + _game.getId(), false);
      int[] tele = zone.getSpawns().get(_side - 1);
      player.teleToLocation(tele[0], tele[1], tele[2], 0);
      if(_type == CompType.TEAM_RANDOM || _type == CompType.TEAM)
      {
        player.setTeam(_side, true);
      }
View Full Code Here


    loadData();
  }

  private void loadData()
  {
    L2Zone zone = ZoneManager.getInstance().getZoneByIndex(ZoneType.OlympiadStadia, getOlympiadStadiaId(), true);
    if(zone != null)
    {
      _Name = zone.getName();
    }
  }
View Full Code Here

  public ShowMiniMap(L2Player player, int mapId)
  {
    _mapId = mapId;
    _period = SevenSigns.getInstance().getCurrentPeriod();
    L2Zone hellBoundTerrytory = ZoneManager.getInstance().getZoneById(L2Zone.ZoneType.dummy, 704004, false);
    // Map of Hellbound
    if(hellBoundTerrytory != null && player.isInZone(hellBoundTerrytory) && Functions.getItemCount(player, 9994) == 0)
    {
      player.sendPacket(Msg.THIS_IS_AN_AREA_WHERE_YOU_CANNOT_USE_THE_MINI_MAP_THE_MINI_MAP_WILL_NOT_BE_OPENED);
      canWriteImpl = false;
View Full Code Here

      // Темные эльфы не могут воскрешаться в городе светлых
      if(player.getRace() == Race.darkelf && TownManager.getInstance().getClosestTown(activeChar).getTownId() == 2)
      {
        return player.getKarma() > 1 ? TownManager.getInstance().getTown(3).getPKSpawn() : TownManager.getInstance().getTown(3).getSpawn();
      }
      L2Zone battle = activeChar.getZone(ZoneType.battle_zone);
      // If in battle zone
      if(battle != null && battle.getRestartPoints() != null)
      {
        return player.getKarma() > 1 ? battle.getPKSpawn() : battle.getSpawn();
      }
      // If in pease zone
      if(activeChar.isInZone(ZoneType.peace_zone) && activeChar.getZone(ZoneType.peace_zone).getRestartPoints() != null)
      {
        return player.getKarma() > 1 ? activeChar.getZone(ZoneType.peace_zone).getPKSpawn() : activeChar.getZone(ZoneType.peace_zone).getSpawn();
View Full Code Here

      _currentFloor = getCurrentFloor(actor);
      super.onEvtAttacked(attacker, damage);
      return;
    }
    Location teleToPoint = null;
    L2Zone floor = null;
    int chance = Rnd.get(70000);
    // Портает вниз (c 1 и 6 вниз не портает)
    if(chance <= 5 && _currentFloor != 1 && _currentFloor != 6)
    {
      floor = _floorZones.get(_currentFloor - 1);
    }
    // Портает вверх
    else if(chance < 20 && chance > 5)
    {
      floor = _floorZones.get(_currentFloor + 1);
    }
    if(floor != null)
    {
      teleToPoint = floor.getSpawn();
      L2Party party = attacker.getPlayer().getParty();
      if(teleToPoint != null)
      {
        if(party != null)
        {
View Full Code Here

      _currentFloor = getCurrentFloor(actor);
      super.onEvtAttacked(attacker, damage);
      return;
    }
    Location teleToPoint = null;
    L2Zone floor = null;
    int chance = Rnd.get(70000);
    // Портает вниз (c 1 и 6 вниз не портает)
    if(chance <= 5 && _currentFloor != 1 && _currentFloor != 6)
    {
      floor = _floorZones.get(_currentFloor - 1);
    }
    // Портает вверх
    else if(chance < 20 && chance > 5)
    {
      floor = _floorZones.get(_currentFloor + 1);
    }
    if(floor != null)
    {
      teleToPoint = floor.getSpawn();
      L2Party party = attacker.getPlayer().getParty();
      if(teleToPoint != null)
      {
        if(party != null)
        {
View Full Code Here

      {
        for(Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
        {
          if("zone".equalsIgnoreCase(d.getNodeName()))
          {
            L2Zone z = new L2Zone(XMLUtil.getAttributeIntValue(d, "id", 0));
            z.setType(ZoneType.valueOf(XMLUtil.getAttributeValue(d, "type")));
            z.setName(XMLUtil.getAttributeValue(d, "name"));
            boolean enabled = true;
            for(Node e = d.getFirstChild(); e != null; e = e.getNextSibling())
            {
              if("set".equalsIgnoreCase(e.getNodeName()))
              {
                String name = XMLUtil.getAttributeValue(e, "name");
                if("index".equalsIgnoreCase(name))
                {
                  z.setIndex(XMLUtil.getAttributeIntValue(e, "val", 0));
                }
                else if("taxById".equalsIgnoreCase(name))
                {
                  z.setTaxById(XMLUtil.getAttributeIntValue(e, "val", 0));
                }
                else if("entering_message_no".equalsIgnoreCase(name))
                {
                  z.setEnteringMessageId(XMLUtil.getAttributeIntValue(e, "val", 0));
                }
                else if("leaving_message_no".equalsIgnoreCase(name))
                {
                  z.setLeavingMessageId(XMLUtil.getAttributeIntValue(e, "val", 0));
                }
                else if("target".equalsIgnoreCase(name))
                {
                  z.setTarget(XMLUtil.getAttributeValue(e, "val"));
                }
                else if("skill_name".equalsIgnoreCase(name))
                {
                  z.setSkill(XMLUtil.getAttributeValue(e, "val"));
                }
                else if("skill_prob".equalsIgnoreCase(name))
                {
                  z.setSkillProb(XMLUtil.getAttributeValue(e, "val"));
                }
                else if("unit_tick".equalsIgnoreCase(name))
                {
                  z.setUnitTick(XMLUtil.getAttributeValue(e, "val"));
                }
                else if("initial_delay".equalsIgnoreCase(name))
                {
                  z.setInitialDelay(XMLUtil.getAttributeValue(e, "val"));
                }
                else if("restart_time".equalsIgnoreCase(name))
                {
                  z.setRestartTime(XMLUtil.getAttributeLongValue(e, "val", 0));
                }
                else if("blocked_actions".equalsIgnoreCase(name))
                {
                  z.setBlockedActions(XMLUtil.getAttributeValue(e, "val"));
                }
                else if("damage_on_hp".equalsIgnoreCase(name))
                {
                  z.setDamageOnHP(XMLUtil.getAttributeValue(e, "val"));
                }
                else if("damage_on_mp".equalsIgnoreCase(name))
                {
                  z.setDamageOnМP(XMLUtil.getAttributeValue(e, "val"));
                }
                else if("message_no".equalsIgnoreCase(name))
                {
                  z.setMessageNumber(XMLUtil.getAttributeValue(e, "val"));
                }
                else if("move_bonus".equalsIgnoreCase(name))
                {
                  z.setMoveBonus(XMLUtil.getAttributeValue(e, "val"));
                }
                else if("hp_regen_bonus".equalsIgnoreCase(name))
                {
                  z.setRegenBonusHP(XMLUtil.getAttributeValue(e, "val"));
                }
                else if("mp_regen_bonus".equalsIgnoreCase(name))
                {
                  z.setRegenBonusMP(XMLUtil.getAttributeValue(e, "val"));
                }
                else if("affect_race".equalsIgnoreCase(name))
                {
                  z.setAffectRace(XMLUtil.getAttributeValue(e, "val"));
                }
                else if("event".equalsIgnoreCase(name))
                {
                  z.setEvent(XMLUtil.getAttributeValue(e, "val"));
                }
                else if("reflectionId".equalsIgnoreCase(name))
                {
                  z.setReflectionId(XMLUtil.getAttributeIntValue(e, "val", 0));
                }
                else if("enabled".equalsIgnoreCase(name))
                {
                  enabled = XMLUtil.getAttributeBooleanValue(e, "val", true) || z.getType() == ZoneType.water;
                }
                else
                {
                  z.setParam(name, XMLUtil.getAttributeValue(e, "val"));
                }
              }
              else if("shape".equalsIgnoreCase(e.getNodeName()) || "restart_point".equalsIgnoreCase(e.getNodeName()) || "PKrestart_point".equalsIgnoreCase(e.getNodeName()))
              {
                int locId = IdFactory.getInstance().getNextId();
                boolean isRound = !XMLUtil.getAttributeValue(e, "loc").isEmpty();
                L2Territory territory;
                if(isRound)
                {
                  String[] coord = XMLUtil.getAttributeValue(e, "loc").replaceAll(",", " ").replaceAll(";", " ").replaceAll("  ", " ").trim().split(" ");
                  if(coord.length < 5) // Не указаны minZ и maxZ, берем граничные значения
                  {
                    territory = new L2RoundTerritory(locId, Integer.parseInt(coord[0]), Integer.parseInt(coord[1]), Integer.parseInt(coord[2]), Integer.MIN_VALUE, Integer.MAX_VALUE);
                  }
                  else
                  {
                    territory = new L2RoundTerritory(locId, Integer.parseInt(coord[0]), Integer.parseInt(coord[1]), Integer.parseInt(coord[2]), Integer.parseInt(coord[3]), Integer.parseInt(coord[4]));
                  }
                }
                else
                {
                  territory = new L2Territory(locId);
                  for(Node location = e.getFirstChild(); location != null; location = location.getNextSibling())
                  {
                    if("coords".equalsIgnoreCase(location.getNodeName()))
                    {
                      String[] coord = XMLUtil.getAttributeValue(location, "loc").replaceAll(",", " ").replaceAll(";", " ").replaceAll("  ", " ").trim().split(" ");
                      if(coord.length < 4) // Не указаны minZ и maxZ, берем граничные значения
                      {
                        territory.add(Integer.parseInt(coord[0]), Integer.parseInt(coord[1]), Integer.MIN_VALUE, Integer.MAX_VALUE);
                      }
                      else
                      {
                        territory.add(Integer.parseInt(coord[0]), Integer.parseInt(coord[1]), Integer.parseInt(coord[2]), Integer.parseInt(coord[3]));
                      }
                    }
                  }
                }
                if("shape".equalsIgnoreCase(e.getNodeName()))
                {
                  z.setLoc(territory);
                  territory.setZone(z);
                  territory.validate();
                }
                else if("restart_point".equalsIgnoreCase(e.getNodeName()))
                {
                  z.setRestartPoints(territory);
                }
                else if("PKrestart_point".equalsIgnoreCase(e.getNodeName()))
                {
                  z.setPKRestartPoints(territory);
                }
                z.setActive(enabled);
                TerritoryTable.getInstance().getLocations().put(locId, territory);
              }
            }
            if(z.getType() == ZoneType.no_landing || z.getType() == ZoneType.Siege || z.getType() == ZoneType.Castle || z.getType() == ZoneType.Fortress || z.getType() == ZoneType.OlympiadStadia)
            {
              z.getListenerEngine().addMethodInvokedListener(_noLandingZoneListener);
            }
            if(z.getType() == ZoneType.monster_trap)
            {
              z.getListenerEngine().addMethodInvokedListener(_monsterTrapZoneListener);
            }
            if(_zonesByType.get(z.getType()) == null)
            {
              _zonesByType.put(z.getType(), new GArray<L2Zone>());
            }
            _zonesByType.get(z.getType()).add(z);
            count++;
          }
        }
      }
    }
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.L2Zone

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.