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:

Common Use Cases:

API Documentation

Information About the typical function names.

Basic Lua

Register Events and Server Hooks

GameObject Methods

Command Methods Description
Activate gameObject:Activate() Activates/Deactivate a go, f.ex. 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() Damages the GO if it’s a destructible building, guid is the damaging Unit’s GUID, 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() Get 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() Get the Location of a spawned unit.
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() Rebuilds the GO, if it’s a destructible building. Restores it’s hp to max, and restores it’s displayid to normal.
RegisterAIUpdateEvent gameObject:RegisterAIUpdateEvent()  
RemoveAIUpdateEvent gameObject:RemoveAIUpdateEvent()  
RemoveEvents gameObject:RemoveEvents()  
RemoveFlag gameObject:RemoveFlag()  
RemoveFromWorld gameObject:RemoveFromWorld() 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() Adds the Achievement with the ID specified to the player.
AddArenaPoints unit:AddArenaPoints() Adds the specified amount of arena points to the Unit specified.
AddAura unit:AddAura() 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() Adds the Target to the Player’s group.
AddGuildMember unit:AddGuildMember() Forces pPlayer to join the Unit’s guild.
AddItem unit:AddItem() Creates a new menu item, used after registering a new menu with GossipCreateMenu().
AddLifetimeKills unit:AddLifetimeKills() Adds the amount of lifetime kills specified to the player’s total count.
AddLoot unit:AddLoot() 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() Sets the player’s skill line at skill to current, and the max to max.
AddToPhase unit:AddToPhase()  
AddVehiclePassenger unit:AddVehiclePassenger() Spawns an NPC and adds it as a passenger to the vehicle.
AdvanceAllSkills unit:AdvanceAllSkills() Advances all skills by amount.
AdvanceQuestObjective unit:AdvanceQuestObjective() Advances the objective in quest id by 1.
AdvanceSkill unit:AdvanceSkill() Advances the skill by count.
AggroWithInRangeFriends unit:AggroWithInRangeFriends() Unknown. See core for usage.
Attack unit:Attack() Sets the Unit’s main-hand attack speed to timer. If offhand is true, offhand is also set to this.
AttackReaction unit:AttackReaction() Adds threat to the target (Not damage) using the spell specified.
BanFromChannel unit:BanFromChannel() Bans the Unit from the Channel.
CalcAngle unit:CalcAngle() 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() Calculates the distance between the Unit and the point specified.
CallForHelpHp unit:CallForHelpHp() 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() Sets the Unit to be able/unable to call for help.
CancelSpell unit:CancelSpell() 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() Casts the specified spell. Any cast time is ignored.
CastSpellAoE unit:CastSpellAoE()  
CastSpellAoF unit:CastSpellAoF() Casts the targeted AoE spell (Think Blizzard & Shadowfury) at the given area. Ignores cast times.
CastSpellOnTarget unit:CastSpellOnTarget() Casts the specified spell on the target. Any cast time is ignored.
ChangeGuildMaster unit:ChangeGuildMaster() Changes the Guild Master to newmaster.
ChangeTarget unit:ChangeTarget() Sets the Unit’s new target to new_target.
ChannelSpell unit:ChannelSpell() Channels the spell given at the target.
ClearAllCooldowns unit:ClearAllCooldowns() Clears all Cooldowns for the player.
ClearCooldownForSpell unit:ClearCooldownForSpell() Removes the Cooldown of the spell specified for the player.
ClearThreatList unit:ClearThreatList() Sets the threat of everyone on the Unit’s threat list to 1.
CreateGuardian unit:CreateGuardian() 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() Deals damage to the target with the specified spell.
DealGoldCost unit:DealGoldCost() Removes the amount of copper from the player.
DealGoldMerit unit:DealGoldMerit() Akin to DealGoldCost(), but adds copper instead of removing it.
DeletePhase unit:DeletePhase() 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() Sets the Unit’s display id back to it’s native one.
DemoteGuildMember unit:DemoteGuildMember() Forces the Unit to demote the target guild member.
Despawn unit:Despawn() Despawns the Unit with the delay. If the respawntimer is set to 0, the mob won’t respawn.
DisableCombat unit:DisableCombat() If set to true, disables the Unit’s ability to enter combat completely.
DisableMelee unit:DisableMelee() If set to true, disables the Unit’s ability to use Melee Combat.
DisableRanged unit:DisableRanged() If set to true, disables the Unit’s ability to use Ranged Combat.
DisableRespawn unit:DisableRespawn() If set to false, the mob will no longer respawn.
DisableSpells unit:DisableSpells() If set to true, disables the Unit’s ability to use Spells.
DisableTargeting unit:DisableTargeting() If set to true, disables the Unit’s targeting capabilities (The mob will not be able to use targeted spells either).
DisbandGuild unit:DisbandGuild() Disbands the Unit’s guild.
DismissPet unit:DismissPet() Dismisses any current pet.
DismissVehicle unit:DismissVehicle() Dismisses the vehicle of the selected unit.
Dismount unit:Dismount() Dismounts the Unit.
EjectAllVehiclePassengers unit:EjectAllVehiclePassengers() Ejects all passengers from the Unit’s vehicle.
EjectVehiclePassengerFromSeat unit:EjectVehiclePassengerFromSeat() Ejects the passenger from the specified seat of the Unit’s vehicle.
Emote unit:Emote() 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() If set to true, disables the usage of all flight path nodes.
EnableFlyCheat unit:EnableFlyCheat() Acts similar to the gm command .cheat fly.
EnableMoveFly unit:EnableMoveFly() Similar to SetFlying().
Energize unit:Energize() Restores the amount of a type of energy to the target using a spell visual. See page for more info.
EnterVehicle unit:EnterVehicle() Makes the Unit enter a vehicle.
EquipWeapons unit:EquipWeapons() Equips the weapons specified in the specified slots. 1 (Main Hand), 2 (Off Hand), 3 (Ranged).
EventCastSpell unit:EventCastSpell() 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() Sends a chat message with the parameters given after a delay in miliseconds.
ExitVehicle unit:ExitVehicle() Makes the Unit exit it’s vehicle.
ExpandToRaid unit:ExpandToRaid() Forcibly changes the Unit’s group to a raid.
FinishQuest unit:FinishQuest() Forces the Unit to finish quest ID. Rewards are not given.
FlagFFA unit:FlagFFA()  
FlagPvP unit:FlagPvP() Flags the Player for PvP.
FullCastSpell unit:FullCastSpell() Casts the specified spell. If the spell has a cast time, it is used.
FullCastSpellAoE unit:FullCastSpellAoE()  
FullCastSpellAoF unit:FullCastSpellAoF()  
FullCastSpellOnTarget unit:FullCastSpellOnTarget() 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() Return 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() 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() Return 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() 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() Return the Unit’s spawn position x co-ordinate.
GetSpawnX unit:GetSpawnX() Return the Unit’s spawn position x co-ordinate.
GetSpawnY unit:GetSpawnY() Return the Unit’s spawn position x co-ordinate.
GetSpawnZ unit:GetSpawnZ() Return 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() 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() Gives the player specified the amount of honor specified.
GiveXp unit:GiveXp() Gives the Player the specified amount of XP.
GossipAddQuests unit:GossipAddQuests() Adds quests to the gossip menu if any available.
GossipComplete unit:GossipComplete() Completes (closes) the player’s gossip window.
GossipCreateMenu unit:GossipCreateMenu() Creates a new NPC gossip menu with the TextID specified.
GossipMenuAddItem unit:GossipMenuAddItem() Creates a new menu item, used after registering a new menu with GossipCreateMenu().
GossipMiscAction unit:GossipMiscAction() Performs a Gossip Action.
GossipSendMenu unit:GossipSendMenu() Sends the gossip menu to the player.
GossipSendPOI unit:GossipSendPOI() Sets a mark on the player’s mini map. Used when asking city guards where to go.
GossipSendQuickMenu unit:GossipSendQuickMenu()  
GuildBankDepositMoney unit:GuildBankDepositMoney() Removes gold from the unit and deposits it in the guild bank.
GuildBankWithdrawMoney unit:GuildBankWithdrawMoney() Removes gold from the guild bank and gives it to the unit.
HandleEvent unit:HandleEvent() 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() 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() 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() 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() 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() 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() 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() Force-joins the specified channel.
KickFromChannel unit:KickFromChannel() Kicks the Unit from the Channel.
KickPlayer unit:KickPlayer() 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() Disables flying if set to 1.
LearnSpell unit:LearnSpell() Teaches the Unit the spell given.
LearnSpells unit:LearnSpells() Teaches the player all spells in the table specified.
LeaveChannel unit:LeaveChannel() Leaves the channel.
LifeTimeKills unit:LifeTimeKills() Adds the amount of lifetime kills specified to the player’s total count.
MarkQuestObjectiveAsComplete unit:MarkQuestObjectiveAsComplete() Marks the objective of questid as completed.
ModFloatValue unit:ModFloatValue() Modifies the Unit’s float value to the float specified. (Disabled)
ModifyAIUpdateEvent unit:ModifyAIUpdateEvent() Modifies the AI Update event to run at newtime.
ModifyFlySpeed unit:ModifyFlySpeed() Modifies the Unit’s fly speed to the specified speed.
ModifyRunSpeed unit:ModifyRunSpeed() Modifies the Unit’s run speed to the specified speed.
ModifyWalkSpeed unit:ModifyWalkSpeed() Modifies the Unit’s walk speed to the specified speed.
ModThreat unit:ModThreat() Modifies the Unit’s threat against target by amount.
ModUInt32Value unit:ModUInt32Value() Modifies the Unit’s uint32_t flag at index. (Disabled)
MovePlayerTo unit:MovePlayerTo() MoveTo() for players. The flag can be 0 (walking), 256 (teleport), 4096 (running) or 12288 (flying).
MoveRandomArea unit:MoveRandomArea() Moves the Unit to a random area within the given realm.
MoveTo unit:MoveTo() Forcibly moves the Unit specified to the co-ordinates specified.
MoveVehiclePassengerToSeat unit:MoveVehiclePassengerToSeat() Moves the specified passenger of the unit’s vehicle to another seat.
PhaseAdd unit:PhaseAdd()  
PhaseDelete unit:PhaseDelete()  
PhaseSet unit:PhaseSet()  
PlayerSendChatMessage unit:PlayerSendChatMessage() Forces the Player to send the message with the parameters specified.
PlaySoundToPlayer unit:PlaySoundToPlayer() Like PlaySoundToSet(sound), only the sound only plays to the player specified.
PlaySoundToSet unit:PlaySoundToSet() Plays the specified sound ID to everyone in the Unit’s map cell.
PlaySpellVisual unit:PlaySpellVisual() ‘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() Like the GM command .npc possess.
PromoteGuildMember unit:PromoteGuildMember() Forces the Unit to promote the target guild member.
QuestAddFinisher unit:QuestAddFinisher() Allows the NPC to be used to finish the quest with the id given.
QuestAddStarter unit:QuestAddStarter() Allows the NPC to be used to start the quest with the id given.
RegisterEvent unit:RegisterEvent() 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() Removes the Achievement with the ID specified from the player.
RemoveAIUpdateEvent unit:RemoveAIUpdateEvent() Removes all AI Update Events.
RemoveAllAuras unit:RemoveAllAuras() Removes all auras on the Unit.
RemoveArenaPoints unit:RemoveArenaPoints() Removes the amount of arena points from the Unit specified.
RemoveAura unit:RemoveAura() Removes the aura specified from the Unit.
RemoveAurasByMechanic unit:RemoveAurasByMechanic() Removes all auras by the mechanic given.
RemoveAurasType unit:RemoveAurasType() Removes all auras by the type given.
RemoveEvents unit:RemoveEvents() Removes all events registered with RegisterEvent().
RemoveFlag unit:RemoveFlag() Removes the Unit’s flag at field, value. (Disabled)
RemoveFromWorld unit:RemoveFromWorld() Removes the Unit from the world.
RemoveGuildMember unit:RemoveGuildMember() 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() Removes an item from the player with the count specified.
RemoveNegativeAuras unit:RemoveNegativeAuras() Removes all negative auras from the Unit.
RemovePvPFlag unit:RemovePvPFlag() Removes the Unit’s PvP flag.
RemoveSkill unit:RemoveSkill() Removes the skill from Unit with the skill id specified.
RemoveStealth unit:RemoveStealth() Removes any stealth from the specified Unit.
RemoveThreat unit:RemoveThreat() Erases the target from the threat table.
RepairAllPlayerItems unit:RepairAllPlayerItems() Repairs all items that the player has.
Repop unit:Repop() Force releases the spirit of a dead player.
ResetAllTalents unit:ResetAllTalents() Resets the player’s talents.
ResetModel unit:ResetModel()  
ResetPetTalents unit:ResetPetTalents() Resets the current pet’s talents.
ResetTalents unit:ResetTalents()  
ResurrectPlayer unit:ResurrectPlayer() 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() Saves the player to the database.
SendAIReaction unit:SendAIReaction()  
SendAreaTriggerMessage unit:SendAreaTriggerMessage() Sends an Area Trigger message with the specified string to the player.
SendAuctionWindow unit:SendAuctionWindow() Sends the player unit’s auction window.
SendBankWindow unit:SendBankWindow() Sends the player specified a bank window with the unit as the sender.
SendBattlegroundWindow unit:SendBattlegroundWindow() 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() Broadcasts the specified string to the player.
SendChatMessage unit:SendChatMessage() Forces the Player to send the message with the parameters specified.
SendChatMessageAlternateEntry unit:SendChatMessageAlternateEntry() Forces the Unit with the entry id specified to send a message with the parameters designated.
SendChatMessageToPlayer unit:SendChatMessageToPlayer() Sends the player specified a chat message with the parameters designated.
SendGuildChatMessage unit:SendGuildChatMessage() 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() Forces the Unit to send a guild invite to pPlayer.
SendGuildLog unit:SendGuildLog() Sends the Guild Log to the Unit.
SendInnkeeperWindow unit:SendInnkeeperWindow() Sends an innkeeper window to the Unit.
SendLootWindow unit:SendLootWindow() 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() 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() Sends the packet specified to the Unit’s group. See Packet Function Documentation for more information on packets.
SendPacketToGuild unit:SendPacketToGuild() Sends the packet specified to the Unit’s guild. See Packet Function Documentation for more information on packets.
SendPacketToPlayer unit:SendPacketToPlayer() Sends the packet specified to the Unit specified. See Packet Function Documentation for more information on packets.
SendTrainerWindow unit:SendTrainerWindow() Akin to SendBankWindow(), but with trainers instead of banks.
SendVendorWindow unit:SendVendorWindow() Akin to SendBankWindow(), but with vendors instead of banks.
SetAttackTimer unit:SetAttackTimer() Sets the Unit’s main-hand attack speed to timer. If offhand is true, offhand is also set to this.
SetBindPoint unit:SetBindPoint() Sets the Unit’s bind point to the co-ordinates specified.
SetByteValue unit:SetByteValue() Sets the byte at index, index1 to value. (Disabled)
SetChannelName unit:SetChannelName() Renames the Channel.
SetChannelPassword unit:SetChannelPassword() Adds a password to the Channel.
SetCombatCapable unit:SetCombatCapable() If set to true, disables the Unit’s ability to enter combat completely.
SetCombatMeleeCapable unit:SetCombatMeleeCapable() If set to true, disables the Unit’s ability to use Melee Combat.
SetCombatRangedCapable unit:SetCombatRangedCapable() If set to true, disables the Unit’s ability to use Ranged Combat.
SetCombatSpellCapable unit:SetCombatSpellCapable()  
SetCombatTargetingCapable unit:SetCombatTargetingCapable() If set to true, disables the Unit’s targeting capabilities (The mob will not be able to use targeted spells either).
SetCreatureNameById unit:SetCreatureNameById() Currently the method is commented out. Do not use.
SetDeathState unit:SetDeathState() Sets the Unit’s death state. 0 (Alive), 1 (Just Died), 2 (Corpse), 3 (Dead).
SetDungeonDifficulty unit:SetDungeonDifficulty() Sets the Dungeon difficulty to the level specified. 0 (10M), 2 (25M), 3 (10M HC) 4 (25M HC).
SetFacing unit:SetFacing() Forces the Unit to face the orientation provided.
SetFaction unit:SetFaction() Sets the Unit’s faction to the faction specified.
SetFlag unit:SetFlag()  
SetFloatValue unit:SetFloatValue() Sets the Unit’s float value to the float specified. (Disabled)
SetFlying unit:SetFlying() Allows the Unit to fly. Use Land() to force the unit to land again.
SetGender unit:SetGender() Sets the gender of a character.
SetGroupLeader unit:SetGroupLeader() 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() Sets the Guild Information to the string provided.
SetGuildMotd unit:SetGuildMotd() Sets the Message of the Day of the unit’s guild to the string given.
SetGuildRank unit:SetGuildRank() Sets the Unit’s guild rank to the one specified.
SetHealth unit:SetHealth() Sets the Unit’s health an absolute value based on the number specified.
SetHealthPct unit:SetHealthPct() Sets the Unit’s health to a percentage based on the percentage given.
SetInFront unit:SetInFront() Sets the target as ‘in front’ of the Unit.
SetInvincible unit:SetInvincible() Makes the unit invincible if set to true.
SetInvisible unit:SetInvisible() If set to true, the Unit becomes completely invisible.
SetKnownTitle unit:SetKnownTitle() Makes the Player use the title specified. This is not saved to the database.
SetLevel unit:SetLevel() Sets the Player’s level to the level given. Cannot exceed the max level in configs.
SetMana unit:SetMana() Sets the Unit’s mana to the absolute value provided.
SetMaxHealth unit:SetMaxHealth() Sets the Unit’s maximum amount of health to the number specified.
SetMaxMana unit:SetMaxMana() Sets the Unit’s maximum mana to the absolute value provided.
SetMaxPower unit:SetMaxPower() Sets the Unit’s maximum power to the absolute value and type provided.
SetModel unit:SetModel() Sets the Unit’s display id to the one specified. Returns true if successful, false if not.
SetMount unit:SetMount() Mounts the Unit with the display ID given.
SetMovementFlags unit:SetMovementFlags() Forces the Unit to move with the flags specified. 0 (Walk), 1 (Run), 2 (Fly).
SetNPCFlags unit:SetNPCFlags() Sets the Unit’s flags to the flags specified (This is used to disable gossip, etc).
SetOfficerNote unit:SetOfficerNote() Sets pPlayer’s officer note to the string provided.
SetOrientation unit:SetOrientation() Sets the Unit’s orientation to the orientation specified.
SetOutOfCombatRange unit:SetOutOfCombatRange() When the Unit reaches this far away from it’s combat target, the combat is broken.
SetPacified unit:SetPacified() True to pacify the Unit, false to unpacify the Unit.
SetPetOwner unit:SetPetOwner() Sets Unit’s new owner to newowner.
SetPhase unit:SetPhase() 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() Sets /unsets the Player at war with the faction specified.
SetPlayerLevel unit:SetPlayerLevel()  
SetPlayerLock unit:SetPlayerLock() Locks / unlocks the player from making any action.
SetPlayerSpeed unit:SetPlayerSpeed() Sets the player’s global speed to speed.
SetPlayerWeather unit:SetPlayerWeather() Sets the player’s weather to type, and makes the strength density.
SetPosition unit:SetPosition() Sets the Unit’s position to the co-ordinates specified.
SetPower unit:SetPower() 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() Same as SetPower(), only this time you give a percentage instead of an absolute value.
SetPowerType unit:SetPowerType()  
SetPublicNote unit:SetPublicNote() Sets pPlayer’s public note to the string provided.
SetScale unit:SetScale() Sets the Unit’s scale to the scale provided.
SetSelectedGO unit:SetSelectedGO()  
SetStanding unit:SetStanding() Sets the Unit’s standing with the faction to the value specified.
SetStandState unit:SetStandState() Sets the Unit’s stand state.
SetStealthLevel unit:SetStealthLevel() Sets the Unit’s stealth level to the one provided. See page for more information.
SetTalentPoints unit:SetTalentPoints() Sets spec to have amount talent points.
SetTauntedBy unit:SetTauntedBy()  
SetUInt32Value unit:SetUInt32Value() Sets the Unit’s uint32_t flag at index. (Disabled)
SetUInt64Value unit:SetUInt64Value() Sets the Unit’s uint64_t guid at field. (Disabled)
SetUnitToFollow unit:SetUnitToFollow() 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() SetPlayerWeather() for zones.
SoftDisconnect unit:SoftDisconnect() Kicks the player to the character select screen.
SpawnAndEnterVehicle unit:SpawnAndEnterVehicle() Spawns a new vehicle and makes the Unit enter it.
SpawnCreature unit:SpawnCreature() 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() 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() Unknown, Check core for usage.
StartQuest unit:StartQuest() Force-start the quest with the given ID. If any items are required for the quest, these are automatically added.
StartTaxi unit:StartTaxi() Forces the Unit to start the taxi path specified, and mount it on the specified display id.
StopChannel unit:StopChannel() Stops channeling the current spell.
StopMovement unit:StopMovement() Stops all movement for the unit for the time specified.
StopPlayerAttack unit:StopPlayerAttack() Stops the player attacking. This is only for melee.
Strike unit:Strike() 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() Like GiveHonor(), but removes instead of adds.
Teleport unit:Teleport() Teleports the Player to the co-ordinates given.
TeleportCreature unit:TeleportCreature() 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() Unbans the Unit from the Channel.
UnlearnSpell unit:UnlearnSpell() Removes the spell from the unit’s spell-book.
Unpossess unit:Unpossess() Like the GM command .npc unpossess.
Unroot unit:Unroot() Allows movement.
UnsetKnownTitle unit:UnsetKnownTitle() Removes the title specified. This is not saved to the database.
UseAI unit:UseAI()  
VendorAddItem unit:VendorAddItem() Adds the specified amount of items to the Unit designated. Setting quantity to zero enables unlimited quantity.
VendorRemoveAllItems unit:VendorRemoveAllItems() Removes all items from the vendor.
VendorRemoveItem unit:VendorRemoveItem() Removes the specified item from the Unit designed.
WipeCurrentTarget unit:WipeCurrentTarget() Drops the Unit’s current target. Also sets their threat to 0 (More specifically, removes them from the threat table).
WipeTargetList unit:WipeTargetList() Resets the Unit’s target list.
WipeThreatList unit:WipeThreatList() 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() Cancels the spell.
Cast spell:Cast() Returns the caster of the spell. Can return a Unit, Item or GameObject.
Finish spell:Finish() Finishes the spell, used post-casting.
GetCastedItemId spell:GetCastedItemId() Returns what item ID 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 unit enemy of the spell. Range is optional.
GetPossibleFriend spell:GetPossibleFriend() Same as above but for a friendly target.
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() See SetVar(var [,subindex], value), but returns the value 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() Like IsStealthSpell() but for invisibility.
IsSeal spell:IsSeal() Returns true if the spell is a paladin Seal spell.
IsStealthSpell spell:IsStealthSpell() Returns true if the spell grants some kind of stealth.
ResetAllVars spell:ResetAllVars() Resets all of Spell’s vars to the DBC originals. Returns true on success, false on failure.
ResetVar spell:ResetVar() Resets the specified var to the DBC original. Returns true on success, false on failure.
SetVar spell:SetVar() Var is a string referring to a parameter of Spell. subindex is optional; used when the variable you are setting has sub indexes. value is what you want to set it to. Returns true on success, false on failure.

Query Methods

Command Methods Description
GetColumn sqlAPI:GetColumn() Get a column by index in the query result.
NextRow sqlAPI:NextRow() Fetches the next row.
GetColumnCount sqlAPI:GetColumnCount() Get number of columns in the query result.
GetRowCount sqlAPI:GetRowCount() Get 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 meanings.
GetCaster aura:GetCaster() Returns the object that casted the aura. Can be a Unit, GameObject, or Item.
GetDuration aura:GetDuration() Returns the duration in miliseconds.
GetObjectType aura:GetObjectType() Will return Aura if the aura is not nil.
GetSpellId aura:GetSpellId() Returns the aura’s spell id.
GetTarget aura:GetTarget() Returns the target of the aura; the person who is currently affected by it.
GetTimeLeft aura:GetTimeLeft() Returns the amount of time left until the aura expires in miliseconds.
GetVar aura:GetVar() See above, but returns the value on success or nil on failure.
Remove aura:Remove() Removes the aura & all of its events (duration, etc.,).
SetAuraSlot aura:SetAuraSlot() Sets the aura’s slot. See Unit.h for meanings.
SetDuration aura:SetDuration() Sets the duration of the aura. The aura will be removed after the duration has passed.
SetVar aura:SetVar() Var is a string referring to a parameter of Spell. subindex is optional; used when the variable you are setting has sub indexes. value is what you want to set it to. Returns true on success, false on failure.

Global Methods

Command Methods Description
bit_and bit_and()  
bit_or bit_or()  
bit_shiftleft bit_shiftleft()  
bit_shiftright bit_shiftright()  
bit_xor bit_xor()  
CharDBQuery CharDBQuery() Performs a query on the character database. Returns a “QueryResult” object.
CharDBQueryTable CharDBQueryTable() Similar to CharDBQuery(query). See core for more info.
GetAERevision GetAERevision() Returns the server’s AE revision.
GetClientVersion GetClientVersion()  
GetDBCSpellVar GetDBCSpellVar() Retrieves a spell var based on spell entry id.
GetGameTime GetGameTime() Returns server time in seconds.
GetGuildByLeaderGuid GetGuildByLeaderGuid() Returns a guild with the name given.
GetGuildByName GetGuildByName() Returns a guild with the name given.
GetInstanceCreature GetInstanceCreature() Returns the creature found in the instance.
GetInstancePlayerCount GetInstancePlayerCount() Returns the number of players in the instance.
GetLuaEngine GetLuaEngine() Returns what engine the server is using. Should be ALE (AscEmu LuaEngine).
GetPlatform GetPlatform() Returns the platform ex. Win32.
GetPlayer GetPlayer() Returns a player with the name given.
GetPlayersInInstance GetPlayersInInstance() Returns a table containing all of the players in the instance.
GetPlayersInMap GetPlayersInMap() Returns a table containing all of the players in the map.
GetPlayersInWorld GetPlayersInWorld() Returns a table containing all the players in the world.
GetPlayersInZone GetPlayersInZone() Returns a table containing all the 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() Changes the color of the log to the number given.
NumberToGUID NumberToGUID() Creates a GUID-sized number from the number given.
PerformIngameSpawn PerformIngameSpawn() Spawns a unit or gameobject.
Rehash Rehash() Rehashes server config files.
ReloadLuaEngine ReloadLuaEngine() Reloads the ALE (AscEmu LuaEngine) and scripts.
ReloadTable ReloadTable() Reload Table.
RemoveTimedEvent RemoveTimedEvent() Removes all timed events from the specified table (string).
RemoveTimedEventsInTable RemoveTimedEventsInTable() Removes all timed events from the specified table (string).
RemoveTimedEventsWithName RemoveTimedEventsWithName() Removes all timed events with the specified name.
SendMail SendMail() Sends a mail message with specified parameters.
SendPacketToChannel SendPacketToChannel() Sends the packet to the said team on the channel.
SendPacketToInstance SendPacketToInstance() Sends the packet to everyone in the instance.
SendPacketToWorld SendPacketToWorld() Sends the packet to everyone online.
SendPacketToZone SendPacketToZone() Sends the packet to everyone in the zone.
SendWorldMessage SendWorldMessage() Sends a message to everyone with message type given.
SetDBCSpellVar SetDBCSpellVar() Similar to Spell:SetVar, but this sets vars by entry id, rather than by individual spell objects.
WorldDBQuery WorldDBQuery() Performs a query on the world database. Returns a “QueryResult” object.
WorldDBQueryTable WorldDBQueryTable() Similar to WorldDBQuery(query). See core for more info.

Key Terminology

You may find some of these terms within the Wiki pages.

Unit: A Creature or Player.
Creature: A Mob/ile Unit. Also known as an NPC - Non-player character
Gossip: Menus that allow you to interact with the Player.
Phase: A unique instance of the Game World.
Method: Also commonly known as a Function or Command. This is the correct word for it - Method adopts a more Object-Orientated view on Lua, which is what we want.
Function: A block of code in Lua.
Command: Usually assumed to be any Lua Method, it is incorrect terminology. It is not a command.
Statement: A piece of code that performs a single action.
Expression: A statement that evaluates true or false.