Information About ALE (AscEmu LuaEngine)
AscEmu LuaEngine (ALE) is a scripting engine that allows server developers to write custom game logic for AscEmu, a emulator based on the Antrix-Ascent-Arcemu cores. It uses the Lua scripting language to make it easier and faster to modify server behavior without recompiling the source code.
Scripting Language: Lua (is a powerful, fast, lightweight, embeddable scripting language.)
Purpose: To create scripts for NPC behavior, quests, events, spells, and more
Advantages:
-
Scripts can be loaded or modified without restarting the server.
-
Lua has a simple and lightweight syntax.
-
Highly flexible and ideal for custom content development.
Common Use Cases:
-
NPC dialogues and interactions.
-
Triggering events when players enter certain areas.
-
Item usage effects.
API Documentation
Information About the typical function names.
Basic Lua
Register Events and Server Hooks
GameObject Methods
| Command | Methods | Description |
|---|---|---|
| Activate | gameObject:Activate() | Returns nothing. Activates or deactivates a GO, for example, opens a door. |
| AddLoot | gameObject:AddLoot() | |
| AddToPhase | gameObject:AddToPhase() | |
| CalcRadAngle | gameObject:CalcRadAngle() | |
| CastSpell | gameObject:CastSpell() | |
| CastSpellOnTarget | gameObject:CastSpellOnTarget() | |
| ChangeScale | gameObject:ChangeScale() | |
| CreateLuaEvent | gameObject:CreateLuaEvent() | |
| CustomAnimate | gameObject:CustomAnimate() | |
| Damage | gameObject:Damage() | Returns nothing. Damages the GO if it is a destructible building. The guid is the damaging Unit’s GUID, and spellid is the damaging spell. |
| DeletePhase | gameObject:DeletePhase() | |
| Despawn | gameObject:Despawn() | |
| FullCastSpell | gameObject:FullCastSpell() | |
| FullCastSpellOnTarget | gameObject:FullCastSpellOnTarget() | |
| GetAreaId | gameObject:GetAreaId() | |
| GetByte | gameObject:GetByte() | |
| GetByteValue | gameObject:GetByteValue() | |
| GetClosestPlayer | gameObject:GetClosestPlayer() | |
| GetClosestUnit | gameObject:GetClosestUnit() | |
| GetCreatureNearestCoords | gameObject:GetCreatureNearestCoords() | |
| GetDistance | gameObject:GetDistance() | |
| GetDistanceYards | gameObject:GetDistanceYards() | |
| GetDungeonDifficulty | gameObject:GetDungeonDifficulty() | |
| GetEntry | gameObject:GetEntry() | Returns the entry ID. |
| GetFloatValue | gameObject:GetFloatValue() | |
| GetGameObjectNearestCoords | gameObject:GetGameObjectNearestCoords() | |
| GetGuid | gameObject:GetGuid() | |
| GetHP | gameObject:GetHP() | Returns the actual HP. |
| GetInRangeObjects | gameObject:GetInRangeObjects() | |
| GetInRangePlayers | gameObject:GetInRangePlayers() | |
| GetInRangePlayersCount | gameObject:GetInRangePlayersCount() | |
| GetInRangeUnits | gameObject:GetInRangeUnits() | |
| GetInstanceID | gameObject:GetInstanceID() | |
| GetLandHeight | gameObject:GetLandHeight() | |
| GetLocation | gameObject:GetLocation() | |
| GetMapId | gameObject:GetMapId() | |
| GetMaxHP | gameObject:GetMaxHP() | Returns the maximum HP. |
| GetName | gameObject:GetName() | Returns the name. |
| GetO | gameObject:GetO() | Returns ‘GameObject’ |
| GetObject | gameObject:GetObject() | Returns ‘GameObject’ |
| GetObjectType | gameObject:GetObjectType() | Returns ‘GameObject’ |
| GetPhase | gameObject:GetPhase() | |
| GetScale | gameObject:GetScale() | |
| GetSpawnId | gameObject:GetSpawnId() | |
| GetSpawnLocation | gameObject:GetSpawnLocation() | Returns the location of the spawned GameObject. |
| GetSpawnO | gameObject:GetSpawnO() | |
| GetSpawnX | gameObject:GetSpawnX() | |
| GetSpawnY | gameObject:GetSpawnY() | |
| GetSpawnZ | gameObject:GetSpawnZ() | |
| GetUInt32Value | gameObject:GetUInt32Value() | |
| GetUInt64Value | gameObject:GetUInt64Value() | |
| GetWorldStateForZone | gameObject:GetWorldStateForZone() | |
| GetX | gameObject:GetX() | |
| GetY | gameObject:GetY() | |
| GetZ | gameObject:GetZ() | |
| GetZoneId | gameObject:GetZoneId() | |
| GossipComplete | gameObject:GossipComplete() | |
| GossipCreateMenu | gameObject:GossipCreateMenu() | |
| GossipMenuAddItem | gameObject:GossipMenuAddItem() | |
| GossipObjectComplete | gameObject:GossipObjectComplete() | |
| GossipObjectCreateMenu | gameObject:GossipObjectCreateMenu() | |
| GossipObjectMenuAddItem | gameObject:GossipObjectMenuAddItem() | |
| GossipObjectSendMenu | gameObject:GossipObjectSendMenu() | |
| GossipObjectSendPOI | gameObject:GossipObjectSendPOI() | |
| GossipSendMenu | gameObject:GossipSendMenu() | |
| GossipSendPOI | gameObject:GossipSendPOI() | |
| GossipSendQuickMenu | gameObject:GossipSendQuickMenu() | |
| HasFlag | gameObject:HasFlag() | |
| IsActive | gameObject:IsActive() | |
| IsInBack | gameObject:IsInBack() | |
| IsInFront | gameObject:IsInFront() | |
| IsInPhase | gameObject:IsInPhase() | |
| IsInWorld | gameObject:IsInWorld() | |
| ModifyAIUpdateEvent | gameObject:ModifyAIUpdateEvent() | |
| ModUInt32Value | gameObject:ModUInt32Value() | |
| PhaseAdd | gameObject:PhaseAdd() | |
| PhaseDelete | gameObject:PhaseDelete() | |
| PhaseSet | gameObject:PhaseSet() | |
| PlaySoundToSet | gameObject:PlaySoundToSet() | |
| Rebuild | gameObject:Rebuild() | Returns nothing. Rebuilds the GO if it is a destructible building. Restores its HP to maximum and its display ID to normal. |
| RegisterAIUpdateEvent | gameObject:RegisterAIUpdateEvent() | |
| RemoveAIUpdateEvent | gameObject:RemoveAIUpdateEvent() | |
| RemoveEvents | gameObject:RemoveEvents() | |
| RemoveFlag | gameObject:RemoveFlag() | |
| RemoveFromWorld | gameObject:RemoveFromWorld() | Returns nothing. Removes the Game Object from the world. |
| SendPacket | gameObject:SendPacket() | |
| SetByte | gameObject:SetByte() | |
| SetByteValue | gameObject:SetByteValue() | |
| SetDungeonDifficulty | gameObject:SetDungeonDifficulty() | |
| SetFlag | gameObject:SetFlag() | |
| SetFloatValue | gameObject:SetFloatValue() | |
| SetOrientation | gameObject:SetOrientation() | |
| SetPhase | gameObject:SetPhase() | |
| SetPosition | gameObject:SetPosition() | |
| SetScale | gameObject:SetScale() | |
| SetUInt32Value | gameObject:SetUInt32Value() | |
| SetUInt64Value | gameObject:SetUInt64Value() | |
| SetWorldStateForZone | gameObject:SetWorldStateForZone() | |
| SetZoneWeather | gameObject:SetZoneWeather() | |
| SpawnCreature | gameObject:SpawnCreature() | |
| SpawnGameObject | gameObject:SpawnGameObject() | |
| Update | gameObject:Update() |
Unit Methods
| Command | Methods | Description |
|---|---|---|
| AddAchievement | unit:AddAchievement() | Returns nothing. Adds the Achievement with the ID specified to the player. |
| AddArenaPoints | unit:AddArenaPoints() | Returns nothing. Adds the specified amount of arena points to the Unit specified. |
| AddAura | unit:AddAura() | Returns nothing. Buffs/Debuffs the current unit/player with the spell specified, with the duration specified. Setting temp to true allows it to stay on after logging. |
| AddAuraObject | unit:AddAuraObject() | |
| AddGroupMember | unit:AddGroupMember() | Returns nothing. Adds the Target to the Player’s group. |
| AddGuildMember | unit:AddGuildMember() | Returns nothing. Forces pPlayer to join the Unit’s guild. |
| AddItem | unit:AddItem() | Returns nothing. Creates a new menu item, used after registering a new menu with GossipCreateMenu(). |
| AddLifetimeKills | unit:AddLifetimeKills() | Returns nothing. Adds the amount of lifetime kills specified to the player’s total count. |
| AddLoot | unit:AddLoot() | Returns nothing. Adds the specified item to the Unit’s loot table. This will drop in amounts of mincount to maxcount, and if freeforall is set to true, anyone can use it. |
| AddSkill | unit:AddSkill() | Returns nothing. Sets the player’s skill line at skill to current, and the max to max. |
| AddToPhase | unit:AddToPhase() | |
| AddVehiclePassenger | unit:AddVehiclePassenger() | Returns nothing. Spawns an NPC and adds it as a passenger to the vehicle. |
| AdvanceAllSkills | unit:AdvanceAllSkills() | Returns nothing. Advances all skills by amount. |
| AdvanceQuestObjective | unit:AdvanceQuestObjective() | Returns nothing. Advances the objective in quest id by 1. |
| AdvanceSkill | unit:AdvanceSkill() | Returns nothing. Advances the skill by count. |
| AggroWithInRangeFriends | unit:AggroWithInRangeFriends() | Returns nothing. Unknown. See core for usage. |
| Attack | unit:Attack() | Returns nothing. Sets the Unit’s main-hand attack speed to timer. If offhand is true, offhand is also set to this. |
| AttackReaction | unit:AttackReaction() | Returns nothing. Adds threat to the target (Not damage) using the spell specified. |
| BanFromChannel | unit:BanFromChannel() | Returns nothing. Bans the Unit from the Channel. |
| CalcAngle | unit:CalcAngle() | Returns nothing. Calculates the angle between x/y and x2/y2 and takes the Unit’s position into account. See page for more info. |
| CalcRadAngle | unit:CalcRadAngle() | Returns an angle in radians from the numbers x/y, x2/y2 and the Unit’s position. |
| CalcToDistance | unit:CalcToDistance() | Returns nothing. Calculates the distance between the Unit and the point specified. |
| CallForHelpHp | unit:CallForHelpHp() | Returns nothing. Sets the Unit’s ‘call for help’ HP to the hp specified. Basically, when the Unit hits this HP he flees for help. |
| CanAttack | unit:CanAttack() | Returns true if the unit can attack the target, false if not. |
| CanCallForHelp | unit:CanCallForHelp() | Returns nothing. Sets the Unit to be able/unable to call for help. |
| CancelSpell | unit:CancelSpell() | Returns nothing. Stops casting the current spell. |
| CanUseCommand | unit:CanUseCommand() | Returns true if the Unit can use the specified level (“a” is usually GM, “az” for an admin). |
| CastSpell | unit:CastSpell() | Returns nothing. Casts the specified spell. Any cast time is ignored. |
| CastSpellAoE | unit:CastSpellAoE() | |
| CastSpellAoF | unit:CastSpellAoF() | Returns nothing. Casts the targeted AoE spell (Think Blizzard & Shadowfury) at the given area. Ignores cast times. |
| CastSpellOnTarget | unit:CastSpellOnTarget() | Returns nothing. Casts the specified spell on the target. Any cast time is ignored. |
| ChangeGuildMaster | unit:ChangeGuildMaster() | Returns nothing. Changes the Guild Master to newmaster. |
| ChangeTarget | unit:ChangeTarget() | Returns nothing. Sets the Unit’s new target to new_target. |
| ChannelSpell | unit:ChannelSpell() | Returns nothing. Channels the spell given at the target. |
| ClearAllCooldowns | unit:ClearAllCooldowns() | Returns nothing. Clears all Cooldowns for the player. |
| ClearCooldownForSpell | unit:ClearCooldownForSpell() | Returns nothing. Removes the Cooldown of the spell specified for the player. |
| ClearThreatList | unit:ClearThreatList() | Returns nothing. Sets the threat of everyone on the Unit’s threat list to 1. |
| CreateGuardian | unit:CreateGuardian() | Returns nothing. Creates a guardian (a mob that attacks when you are attacked) with the specified parameters. |
| CreateLuaEvent | unit:CreateLuaEvent() | |
| CreatureHasQuest | unit:CreatureHasQuest() | Returns true if the creature can give the quest, otherwise returns false. |
| DealDamage | unit:DealDamage() | Returns nothing. Deals damage to the target with the specified spell. |
| DealGoldCost | unit:DealGoldCost() | Returns nothing. Removes the amount of copper from the player. |
| DealGoldMerit | unit:DealGoldMerit() | Returns nothing. Akin to DealGoldCost(), but adds copper instead of removing it. |
| DeletePhase | unit:DeletePhase() | Returns nothing. Removes the phase specified. If ‘save’ is set to true, and the Unit is a NPC/Object, then the Unit will be saved to the new phase it is automatically set to. |
| deMorph | unit:deMorph() | Returns nothing. Sets the Unit’s display id back to it’s native one. |
| DemoteGuildMember | unit:DemoteGuildMember() | Returns nothing. Forces the Unit to demote the target guild member. |
| Despawn | unit:Despawn() | Returns nothing. Despawns the Unit with the delay. If the respawntimer is set to 0, the mob won’t respawn. |
| DisableCombat | unit:DisableCombat() | Returns nothing. If set to true, disables the Unit’s ability to enter combat completely. |
| DisableMelee | unit:DisableMelee() | Returns nothing. If set to true, disables the Unit’s ability to use Melee Combat. |
| DisableRanged | unit:DisableRanged() | Returns nothing. If set to true, disables the Unit’s ability to use Ranged Combat. |
| DisableRespawn | unit:DisableRespawn() | Returns nothing. If set to false, the mob will no longer respawn. |
| DisableSpells | unit:DisableSpells() | Returns nothing. If set to true, disables the Unit’s ability to use Spells. |
| DisableTargeting | unit:DisableTargeting() | Returns nothing. If set to true, disables the Unit’s targeting capabilities (The mob will not be able to use targeted spells either). |
| DisbandGuild | unit:DisbandGuild() | Returns nothing. Disbands the Unit’s guild. |
| DismissPet | unit:DismissPet() | Returns nothing. Dismisses any current pet. |
| DismissVehicle | unit:DismissVehicle() | Returns nothing. Dismisses the vehicle of the selected unit. |
| Dismount | unit:Dismount() | Returns nothing. Dismounts the Unit. |
| EjectAllVehiclePassengers | unit:EjectAllVehiclePassengers() | Returns nothing. Ejects all passengers from the Unit’s vehicle. |
| EjectVehiclePassengerFromSeat | unit:EjectVehiclePassengerFromSeat() | Returns nothing. Ejects the passenger from the specified seat of the Unit’s vehicle. |
| Emote | unit:Emote() | Returns nothing. Makes the Unit use the emote specified. If time is greater than 0, then it is preformed after a delay of (time)ms. |
| EnableFlight | unit:EnableFlight() | Returns nothing. If set to true, disables the usage of all flight path nodes. |
| EnableFlyCheat | unit:EnableFlyCheat() | Returns nothing. Acts similar to the gm command .cheat fly. |
| EnableMoveFly | unit:EnableMoveFly() | Returns nothing. Similar to SetFlying(). |
| Energize | unit:Energize() | Returns nothing. Restores the amount of a type of energy to the target using a spell visual. See page for more info. |
| EnterVehicle | unit:EnterVehicle() | Returns nothing. Makes the Unit enter a vehicle. |
| EquipWeapons | unit:EquipWeapons() | Returns nothing. Equips the weapons specified in the specified slots. 1 (Main Hand), 2 (Off Hand), 3 (Ranged). |
| EventCastSpell | unit:EventCastSpell() | Returns nothing. Casts the spell on the target after the delay specified. Repeat set to 0 means that it repeats indefinitely. Ignores cast times. |
| EventChat | unit:EventChat() | Returns nothing. Sends a chat message with the parameters given after a delay in miliseconds. |
| ExitVehicle | unit:ExitVehicle() | Returns nothing. Makes the Unit exit it’s vehicle. |
| ExpandToRaid | unit:ExpandToRaid() | Returns nothing. Forcibly changes the Unit’s group to a raid. |
| FinishQuest | unit:FinishQuest() | Returns nothing. Forces the Unit to finish quest ID. Rewards are not given. |
| FlagFFA | unit:FlagFFA() | |
| FlagPvP | unit:FlagPvP() | Returns nothing. Flags the Player for PvP. |
| FullCastSpell | unit:FullCastSpell() | Returns nothing. Casts the specified spell. If the spell has a cast time, it is used. |
| FullCastSpellAoE | unit:FullCastSpellAoE() | |
| FullCastSpellAoF | unit:FullCastSpellAoF() | |
| FullCastSpellOnTarget | unit:FullCastSpellOnTarget() | Returns nothing. Casts the specified spell on the target. If the spell has a cast time, it is used. |
| GetAccountName | unit:GetAccountName() | Returns the player’s account name. |
| GetAddTank | unit:GetAddTank() | Returns the Unit second on the Unit’s threat table. |
| GetAITargets | unit:GetAITargets() | Returns all units with threat on the Unit’s threat table. |
| GetAITargetsCount | unit:GetAITargetsCount() | Returns the amount of units with threat on the Unit’s threat table. |
| GetAreaId | unit:GetAreaId() | Returns the Unit’s area id. |
| GetArenaPoints | unit:GetArenaPoints() | Returns the amount of Arena Points that the Unit specified has. |
| GetAuraObjectById | unit:GetAuraObjectById() | Returns a aura object with the entered spell id. |
| GetAuraStackCount | unit:GetAuraStackCount() | |
| GetByteValue | unit:GetByteValue() | Returns the Byte value at index, index1. (Disabled) |
| GetChannelMemberCount | unit:GetChannelMemberCount() | Returns the number of members in Channel. |
| GetChannelPassword | unit:GetChannelPassword() | Returns the password for the Channel. |
| GetClosestEnemy | unit:GetClosestEnemy() | Returns the closest Unit to the Unit considered ‘hostile’. |
| GetClosestFriend | unit:GetClosestFriend() | Returns the closest Unit to the Unit considered ‘friendly’. |
| GetClosestPlayer | unit:GetClosestPlayer() | Returns the closets player to the Unit. |
| GetClosestUnit | unit:GetClosestUnit() | |
| GetCoinage | unit:GetCoinage() | Returns the amount of copper the player has. |
| GetCreatureNearestCoords | unit:GetCreatureNearestCoords() | Returns a creature that with the specified ID that is closest to the co-ordinates given. |
| GetCurrentSkill | unit:GetCurrentSkill() | Returns the player’s Skill level of the skill specified. |
| GetCurrentSpell | unit:GetCurrentSpell() | Returns a SPELL object. |
| GetCurrentSpellId | unit:GetCurrentSpellId() | Returns the spell entry ID that is current casting. |
| GetDisplay | unit:GetDisplay() | Returns the Unit’s current display ID. |
| GetDistance | unit:GetDistance() | Returns the number of pixels between the Unit and target. |
| GetDistanceYards | unit:GetDistanceYards() | Returns the number of yards between the Unit and target. |
| GetDuelState | unit:GetDuelState() | Returns the stage in which a duel is taking place with the unit. 0 (Requested), 1 (Started) or 2 (Finished). |
| GetDungeonDifficulty | unit:GetDungeonDifficulty() | Returns the dungeon difficulty of the Unit. |
| GetEntry | unit:GetEntry() | Returns the Unit’s entry id (does not work for items). |
| GetEquippedItemBySlot | unit:GetEquippedItemBySlot() | Returns an ITEM object from the item in the slot specified. |
| GetFaction | unit:GetFaction() | Returns the Unit’s faction. |
| GetFactionStanding | unit:GetFactionStanding() | Returns a string value of the Unit’s standing with the faction. |
| GetFloatValue | unit:GetFloatValue() | Returns the Unit’s float value. (Disabled) |
| GetGameObjectNearestCoords | unit:GetGameObjectNearestCoords() | Returns the object closest to the co-ordinates specified with the id designated. |
| GetGender | unit:GetGender() | Returns a numerical representation of the Unit’s gender. |
| GetGmRank | unit:GetGmRank() | Returns the player’s GM rank in string form (Ie, “a”, “az”). Returns nil when the player is not a GM. |
| GetGroupLeader | unit:GetGroupLeader() | Returns a object of the player’s group leader. |
| GetGroupPlayers | unit:GetGroupPlayers() | Returns a table with the userdata of all players in Unit’s group. |
| GetGroupType | unit:GetGroupType() | Returns the player’s group type. Returns nil if the player is not in a group. |
| GetGuid | unit:GetGuid() | Returns the Unit’s GUID. A GUID is a unique number assigned to each and every object, unit and player in AE. |
| GetGuildId | unit:GetGuildId() | Returns the player’s Guild ID. Note that the guild ID is NOT the guild name. |
| GetGuildLeader | unit:GetGuildLeader() | Returns a string value of the Guild Leader’s name. |
| GetGuildMemberCount | unit:GetGuildMemberCount() | Returns the amount of members in the guild. |
| GetGuildMembers | unit:GetGuildMembers() | Returns a table of strings of guild members. |
| GetGuildMotd | unit:GetGuildMotd() | Returns the Message of the Day from the specified unit’s guild. |
| GetGuildName | unit:GetGuildName() | Returns the player’s guild name. |
| GetGuildRank | unit:GetGuildRank() | Returns the Unit’s guild rank. |
| GetHealth | unit:GetHealth() | Returns an absolute value of the Unit’s health. |
| GetHealthPct | unit:GetHealthPct() | Returns a percentage of the Unit’s health. |
| GetHonorToday | unit:GetHonorToday() | Returns all Honor earned by the Unit today. |
| GetHonorYesterday | unit:GetHonorYesterday() | Returns the Unit’s honor that was earnt yesterday. |
| GetInRangeEnemies | unit:GetInRangeEnemies() | Returns all hostiles in range of the Unit. |
| GetInRangeFriends | unit:GetInRangeFriends() | Returns all friendlies in range of the Unit. |
| GetInRangeObjects | unit:GetInRangeObjects() | Returns all nearby GameObjects in range of the Unit. |
| GetInRangeObjectsCount | unit:GetInRangeObjectsCount() | Returns a count of all the GameObjects in range of the Unit. |
| GetInRangePlayers | unit:GetInRangePlayers() | Returns all players in range of the Unit. |
| GetInRangePlayersCount | unit:GetInRangePlayersCount() | Returns a count of all the players in range of the Unit. |
| GetInRangeUnits | unit:GetInRangeUnits() | Returns all units in the range of the Unit. |
| GetInstanceID | unit:GetInstanceID() | Returns the Unit’s instance id. |
| GetInventoryItem | unit:GetInventoryItem() | Returns the item in the player’s inventory in specified bag and slot. |
| GetInventoryItemById | unit:GetInventoryItemById() | Returns the slot that the item is in in the player’s inventory. |
| GetItemCount | unit:GetItemCount() | Returns how many of an item the Unit has. |
| GetLandHeight | unit:GetLandHeight() | Returns the land height using the parameters given. |
| GetLevel | unit:GetLevel() | |
| GetLocation | unit:GetLocation() | Returns the Unit’s x, y, z and o co-ordinates. |
| GetMainTank | unit:GetMainTank() | Returns the Unit with the highest threat on the Unit’s threat table. |
| GetMana | unit:GetMana() | Returns an absolute value of the Unit’s mana. |
| GetManaPct | unit:GetManaPct() | Returns a percentage of the Unit’s mana. |
| GetMapId | unit:GetMapId() | Returns the Unit’s map id. |
| GetMaxHealth | unit:GetMaxHealth() | Returns the maximum amount of health the Unit can have. |
| GetMaxMana | unit:GetMaxMana() | Returns the maximum amount of mana the Unit can have. |
| GetMaxPower | unit:GetMaxPower() | Returns the absolute value of the Unit’s power (If type is specified, that type is returned instead). |
| GetMaxSkill | unit:GetMaxSkill() | Returns the player’s Max Skill level of the skill specified. |
| GetName | unit:GetName() | Returns the Unit’s name. |
| GetNativeDisplay | unit:GetNativeDisplay() | Returns the Unit’s spawn display ID. |
| GetNativeFaction | unit:GetNativeFaction() | Returns the Unit’s spawn faction. |
| GetO | unit:GetO() | Returns the Unit’s o co-ordinate. |
| GetObject | unit:GetObject() | Returns a Unit based on the GUID given. |
| GetObjectType | unit:GetObjectType() | Returns ‘Player’ or ‘Unit’ depending on the Unit. |
| GetPetOwner | unit:GetPetOwner() | Returns nothing. Get Unit’s owner. |
| GetPhase | unit:GetPhase() | Returns the phase the Unit is currently in. |
| GetPlayerClass | unit:GetPlayerClass() | Returns a string representation of the player’s class. |
| GetPlayerLevel | unit:GetPlayerLevel() | Returns the Unit’s level. |
| GetPlayerMovementFlags | unit:GetPlayerMovementFlags() | Returns the movement flag of the player. See page for more information. |
| GetPlayerMovementVector | unit:GetPlayerMovementVector() | Returns information about the Player’s movement. |
| GetPlayerRace | unit:GetPlayerRace() | Returns a numerical representation of the player’s race. |
| GetPower | unit:GetPower() | Returns an absolute value of the Unit’s power (If type is specified, that type is returned instead). |
| GetPowerPct | unit:GetPowerPct() | Returns a percentage of the Unit’s power (If type is specified, that type is returned instead). |
| GetPowerType | unit:GetPowerType() | Returns a numerical representation of the Unit’s power type. |
| GetQuestLogSlot | unit:GetQuestLogSlot() | |
| GetQuestObjectiveCompletion | unit:GetQuestObjectiveCompletion() | Returns how many mobs killed for the specified quest and objective. |
| GetRandomEnemy | unit:GetRandomEnemy() | Returns a Unit that is considered an Enemy to the Unit. |
| GetRandomFriend | unit:GetRandomFriend() | Returns nothing. Gets a Unit that is considered a Friend to the Unit. |
| GetRandomPlayer | unit:GetRandomPlayer() | Returns a random player based on the flag specified. See page for more details. |
| GetSecondHated | unit:GetSecondHated() | |
| GetSelectedGO | unit:GetSelectedGO() | |
| GetSelection | unit:GetSelection() | Returns the player’s currently selected Unit. |
| GetSpawnId | unit:GetSpawnId() | Returns the Unit’s spawn ID. |
| GetSpawnLocation | unit:GetSpawnLocation() | Returns the Unit’s spawn x, y, and z co-ordinates. |
| GetSpawnO | unit:GetSpawnO() | Returns the Unit’s spawn position x co-ordinate. |
| GetSpawnX | unit:GetSpawnX() | Returns the Unit’s spawn position x co-ordinate. |
| GetSpawnY | unit:GetSpawnY() | Returns the Unit’s spawn position x co-ordinate. |
| GetSpawnZ | unit:GetSpawnZ() | Returns the Unit’s spawn position x co-ordinate. |
| GetStanding | unit:GetStanding() | Returns a numerical value of the Unit’s standing with the faction. |
| GetStealthLevel | unit:GetStanding() | Returns the Unit’s stealth level. To set the stealth level, use SetStealthLevel(). |
| GetTalentPoints | unit:GetTalentPoints() | Returns the player’s free talent points in the player’s primary (0) spec or secondary (1) spec. |
| GetTaxi | unit:GetTaxi() | Returns the taxi that the player is on. |
| GetTeam | unit:GetTeam() | Returns 1 if Horde, and 0 if Alliance. |
| GetThreat | unit:GetThreat() | Returns the amount of threat that the Unit has with the target specified. |
| GetTotalHonor | unit:GetTotalHonor() | Returns the unit’s total honor. |
| GetUInt32Value | unit:GetUInt32Value() | Returns the UInt32Value for Unit at field. (Disabled) |
| GetUInt64Value | unit:GetUInt64Value() | Returns the UInt64Value for Unit at field. (Disabled) |
| GetUnitByGUID | unit:GetUnitByGUID() | Returns the Unit with the GUID specified. |
| GetUnitBySqlId | unit:GetUnitBySqlId() | Returns the Unit with the specified SQL ID. |
| GetVehicleBase | unit:GetVehicleBase() | Returns nothing. Retrieves the base unit of the Unit’s vehicle. |
| GetWorldStateForZone | unit:GetWorldStateForZone() | |
| GetX | unit:GetX() | Returns the Unit’s x co-ordinate. |
| GetY | unit:GetY() | Returns the Unit’s y co-ordinate. |
| GetZ | unit:GetZ() | Returns the Unit’s z co-ordinate. |
| GetZoneId | unit:GetZoneId() | Returns the Unit’s zone id. |
| GiveHonor | unit:GiveHonor() | Returns nothing. Gives the player specified the amount of honor specified. |
| GiveXp | unit:GiveXp() | Returns nothing. Gives the Player the specified amount of XP. |
| GossipAddQuests | unit:GossipAddQuests() | Returns nothing. Adds quests to the gossip menu if any available. |
| GossipComplete | unit:GossipComplete() | Returns nothing. Completes (closes) the player’s gossip window. |
| GossipCreateMenu | unit:GossipCreateMenu() | Returns nothing. Creates a new NPC gossip menu with the TextID specified. |
| GossipMenuAddItem | unit:GossipMenuAddItem() | Returns nothing. Creates a new menu item, used after registering a new menu with GossipCreateMenu(). |
| GossipMiscAction | unit:GossipMiscAction() | Returns nothing. Performs a Gossip Action. |
| GossipSendMenu | unit:GossipSendMenu() | Returns nothing. Sends the gossip menu to the player. |
| GossipSendPOI | unit:GossipSendPOI() | Returns nothing. Sets a mark on the player’s mini map. Used when asking city guards where to go. |
| GossipSendQuickMenu | unit:GossipSendQuickMenu() | |
| GuildBankDepositMoney | unit:GuildBankDepositMoney() | Returns nothing. Removes gold from the unit and deposits it in the guild bank. |
| GuildBankWithdrawMoney | unit:GuildBankWithdrawMoney() | Returns nothing. Removes gold from the guild bank and gives it to the unit. |
| HandleEvent | unit:HandleEvent() | Returns nothing. Unknown, see core for usage. |
| HasAchievement | unit:HasAchievement() | Returns true if the player has the achievement, otherwise false. |
| HasAura | unit:HasAura() | Returns true if the Unit is afflicted by an aura with the id specified, otherwise false. |
| HasAuraWithMechanic | unit:HasAuraWithMechanic() | Returns true if the Unit has an aura that has a specific mechanic. See page for more details. |
| HasEmptyVehicleSeat | unit:HasEmptyVehicleSeat() | Returns nothing. Tells if the Unit’s vehicle has an empty seat. |
| HasFinishedQuest | unit:HasFinishedQuest() | Returns true if the unit has completed the quest, false otherwise. |
| HasFlag | unit:HasFlag() | Returns true if the Unit possess the flag at index, otherwise false. (Disabled) |
| HasInRangeObjects | unit:HasInRangeObjects() | Returns true if there are GameObjects in range of the Unit. |
| HasItem | unit:HasItem() | Returns true if the player has the item specified, false if not. |
| HasNegativeAura | unit:HasNegativeAura() | Returns true if the Unit has a debuff on them, otherwise it returns false. |
| HasPositiveAura | unit:HasPositiveAura() | Returns nothing. The same as HasNegativeAura(), but with buffs instead of debuffs. |
| HasQuest | unit:HasQuest() | Returns true if the Unit has the quest, returns false otherwise. |
| HasSkill | unit:HasSkill() | Returns true if the Unit has the skill specified, false if not. |
| HasSpell | unit:HasSpell() | Returns true if the Unit has the spell specified, false if not. |
| HasTitle | unit:HasTitle() | Returns true if the Unit has the title specified, otherwise false. |
| Heal | unit:Heal() | Returns an absolute value of the Unit’s health. |
| InterruptSpell | unit:InterruptSpell() | Returns nothing. Interrupts the current spell. |
| IsAlive | unit:IsAlive() | Returns true if the Unit is alive, otherwise false. |
| IsAttackable | unit:IsAttackable() | Returns true if Unit can attack target, otherwise false. |
| IsCreature | unit:IsCreature() | Returns true if the Unit is a creature, otherwise false. |
| isDazed | unit:isDazed() | Returns true if the Unit is dazed, otherwise false. |
| IsDead | unit:IsDead() | Returns true if the Unit is dead, otherwise false. |
| IsFeared | unit:IsFeared() | Returns true if the Unit is feared, otherwise false. |
| IsFFAFlagged | unit:IsFFAFlagged() | |
| IsFFAPvPFlagged | unit:IsFFAPvPFlagged() | Returns true if the Unit is flagged for free for all, otherwise false. |
| IsFlying | unit:IsFlying() | Returns true if the Unit is flying, otherwise false. |
| IsFriendly | unit:IsFriendly() | Returns true if the target is friendly to the Unit, otherwise false. |
| IsGm | unit:IsGm() | Returns true if the Unit has GM levels, otherwise false. |
| IsGroupedWith | unit:IsGroupedWith() | Returns true if the player is in a group with the target, false if not. |
| IsGroupFull | unit:IsGroupFull() | Returns true if the group is full, false if not. |
| IsHostile | unit:IsHostile() | Returns nothing. IsFriendly(target) for hostile Units. |
| IsInArc | unit:IsInArc() | Returns true if the target is in an Arc that is degrees wide from the Unit. |
| IsInBack | unit:IsInBack() | Returns true if the Unit is considered ‘behind’ target. |
| IsInChannel | unit:IsInChannel() | Returns true if the Unit is in the channel specified, otherwise false. |
| IsInCombat | unit:IsInCombat() | Returns true if the Unit is in Combat, otherwise false. |
| IsInDungeon | unit:IsInDungeon() | Returns true if the Unit is in a dungeon, otherwise false. |
| IsInFront | unit:IsInFront() | Returns true if the Unit is considered ‘in front’ target. |
| IsInGroup | unit:IsInGroup() | Returns true if the player is in a group, false if not. |
| IsInGuild | unit:IsInGuild() | Returns true if the Unit is in a guild, otherwise false. |
| IsInPhase | unit:IsInPhase() | Returns true if the Unit is in the specified phase, otherwise false. |
| IsInRaid | unit:IsInRaid() | Returns nothing. IsInDungeon() for raids. |
| IsInWater | unit:IsInWater() | Returns true if the Unit is in water, otherwise false. |
| IsInWorld | unit:IsInWorld() | Returns true if the Unit is in the world, otherwise false. |
| IsMounted | unit:IsMounted() | Returns true if the Unit is mounted, false if not. |
| IsOnTaxi | unit:IsOnTaxi() | Returns true if the Unit is on a taxi, otherwise false. |
| IsOnVehicle | unit:IsOnVehicle() | Returns nothing. Tells if the unit is on a vehicle. |
| IsPacified | unit:IsPacified() | Returns true if the unit is pacified, false if not. |
| IsPet | unit:IsPet() | Returns true if the Unit is a pet, otherwise false. |
| IsPlayer | unit:IsPlayer() | Returns true if the player is moving, false if not. |
| IsPlayerAttacking | unit:IsPlayerAttacking() | Returns true if the player is attacking, false if not. |
| IsPlayerMoving | unit:IsPlayerMoving() | Returns true if the player is moving, false if not. |
| isPoisoned | unit:isPoisoned() | Returns true if the unit is poisoned, false if not. |
| IsPvPFlagged | unit:IsPvPFlagged() | Returns true if the Unit is flagged for PvP, otherwise false. |
| IsRooted | unit:IsRooted() | Returns true if the Unit is rooted, otherwise false. |
| IsStealthed | unit:IsStealthed() | Returns true if the Unit is stealthed, otherwise false. |
| IsStunned | unit:IsStunned() | Returns true if the unit is stunned, false if not. |
| JoinChannel | unit:JoinChannel() | Returns nothing. Force-joins the specified channel. |
| KickFromChannel | unit:KickFromChannel() | Returns nothing. Kicks the Unit from the Channel. |
| KickPlayer | unit:KickPlayer() | Returns nothing. Kicks the player after the delay. Please leave your message after the beep. |
| Kill | unit:Kill() | Returns the player’s Skill level of the skill specified. |
| Land | unit:Land() | Returns nothing. Disables flying if set to 1. |
| LearnSpell | unit:LearnSpell() | Returns nothing. Teaches the Unit the spell given. |
| LearnSpells | unit:LearnSpells() | Returns nothing. Teaches the player all spells in the table specified. |
| LeaveChannel | unit:LeaveChannel() | Returns nothing. Leaves the channel. |
| LifeTimeKills | unit:LifeTimeKills() | Returns nothing. Adds the amount of lifetime kills specified to the player’s total count. |
| MarkQuestObjectiveAsComplete | unit:MarkQuestObjectiveAsComplete() | Returns nothing. Marks the objective of questid as completed. |
| ModFloatValue | unit:ModFloatValue() | Returns nothing. Modifies the Unit’s float value to the float specified. (Disabled) |
| ModifyAIUpdateEvent | unit:ModifyAIUpdateEvent() | Returns nothing. Modifies the AI Update event to run at newtime. |
| ModifyFlySpeed | unit:ModifyFlySpeed() | Returns nothing. Modifies the Unit’s fly speed to the specified speed. |
| ModifyRunSpeed | unit:ModifyRunSpeed() | Returns nothing. Modifies the Unit’s run speed to the specified speed. |
| ModifyWalkSpeed | unit:ModifyWalkSpeed() | Returns nothing. Modifies the Unit’s walk speed to the specified speed. |
| ModThreat | unit:ModThreat() | Returns nothing. Modifies the Unit’s threat against target by amount. |
| ModUInt32Value | unit:ModUInt32Value() | Returns nothing. Modifies the Unit’s uint32_t flag at index. (Disabled) |
| MovePlayerTo | unit:MovePlayerTo() | Returns nothing. MoveTo() for players. The flag can be 0 (walking), 256 (teleport), 4096 (running) or 12288 (flying). |
| MoveRandomArea | unit:MoveRandomArea() | Returns nothing. Moves the Unit to a random area within the given realm. |
| MoveTo | unit:MoveTo() | Returns nothing. Forcibly moves the Unit specified to the co-ordinates specified. |
| MoveVehiclePassengerToSeat | unit:MoveVehiclePassengerToSeat() | Returns nothing. Moves the specified passenger of the unit’s vehicle to another seat. |
| PhaseAdd | unit:PhaseAdd() | |
| PhaseDelete | unit:PhaseDelete() | |
| PhaseSet | unit:PhaseSet() | |
| PlayerSendChatMessage | unit:PlayerSendChatMessage() | Returns nothing. Forces the Player to send the message with the parameters specified. |
| PlaySoundToPlayer | unit:PlaySoundToPlayer() | Returns nothing. Like PlaySoundToSet(sound), only the sound only plays to the player specified. |
| PlaySoundToSet | unit:PlaySoundToSet() | Returns nothing. Plays the specified sound ID to everyone in the Unit’s map cell. |
| PlaySpellVisual | unit:PlaySpellVisual() | Returns nothing. ‘Casts’ the spell on the Unit GUID specified. The spell has no effect, and only the visual is played. To get a GUID, use GetGUID(). |
| Possess | unit:Possess() | Returns nothing. Like the GM command .npc possess. |
| PromoteGuildMember | unit:PromoteGuildMember() | Returns nothing. Forces the Unit to promote the target guild member. |
| QuestAddFinisher | unit:QuestAddFinisher() | Returns nothing. Allows the NPC to be used to finish the quest with the id given. |
| QuestAddStarter | unit:QuestAddStarter() | Returns nothing. Allows the NPC to be used to start the quest with the id given. |
| RegisterEvent | unit:RegisterEvent() | Returns nothing. Registers the method given with the delay given and repeats (0 repeats indefinitely). The name can either be a reference, a direct method or a string value of the method. |
| RemoveAchievement | unit:RemoveAchievement() | Returns nothing. Removes the Achievement with the ID specified from the player. |
| RemoveAIUpdateEvent | unit:RemoveAIUpdateEvent() | Returns nothing. Removes all AI Update Events. |
| RemoveAllAuras | unit:RemoveAllAuras() | Returns nothing. Removes all auras on the Unit. |
| RemoveArenaPoints | unit:RemoveArenaPoints() | Returns nothing. Removes the amount of arena points from the Unit specified. |
| RemoveAura | unit:RemoveAura() | Returns nothing. Removes the aura specified from the Unit. |
| RemoveAurasByMechanic | unit:RemoveAurasByMechanic() | Returns nothing. Removes all auras by the mechanic given. |
| RemoveAurasType | unit:RemoveAurasType() | Returns nothing. Removes all auras by the type given. |
| RemoveEvents | unit:RemoveEvents() | Returns nothing. Removes all events registered with RegisterEvent(). |
| RemoveFlag | unit:RemoveFlag() | Returns nothing. Removes the Unit’s flag at field, value. (Disabled) |
| RemoveFromWorld | unit:RemoveFromWorld() | Returns nothing. Removes the Unit from the world. |
| RemoveGuildMember | unit:RemoveGuildMember() | Returns nothing. Force-removes the targeted guild member from the specified unit’s guild. Note that the target must be online for this to work. |
| RemoveItem | unit:RemoveItem() | Returns nothing. Removes an item from the player with the count specified. |
| RemoveNegativeAuras | unit:RemoveNegativeAuras() | Returns nothing. Removes all negative auras from the Unit. |
| RemovePvPFlag | unit:RemovePvPFlag() | Returns nothing. Removes the Unit’s PvP flag. |
| RemoveSkill | unit:RemoveSkill() | Returns nothing. Removes the skill from Unit with the skill id specified. |
| RemoveStealth | unit:RemoveStealth() | Returns nothing. Removes any stealth from the specified Unit. |
| RemoveThreat | unit:RemoveThreat() | Returns nothing. Erases the target from the threat table. |
| RepairAllPlayerItems | unit:RepairAllPlayerItems() | Returns nothing. Repairs all items that the player has. |
| Repop | unit:Repop() | Returns nothing. Force releases the spirit of a dead player. |
| ResetAllTalents | unit:ResetAllTalents() | Returns nothing. Resets the player’s talents. |
| ResetModel | unit:ResetModel() | |
| ResetPetTalents | unit:ResetPetTalents() | Returns nothing. Resets the current pet’s talents. |
| ResetTalents | unit:ResetTalents() | |
| ResurrectPlayer | unit:ResurrectPlayer() | Returns nothing. Revives the player unit. |
| ReturnToSpawnPoint | unit:ReturnToSpawnPoint() | Returns the Unit to it’s spawn point. |
| Root | unit:Root() | Returns true if the Unit is rooted, otherwise false. |
| SavePlayer | unit:SavePlayer() | Returns nothing. Saves the player to the database. |
| SendAIReaction | unit:SendAIReaction() | |
| SendAreaTriggerMessage | unit:SendAreaTriggerMessage() | Returns nothing. Sends an Area Trigger message with the specified string to the player. |
| SendAuctionWindow | unit:SendAuctionWindow() | Returns nothing. Sends the player unit’s auction window. |
| SendBankWindow | unit:SendBankWindow() | Returns nothing. Sends the player specified a bank window with the unit as the sender. |
| SendBattlegroundWindow | unit:SendBattlegroundWindow() | Returns nothing. Sends the Player Unit’s battleground window. The battleground window varies on the ID you give it - see page for more info. |
| SendBroadcastMessage | unit:SendBroadcastMessage() | Returns nothing. Broadcasts the specified string to the player. |
| SendChatMessage | unit:SendChatMessage() | Returns nothing. Forces the Player to send the message with the parameters specified. |
| SendChatMessageAlternateEntry | unit:SendChatMessageAlternateEntry() | Returns nothing. Forces the Unit with the entry id specified to send a message with the parameters designated. |
| SendChatMessageToPlayer | unit:SendChatMessageToPlayer() | Returns nothing. Sends the player specified a chat message with the parameters designated. |
| SendGuildChatMessage | unit:SendGuildChatMessage() | Returns nothing. Forces Unit to send a message to guild. If officer is set to true, then the message is broadcasted in the officer chat instead. |
| SendGuildInvite | unit:SendGuildInvite() | Returns nothing. Forces the Unit to send a guild invite to pPlayer. |
| SendGuildLog | unit:SendGuildLog() | Returns nothing. Sends the Guild Log to the Unit. |
| SendInnkeeperWindow | unit:SendInnkeeperWindow() | Returns nothing. Sends an innkeeper window to the Unit. |
| SendLootWindow | unit:SendLootWindow() | Returns nothing. Sends a loot window to the Unit with the specified loottype. 1 (creature), 2 (skinning), 3 (pickpocket), 4 (fishing), 5 (herb/mining), 6 (disenchanting/prospecting/milling, etc). |
| SendPacket | unit:SendPacket() | Returns nothing. Sends the packet specified to all near Units. If self is set to true, the packet is also sent to the unit. See Packet Function Documentation for more information on packets. |
| SendPacketToGroup | unit:SendPacketToGroup() | Returns nothing. Sends the packet specified to the Unit’s group. See Packet Function Documentation for more information on packets. |
| SendPacketToGuild | unit:SendPacketToGuild() | Returns nothing. Sends the packet specified to the Unit’s guild. See Packet Function Documentation for more information on packets. |
| SendPacketToPlayer | unit:SendPacketToPlayer() | Returns nothing. Sends the packet specified to the Unit specified. See Packet Function Documentation for more information on packets. |
| SendTrainerWindow | unit:SendTrainerWindow() | Returns nothing. Akin to SendBankWindow(), but with trainers instead of banks. |
| SendVendorWindow | unit:SendVendorWindow() | Returns nothing. Akin to SendBankWindow(), but with vendors instead of banks. |
| SetAttackTimer | unit:SetAttackTimer() | Returns nothing. Sets the Unit’s main-hand attack speed to timer. If offhand is true, offhand is also set to this. |
| SetBindPoint | unit:SetBindPoint() | Returns nothing. Sets the Unit’s bind point to the co-ordinates specified. |
| SetByteValue | unit:SetByteValue() | Returns nothing. Sets the byte at index, index1 to value. (Disabled) |
| SetChannelName | unit:SetChannelName() | Returns nothing. Renames the Channel. |
| SetChannelPassword | unit:SetChannelPassword() | Returns nothing. Adds a password to the Channel. |
| SetCombatCapable | unit:SetCombatCapable() | Returns nothing. If set to true, disables the Unit’s ability to enter combat completely. |
| SetCombatMeleeCapable | unit:SetCombatMeleeCapable() | Returns nothing. If set to true, disables the Unit’s ability to use Melee Combat. |
| SetCombatRangedCapable | unit:SetCombatRangedCapable() | Returns nothing. If set to true, disables the Unit’s ability to use Ranged Combat. |
| SetCombatSpellCapable | unit:SetCombatSpellCapable() | |
| SetCombatTargetingCapable | unit:SetCombatTargetingCapable() | Returns nothing. If set to true, disables the Unit’s targeting capabilities (The mob will not be able to use targeted spells either). |
| SetCreatureNameById | unit:SetCreatureNameById() | Returns nothing. Currently the method is commented out. Do not use. |
| SetDeathState | unit:SetDeathState() | Returns nothing. Sets the Unit’s death state. 0 (Alive), 1 (Just Died), 2 (Corpse), 3 (Dead). |
| SetDungeonDifficulty | unit:SetDungeonDifficulty() | Returns nothing. Sets the Dungeon difficulty to the level specified. 0 (10M), 2 (25M), 3 (10M HC) 4 (25M HC). |
| SetFacing | unit:SetFacing() | Returns nothing. Forces the Unit to face the orientation provided. |
| SetFaction | unit:SetFaction() | Returns nothing. Sets the Unit’s faction to the faction specified. |
| SetFlag | unit:SetFlag() | |
| SetFloatValue | unit:SetFloatValue() | Returns nothing. Sets the Unit’s float value to the float specified. (Disabled) |
| SetFlying | unit:SetFlying() | Returns nothing. Allows the Unit to fly. Use Land() to force the unit to land again. |
| SetGender | unit:SetGender() | Returns nothing. Sets the gender of a character. |
| SetGroupLeader | unit:SetGroupLeader() | Returns nothing. Promotes the player specified to the Group Leader. If silent is set to true, then no message is made in the chat frame. |
| SetGuildInformation | unit:SetGuildInformation() | Returns nothing. Sets the Guild Information to the string provided. |
| SetGuildMotd | unit:SetGuildMotd() | Returns nothing. Sets the Message of the Day of the unit’s guild to the string given. |
| SetGuildRank | unit:SetGuildRank() | Returns nothing. Sets the Unit’s guild rank to the one specified. |
| SetHealth | unit:SetHealth() | Returns nothing. Sets the Unit’s health an absolute value based on the number specified. |
| SetHealthPct | unit:SetHealthPct() | Returns nothing. Sets the Unit’s health to a percentage based on the percentage given. |
| SetInFront | unit:SetInFront() | Returns nothing. Sets the target as ‘in front’ of the Unit. |
| SetInvincible | unit:SetInvincible() | Returns nothing. Makes the unit invincible if set to true. |
| SetInvisible | unit:SetInvisible() | Returns nothing. If set to true, the Unit becomes completely invisible. |
| SetKnownTitle | unit:SetKnownTitle() | Returns nothing. Makes the Player use the title specified. This is not saved to the database. |
| SetLevel | unit:SetLevel() | Returns nothing. Sets the Player’s level to the level given. Cannot exceed the max level in configs. |
| SetMana | unit:SetMana() | Returns nothing. Sets the Unit’s mana to the absolute value provided. |
| SetMaxHealth | unit:SetMaxHealth() | Returns nothing. Sets the Unit’s maximum amount of health to the number specified. |
| SetMaxMana | unit:SetMaxMana() | Returns nothing. Sets the Unit’s maximum mana to the absolute value provided. |
| SetMaxPower | unit:SetMaxPower() | Returns nothing. Sets the Unit’s maximum power to the absolute value and type provided. |
| SetModel | unit:SetModel() | Returns nothing. Sets the Unit’s display id to the one specified. Returns true if successful, false if not. |
| SetMount | unit:SetMount() | Returns nothing. Mounts the Unit with the display ID given. |
| SetMovementFlags | unit:SetMovementFlags() | Returns nothing. Forces the Unit to move with the flags specified. 0 (Walk), 1 (Run), 2 (Fly). |
| SetNPCFlags | unit:SetNPCFlags() | Returns nothing. Sets the Unit’s flags to the flags specified (This is used to disable gossip, etc). |
| SetOfficerNote | unit:SetOfficerNote() | Returns nothing. Sets pPlayer’s officer note to the string provided. |
| SetOrientation | unit:SetOrientation() | Returns nothing. Sets the Unit’s orientation to the orientation specified. |
| SetOutOfCombatRange | unit:SetOutOfCombatRange() | Returns nothing. When the Unit reaches this far away from it’s combat target, the combat is broken. |
| SetPacified | unit:SetPacified() | Returns nothing. True to pacify the Unit, false to unpacify the Unit. |
| SetPetOwner | unit:SetPetOwner() | Returns nothing. Sets Unit’s new owner to newowner. |
| SetPhase | unit:SetPhase() | Returns nothing. Sets the Unit to the phase specified. If ‘save’ is set to true, and the Unit is a NPC/Object, then the Unit will be saved in that phase. Mapped to PhaseSet(newphase[, save]) and PhaseAdd(newphase[, save]). |
| SetPlayerAtWar | unit:SetPlayerAtWar() | Returns nothing. Sets /unsets the Player at war with the faction specified. |
| SetPlayerLevel | unit:SetPlayerLevel() | |
| SetPlayerLock | unit:SetPlayerLock() | Returns nothing. Locks / unlocks the player from making any action. |
| SetPlayerSpeed | unit:SetPlayerSpeed() | Returns nothing. Sets the player’s global speed to speed. |
| SetPlayerWeather | unit:SetPlayerWeather() | Returns nothing. Sets the player’s weather to type, and makes the strength density. |
| SetPosition | unit:SetPosition() | Returns nothing. Sets the Unit’s position to the co-ordinates specified. |
| SetPower | unit:SetPower() | Returns nothing. Sets the Unit’s power to the amount specified. If type is specified, the unit’s power of that type is used instead. See the page for more info. |
| SetPowerPct | unit:SetPowerPct() | Returns nothing. Same as SetPower(), only this time you give a percentage instead of an absolute value. |
| SetPowerType | unit:SetPowerType() | |
| SetPublicNote | unit:SetPublicNote() | Returns nothing. Sets pPlayer’s public note to the string provided. |
| SetScale | unit:SetScale() | Returns nothing. Sets the Unit’s scale to the scale provided. |
| SetSelectedGO | unit:SetSelectedGO() | |
| SetStanding | unit:SetStanding() | Returns nothing. Sets the Unit’s standing with the faction to the value specified. |
| SetStandState | unit:SetStandState() | Returns nothing. Sets the Unit’s stand state. |
| SetStealthLevel | unit:SetStealthLevel() | Returns nothing. Sets the Unit’s stealth level to the one provided. See page for more information. |
| SetTalentPoints | unit:SetTalentPoints() | Returns nothing. Sets spec to have amount talent points. |
| SetTauntedBy | unit:SetTauntedBy() | |
| SetUInt32Value | unit:SetUInt32Value() | Returns nothing. Sets the Unit’s uint32_t flag at index. (Disabled) |
| SetUInt64Value | unit:SetUInt64Value() | Returns nothing. Sets the Unit’s uint64_t guid at field. (Disabled) |
| SetUnitToFollow | unit:SetUnitToFollow() | Returns nothing. Follows the target specified, at the specified angle and will stop following when it reaches the amount of yards specified. |
| SetWorldStateForPlayer | unit:SetWorldStateForPlayer() | |
| SetWorldStateForZone | unit:SetWorldStateForZone() | |
| SetZoneWeather | unit:SetZoneWeather() | Returns nothing. SetPlayerWeather() for zones. |
| SoftDisconnect | unit:SoftDisconnect() | Returns nothing. Kicks the player to the character select screen. |
| SpawnAndEnterVehicle | unit:SpawnAndEnterVehicle() | Returns nothing. Spawns a new vehicle and makes the Unit enter it. |
| SpawnCreature | unit:SpawnCreature() | Returns nothing. Spawns a creature in the Unit’s map with the co-ordinates and faction specified. Despawns after duration (0 for no despawn). |
| SpawnGameObject | unit:SpawnGameObject() | Returns nothing. Spawns a GameObject in the Unit’s map with the co-ordinates and scale specified. Despawns after duration (0 for no despawn). |
| SpellNonMeleeDamageLog | unit:SpellNonMeleeDamageLog() | Returns nothing. Unknown, Check core for usage. |
| StartQuest | unit:StartQuest() | Returns nothing. Force-start the quest with the given ID. If any items are required for the quest, these are automatically added. |
| StartTaxi | unit:StartTaxi() | Returns nothing. Forces the Unit to start the taxi path specified, and mount it on the specified display id. |
| StopChannel | unit:StopChannel() | Returns nothing. Stops channeling the current spell. |
| StopMovement | unit:StopMovement() | Returns nothing. Stops all movement for the unit for the time specified. |
| StopPlayerAttack | unit:StopPlayerAttack() | Returns nothing. Stops the player attacking. This is only for melee. |
| Strike | unit:Strike() | Returns nothing. The Unit damages the target with the damage type specified. If a spell is specified, this will be used. See the page for more information. |
| TakeHonor | unit:TakeHonor() | Returns nothing. Like GiveHonor(), but removes instead of adds. |
| Teleport | unit:Teleport() | Returns nothing. Teleports the Player to the co-ordinates given. |
| TeleportCreature | unit:TeleportCreature() | Returns nothing. Teleports the Creature to the co-ordinates given. Note that the creature cannot be teleported to another map. To do this, you’ll need to spawn it there. |
| UnbanFromChannel | unit:UnbanFromChannel() | Returns nothing. Unbans the Unit from the Channel. |
| UnlearnSpell | unit:UnlearnSpell() | Returns nothing. Removes the spell from the unit’s spell-book. |
| Unpossess | unit:Unpossess() | Returns nothing. Like the GM command .npc unpossess. |
| Unroot | unit:Unroot() | Returns nothing. Allows movement. |
| UnsetKnownTitle | unit:UnsetKnownTitle() | Returns nothing. Removes the title specified. This is not saved to the database. |
| UseAI | unit:UseAI() | |
| VendorAddItem | unit:VendorAddItem() | Returns nothing. Adds the specified amount of items to the Unit designated. Setting quantity to zero enables unlimited quantity. |
| VendorRemoveAllItems | unit:VendorRemoveAllItems() | Returns nothing. Removes all items from the vendor. |
| VendorRemoveItem | unit:VendorRemoveItem() | Returns nothing. Removes the specified item from the Unit designed. |
| WipeCurrentTarget | unit:WipeCurrentTarget() | Returns nothing. Drops the Unit’s current target. Also sets their threat to 0 (More specifically, removes them from the threat table). |
| WipeTargetList | unit:WipeTargetList() | Returns nothing. Resets the Unit’s target list. |
| WipeThreatList | unit:WipeThreatList() | Returns nothing. Sets the threat of everyone on the unit’s threat list to 0. |
Item Methods
| Command | Methods | Description |
|---|---|---|
| AddEnchantment | item:AddEnchantment() | |
| AddLoot | item:AddLoot() | |
| Create | item:Create() | |
| GetBuyPrice | item:GetBuyPrice() | |
| GetByteValue | item:GetByteValue() | |
| GetContainerItemCount | item:GetContainerItemCount() | |
| GetDurability | item:GetDurability() | |
| GetEntryId | item:GetEntryId() | |
| GetEquippedSlot | item:GetEquippedSlot() | |
| GetFloatValue | item:GetFloatValue() | |
| GetGuid | item:GetGuid() | |
| GetItemLevel | item:GetItemLevel() | |
| getItemLink | item:getItemLink() | |
| GetMaxDurability | item:GetMaxDurability() | |
| GetName | item:GetName() | |
| GetObjectType | item:GetObjectType() | |
| GetOwner | item:GetOwner() | |
| GetRequiredLevel | item:GetRequiredLevel() | |
| GetSellPrice | item:GetSellPrice() | |
| GetSpellId | item:GetSpellId() | |
| GetSpellTrigger | item:GetSpellTrigger() | |
| GetUInt32Value | item:GetUInt32Value() | |
| GetUInt64Value | item:GetUInt64Value() | |
| GossipComplete | item:GossipComplete() | |
| GossipCreateMenu | item:GossipCreateMenu() | |
| GossipMenuAddItem | item:GossipMenuAddItem() | |
| GossipSendMenu | item:GossipSendMenu() | |
| GossipSendPOI | item:GossipSendPOI() | |
| GossipSendQuickMenu | item:GossipSendQuickMenu() | |
| HasEnchantment | item:HasEnchantment() | |
| HasFlag | item:HasFlag() | |
| IsAccountbound | item:IsAccountbound() | |
| IsContainer | item:IsContainer() | |
| IsSoulbound | item:IsSoulbound() | |
| ModFloatValue | item:ModFloatValue() | |
| ModifyEnchantmentTime | item:ModifyEnchantmentTime() | |
| ModUInt32Value | item:ModUInt32Value() | |
| Remove | item:Remove() | |
| RemoveEnchantment | item:RemoveEnchantment() | |
| RemoveFlag | item:RemoveFlag() | |
| repairItem | item:repairItem() | |
| SetByteValue | item:SetByteValue() | |
| SetFlag | item:SetFlag() | |
| SetFloatValue | item:SetFloatValue() | |
| SetStackCount | item:SetStackCount() | |
| SetUInt32Value | item:SetUInt32Value() | |
| SetUInt64Value | item:SetUInt64Value() |
Packet Methods
| Command | Methods | Description |
|---|---|---|
| CreatePacket | packet:CreatePacket() | |
| GetObjectType | packet:GetObjectType() | |
| GetOpcode | packet:GetOpcode() | |
| GetSize | packet:GetSize() | |
| ReadByte | packet:ReadByte() | |
| ReadDouble | packet:ReadDouble() | |
| ReadFloat | packet:ReadFloat() | |
| ReadGUID | packet:ReadGUID() | |
| ReadLong | packet:ReadLong() | |
| ReadShort | packet:ReadShort() | |
| ReadString | packet:ReadString() | |
| ReadUByte | packet:ReadUByte() | |
| ReadULong | packet:ReadULong() | |
| ReadUShort | packet:ReadUShort() | |
| ReadWoWGuid | packet:ReadWoWGuid() | |
| WriteByte | packet:WriteByte() | |
| WriteDouble | packet:WriteDouble() | |
| WriteFloat | packet:WriteFloat() | |
| WriteGUID | packet:WriteGUID() | |
| WriteLong | packet:WriteLong() | |
| WriteShort | packet:WriteShort() | |
| WriteString | packet:WriteString() | |
| WriteUByte | packet:WriteUByte() | |
| WriteULong | packet:WriteULong() | |
| WriteUShort | packet:WriteUShort() | |
| WriteWoWGuid | packet:WriteWoWGuid() |
Taxi Methods
| Command | Methods | Description |
|---|---|---|
| AddPathNode | taxi:AddPathNode() | |
| CreateTaxi | taxi:CreateTaxi() | |
| GetId | taxi:GetId() | |
| GetNodeCount | taxi:GetNodeCount() | |
| GetNodeMapId | taxi:GetNodeMapId() | |
| GetNodeX | taxi:GetNodeX() | |
| GetNodeY | taxi:GetNodeY() | |
| GetNodeZ | taxi:GetNodeZ() | |
| GetObjectType | taxi:GetObjectType() |
Spell Methods
| Command | Methods | Description |
|---|---|---|
| CanCast | spell:CanCast() | Returns true if the spell is castable. |
| Cancel | spell:Cancel() | Returns nothing. Cancels the spell. |
| Cast | spell:Cast() | Returns the caster of the spell. Can return a Unit, Item, or GameObject. |
| Finish | spell:Finish() | Returns nothing. Finishes the spell after casting. |
| GetCastedItemId | spell:GetCastedItemId() | Returns the item ID used to cast the spell. |
| GetCaster | spell:GetCaster() | Returns the caster of the spell. Can return a Unit, Item, or GameObject. |
| GetEntry | spell:GetEntry() | Returns the entry ID of the spell. |
| GetObjectType | spell:GetObjectType() | Returns Spell. |
| GetPossibleEnemy | spell:GetPossibleEnemy() | Returns the GUID of a possible enemy unit of the spell. Range is optional. |
| GetPossibleFriend | spell:GetPossibleFriend() | Returns the GUID of a possible friendly unit of the spell. Range is optional. |
| GetSpellState | spell:GetSpellState() | Returns the state of the spell. |
| GetSpellType | spell:GetSpellType() | Returns the type of the spell. |
| GetTarget | spell:GetTarget() | Returns the target of the spell if the spell has a trigger effect. Can return a Unit, Item, or GameObject. |
| GetVar | spell:GetVar() | Returns the value of the specified variable on success or nil on failure. |
| HasPower | spell:HasPower() | Returns true if the caster has enough power to cast the spell. |
| IsAspect | spell:IsAspect() | Returns true if the spell is a Hunter Aspect spell. |
| IsDuelSpell | spell:IsDuelSpell() | Returns true if the spell was cast in a duel. |
| IsInvisibilitySpell | spell:IsInvisibilitySpell() | Returns true if the spell is an invisibility spell. |
| IsSeal | spell:IsSeal() | Returns true if the spell is a Paladin Seal spell. |
| IsStealthSpell | spell:IsStealthSpell() | Returns true if the spell grants stealth. |
| ResetAllVars | spell:ResetAllVars() | Returns true on success and false on failure. Resets all Spell variables to their DBC originals. |
| ResetVar | spell:ResetVar() | Returns true on success and false on failure. Resets the specified variable to its DBC original. |
| SetVar | spell:SetVar() | Returns true on success and false on failure. Sets a Spell variable to the specified value. |
Query Methods
| Command | Methods | Description |
|---|---|---|
| GetColumn | sqlAPI:GetColumn() | Returns a column by index in the query result. |
| NextRow | sqlAPI:NextRow() | Returns the next row. |
| GetColumnCount | sqlAPI:GetColumnCount() | Returns the number of columns in the query result. |
| GetRowCount | sqlAPI:GetRowCount() | Returns the number of rows in the query result. |
Fields Methods
| Command | Methods | Description |
|---|---|---|
| GetBool | sqlAPI:GetBool() | |
| GetByte | sqlAPI:GetByte() | |
| GetFloat | sqlAPI:GetFloat() | |
| GetGuid | sqlAPI:GetGuid() | |
| GetLong | sqlAPI:GetLong() | |
| GetShort | sqlAPI:GetShort() | |
| GetString | sqlAPI:GetString() | |
| GetUByte | sqlAPI:GetUByte() | |
| GetULong | sqlAPI:GetULong() | |
| GetUShort | sqlAPI:GetUShort() |
Aura Methods
| Command | Methods | Description |
|---|---|---|
| GetAuraSlot | aura:GetAuraSlot() | Returns the slot that the aura is in. See Unit.h for slot meanings. |
| GetCaster | aura:GetCaster() | Returns the object that cast the aura. Can be a Unit, GameObject, or Item. |
| GetDuration | aura:GetDuration() | Returns the duration in milliseconds. |
| GetObjectType | aura:GetObjectType() | Returns Aura if the aura is not nil. |
| GetSpellId | aura:GetSpellId() | Returns the spell ID of the aura. |
| GetTarget | aura:GetTarget() | Returns the target of the aura, which is the object currently affected by it. |
| GetTimeLeft | aura:GetTimeLeft() | Returns the time remaining until the aura expires in milliseconds. |
| GetVar | aura:GetVar() | Returns the value of the specified variable on success or nil on failure. |
| Remove | aura:Remove() | Returns nothing. Removes the aura and all of its events. |
| SetAuraSlot | aura:SetAuraSlot() | Returns nothing. Sets the aura’s slot. See Unit.h for slot meanings. |
| SetDuration | aura:SetDuration() | Returns nothing. Sets the duration of the aura. The aura is removed after the duration expires. |
| SetVar | aura:SetVar() | Returns true on success and false on failure. Sets a variable to the specified value. The variable is identified by a string, with an optional subindex for variables that have subindexes. |
Global Methods
| Command | Methods | Description |
|---|---|---|
| bit_and | bit_and() | Returns the result of a bitwise AND operation. |
| bit_or | bit_or() | Returns the result of a bitwise OR operation. |
| bit_shiftleft | bit_shiftleft() | Returns the result of a bitwise left shift operation. |
| bit_shiftright | bit_shiftright() | Returns the result of a bitwise right shift operation. |
| bit_xor | bit_xor() | Returns the result of a bitwise XOR operation. |
| CharDBQuery | CharDBQuery() | Returns a QueryResult object from a query on the character database. |
| CharDBQueryTable | CharDBQueryTable() | Returns a table containing the results of a character database query. |
| GetAERevision | GetAERevision() | Returns the server’s AE revision. |
| GetClientVersion | GetClientVersion() | Returns the client version. |
| GetDBCSpellVar | GetDBCSpellVar() | Returns the specified spell variable based on the spell entry ID. |
| GetGameTime | GetGameTime() | Returns the server time in seconds. |
| GetGuildByLeaderGuid | GetGuildByLeaderGuid() | Returns the guild led by the specified leader GUID. |
| GetGuildByName | GetGuildByName() | Returns the guild with the specified name. |
| GetInstanceCreature | GetInstanceCreature() | Returns the creature found in the instance. |
| GetInstancePlayerCount | GetInstancePlayerCount() | Returns the number of players in the instance. |
| GetLuaEngine | GetLuaEngine() | Returns the Lua engine used by the server. Should be ALE (AscEmu LuaEngine). |
| GetPlatform | GetPlatform() | Returns the platform, such as Win32. |
| GetPlayer | GetPlayer() | Returns the player with the specified name. |
| GetPlayersInInstance | GetPlayersInInstance() | Returns a table containing all players in the instance. |
| GetPlayersInMap | GetPlayersInMap() | Returns a table containing all players on the map. |
| GetPlayersInWorld | GetPlayersInWorld() | Returns a table containing all players in the world. |
| GetPlayersInZone | GetPlayersInZone() | Returns a table containing all players in the zone. |
| HasTimedEvent | HasTimedEvent() | Returns true if any timed events are registered. |
| HasTimedEventInTable | HasTimedEventInTable() | Returns true if an event with the specified table is registered. |
| HasTimedEvents | HasTimedEvents() | Returns true if any timed events are registered. |
| HasTimedEventWithName | HasTimedEventWithName() | Returns true if an event with the specified name is registered. |
| logcol | logcol() | Returns nothing. Changes the color of the log to the specified color. |
| NumberToGUID | NumberToGUID() | Returns a GUID-sized number created from the specified number. |
| PerformIngameSpawn | PerformIngameSpawn() | Returns the spawned unit or gameobject. |
| Rehash | Rehash() | Returns nothing. Reloads the server configuration files. |
| ReloadLuaEngine | ReloadLuaEngine() | Returns nothing. Reloads the ALE (AscEmu LuaEngine) and scripts. |
| ReloadTable | ReloadTable() | Returns nothing. Reloads the specified table. |
| RemoveTimedEvent | RemoveTimedEvent() | Returns nothing. Removes all timed events from the specified table. |
| RemoveTimedEventsInTable | RemoveTimedEventsInTable() | Returns nothing. Removes all timed events from the specified table. |
| RemoveTimedEventsWithName | RemoveTimedEventsWithName() | Returns nothing. Removes all timed events with the specified name. |
| SendMail | SendMail() | Returns nothing. Sends a mail message with the specified parameters. |
| SendPacketToChannel | SendPacketToChannel() | Returns nothing. Sends the packet to the specified team on the channel. |
| SendPacketToInstance | SendPacketToInstance() | Returns nothing. Sends the packet to everyone in the instance. |
| SendPacketToWorld | SendPacketToWorld() | Returns nothing. Sends the packet to everyone online. |
| SendPacketToZone | SendPacketToZone() | Returns nothing. Sends the packet to everyone in the zone. |
| SendWorldMessage | SendWorldMessage() | Returns nothing. Sends a message to everyone with the specified message type. |
| SetDBCSpellVar | SetDBCSpellVar() | Returns true on success and false on failure. Sets spell variables by entry ID instead of individual spell objects. |
| WorldDBQuery | WorldDBQuery() | Returns a QueryResult object from a query on the world database. |
| WorldDBQueryTable | WorldDBQueryTable() | Returns a table containing the results of a world database query. |
Key Terminology
You may find some of these terms throughout the Wiki pages.