No categories assigned
LUA:SpawnByLocationID
- Last edited 12 years ago by I need to Update My Profile
Contents
LUA Functions: SpawnByLocationID()
Spawns a mob by location id
Syntax
SpawnByLocationID(param1, param2)
Parameters
- Required - param1 (Zone), param2 (int32)
- param1 is the zone to spawn the mob in
- param2 is the location id
Returns
- Spawn
- Pointer to the newly spawned mob
Usage
function hailed(NPC, Spawn) zone = GetZone(Spawn) newSpawn = SpawnByLocationID(zone, 160012) if newSpawn ~= nil then Shout(newSpawn, "Test") end end
This spawn script will spawn a mob with the location id 160012, it then checks to see if the spawn was created and if so has the new spawn shout.
Notes
This will spawn the mob no matter what their spawnpercentage is set to, it will also only spawn the first mob in the location list in the event the location contains multiple mobs.