Lua Scene Script Documentation

SceneEventType

Table containing constants indicating the type of event notification
constant None - Invalid event
constant Debug - A debug event, triggered with the cheat SendSceneEvent, stringData of the event contains the parameters the cheat was called with
constant SpellCancel - Indicates a client spell cast was canceled, spellID is stored in the integerData of the event
constant SpellStart - Indicates a client spell cast started, spellID is stored in the integerData of the event, spell reticle radius in the floatData of the event, and scene space dest target in the vectorData
constant SpellComplete - Indicates a client spell cast completed successfully, spellID is stored in the integerData of the event, spell reticle radius in the floatData of the event

SceneEvent

A notification to the scene from an external source (e.g. spell cast, debug cheat)
SceneEventType type - type of event, member of the SceneEventType table
integer timeStamp - time in milliseconds since the start scene when the event notification occurred
integer integerData - integer data associated with the event
float floatData - floating point (fractional number) data associated with the event
string stringData - string data associated with the event
Vector vectorData - vector data associated with the event

Scene

The Scene class table contains all the overall control mechanisms for ascene, including timing and spawning actors. The current Scene class table that is active in the scene is specially pushed to script as the variable 'scene'.

GetPosition

Function: Vector GetPosition(Scene self)
Return: Vector the location that the scene was created at

Wait

Function: YIELD Wait(Scene self, Sync sync)
Yield the currently executing script back to game code, until the sync object is signaled. The sync object is typically a timer, and execution will continue after the timer has expired
Parameters:

  1. Sync sync: synchronization object for this wait - when it is signaled, execution will resume

Timer

Function: Sync Timer(Scene self, float seconds)
Create a synchronization object that waits a specific time
Return: Sync newly created sycnhronization timer, that can be waited on
Parameters:

  1. float seconds: time in seconds to wait

EndScene

Function: EndScene(Scene self)
Forcibly complete the current scene

CancelScene

Function: CancelScene(Scene self)
Forcibly cancel the current scene

SpawnActor

Function: Actor SpawnActor(Scene self, ActorCreateData actorcreateData)
Spawn an actor under the control of the scene
Return: Actor newly created Actor instance
Parameters:

  1. ActorCreateData actorcreateData: data table describing the spawn information for the new actor

AddCoroutine

Function: AddCoroutine(Scene self, function mainFunction)
Run the function specified as a coroutine in the current scene. The coroutine is added as pending, added to the end of the current queue.
Parameters:

  1. function mainFunction: function to run as a coroutine

SetFadeRegion

Function: SetFadeRegion(Scene self, float radius, boolean includePlayer)
Set a client fading region centered on the scene origin. All units entering this region will be seen to fade out.
Parameters:

  1. float radius: fade redion radius, in yards. 0 will turn off the fade region.
  2. boolean includePlayer: if true, the active player model will also be faded when inside the fade region

SetOverrideSpawnAOISettings

Function: SetOverrideSpawnAOISettings(Scene self, boolean enabled, ActorAOISettings settings)
For any new actor spawns, override their AOI settings with those specified
Parameters:

  1. boolean enabled: Enable or disable AOI overrides.
  2. ActorAOISettings settings: Override AOI settings for all subsequent spawns.

SetFadeRegionExcludesAllPlayers

Function: SetFadeRegionExcludesAllPlayers(Scene self, boolean excludeAllPlayers)
Set the currently active fade region to exclude or include all players for fading.
Parameters:

  1. boolean excludeAllPlayers: if true, all players in the fade region will be visible

AddFadeRegionExcludedCreature

Function: AddFadeRegionExcludedCreature(Scene self, integer creatureID)
Add a creature by creatureID that will be excluded from all fading within the region
Parameters:

  1. integer creatureID: ID of the creature to exclude

AddFadeRegionExcludedGameObject

Function: AddFadeRegionExcludedGameObject(Scene self, integer gameObjectID)
Add a game object by gameObjectID that will be excluded from all fading within the region
Parameters:

  1. integer gameObjectID: ID of the game object to exclude

RemoveFadeRegionExcludedCreature

Function: RemoveFadeRegionExcludedCreature(Scene self, integer creatureID)
Remove a creature by creatureID from fade region exclusion, causing it to fade in the region
Parameters:

  1. integer creatureID: ID of the creature to stop excluding from fading

RemoveFadeRegionExcludedGameObject

Function: RemoveFadeRegionExcludedGameObject(Scene self, integer gameObjectID)
Remove a game object by gameObjectID from fade region exclusion, causing it to fade in the region
Parameters:

  1. integer gameObjectID: ID of the game obejct to stop excluding from fading

PeekEvent

Function: SceneEvent PeekEvent(Scene self)
Check for a pending server script event
Return: SceneEvent if the server has sent this scene a script event, it will be returned, otherwise the return value is nil

PopEvent

Function: PopEvent(Scene self)
Discard the server script event at the top of the stack, allowing PeekEvent to return subsequent events

TriggerServerEvent

Function: TriggerServerEvent(Scene self, string event)
Send a named server trigger event
Parameters:

  1. string event: named server event trigger, will fire the matching server event for this scene

SetRelativeCoords

Function: SetRelativeCoords(Scene self, boolean relative)
Switch the scene between absolute world coordinates, and coordinates being relative to the scene origin
Parameters:

  1. boolean relative: true indicates that the scene should be in a relative coordinate space

SetAxisAlignedCoords

Function: SetAxisAlignedCoords(Scene self, boolean aligned)
If a scene is in a relative coordinate space, only use the translation (i.e. the x axis will point in the world space x direction)
Parameters:

  1. boolean aligned: true indicates that the scenes x, y and z axis should be aligned with the world x, y and z axis

SetGameCameraTarget

Function: SetGameCameraTarget(Scene self, Actor targetActor, float maxZoom, float)
Set the camera focus/orbit to an actor in the scene
Parameters:

  1. Actor targetActor: actor to be the new camera orbit point. Nil indicates that the game camera should return to the active mover/player.
  2. float maxZoom: maximum zoom (in yards) for the orbit camera around the new actor

ResetGameCameraZoom

Function: ResetGameCameraZoom(Scene self)
Return zoom and zoom extents back to their default values

SetCamera

Function: SetCamera(Scene self, integer cameraID, float transitionTime, Actor targetA, Actor targetB)
Set a custom scene camera. This will take camera control away from the player.
Parameters:

  1. integer cameraID: ID of a Camera record to use. 0 indicates the default gameplay camera.
  2. float transitionTime: Time (in seconds) to transition from the current camera to the new camera.
  3. Actor targetA: For Camera records that are relative to some primary unit/actor, this is specified here
  4. Actor targetB: For Camera records that are relative to some secondary unit/actor, this is specified here

AddCameraShake

Function: integer AddCameraShake(Scene self, integer cameraShakeRecID, Vector pos)
Add a one-shot or looping camera shake to the scene
Return: integer Handle to the created camera shake instance, which can be used to manually stop the shake later
Parameters:

  1. integer cameraShakeRecID: ID of a CameraShake record describing the shake parameters
  2. Vector pos: For 3D shakes, this is the source of the shake

ClearCameraShake

Function: ClearCameraShake(Scene self, integer shakeInstanceID)
Clear a previously initiated shake
Parameters:

  1. integer shakeInstanceID: Handle to the previously created shake, returned from AddCameraShake

GetOverrideSpellDataID

Function: integer GetOverrideSpellDataID(Scene self)
Get the override spell data for this scene. Note that this spell data may not actually be in use if another scene changed it first
Return: integer ID of the OverrideSpellData entry

SetOverrideSpellDataID

Function: SetOverrideSpellDataID(Scene self, integer overrideSpellDataID)
Set the override spell data for this scene. Note that this spell data may not actually be in use if another scene changed it first
Parameters:

  1. integer overrideSpellDataID: ID of the OverrideSpellData entry

SetCameraInterruptedByFreelook

Function: SetCameraInterruptedByFreelook(Scene self, boolean canBeInterrupted)
If set, attempting to mouse look will clear the scene camera and prevent future scene cameras from starting
Parameters:

  1. boolean canBeInterrupted: indicate whether to disable or enable freelook cancel

GetWorldState

Function: integer GetWorldState(Scene self, integer worldStateID)
Get the value of a world state variable
Return: integer rvalue of the variable
Parameters:

  1. integer worldStateID: ID of the world state

EvalWorldStateExpression

Function: boolean EvalWorldStateExpression(Scene self, integer worldStateExpressionID)
Evaluate a world state expression
Return: boolean result of the expression (true/false)
Parameters:

  1. integer worldStateExpressionID: ID of the expression

EvalPlayerCondition

Function: boolean EvalPlayerCondition(Scene self, integer playerConditionID)
Evaluate a player condition for the local client.
Return: boolean result of the condition (true/false)
Parameters:

  1. integer playerConditionID: ID of the player condition. Player condition must be flagged as availabled on the client.

LoadPath

Function: PathData LoadPath(Scene self, integer pathID)
Load all the information of a WOWEdit created Path record into script
Return: PathData the loaded path data
Parameters:

  1. integer pathID: ID of the WOWEdit Path

ApplyScreenEffect

Function: ApplyScreenEffect(Scene self, integer screenEffectID)
Apply a ScreenEffect record by ID
Parameters:

  1. integer screenEffectID: ID of a ScreenEffect record

ClearScreenEffect

Function: ClearScreenEffect(Scene self, integer screenEffectID)
Clear a ScreenEffect record by ID
Parameters:

  1. integer screenEffectID: ID of a ScreenEffect record. All screen effects currently active on the scene matching this ID will be cleared

GetTransform

Function: Transform GetTransform(Scene self)
Return: Transform return the world space transformation of the scene origin

GetActivePlayerDisplay

Function: UnitDisplay GetActivePlayerDisplay(Scene self)
Return: UnitDisplay handle to the active players UnitDisplay, so that visuals and position queries can be performed on the active player.

GetCreatorDisplay

Function: UnitDisplay GetCreatorDisplay(Scene self)
Return: UnitDisplay handle to the creating units UnitDisplay, so that visuals and position queries can be performed.

GetSelectedActor

Function: Actor GetSelectedActor(Scene self)
Return: Actor return a handle to the selected actor, from this scene. Note if a unit or actor from another scene is selected, nil will be returned

PetBattleState

Table of constants indicating the current overall state that the battle is in
constant Invalid
constant Created
constant WaitingPreBattle
constant RoundInProgress
constant WaitingForFrontPets
constant CreateFailed
constant FinalRound
constant Finished

PetBattleEffect

Table of constants indicating the type of a round effect
constant Invalid
constant SetHealth
constant AuraApply
constant AuraCancel
constant AuraChange
constant PetSwap
constant StatusChange
constant SetState
constant SetMaxHealth
constant SetSpeed
constant SetPower
constant TriggerAbility
constant AbilityChange
constant NPCEmote
constant AuraProcesssingBegin
constant AuraProcesssingEnd

PetBattlePetID

Table of constants indicating a particular slot of pet for a battle participant
constant Invalid
constant Pad
constant Weather - Only relevant for 'players' of type Weather
constant Slot1
constant Slot2
constant Slot3

PetBattlePlayerID

Table of constants indicating a particulat battle participant
constant Invalid
constant Weather
constant Player1
constant Player2

PetBattleEvent

Table of constants indicating particular events needing to be performed in the playback of battle results
constant Invalid
constant RoundResult
constant RoundStart
constant RoundComplete
constant BattleResultsBegin
constant BattleResults
constant BattleOver
constant ObserverChange
constant MoveAbilitySelected - This is a 'precast' event on the client that is triggered as soon as an action is selected
constant MovePetSwapSelected - This is a 'precast' event on the client that is triggereed as soon as a pet swap action is selected
constant MoveTrapSelected - This is a 'precast' event on the client that is triggereed as soon as a trap action is selected

PetBattleRange

Table of constant range types for a PetBattleVisual, mapping to those selectable in WOWEdit
constant Invalid
constant Melee
constant Ranged
constant InPlace
constant PointBlank
constant BehindMelee
constant BehindRanged

PetBattleVisual

Table of data generated from a BattlePetVisual static data record in WOWEdit. Only records relevant to the current battle will be loaded into the pet battle script
integer ID - ID of the static data in WOWEdit
PetBattleRange range - One of the range constants
integer spellVisualID - spellVisualID associated with this visual
float castTime - time to channel a precast animation and visual
float impactTime - time after cast before impact (e.g. of a missile)
string scriptFunctionString - special script code for this visual

PetBattlePetAbility

Table of data generated from a BattlePetAbility static data record in WOWEdit. Only records relevant to the current battle will be loaded into the pet battle script
integer ID - ID of the static data in WOWEdit
integer visualID - ID of the PetBattleVisual table associated with this ability
{integer, ...} turnIDs - List of IDs of the PetBattlePetAbilityTurn tables associated with this ability

PetBattlePetAbilityTurn

Table of data generated from a BattlePetAbilityTurn static data record in WOWEdit. Only records relevant to the current battle will be loaded into the pet battle script
integer ID - ID of the static data in WOWEdit
integer abilityID - ID of the parent PetBattlePetAbility table that this turn belongs to
integer visualID - ID of the PetBattleVisual table associated with this turn
{integer, ...} effectIDs - List of IDs of the PetBattlePetAbilityEffect tables associated with this turn

PetBattlePetAbilityEffect

Table of data generated from a BattlePetAbilityEffect static data record in WOWEdit. Only records relevant to the current battle will be loaded into the pet battle script
integer ID - ID of the static data in WOWEdit
integer turnID - ID of the parent PetBattlePetAbilityTurn table that this effect belongs to
integer visualID - ID of the PetBattleVisual table associated with this effect
integer effectType - ID of the PetBattlePetAbilityEffectType of this effect

PetBattlePetAbilityEffectType

Table of data generated from a BattlePetEffectProperties static data record in WOWEdit. Only records relevant to the current battle will be loaded into the pet battle script
integer ID - ID of the static data in WOWEdit
integer visualID - ID of the PetBattleVisual table associated with this effect type

PetBattlePetAura

Table of aura information associated with a pet or pad
integer instanceID - unique instance ID used to identify this aura application
integer abilityID - ability ID of the aura ability
integer turnsRemaining - number of turns remaining until the aura expires. -1 indicates the aura lasts forever
PetBattlePlayerID casterPlayerID - identifier of the player that owns the pet that applied this aura
PetBattlePetID casterPetID - identifier of the pet of the casterPlayerID player that applied this aura

PetBattlePetState

Table of a particular state variable associated with a pet or pad
integer ID - ID of the state variable
integer value - current value of the state variable

PetBattlePetActiveAbility

Table of information associated with the active abilities of a pet (i.e. the abilities that can actually be cast, and are on the UI bar)
integer abilityID - references a PetBattlePetAbility table by ID
integer cooldownRemaining - number of cooldown rounds remaining
integer lockdownRemaining - number of lockdown rounds remaining

PetBattlePetStatus

Table of status flags associated with a pet
boolean isTrapped - pet is currently in a trap
boolean isStunned - pet is stunned
boolean isSwapLocked - pet is locked from swapping out
boolean isSwapInLocked - pet is locked from swapping in

PetBattlePet

Table of data describing the entire current state of a pet
PetBattlePetID slot - indicates which slot of the owning player this pet is in
integer creatureID - Creature record ID of the pet
integer displayID - CreatureDisplay record ID of the pet
integer baseHealth - maximum health of the pet
integer level - current level of the pet
integer xp - current XP of the pet
integer health - current health of the pet
{PetBattlePetActiveAbility, ...} abilities - list of active abilities that the pet posseses, as well as their cooldowns etc
{PetBattlePetAura, ...} auras - list of auras currently active on the pet
{PetBattlePetState, ...} states - list of current state variables and their values on the pet
PetBattlePetStatus status - status flags of the pet (e.g. stunned, trapped)

PetBattlePlayer

Table of data describing the entire current state of a player
boolean isNPC - is this player AI controlled
PetBattlePlayerID playerID - indicates which of the two players (or weather) this data is for
PetBattlePetID activePet - slot of the currently active front pet
{PetBattlePet, ...} petDescs - list of pet state data for this player
integer trapAbilityID - ability ID that this player should use for a trap
integer npcCreatureID - in an NPC battle, this indicates the Creature ID to spawn as an opponent player
integer npcDisplayID - in an NPC battle, this indicates the CreatureDisplay ID of the opponent

PetBattle

Table of data describing the entire current state of the battle, it's players and their pets
PetBattleState battleState - current stage of the battle
integer round - round number of the round awaiting playback
{PetBattlePlayer, ...} players - list of the state of players in the battle
{PetBattlePetAbility, ...} abilityDescs - static database of all the relevant abilities to the battle
{PetBattlePetAbilityTurn, ...} abilityTurnDescs - static database of all the relevant ability turns to the battle
{PetBattlePetAbilityEffect, ...} abilityEffectDescs - static database of all the relevant ability effects to the battle
{PetBattlePetAbilityEffectType, ...} abilityEffectTypeDescs - static database of all the relevant effect types to the battle
{PetBattleVisual, ...} abilityVisualDescs - static database of all the relevant ability visuals to the battle

PetBattleFinalPet

Table of data describing a victory ceremony reward for a pet
integer playerID - player whose pet will be rewarded
integer petSlot - slot of the pet to be rewarded
boolean wasCaptured - was this pet captured (trapped) during the battle
boolean awardedXP - total experience awarded
integer newLevel - final level of the pet
integer newXP - final XP of the pet
integer newHealth - new health value of the pet, after round recovery is applied
boolean caged - did the pet end up in a cage

PetBattleEventFlags

Table of flags for a round effect
boolean invalidTarget - indicates the round effect failed on the server for some unknown reason
boolean miss
boolean crit
boolean blocked
boolean dodge
boolean heal
boolean unkillable
boolean reflect
boolean absorb
boolean immune
boolean strong
boolean weak

PetBattleEventTable

Table of data representing a scene playback element
integer instanceID - unique instance ID to identify this particular playback element. These are used in SignalRoundEffectApplied.
PetBattleEvent eventType - type of playback event (e.g. begin round, round result, round result)
integer roundNumber - round number that this playback element is associated with
integer turnInstanceID - for round results, this is a number uniquely identifying this result as belonging to a particular source ability turn
integer stackDepth - for round results, indicates the proc depth of the result
PetBattleEffect effectType - for round results, this indicates the type of result (e.g. SetHealth)
PetBattleEventFlags flags - for round results, this indicates the success or failure
integer sourceAuraInstanceID - indicates the source of this result is an aura. The caster will be who originally applied this aura
PetBattlePlayerID casterPlayerID - player ID of the caster that caused this round result
PetBattlePetID casterPetSlot - pet slot of the caster that caused this round result
PetBattlePlayerID targetPlayerID - player ID of the target of this round result
PetBattlePetID targetPetSlot - pet slot of the target of this round result
integer effectID - an ID of a PetBattlePetAbilityEffect table associated with this round result
integer value - if the effect type sets a value (e.g. health), then the new value will be in this field
integer auraInstanceID - for aura related round results, this is the instance ID of the aura to manipulate
integer auraAbilityID - for aura added round results, this is the ability ID of the aura added, and references a PetBattlePetAbility table
integer auraTurnsRemaining - for aura related round results, this is the number of turns remaining on the aura
integer stateID - indicates the state variable ID for effect type SetState
PetBattlePetStatus status - for StatusChange round results, this indicates the new values of the flags
PetBattleState stateChange - for RoundComplete event types, this indicates the change to the overall battle state at the end of the round
PetBattlePlayerID winnerID - for BattleResults and BattleOver event types, this is the player slot of the winner of the battle. An invalid player ID indicates a draw or there was no winner
boolean abandoned - for BattleResults and BattleOver event types, this indicates if the battle was actually abandoned
{PetBattleFinalPet, ...} rewards - for BattleResults and BattleOver event types, this is a list of all the individual rewards that should be applied

MissReasons

Table containing constants mapping to the various miss reasons available to floating world text
constant None
constant Physical
constant Resist
constant Dodged
constant Parried
constant Blocked
constant Evaded
constant Immune
constant Immune
constant Deflected
constant Absorbed
constant Reflected
constant Misfired

WorldText

Table containing constants mapping to the different kinds of floating world text that can be displayed
constant Damage
constant Absorb
constant Critical
constant Miss
constant XPGain
constant HonorGain
constant Healing
constant HealingCritical
constant BuildingDamage
constant BuildingHeal
constant Threat
constant WhiteDamage
constant None

BroadcastType

Table containing constants mapping to the different kinds of broadcast
constant Say
constant Yell
constant Whisper - NOT YET IMPLEMENTED
constant Emote - NOT YET IMPLEMENTED
constant Invalid

MoveRotControl

Table containing constants indicating how an angle should be adjusted with progress along a move path
constant None - Do not influence rotation
constant Angle - Rotate the shortest arc to reach angle (degrees)
constant AngleAbs - Rotate to this angle exactly, ignoring wrap around
constant Tangent - Angle is adjusted to match the tangent of the path
constant LookAt - Angle is adjusted to face the current look at path point

MovePosControl

Table containing constants indicating how position should change over time as a move path is followed
constant TotalTime - Use the MoveData time field as the total time to travel the path
constant ConstantSpeed - Use the MoveData time field as a constant speed to travel the path
constant ConstantSpeedXY - Use the MoveData time field as a constant speed to travel the path, ignoring vertical changes
constant PointTime - Use each MovePoint's time field as the time taken to reach that point
constant PointSpeed - Use each MovePoint's speed field as the speed to be at when crossing that point
constant PointSpeedXY - Use each MovePoint's speed field as the speed to be at when crossing that point, ignoring vertical changes
constant PointSpeedMul - Use each MovePoint's speed field as a multiplier on the base MoveData speed when crossing that point
constant PointSpeedMulXY - Use each MovePoint's speed field as a multiplier on the base MoveData speed when crossing that point, ignoring vertical changes

AnimTier

Table containing constants mapping to an animation tier for an Actor
constant Ground
constant Swim
constant Hover
constant Fly
constant Submerged
constant Invalid

ActorAOIPriority

Table containing constants indicating the priority of an actor. Low priority actors are eligible to be faded out if the current actor count is high.
constant Always - If the actor is in range, it will always beshown, regardless of actor count
constant Low

ActorAOIRange

Table containing constants indicating at what distance an actor should fade
constant None - 0 yards
constant Infinite - extends to the farclip plane
constant Gigantic - 400 yards
constant Large - 200 yards
constant Normal - 100 yards
constant Small - 50 yards
constant Tiny - 25 yards

CursorRange

Table containing constants indicating how to disable interaction cursor with range
constant AlwaysOutOfRange - Interaction always out of range
constant AlwaysInRange - Interaction always in range
constant RangeFromPlayer - Interaction range is distance to local player
constant RangeFromCamera - Interaction range is distance to local camera
constant RangeFromActor - Interaction range is distance to a specified actor

ReactionType

Table containing constants indicating an override reaction type for the actor (dictates selection, nameplate color if interactible)
constant Default - Default to the reaction dictated by the creature data
constant Hostile - Appear as hostile (RED)
constant Unfriendly - Appear as unfriendly (ORANGE)
constant Neutral - Appear as neutral (YELLOW)
constant Friendly - Appear as friendly (GREEN)
constant Dead - Appear as dead (GRAY)

WeaponSlot

Table containing constants indicating weapon slots
constant MainHand - Main hand weapon slot
constant OffHand - Off hand weapon slot
constant Ranged - Ranged weapon slot
constant None - Invalid slot

SheatheState

Table containing constants indicating weapon sheathing
constant Sheathed - Sheathe all weapons
constant ShowWeapon - Show melee weapons
constant ShowRanged - Show ranged weapons

AnimKitSpeedType

Table containing constants indicating how to interpret the additional speed value used to play an anim kit
constant None - Speed unchanged from that defined in the anim kit
constant Set - Force speed to the override value
constant Scale - Scale anim kit speed by the override value
constant ScaleMoveSpeed - Interpret override value as a move speed, and scale anim playback speed by the animated move speed (used to reduce foot sliding)

AnimKitBlendType

Table containing constants indicating how to interpret the additional blend value used to play an anim kit
constant None - Blend time unchanged from that defined by default in the anim kit and the models animation data
constant Set - Force blend time to the override value
constant Min - Take the minimum blend time of the default and the override value
constant Max - Take the maximum blend time of the default and the override value

ActorAOISettings

Table of data that describes how an actor should be faded automatically with range
ActorAOIPriority priority - indicate the actor priority. Low priority actors are candidates for auto fading if the actor count is high.
ActorAOIRange range - indicate the automatic fading range of the actor.
ActorAOIRange minRange - indicate a minimum distance that an actor must be from you to be visible (inverse AOI).

ActorCreateData

Table of data that is defines how, where and what sort of actor should be created, passed to various Scene create functions
integer creatureID - creature record to use to spawn the actor, the record MUST be flagged as client local
integer creatureDisplayID - creature display ID override to spawn the actor
integer itemID - item record used to spawn the actor, the model and texture will be taken from the item record
string model - model filename override to spawn the actor with
float scale - initial span scale of the actor
float facingOffset - reorient the base facing of the actor by this angle (degrees)
string name - name to show for the actor if it is interactible
Transform transform - spawn location of the actor
float hoverHeight - height to hover above the ground if ground snapping is enabled
boolean groundSnap - actor should snap to ground
boolean interactible - actor is interactible (can be moused over)
boolean selectable - actor is selectable
boolean floatingTooltip - if interactible, a floating tooltip should be shown
boolean smoothPhase - actor will smooth phase if a matching unit/actor is available
ActorAOISettings aoiSettings - controls the automatic fading off the actor
ReactionType overrideReaction - controls the reaction type for the actor

MovePoint

Table of point data, contained in a list of points in a parent MoveData table structure. Defines information for each point on a path.
Vector pos - location of the path point
Vector lookAt - a look at point for this path point, used by any angle control set to the LookAt option
float time - time value associated with this point, used if the MoveData posControl is PointTime
float speed - speed value asscoiated with this point, used if the MoveData posControl is any of the PointSpeed options
float yaw - yaw angle at this point in degrees, used if the MoveData yawControl is any of the Angle options
float pitch - pitch angle at this point in degrees, used if the MoveData pitchControl is any of the Angle options
float roll - roll angle at this point in degrees, used if the MoveData rollControl is any of the Angle options

MoveData

Table of move data, contains a list of points or a pathID of point data, as well as information about how the path should be followed
boolean isRelative - points/angles of the path are relative to the actors current location and orientation
boolean isGroundSnapping - points of the path will be ground snapped, with the Z value of the point being used as an offset from ground level (unless forceGroundSnapPositionZ is also flagged
boolean teleportToFirstPoint - rather than moving from the current location to the first point, the actor will snap to the first point instantly
boolean forceGroundSnapPositionZ - if ground snapping, the position z is used only for the ground test and not as a relative ground offset
boolean noDefaultAnimation - do not play a default movement animation
integer animKitID - custom anim kit to use while performing this movement
MovePosControl posControl - indicate what timing method should be used to follow the path
MoveRotControl yawControl - indicate how yaw should change along the path
MoveRotControl pitchControl - indicate how pitch should change along the path
MoveRotControl rollControl - indicate how roll should change along the path
float time - total time to travel the path, used if posControl is set to TotalTime
float speed - constant speed (or base speed) to use to travel the path, if posControl is set to ConstantSpeed, PointSpeedMul, PointSpeedMulXY
{MovePoint, ...} points - list of point data for the path
integer pathID - if specified, attempt to use path data from the DB

AnimKitData

Table of anim data, used to play an animation kit and override animations, start time blending and speed
integer animKitID - ID of the anim kit to play. All speed, blend and start time settings come from the anim kit data unless otherwised specified here
boolean isMaintained - if true, anim kit will play as a maintained/looping kit, and will need to be manually stopped. If false, anim kit plays as a fire and forget one-shot
integer animOverride - Entry from the Animations table to override as the initial anim of the anim kit
integer boneSetIDOverride - Entry from the AnimKitBoneSet table for an override bone to play on (-1 means use default specified in the anim kit)
integer variationOverride - Override the variation index for the initial anim
integer startTimeOverrideMS - If specified, anim kit will begin from this many milliseconds into the initial animation
float startTimeOverrideProgress - If specified, the initial animation will start at this percentage completion (0 to 1). Takes precedence over the milliseconds value above
AnimKitBlendType blendOverrideType - Indicate what type of blend override to use
integer blendOverrideMS - Indicate the value for the blend override
AnimKitSpeedType speedOverrideType - Indicate what type of speed override to use
float speedOverrideValue - Indicate the value for the speed override

AttachmentData

Table of attachment data, used to define a link between one actor and another
Actor parentActor - parent actor to attach to
integer parentAttachment - attachment index in the AttachmentPoints table to attach to
boolean useChildAttachOrientation - if true, the orientation of the child attachment will be applied
integer childAttachment - if specified, this attachment point of the child will be attached to the parent
boolean useTargetOffset - if true, use the specified target offset from the attachment point. Otherwise, maintain the actors current offset from the attachment point
Transform targetOffset - target offset from the attachment point
float transitionTime - time to transition to the new attachment point

AnimKit

A class table that is a handle to an anim kit that was played on an Actor by script. The handle need not be stored, but can be if you later want to control or stop playback manually.

Stop

Function: Stop(AnimKit self)
Stop the anim kit from playing

IsStopped

Function: boolean IsStopped(AnimKit self)
Query if the anim kit has stopped
Return: boolean true if anim kit playback has stopped

SoundKit

A class table that is a handle to a sound kit that was played on an Actor by script. The handle need not be stored, but can be if you later want to control or stop playback manually.

Stop

Function: Stop(SoundKit self)
Stop the sound kit from playing

IsStopped

Function: boolean IsStopped(SoundKit self)
Query if the sound kit has stopped
Return: boolean true if sound kit playback has stopped

UnitDisplay

A class table that provides base functionality for manipulating animation, sound and spell effects on an Actor (or a real unit, in certain cases). The Actor class table also includes all of these functions.

GetScene

Function: Scene GetScene(UnitDisplay self)
Return: Scene the Scene object that owns this actor

GetPosition

Function: Vector GetPosition(UnitDisplay self)
Return: Vector current position of the actor

GetTransform

Function: Transform GetTransform(UnitDisplay self)
Return: Transform current transform of the actor

GetRaceID

Function: integer GetRaceID(UnitDisplay self, boolean useNativeVisual)
find the race of an actor or unit
Return: integer return the race ID of the actor or unit. Returns 0 if no race could be found
Parameters:

  1. boolean useNativeVisual: if true, return the race of what you were prior to your current transform

StopAnimKit

Function: StopAnimKit(UnitDisplay self, integer animKitID)
stop anim kit(s) from playing on this actor
Parameters:

  1. integer animKitID: stop all currently active anim kits on the actor matching this ID

IsPlayingCombatAction

Function: boolean IsPlayingCombatAction(UnitDisplay self)
Return: boolean true if the actor is playing a combat action anim kit (e.g. triggered from a spell visual)

GetAnimTier

Function: AnimTier GetAnimTier(UnitDisplay self)
Return: AnimTier current anim kit tier for the actor

SetAnimTier

Function: SetAnimTier(UnitDisplay self, AnimTier animTier)
switch the animation tier of the actor
Parameters:

  1. AnimTier animTier: new animation tier

ClearSpellPreCastVisual

Function: ClearSpellPreCastVisual(UnitDisplay self, integer spellVisualID, integer instanceID)
Clear a currently playing precast spell visual from the actor
Parameters:

  1. integer spellVisualID: cleared spell visuals must match this ID
  2. integer instanceID: cleared spell visuals must match this particular application instance

ClearSpellStateVisual

Function: ClearSpellStateVisual(UnitDisplay self, integer spellVisualID, integer instanceID)
Clear a currently playing state spell visual from the actor
Parameters:

  1. integer spellVisualID: cleared spell visuals must match this ID
  2. integer instanceID: cleared spell visuals must match this particular application instance

ClearSpellChannelVisual

Function: ClearSpellChannelVisual(UnitDisplay self, integer spellVisualID, integer instanceID)
Clear a currently playing channel spell visual from the actor
Parameters:

  1. integer spellVisualID: cleared spell visuals must match this ID
  2. integer instanceID: cleared spell visuals must match this particular application instance

PlaySpellPreCastVisual

Function: integer PlaySpellPreCastVisual(UnitDisplay self, integer spellVisualID)
Play (and maintain) the pre cast visual kit from a SpellVisual
Return: integer instance ID for the active spell visual
Parameters:

  1. integer spellVisualID: ID of the SpellVisual record to use

PlaySpellCastVisual

Function: integer PlaySpellCastVisual(UnitDisplay self, integer spellVisualID)
Play (and maintain) the cast visual kit from a SpellVisual
Return: integer instance ID for the active spell visual
Parameters:

  1. integer spellVisualID: ID of the SpellVisual record to use

PlaySpellCastVisualAtTargets

Function: integer PlaySpellCastVisualAtTargets(UnitDisplay self, integer spellVisualID, float missileSpeed, boolean speedAsTime, {Actor, ...} targets)
Play (and maintain) the cast visual kit from a SpellVisual at specific target actors
Return: integer instance ID for the active spell visual (on the caster)
Parameters:

  1. integer spellVisualID: ID of the SpellVisual record to use
  2. float missileSpeed: speed in yards per second of any produced missiles
  3. boolean speedAsTime: treat speed value as the time to reach target for missiles
  4. {Actor, ...} targets: list of actors to cast the spell visual at

PlaySpellCastVisualAtPoints

Function: integer PlaySpellCastVisualAtPoints(UnitDisplay self, integer spellVisualID, float missileSpeed, boolean speedAsTime, {Vector, ...} targets)
Play (and maintain) the cast visual kit from a SpellVisual at specific target points
Return: integer instance ID for the active spell visual (on the caster)
Parameters:

  1. integer spellVisualID: ID of the SpellVisual record to use
  2. float missileSpeed: speed in yards per second of any produced missiles
  3. boolean speedAsTime: treat speed value as the time to reach target for missiles
  4. {Vector, ...} targets: list of points to cast the spell visual at

PlaySpellImpactVisual

Function: PlaySpellImpactVisual(UnitDisplay self, integer spellVisualID)
Play a one shot impact visual kit from a SpellVisual
Parameters:

  1. integer spellVisualID: ID of the SpellVisual record to use

PlaySpellTargetImpactVisual

Function: PlaySpellTargetImpactVisual(UnitDisplay self, integer spellVisualID)
Play a one shot target impact visual kit from a SpellVisual
Parameters:

  1. integer spellVisualID: ID of the SpellVisual record to use

PlaySpellStateVisual

Function: integer PlaySpellStateVisual(UnitDisplay self, integer spellVisualID)
Play (and maintain) the state visual kit from a SpellVisual
Return: integer instance ID for the active spell visual
Parameters:

  1. integer spellVisualID: ID of the SpellVisual record to use

PlaySpellStateVisualAtTargets

Function: integer PlaySpellStateVisualAtTargets(UnitDisplay self, integer spellVisualID, {Actor, ...} targets)
Play (and maintain) the state visual kit from a SpellVisual at targets, useful for creating beams
Return: integer instance ID for the active spell visual
Parameters:

  1. integer spellVisualID: ID of the SpellVisual record to use
  2. {Actor, ...} targets: list of target actors

PlaySpellChannelVisualAtTargets

Function: integer PlaySpellChannelVisualAtTargets(UnitDisplay self, integer spellVisualID, {Actor, ...} targets)
Play (and maintain) the channel visual kit from a SpellVisual at targets, useful for creating beams
Return: integer instance ID for the active spell visual
Parameters:

  1. integer spellVisualID: ID of the SpellVisual record to use
  2. {Actor, ...} targets: list of target actors

ApplyLevelUpEffect

Function: ApplyLevelUpEffect(UnitDisplay self)
Play the ding effect on this actor

IsPlayingSpellCastAnim

Function: boolean IsPlayingSpellCastAnim(UnitDisplay self)
Return: boolean true if a cast spell visual is causing the actor to animate

IsPlayingSpellPreCastAnim

Function: boolean IsPlayingSpellPreCastAnim(UnitDisplay self)
Return: boolean true if a precast spell visual is causing the actor to animate

HasSpellEffect

Function: boolean HasSpellEffect(UnitDisplay self, integer spellID)
Return if any specific effects are attached to the actor from a specific spell source
Return: boolean has attached effects
Parameters:

  1. integer spellID: search for effects created from this spell record

HasCastSpellEffect

Function: boolean HasCastSpellEffect(UnitDisplay self, integer spellID)
Return if any specific cast effects are attached to the actor from a specific spell source
Return: boolean has attached effects
Parameters:

  1. integer spellID: search for cast effects created from this spell record

HasPreCastSpellEffect

Function: boolean HasPreCastSpellEffect(UnitDisplay self, integer spellID)
Return if any specific pre-cast effects are attached to the actor from a specific spell source
Return: boolean has attached effects
Parameters:

  1. integer spellID: search for pre-cast effects created from this spell record

HasPendingMissiles

Function: boolean HasPendingMissiles(UnitDisplay self, integer instanceID)
return if there are any pending (i.e. waiting on an anim event to launch) missiles on this actor
Return: boolean has missiles
Parameters:

  1. integer instanceID: spell visual handle returned from the Cast functions

HasPendingOrInFlightMissiles

Function: boolean HasPendingOrInFlightMissiles(UnitDisplay self, integer instanceID)
return if there are any pending or in flight missiles from this actor
Return: boolean has missiles
Parameters:

  1. integer instanceID: spell visual handle returned from the Cast functions

AddWorldXPGainText

Function: AddWorldXPGainText(UnitDisplay self, integer xpGain)
Add floating XP text
Parameters:

  1. integer xpGain: Numerical value

PlaySoundKit

Function: SoundKit PlaySoundKit(UnitDisplay self, integer soundKitID, boolean oneShot)
Play a 3D sound kit at the actor's location
Return: SoundKit Handle to the active sound
Parameters:

  1. integer soundKitID: Sound Entry ID of the sound kit to play
  2. boolean oneShot: Should the sound fire and forget or loop continuously

PlaySoundKitStereo

Function: SoundKit PlaySoundKitStereo(UnitDisplay self, integer soundKitID, boolean oneShot)
Play a 2D sound kit
Return: SoundKit Handle to the active sound
Parameters:

  1. integer soundKitID: Sound Entry ID of the sound kit to play
  2. boolean oneShot: Should the sound fire and forget or loop continuously

PlayMusic

Function: SoundKit PlayMusic(UnitDisplay self, integer soundKitID)
Play a 2D sound on the music channel
Return: SoundKit Handle to the active sound
Parameters:

  1. integer soundKitID: Sound Entry ID of the sound kit to play

StopSoundKit

Function: StopSoundKit(UnitDisplay self, integer soundKitID)
Stop all anim kits on the actor by sound kit ID
Parameters:

  1. integer soundKitID: stop all active sounds matching this ID

BroadcastText

Function: BroadcastText(UnitDisplay self, BroadcastType type, integer broadcastTextID)
Play chat bubbles and dialog on the actor, with the dialog playing in 3D
Parameters:

  1. BroadcastType type: Type of broadcast - e.g. yell, say
  2. integer broadcastTextID: ID of a BroadcastText record

BroadcastTextStereo

Function: BroadcastTextStereo(UnitDisplay self, BroadcastType type, integer broadcastTextID)
Play chat bubbles and dialog on the actor, with the dialog playing in 2D
Parameters:

  1. BroadcastType type: Type of broadcast - e.g. yell, say
  2. integer broadcastTextID: ID of a BroadcastText record

IsPlayingDialogSound

Function: boolean IsPlayingDialogSound(UnitDisplay self)
Return true if the dialog audio for a broadcast text is playing
Return: boolean Dialog sound is playing

Sync

A synchronization object used to control when script should yield back to the game. For example, a timer synch object allows the script to sleep for a certain number of seconds

IsSignaled

Function: integer IsSignaled(Sync self)
Return: integer if the condition (e.g. time) on the synch object has expired, this will return true

Reset

Function: Reset(Sync self)
Reset the timer on the synch object so it will need to wait the full time again

Vector

Table storing 3D position information
float x
float y
float z

Transform

Table storing a point and rotation in 3D space
Vector position
float yaw - degrees
float pitch - degrees
float roll - degrees

Color

Table for storing a 32 bit ARGB color value
byte a - alpha value, 0-255
byte r - red value, 0-255
byte g - green value, 0-255
byte b - blue value, 0-255

PathDataNode

Table representing a single node of information of a PathData parent table
Vector pos - position of the node
Vector rot - vector containing (roll, pitch, yaw) of the node (in degrees)
float scale - scale of the node
float value - additional data stored at the node

PathData

Table containing a list of path points, that can be populated directly from the data base
boolean isRelative - path points are relative to a local origin
{PathDataNode, ...} nodes - list of path nodes

PetBattleScene

This is the primary interface for all pet battle related functions, and is pushed to script automatically as the global variable 'battleScene'. Internally the scene manages the state of the battle, and this can be queried. It will also accumulate round results, and they can be processed from script and then signaled as completed, which will update the internal state and notify the UI

UseTestPlayerData

Function: boolean UseTestPlayerData(PetBattleScene self)
Return: boolean true if the user has enabled the CVAR to use test data for the pet battle

IsTestBattle

Function: boolean IsTestBattle(PetBattleScene self)
Return: boolean true if the user has enabled the CVAR to run a test pet battle

WarningsEnabled

Function: boolean WarningsEnabled(PetBattleScene self)
Return: boolean true if the user has enabled the CVAR to turn on pet battle warnings

SpawnPet

Function: Actor SpawnPet(PetBattleScene self, PetBattlePlayerID playerID, PetBattlePetID petID, ActorCreateData actorCreateData)
Spawn a pet specifically associated with a particular player and pet slot according to the supplied ActorCreateData. The pet actor will be uniquely bound to the game code, so that it can be identified for sound and other hooks
Return: Actor the newly spawned actor
Parameters:

  1. PetBattlePlayerID playerID: player owning the pet
  2. PetBattlePetID petID: slot of the pet
  3. ActorCreateData actorCreateData: spawn information for the pet

SpawnNPC

Function: Actor SpawnNPC(PetBattleScene self, PetBattlePlayerID playerID, ActorCreateData actorCreateData)
Spawn an NPC pet specifically associated with a particular player according to the supplied ActorCreateData. The pet actor will be uniquely bound to the game code, so that it can be identified for sound and other hooks
Return: Actor the newly spawned actor
Parameters:

  1. PetBattlePlayerID playerID: player owning the pet
  2. ActorCreateData actorCreateData: spawn information for the pet

GetBattleState

Function: PetBattle GetBattleState(PetBattleScene self)
Return the full up to date battle state associated with the pet battle. WARNING: this function is relatively expensive and should typically only be called on battle startup
Return: PetBattle full update of the current battle state

SignalOpeningComplete

Function: SignalOpeningComplete(PetBattleScene self)
Indicate that the opening phase of the pet battle intro is complete and that the UI should be displayed

HasPendingEffects

Function: boolean HasPendingEffects(PetBattleScene self)
Return: boolean true if there are pending events that need to be played back by the scene script

GetPendingEffect

Function: PetBattleEventTable GetPendingEffect(PetBattleScene self)
Return: PetBattleEventTable the first pending playback event

SignalEffectApplied

Function: SignalEffectApplied(PetBattleScene self, integer eventInstanceID)
When a playback event has been completed by the script, this notifies the internal state to update, which will in turn trigger the UI and other feedback
Parameters:

  1. integer eventInstanceID: instanceID of the playback event to signal. Since playback must occur in order, if the instance ID is not the first pending, all playback events will be flushed until this is reached

SignalBattleComplete

Function: SignalBattleComplete(PetBattleScene self)
Indicates that the battle playback has completed and the battle can shutdown

IsUIObserving

Function: boolean IsUIObserving(PetBattleScene self)
Return: boolean true if the battle is being observed from the pet battle UI

GetUIObservingPlayer

Function: integer GetUIObservingPlayer(PetBattleScene self)
Return: integer the slot of the player that the UI is observing the battle from

GetUICameraTransition

Function: integer GetUICameraTransition(PetBattleScene self)
Return: integer a value indicating if there is enough space available to successfuly perform the default camera transitoin

SetPetBattleGameCameraTarget

Function: SetPetBattleGameCameraTarget(PetBattleScene self, Actor cameraTarget, float zoomMin, float zoomMax)
Set the pet battle orbit camera to focus on an actor, restoring the pet battle camera zoom that has been saved
Parameters:

  1. Actor cameraTarget: target actor for the freelook camera
  2. float zoomMin: minimum zoom for the camera
  3. float zoomMax: maximum zoom for the camera

ResetPetBattleGameCameraZoom

Function: ResetPetBattleGameCameraZoom(PetBattleScene self)
Reset the game camera zoom to the normal values, and store the current pet battle zoom

GetActivePlayerDisplay

Function: UnitDisplay GetActivePlayerDisplay(PetBattleScene self, PetBattlePlayerID playerID)
Get a display handle for the active players in a pet battle, so that they can have animations and effects played on them
Return: UnitDisplay the display handle fof the requested player
Parameters:

  1. PetBattlePlayerID playerID: player slot of the player handle to obtain

PlayPetBattleMusic

Function: PlayPetBattleMusic(PetBattleScene self, integer soundKitID)
Play a sound by ID on the special PetBattleMusic sound track
Parameters:

  1. integer soundKitID: ID of the SoundEntry for the music

Actor

A class table that maps to an instance of a client created unit. As well as the functions listed below, an Actor contains all the functions of a UnitDisplay table.

SetTransform

Function: SetTransform(Actor self, Transform transform)
Set the current position and rotation of the actor
Parameters:

  1. Transform transform: new transform for the actor

SetModel

Function: SetModel(Actor self, ActorCreateData modelData)
Change the model used for the actor, without interrupting animation or movement
Parameters:

  1. ActorCreateData modelData: structure containing dispolay information for the new model. Transformation and name information are ignored, but a model file name, creature ID or creature display ID can be specified, as well as a scale and facing offset.

GetScale

Function: float GetScale(Actor self)
Return: float the current script scale of the actor

SetScale

Function: SetScale(Actor self, float scale)
Set the current script scale of the actor
Parameters:

  1. float scale: new scale for the actor

EquipWeapon

Function: EquipWeapon(Actor self, WeaponSlot slot, integer itemID)
Set the item equipped in a particular weapon slot (0 clears the slot)
Parameters:

  1. WeaponSlot slot: weapon slot
  2. integer itemID: ID of an item record in WOWEdit

GetSheatheState

Function: SheatheState GetSheatheState(Actor self)
Return: SheatheState the current target sheathe state of the actor (spell effects that manipulate sheathing will take priority, as with normal units)

SetSheatheState

Function: SetSheatheState(Actor self, SheatheState sheatheState, boolean instant)
Set the target sheathe state for the actor (spell effects that manipulate sheathing will take priority, as with normal units)
Parameters:

  1. SheatheState sheatheState: new target sheathe state
  2. boolean instant: do not animate any sheathe transition

GetHealth

Function: integer GetHealth(Actor self)
Return: integer the current health value of the actor, purely for visuals on the portrait

GetMaxHealth

Function: integer GetMaxHealth(Actor self)
Return: integer the current max health value of the actor, purely for visuals on the portrait

SetHealth

Function: SetHealth(Actor self, integer health)
Set the health that will displayed on UI elements (e.g. protrait frames) for this actor
Parameters:

  1. integer health: new health value of this actor

SetMaxHealth

Function: SetMaxHealth(Actor self, integer maxHealth)
Set the maximum health that will displayed on UI elements (e.g. protrait frames) for this actor
Parameters:

  1. integer maxHealth: new maximum health value of this actor

SetRelativeTo

Function: SetRelativeTo(Actor self, Actor parentActor)
Maintaining the actor's current position, mark it as relative to another actor. When the parent actor moves, the current offset from the parent will be maintained. When the child actor moves, movement will modify the offset to the parent
Parameters:

  1. Actor parentActor: actor that will become the new parent, or 'transport' of this actor

SetAttachedTo

Function: SetAttachedTo(Actor self, AttachmentData attachData)
Maintaining the actor's current position, mark it as relative to another actor's attachment point. When the parent actor moves, the current offset from the parent will be maintained. When the child actor moves, movement will modify the offset to the parent
Parameters:

  1. AttachmentData attachData: information for the attachment - parent actor, attachment point, offsets etc

GetAttachmentTransform

Function: Transform GetAttachmentTransform(Actor self, integer attachmentIndex, Transform offset, float predictAheadSeconds)
Return the world space transform of an attachment point of an actor. If the actor does not have that attachment point, the root of the actor will be returned.
Return: Transform Full transform of the attachment point (note, scale will be removed)
Parameters:

  1. integer attachmentIndex: attachment point to look up, see the AttachmentPoint table for available points
  2. Transform offset: additional transformation to apply to the attachment point
  3. float predictAheadSeconds: if the actor is moving, predict the attachment point this many seconds into the future. NOTE: this will be approximate

StopMovement

Function: StopMovement(Actor self)
Stop any current movement

Move

Function: Move(Actor self, MoveData moveData)
Instruct the actor to perform a movement
Parameters:

  1. MoveData moveData: data structure containing a description of the movement to be performed

IsMoving

Function: boolean IsMoving(Actor self)
Return: boolean true if the actor is moving

GetRemainingMoveTime

Function: float GetRemainingMoveTime(Actor self)
Return: float return time remaining until current movement complete

SetSnapToGround

Function: SetSnapToGround(Actor self, boolean snapToGround)
Turn on/off ground snapping for an actor. When snap is enabled, the actor will immediately snap from it's current location to the ground.
Parameters:

  1. boolean snapToGround: enable ground snap

IsGroundSnapPending

Function: boolean IsGroundSnapPending(Actor self)
Return: boolean true if this actor is set to snap to the ground, but ground couldn't not be found (either too high, or the ground may be too far out of range to be loaded)

SetHoverHeight

Function: SetHoverHeight(Actor self, float hoverHeight)
Modify the hover height for the actor. If the actor is ground snapping, this is the height above the ground that that the actor will maintain
Parameters:

  1. float hoverHeight: new hover height for the actor

GetHoverHeight

Function: float GetHoverHeight(Actor self)
Return: float current hover height of the actor

SetHoverHeightSpeed

Function: SetHoverHeightSpeed(Actor self, float hoverHeightSpeed)
Modify the hover height change speed of the actor. Rate at which hover height will be changed (a value of zero will lead to instant changes)
Parameters:

  1. float hoverHeightSpeed: new hover height for the actor

GetHoverHeightSpeed

Function: float GetHoverHeightSpeed(Actor self)
Return: float current hover height speed of the actor

SetFacing

Function: SetFacing(Actor self, float facingAngle)
Turn the actor to a given facing. If the actor is moving, or starts a new move, the facing will be reset to the direction of movement.
Parameters:

  1. float facingAngle: new facing angle for the actor (degrees)

SetFacingToAbs

Function: SetFacingToAbs(Actor self, Vector absPos)
Lock actor facing to a particular world position. The actor will continue to face this position during movement, until ClearFacing is called.
Parameters:

  1. Vector absPos: position in the world to face

SetFacingToTarget

Function: SetFacingToTarget(Actor self, Actor target, Vector offset)
Lock actor facing to another actor, plus a world space offset. Movement will not break the facing lock.
Parameters:

  1. Actor target: actor to focus facing direction on
  2. Vector offset: offset from the target actor to look at. (0,0,0) will look directly at the actor

ClearFacing

Function: ClearFacing(Actor self)
Remove any current facing lock on the actor. The actor will maintain it's current facing until a movement or other facing change.

SetHeadFacing

Function: SetHeadFacing(Actor self, float facingAngle)
Turn the actor's head to a given facing. If the actor is moving, or starts a new move, the head facing will be reset to the direction of movement.
Parameters:

  1. float facingAngle: new head facing angle for the actor (degrees)

SetHeadFacingToAbs

Function: SetHeadFacingToAbs(Actor self, Vector absPos)
Lock actor head facing to a particular world position. The actor will continue to face his head at this position during movement, until ClearHeadFacing is called.
Parameters:

  1. Vector absPos: position in the world to turn head to

SetHeadFacingToTarget

Function: SetHeadFacingToTarget(Actor self, Actor target, Vector offset)
Lock actor head facing to another actor, plus a world space offset. Movement will not break the head facing lock.
Parameters:

  1. Actor target: actor to focus head facing direction on
  2. Vector offset: offset from the target actor to look at. (0,0,0) will turn head directly at the actor

ClearHeadFacing

Function: ClearHeadFacing(Actor self)
Remove any current head facing lock on the actor. The actor's head facing will return to its current base facing.

SetFacingTurnRate

Function: SetFacingTurnRate(Actor self, float rate)
Adjust the rate at which facing adjustments are made by the actor. Default is '5', a higher number will turn faster
Parameters:

  1. float rate: new facing for the actor

GetFacingTurnRate

Function: float GetFacingTurnRate(Actor self)
Return: float current facing rate for the actor

IsReadyToDisplay

Function: boolean IsReadyToDisplay(Actor self)
Return: boolean true if the actor's model and textures are fully loaded, so that it can be rendered

SetHidden

Function: SetHidden(Actor self, boolean hidden)
Turn on and off rendering for an actor
Parameters:

  1. boolean hidden: new rendering state for the actor

Despawn

Function: Despawn(Actor self)
Fade out and despawn the actor

IsDespawned

Function: boolean IsDespawned(Actor self)
Test if the actor has been despawned
Return: boolean returns true if Despawn has previously been called on this actor

Fade

Function: Fade(Actor self, float alpha, float time)
Fade the actor to a particular alpha value over time
Parameters:

  1. float alpha: target alpha value for the fade (a number 0 to 1)
  2. float time: time to fade over, in seconds

SetFloatingTooltip

Function: SetFloatingTooltip(Actor self, boolean floating)
Enable or disable tooltips in the 'floating' style (e.g. signs on sign posts). Tooltips are only visible for interactable actors.
Parameters:

  1. boolean floating: set to true to enable tooltips in the 'floating' style

SetInteractible

Function: SetInteractible(Actor self, boolean interactable)
Control the interactability of the actor. Interactable actors have mouse-over highlight and tooltips available
Parameters:

  1. boolean interactable: set to true to make the actor interactable

SetSelectable

Function: SetSelectable(Actor self, boolean selectable)
Control the selectability of the actor. Selectable actors will have portrait frames and selection circles like a normal unit
Parameters:

  1. boolean selectable: set to true to make the actor selectable

SetInteractCursor

Function: SetInteractCursor(Actor self, string cursorName, CursorRange rangeType, float range, Actor relativeTo)
Change the cursor and interaction range for the actor
Parameters:

  1. string cursorName: name of the cursor file, e.g. 'crosshairs'
  2. CursorRange rangeType: method for calculating the range of the interaction {e.g. from player, from camera)
  3. float range: range of the interaction
  4. Actor relativeTo: if range type is relative to some other actor, specify that actor here (otherwise use nil)

GetOverrideReaction

Function: ReactionType GetOverrideReaction(Actor self)
Return: ReactionType return the current reaction type for this actor

SetOverrideReaction

Function: SetOverrideReaction(Actor self, ReactionType reaction)
Set an override for the reaction type for this actor, dictates selection color
Parameters:

  1. ReactionType reaction: new reaction type for the actor. Set to type default to revert to the creature data reaction

GetRightClickCount

Function: integer GetRightClickCount(Actor self)
Return: integer return the number of times this actor has been right clicked

CastSpell

Function: CastSpell(Actor self, integer spellID, Actor target)
Simulate a full spell cast, playing all appropriate spell visuals and respecting cast time to play precast visuals
Parameters:

  1. integer spellID: Spell table ID of the spell to cast. Must be available on the client
  2. Actor target: Target actor for impacts, missile destinations etc

IsCasting

Function: boolean IsCasting(Actor self)
Return: boolean true if the actor is simulating a spell cast