Package lineage2.gameserver.templates.spawn

Examples of lineage2.gameserver.templates.spawn.SpawnNpcInfo


   * @return NpcInstance
   */
  @Override
  public NpcInstance doSpawn(boolean spawn)
  {
    SpawnNpcInfo npcInfo = getNextNpcInfo();
    return doSpawn0(npcInfo.getTemplate(), spawn, npcInfo.getParameters());
  }
View Full Code Here


   * @return int
   */
  @Override
  public int getCurrentNpcId()
  {
    SpawnNpcInfo npcInfo = _template.getNpcId(_npcIndex);
    if (npcInfo.getTemplate() == null)
    {
      _log.warn("NpcIndex not found: " + _npcIndex);
      return 0;
    }
    return npcInfo.getTemplate().npcId;
  }
View Full Code Here

    int old = _npcIndex++;
    if (_npcIndex >= _template.getNpcSize())
    {
      _npcIndex = 0;
    }
    SpawnNpcInfo npcInfo = _template.getNpcId(old);
    if (npcInfo.getMax() > 0)
    {
      int count = 0;
      for (NpcInstance npc : _spawned)
      {
        if (npc.getNpcId() == npcInfo.getTemplate().getNpcId())
        {
          count++;
        }
      }
      if (count >= npcInfo.getMax())
      {
        return getNextNpcInfo();
      }
    }
    return npcInfo;
View Full Code Here

        int x = rset.getInt("locx");
        int y = rset.getInt("locy");
        int z = rset.getInt("locz");
        int h = rset.getInt("heading");
        template = new SpawnTemplate(PeriodOfDay.NONE, count, delay, delay_rnd);
        template.addNpc(new SpawnNpcInfo(npcId, 1, StatsSet.EMPTY));
        template.addSpawnRange(new Location(x, y, z, h));
        SpawnHolder.getInstance().addSpawn(PeriodOfDay.NONE.name(), template);
      }
    }
    catch (Exception e1)
View Full Code Here

        int x = rset.getInt("locx");
        int y = rset.getInt("locy");
        int z = rset.getInt("locz");
        int h = rset.getInt("heading");
        template = new SpawnTemplate(PeriodOfDay.NONE, count, delay, delay_rnd);
        template.addNpc(new SpawnNpcInfo(npcId, 1, StatsSet.EMPTY));
        template.addSpawnRange(new Location(x, y, z, h));
        SpawnHolder.getInstance().addSpawn(PeriodOfDay.NONE.name(), template);
      }
    }
    catch (Exception e1)
View Full Code Here

              {
                parameters = new MultiValueSet<>();
              }
              parameters.set(e.attributeValue("name"), e.attributeValue("value"));
            }
            template.addNpc(new SpawnNpcInfo(npcId, max, parameters));
          }
        }
        if (template.getNpcSize() == 0)
        {
          warn("Npc id is zero! File: " + getCurrentFileName());
View Full Code Here

      {
        player.sendPacket(Msg.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE);
        return;
      }
    }
    final Location pos = Location.findPointToStay(x, y, z, 50, 100, player.getGeoIndex());
    if (price > 0)
    {
      player.reduceAdena(price, true);
    }
    player.teleToLocation(pos);
View Full Code Here

      player.sendPacket(SystemMessage2.removeItems(item, count));
    }
    final int x = Integer.parseInt(param[0]);
    final int y = Integer.parseInt(param[1]);
    final int z = Integer.parseInt(param[2]);
    final Location pos = Location.findPointToStay(x, y, z, 20, 70, player.getGeoIndex());
    player.teleToLocation(pos);
  }
View Full Code Here

      return;
    }
    final String var = player.getVar("DCBackCoords");
    if ((var == null) || var.isEmpty())
    {
      player.teleToLocation(new Location(43768, -48232, -800), 0);
      return;
    }
    player.teleToLocation(Location.parseLoc(var), 0);
    player.unsetVar("DCBackCoords");
  }
View Full Code Here

    }
    for (Player player : World.getAroundPlayers(actor, 200, 200))
    {
      if (player != null)
      {
        player.teleToLocation(new Location(207559, 86429, -1000));
      }
    }
    return true;
  }
View Full Code Here

TOP

Related Classes of lineage2.gameserver.templates.spawn.SpawnNpcInfo

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.