# Method WorldObject:SpawnCreature [-] [+]

Spawns the creature at specified location.

    enum TempSummonType
    {
        TEMPSUMMON_TIMED_OR_DEAD_DESPAWN       = 1, // despawns after a specified time OR when the creature disappears
        TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN     = 2, // despawns after a specified time OR when the creature dies
        TEMPSUMMON_TIMED_DESPAWN               = 3, // despawns after a specified time
        TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT = 4, // despawns after a specified time after the creature is out of combat
        TEMPSUMMON_CORPSE_DESPAWN              = 5, // despawns instantly after death
        TEMPSUMMON_CORPSE_TIMED_DESPAWN        = 6, // despawns after a specified time after death
        TEMPSUMMON_DEAD_DESPAWN                = 7, // despawns when the creature disappears
        TEMPSUMMON_MANUAL_DESPAWN              = 8, // despawns when UnSummon() is called
        TEMPSUMMON_TIMED_OOC_OR_CORPSE_DESPAWN = 9, // despawns after a specified time (OOC) OR when the creature dies
        TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN   = 10 // despawns after a specified time (OOC) OR when the creature disappears
    };

## Synopsis

`spawnedCreature = WorldObject:SpawnCreature( entry, x, y, z, o )`

`spawnedCreature = WorldObject:SpawnCreature( entry, x, y, z, o, spawnType )`

`spawnedCreature = WorldObject:SpawnCreature( entry, x, y, z, o, spawnType, despawnTimer )`

## Arguments

`number entry`

  Creature's entry ID.

  Valid numbers: integers from 0 to 4,294,967,295.

`number x`

  Valid numbers: all decimal numbers.

`number y`

  Valid numbers: all decimal numbers.

`number z`

  Valid numbers: all decimal numbers.

`number o`

  Valid numbers: all decimal numbers.

`TempSummonType spawnType (MANUAL_DESPAWN)`

  Defines how and when the creature despawns.

`number despawnTimer (0)`

  Despawn time in milliseconds.

  Valid numbers: integers from 0 to 4,294,967,295.

## Returns

`Creature spawnedCreature`
  See method description.

# Keyboard shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result

# Search tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct` (or `str`), `enum`, `trait`, `typedef` (or `tdef`).

Generated on
© 2010 - 2024 Eluna Lua Engine