### Add Taxi Path and Start Taxi Source: https://www.azerothcore.org/eluna/Global/AddTaxiPath.html Example of adding a taxi path on server startup and then starting it for a player. ```lua -- Execute on startup local pathTable = {{mapid, x, y, z}, {mapid, x, y, z}} local path = AddTaxiPath(pathTable, 28135, 28135) -- Execute when the player should fly player:StartTaxi(path) ``` -------------------------------- ### GET Request Example Source: https://www.azerothcore.org/eluna/Global/HttpRequest.html Demonstrates a GET request to fetch a random word. The callback function processes the response body to extract the word. ```lua -- GET example (prints a random word) HttpRequest("GET", "https://random-word-api.herokuapp.com/word", function(status, body, headers) print("Random word: " .. string.sub(body, 3, body:len() - 2)) end) ``` -------------------------------- ### Request with Custom Headers Example Source: https://www.azerothcore.org/eluna/Global/HttpRequest.html Shows how to include custom request headers like 'Accept' and 'User-Agent' in a GET request. The callback prints the response body, which should contain the sent headers. ```lua -- Example with request headers HttpRequest("GET", "https://postman-echo.com/headers", { Accept = "application/json", ["User-Agent"] = "ALE Lua Engine" }, function(status, body, headers) print(body) end) ``` -------------------------------- ### StartGameEvent Source: https://www.azerothcore.org/eluna/Global/StartGameEvent.html Starts a game event by its ID. An optional 'force' argument can be used to override the current event state and force the start. ```APIDOC ## StartGameEvent( eventId, [force] ) ### Description Starts the event by eventId. If `force` is set to true, the event will start regardless of its previous state. ### Method Global Function ### Parameters #### Arguments - **eventId** (number) - Required - The ID of the event to start. Valid numbers are integers from 0 to 65,535. - **force** (boolean) - Optional (defaults to false) - Set to `true` to force start the event. ``` -------------------------------- ### Global:GetGUIDEntry Source: https://www.azerothcore.org/eluna/Global/GetGUIDEntry.html Returns the entry ID from a GUID. A GUID consists of an entry ID, a low GUID, and a type ID. ```APIDOC ## Method Global:GetGUIDEntry ### Description Returns the entry ID from a GUID. GUID consists of entry ID, low GUID, and type ID. ### Synopsis `entry = GetGUIDEntry( guid )` ### Arguments * **guid** (number) - GUID of an Creature or GameObject. Valid numbers: integers from 0 to 18,446,744,073,709,551,615. ### Returns * **entry** (number) - Entry ID, or `0` if `guid` is not a Creature or GameObject. Valid numbers: integers from 0 to 4,294,967,295. ``` -------------------------------- ### Player:SendMovieStart Source: https://www.azerothcore.org/eluna/Player/SendMovieStart.html Starts a movie for the Player by specifying the MovieId. ```APIDOC ## Player:SendMovieStart ### Description Starts a movie for the Player by specifying the MovieId. ### Method Player:SendMovieStart ### Parameters #### Arguments * **MovieId** (number) - Required - Entry of a movie. Valid numbers: integers from 0 to 4,294,967,295. ### Returns Nothing. ``` -------------------------------- ### GetGUIDEntry Source: https://www.azerothcore.org/eluna/Global/index.html Returns the entry ID from a GUID. ```APIDOC ## GetGUIDEntry ### Description Returns the entry ID from a GUID. ### Method Not specified (assumed to be a script function call) ### Parameters - **guid** (GUID) - The GUID to extract the entry ID from. ### Request Example ```lua local entryId = GetGUIDEntry(someGuid) ``` ### Response - **entryId** (number) - The entry ID extracted from the GUID. ``` -------------------------------- ### GetItemByGUID Source: https://www.azerothcore.org/eluna/Player/index.html Returns an Item from the player by guid. ```APIDOC ## GetItemByGUID ### Description Retrieves an Item from the player's inventory using its unique GUID. ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **Item**: Object representing the found item. #### Response Example None ``` -------------------------------- ### Example Usage of Creature:GetAITarget Source: https://www.azerothcore.org/eluna/Creature/GetAITarget.html Demonstrates how to use the Creature:GetAITarget function to find a specific target. This example selects the third-farthest player with the 'Corrupted Blood' aura within 50 yards. ```lua target = creature:GetAITarget(4, true, 3, 50, 24328) ``` -------------------------------- ### Player:GetItemByGUID Source: https://www.azerothcore.org/eluna/Player/GetItemByGUID.html Returns an Item from the player by guid. The item can be equipped, in bags or in bank. ```APIDOC ## Player:GetItemByGUI ### Description Returns an Item from the player by guid. The item can be equipped, in bags or in bank. ### Method Player:GetItemByGUID ### Parameters #### Path Parameters - **guid** (number) - Required - An item guid. Valid numbers: integers from 0 to 18,446,744,073,709,551,615. ### Returns #### Success Response - **item** (Item) - See method description. ``` -------------------------------- ### Clone ALE Module Source: https://www.azerothcore.org/eluna/index.html Clone the ALE module into your AzerothCore project's modules directory to install it. ```bash git clone https://github.com/azerothcore/mod-ale.git mod-ale ``` -------------------------------- ### Player:SendCinematicStart Source: https://www.azerothcore.org/eluna/Player/SendCinematicStart.html Starts a cinematic for the Player. This method takes a single argument, the ID of the cinematic sequence to play. ```APIDOC ## Player:SendCinematicStart ### Description Starts a cinematic for the Player. This method takes a single argument, the ID of the cinematic sequence to play. ### Method `Player:SendCinematicStart( CinematicSequenceId )` ### Parameters #### Path Parameters - **CinematicSequenceId** (number) - Required - Entry of a cinematic. Valid numbers: integers from 0 to 4,294,967,295. ### Returns Nothing. ``` -------------------------------- ### WorldPacket:ReadPackedGUID Source: https://www.azerothcore.org/eluna/WorldPacket/ReadPackedGUID.html Reads a packed GUID from the WorldPacket and returns it as a full 64-bit integer. The packed data size varies (2-9 bytes), but always unpacks to a complete 64-bit GUID. ```APIDOC ## WorldPacket:ReadPackedGUID ### Description Reads a packed GUID from the WorldPacket and returns it as a full 64-bit integer. The packed data size varies (2-9 bytes), but always unpacks to a complete 64-bit GUID. ### Method `value = WorldPacket:ReadPackedGUID()` ### Parameters None. ### Returns `**number** value` Value returned as string. _Valid numbers_ : integers from 0 to 18,446,744,073,709,551,615. ``` -------------------------------- ### Global:GetItemGUID Source: https://www.azerothcore.org/eluna/Global/GetItemGUID.html Builds an Item's GUID. Item GUID consists of low GUID and type ID. Player and Item for example can have the same low GUID but not GUID. ```APIDOC ## Global:GetItemGUID ### Description Builds an Item's GUID. Item GUID consists of low GUID and type ID. Player and Item for example can have the same low GUID but not GUID. ### Synopsis `guid = GetItemGUID( lowguid )` ### Arguments #### **number** lowguid Low GUID of the Item. _Valid numbers_: integers from 0 to 4,294,967,295. ### Returns #### **number** guid _Valid numbers_: integers from 0 to 18,446,744,073,709,551,615. ``` -------------------------------- ### GetObjectGUID Source: https://www.azerothcore.org/eluna/Global/index.html Builds and returns a GameObject's GUID. ```APIDOC ## GetObjectGUID ### Description Builds a GameObject's GUID. ### Method Not specified (assumed to be a script function call) ### Parameters - **entryId** (number) - The entry ID of the game object. - **mapId** (number) - The ID of the map the game object is on. - **phaseMask** (number, optional) - The phase mask for the game object. ### Request Example ```lua local objectGuid = GetObjectGUID(180000, 1) ``` ### Response - **objectGuid** (GUID) - The generated GUID for the game object. ``` -------------------------------- ### POST Request Example Source: https://www.azerothcore.org/eluna/Global/HttpRequest.html Illustrates a POST request with a JSON body to create a new post. The callback function prints the response body. ```lua -- POST example with JSON request body HttpRequest("POST", "https://jsonplaceholder.typicode.com/posts", '{"userId": 1,"title": "Foo","body": "Bar!"}', "application/json", function(status, body, headers) print(body) end) ``` -------------------------------- ### Global:GetPlayerGUID Source: https://www.azerothcore.org/eluna/Global/GetPlayerGUID.html Builds a Player's GUID. The Player GUID consists of a low GUID and a type ID. Players and Creatures, for example, can have the same low GUID but not the same overall GUID. ```APIDOC ## Method Global:GetPlayerGUID ### Description Builds a Player's GUID. Player GUIDs consist of a low GUID and a type ID. Players and Creatures, for example, can have the same low GUID but not the same overall GUID. ### Synopsis `guid = GetPlayerGUID( lowguid )` ### Arguments #### Path Parameters - **lowguid** (number) - Required - Low GUID of the Player. Valid numbers: integers from 0 to 4,294,967,295. ### Returns #### Success Response - **guid** (number) - Valid numbers: integers from 0 to 18,446,744,073,709,551,615. ``` -------------------------------- ### GetPlayerGUID Source: https://www.azerothcore.org/eluna/Global/index.html Builds a Player's GUID (Globally Unique Identifier). ```APIDOC ## GetPlayerGUID ### Description Builds a Player's GUID (Globally Unique Identifier). ### Method Global ### Endpoint N/A (Scripting API) ### Parameters * **player** (Player) - The player object for which to build the GUID. ### Request Example N/A ### Response #### Success Response - **guid** (string) - The GUID of the player. ### Response Example ```json "player_guid_string" ``` ``` -------------------------------- ### Get Object's Low GUID Source: https://www.azerothcore.org/eluna/Object/GetGUIDLow.html Retrieves the low-order part of the object's globally unique identifier (GUID). This value's uniqueness depends on the server implementation (TrinityCore, MaNGOS, cMaNGOS). ```lua guidLow = Object:GetGUIDLow() ``` -------------------------------- ### Spawn Creature with Basic Parameters Source: https://www.azerothcore.org/eluna/WorldObject/SpawnCreature.html Spawns a creature using its entry ID and location coordinates. ```lua spawnedCreature = WorldObject:SpawnCreature( entry, x, y, z, o ) ``` -------------------------------- ### Get Spell Target Destination Coordinates Source: https://www.azerothcore.org/eluna/Spell/GetTargetDest.html Call this method to retrieve the X, Y, and Z coordinates of the spell's target destination. No setup or imports are required. ```lua x, y, z = Spell:GetTargetDest() ``` -------------------------------- ### Global:GetCoreExpansion Source: https://www.azerothcore.org/eluna/Global/GetCoreExpansion.html Returns the emulator's supported expansion. Expansion is 0 for pre-TBC, 1 for TBC, 2 for WotLK, and 3 for Cataclysm. ```APIDOC ## Global:GetCoreExpansion ### Description Returns the emulator's supported expansion. Expansion is 0 for pre-TBC, 1 for TBC, 2 for WotLK, and 3 for Cataclysm. ### Method None (Function Call) ### Arguments None. ### Returns `**number** expansion` _Valid numbers_ : integers from -2,147,483,647 to 2,147,483,647. ``` -------------------------------- ### Object:GetByteValue Source: https://www.azerothcore.org/eluna/Object/GetByteValue.html Returns the data at the specified index and offset, casted to an unsigned 8-bit integer. For example, to get the second byte at index 10, you would pass in 1 as the offset. ```APIDOC ## Object:GetByteValue ### Description Returns the data at the specified index and offset, casted to an unsigned 8-bit integer. ### Synopsis `value = Object:GetByteValue( index, offset )` ### Arguments * **index** (number) - Valid numbers: integers from 0 to 65,535. * **offset** (number) - Should be 0, 1, 2, or 3. Valid numbers: integers from 0 to 255. ### Returns * **value** (number) - Valid numbers: integers from 0 to 255. ``` -------------------------------- ### BattleGround Methods Source: https://www.azerothcore.org/eluna/BattleGround/index.html This section lists the methods available on the BattleGround class to query its state and properties. ```APIDOC ## BattleGround Class Methods This class provides methods to access information about battlegrounds. ### Methods - **GetAlivePlayersCountByTeam(teamId)**: Returns the amount of alive players in the BattleGround by the team ID. - **GetBonusHonorFromKillCount(killCount)**: Returns the bonus honor given by amount of kills in the specific BattleGround. - **GetEndTime()**: Returns the end time of the BattleGround. - **GetFreeSlotsForTeam(teamId)**: Returns the amount of free slots for the selected team in the specific BattleGround. - **GetInstanceId()**: Returns the instance ID of the BattleGround. - **GetMap()**: Returns the Map of the BattleGround. - **GetMapId()**: Returns the map ID of the BattleGround. - **GetMaxLevel()**: Returns the max allowed Player level of the specific BattleGround. - **GetMaxPlayers()**: Returns the maximum allowed Player count of the specific BattleGround. - **GetMaxPlayersPerTeam()**: Returns the maximum allowed Player count per team of the specific BattleGround. - **GetMinLevel()**: Returns the minimum allowed Player level of the specific BattleGround. - **GetMinPlayers()**: Returns the minimum allowed Player count of the specific BattleGround. - **GetMinPlayersPerTeam()**: Returns the minimum allowed Player count per team of the specific BattleGround. - **GetName()**: Returns the name of the BattleGround. - **GetStatus()**: Returns the status of the specific BattleGround. - **GetTypeId()**: Returns the type ID of the BattleGround. - **GetWinner()**: Returns the winning team of the specific BattleGround. ``` -------------------------------- ### Pet:InitTalentForLevel Source: https://www.azerothcore.org/eluna/Pet/InitTalentForLevel.html Initializes talents for the Pet's current level. This assigns talent points based on the pet's level. ```APIDOC ## Pet:InitTalentForLevel ### Description Initializes talents for the Pet's current level. This assigns talent points based on the pet's level. ### Method `Pet:InitTalentForLevel()` ### Arguments None. ### Returns Nothing. ``` -------------------------------- ### Global:GetGUIDLow Source: https://www.azerothcore.org/eluna/Global/GetGUIDLow.html Returns the low GUID from a GUID. A GUID consists of a low GUID, type ID, and possibly an entry ID depending on the type ID. Low GUID is an ID to distinct the objects of the same type. ```APIDOC ## Global:GetGUIDLow ### Description Returns the low GUID from a GUID. A GUID consists of a low GUID, type ID, and possibly an entry ID depending on the type ID. Low GUID is an ID to distinct the objects of the same type. ### Method Global ### Endpoint GetGUIDLow ### Parameters #### Path Parameters - **guid** (number) - Required - GUID of an Object. Valid numbers: integers from 0 to 18,446,744,073,709,551,615. ### Returns #### Success Response - **lowguid** (number) - Low GUID of the Object. Valid numbers: integers from 0 to 4,294,967,295. ``` -------------------------------- ### Player:GiveXP Source: https://www.azerothcore.org/eluna/Player/GiveXP.html Gives the Player experience. This method can be called with one or two arguments. The first argument is the amount of experience to give, and the optional second argument is the victim from whom the experience is gained. ```APIDOC ## Player:GiveXP ### Description Gives the Player experience. This method can be called with one or two arguments. The first argument is the amount of experience to give, and the optional second argument is the victim from whom the experience is gained. ### Method `Player:GiveXP( xp )` `Player:GiveXP( xp, victim )` ### Parameters #### Arguments - **xp** (number) - Required - Experience to give. Valid numbers: integers from 0 to 4,294,967,295. - **victim** (Unit) - Optional - See method description. ### Returns Nothing. ``` -------------------------------- ### GetUnitGUID Source: https://www.azerothcore.org/eluna/Global/GetUnitGUID.html Builds a Creature's GUID using its low GUID and entry ID. Creature GUIDs are unique even if low GUIDs overlap between different unit types. ```APIDOC ## GetUnitGUID ### Description Builds a Creature's GUID. Creature GUIDs consist of entry ID, low GUID, and type ID. Player and Creature for example can have the same low GUID but not GUID. ### Synopsis `guid = GetUnitGUID( lowguid, entry )` ### Arguments #### `lowguid` (number) - Required - Low GUID of the Creature. Valid numbers: integers from 0 to 4,294,967,295. #### `entry` (number) - Required - Entry ID of the Creature. Valid numbers: integers from 0 to 4,294,967,295. ### Returns #### `guid` (number) - The constructed GUID. Valid numbers: integers from 0 to 18,446,744,073,709,551,615. ``` -------------------------------- ### Pet:InitPetCreateSpells Source: https://www.azerothcore.org/eluna/Pet/InitPetCreateSpells.html Initializes the Pet's creation spells. This sets up the basic spells the pet should have when first created. ```APIDOC ## Pet:InitPetCreateSpells ### Description Initializes the Pet's creation spells. This sets up the basic spells the pet should have when first created. ### Method `Pet:InitPetCreateSpells()` ### Arguments None. ### Returns Nothing. ``` -------------------------------- ### GetObjectGUID Source: https://www.azerothcore.org/eluna/Global/GetObjectGUID.html Constructs a unique GUID for a GameObject. The GUID is formed by combining the provided low GUID and entry ID. ```APIDOC ## GetObjectGUID ### Description Builds a GameObject's GUID by combining its low GUID and entry ID. This ensures uniqueness even if other object types share the same low GUID. ### Method `guid = GetObjectGUID( lowguid, entry )` ### Parameters #### Arguments - **lowguid** (number) - Required - Low GUID of the GameObject. Valid numbers are integers from 0 to 4,294,967,295. - **entry** (number) - Required - Entry ID of the GameObject. Valid numbers are integers from 0 to 4,294,967,295. ### Returns #### guid (number) - Returns the unique GUID of the GameObject. Valid numbers are integers from 0 to 18,446,744,073,709,551,615. ``` -------------------------------- ### GetCoreName Source: https://www.azerothcore.org/eluna/Global/index.html Returns the name of the emulator. ```APIDOC ## GetCoreName ### Description Returns emulator's name. ### Method Not specified (assumed to be a script function call) ### Parameters None ### Request Example ```lua local coreName = GetCoreName() ``` ### Response - **coreName** (string) - The name of the emulator. ``` -------------------------------- ### Example Query and Result Structure Source: https://www.azerothcore.org/eluna/ALEQuery/GetRow.html Demonstrates the expected output format of ALEQuery:GetRow after executing a SQL query. Numerical values are preserved as numbers, while other types are returned as strings. ```sql SELECT entry, name FROM creature_template ``` ```lua { entry = 123, name = "some creature name" } ``` -------------------------------- ### Unit:GetControllerGUIDS Source: https://www.azerothcore.org/eluna/Unit/GetControllerGUIDS.html Returns the GUID of the Unit's charmer or owner or its own GUID. ```APIDOC ## Unit:GetControllerGUIDS ### Description Returns the GUID of the Unit's charmer or owner or its own GUID. ### Method Unit:GetControllerGUIDS() ### Arguments None. ### Returns `number` controllerGUID - The GUID of the unit's controller or owner, or its own GUID. Valid numbers are integers from 0 to 18,446,744,073,709,551,615. ``` -------------------------------- ### WorldObject Methods Source: https://www.azerothcore.org/eluna/WorldObject/index.html This section details the various methods available for WorldObject instances, allowing for interaction with game world objects. ```APIDOC ## WorldObject Methods ### Description Provides access to methods for retrieving information about a WorldObject, checking its proximity to other objects or points, and managing game-related events and states. ### Methods - **GetAngle(target)**: Returns the angle between this WorldObject and another WorldObject or a point. - **GetAreaId()**: Returns the current area ID of the WorldObject. - **GetCreaturesInRange(range, entryId)**: Returns a table of Creature objects in sight of the WorldObject or within the given range and/or with a specific entry ID. - **GetDistance(target)**: Returns the distance from this WorldObject to another WorldObject, or from this WorldObject to a point in 3D space. - **GetDistance2d(target)**: Returns the distance from this WorldObject to another WorldObject, or from this WorldObject to a point in 2D space. - **GetExactDistance(target)**: Returns the distance from this WorldObject to another WorldObject, or from this WorldObject to a point in 3D space. - **GetExactDistance2d(target)**: Returns the distance from this WorldObject to another WorldObject, or from this WorldObject to a point in 2D space. - **GetGameObjectsInRange(range, entryId)**: Returns a table of GameObject objects in sight of the WorldObject or within the given range and/or with a specific entry ID. - **GetInstanceId()**: Returns the current instance ID of the WorldObject. - **GetLocation()**: Returns the coordinates and orientation of the WorldObject. - **GetMap()**: Returns the current Map object of the WorldObject. - **GetMapId()**: Returns the current map ID of the WorldObject. - **GetName()**: Returns the name of the WorldObject. - **GetNearObject(distance, type, entry, hostility)**: Returns nearest WorldObject in sight of the WorldObject. The distance, type, entry and hostility requirements the WorldObject must match can be passed. - **GetNearObjects(distance, type, entry, hostility)**: Returns a table of WorldObjects in sight of the WorldObject. The distance, type, entry and hostility requirements the WorldObject must match can be passed. - **GetNearestCreature(range, entryId)**: Returns the nearest Creature object in sight of the WorldObject or within the given range and/or with a specific entry ID. - **GetNearestGameObject(range, entryId)**: Returns the nearest GameObject object in sight of the WorldObject or within the given range and/or with a specific entry ID. - **GetNearestPlayer(range)**: Returns the nearest Player object in sight of the WorldObject or within the given range. - **GetO()**: Returns the current orientation of the WorldObject. - **GetPhaseMask()**: Returns the current phase of the WorldObject. - **GetPlayersInRange(range)**: Returns a table of Player objects in sight of the WorldObject or within the given range. - **GetRelativePoint(distance)**: Returns the x, y and z of a point dist away from the WorldObject. - **GetTransport()**: Returns the transport the WorldObject is on, or nil if not on a transport. - **GetX()**: Returns the current X coordinate of the WorldObject. - **GetY()**: Returns the current Y coordinate of the WorldObject. - **GetZ()**: Returns the current Z coordinate of the WorldObject. - **GetZoneId()**: Returns the current zone ID of the WorldObject. - **IsInBack(target, arc)**: Returns true if the target is in the given arc behind the WorldObject. - **IsInFront(target, arc)**: Returns true if the target is in the given arc in front of the WorldObject. - **IsInMap(target)**: Returns true if the WorldObjects are on the same map. - **IsInRange(target, range)**: Returns true if the target is within given range. - **IsInRange2d(point, range)**: Returns true if the point is within given range. - **IsInRange3d(point, range)**: Returns true if the point is within given range. - **IsWithinDist(target, distance)**: Returns true if the target is in the given distance of the WorldObject. - **IsWithinDist2d(point, distance)**: Returns true if the point is in the given distance of the WorldObject. - **IsWithinDist3d(point, distance)**: Returns true if the point is in the given distance of the WorldObject. - **IsWithinDistInMap(target, distance)**: Returns true if the WorldObject is on the same map and within given distance. - **IsWithinLoS(target)**: Returns true if the given WorldObject or coordinates are in the WorldObject's line of sight. - **PlayDirectSound(player, soundId)**: The WorldObject plays a sound to a Player. - **PlayDistanceSound(player, soundId)**: The WorldObject plays a sound to a Player. - **PlayMusic(player, musicId)**: The WorldObject plays music to a Player. - **RegisterEvent(eventId, delay, repeats, callback)**: Registers a timed event to the WorldObject. When the passed function is called, the parameters `(eventId, delay, repeats, worldobject)` are passed to it. Repeats will decrease on each call if the event does not repeat indefinitely. - **RemoveEventById(eventId)**: Removes the timed event from a WorldObject by the specified event ID. - **RemoveEvents()**: Removes all timed events from a WorldObject. - **SendPacket(packet)**: Sends a WorldPacket to Players in sight of the WorldObject. - **SetPhaseMask(phaseMask)**: Sets the WorldObject's phase mask. - **SpawnCreature(entry, x, y, z, o)**: Spawns the creature at specified location. - **SummonGameObject(entry, x, y, z, o)**: Spawns a GameObject at specified location. ``` -------------------------------- ### GetGUIDType Source: https://www.azerothcore.org/eluna/Global/GetGUIDType.html Retrieves the type ID from a GUID. The type ID is distinct for each object type (e.g., Player, Creature, GameObject). A GUID is composed of an entry ID, a low GUID, and a type ID. ```APIDOC ## GetGUIDType ### Description Returns the type ID from a GUID. Type ID is different for each type (Player, Creature, GameObject, etc.). GUID consists of entry ID, low GUID, and type ID. ### Synopsis `typeId = GetGUIDType( guid )` ### Arguments #### guid (number) GUID of an Object. _Valid numbers_: integers from 0 to 18,446,744,073,709,551,615. ### Returns #### typeId (number) Type ID of the Object. _Valid numbers_: integers from -2,147,483,647 to 2,147,483,647. ``` -------------------------------- ### RunCommand Source: https://www.azerothcore.org/eluna/Global/RunCommand.html Runs a command. ```APIDOC ## Method Global:RunCommand ### Description Runs a command. ### Synopsis `RunCommand( command )` ### Arguments * **command** (string) - The command to run. ### Returns Nothing. ``` -------------------------------- ### Check if Unit is a Spirit Guide Source: https://www.azerothcore.org/eluna/Unit/IsSpiritGuide.html Returns true if the Unit is a spirit guide. This method takes no arguments. ```lua isSpiritGuide = Unit:IsSpiritGuide() ``` -------------------------------- ### Player:InitTaxiNodesForLevel Source: https://www.azerothcore.org/eluna/Player/InitTaxiNodesForLevel.html Initializes taxi nodes for the Player's current level. ```APIDOC ## Player:InitTaxiNodesForLevel ### Description Initializes taxi nodes for the Player's current level. ### Method `Player:InitTaxiNodesForLevel()` ### Parameters None. ### Returns Nothing. ``` -------------------------------- ### Unit:SetOwnerGUID Source: https://www.azerothcore.org/eluna/Unit/SetOwnerGUID.html Sets the Unit's owner GUID to the provided GUID. This is a method available on Unit objects. ```APIDOC ## Unit:SetOwnerGUID ### Description Sets the Unit's owner GUID to a given GUID. ### Method `Unit:SetOwnerGUID( guid )` ### Parameters #### Arguments * **guid** (number) - Required - The new owner GUID. Valid numbers are integers from 0 to 18,446,744,073,709,551,615. ### Returns Nothing. ``` -------------------------------- ### Unit:GetCritterGUID Source: https://www.azerothcore.org/eluna/Unit/GetCritterGUID.html Returns the Critter GUID. This method does not take any arguments and returns a numerical GUID representing the critter. ```APIDOC ## Unit:GetCritterGUID ### Description Returns the unique identifier (GUID) for a critter. ### Method None (this is a method call on a Unit object). ### Endpoint N/A (SDK method) ### Parameters None. ### Returns - **number** critterGuid - The unique numerical identifier for the critter. Valid numbers are integers from 0 to 18,446,744,073,709,551,615. ``` -------------------------------- ### Pet:InitLevelupSpellsForLevel Source: https://www.azerothcore.org/eluna/Pet/InitLevelupSpellsForLevel.html Initializes level-up spells for the Pet's current level. This teaches the pet all spells it should know at its current level. ```APIDOC ## Pet:InitLevelupSpellsForLevel ### Description Initializes level-up spells for the Pet's current level. This teaches the pet all spells it should know at its current level. ### Method `Pet:InitLevelupSpellsForLevel()` ### Arguments None. ### Returns Nothing. ``` -------------------------------- ### Ticket:GetAssignedToGUID Source: https://www.azerothcore.org/eluna/Ticket/GetAssignedToGUID.html Returns the assigned GUID for a ticket. This method does not require any arguments and returns a numerical value representing the GUID. ```APIDOC ## Method Ticket:GetAssignedToGUID ### Description Returns the assigned GUID for a ticket. ### Synopsis `assignedGuid = Ticket:GetAssignedToGUID()` ### Arguments None. ### Returns `**number** assignedGuid` _Valid numbers_ : integers from 0 to 4,294,967,295. ``` -------------------------------- ### Object:GetGUIDLow Source: https://www.azerothcore.org/eluna/Object/GetGUIDLow.html Returns the low-part of the Object's GUID. The uniqueness and behavior of low GUIDs differ between TrinityCore and MaNGOS/cMaNGOS. ```APIDOC ## Method Object:GetGUIDLow ### Description Returns the low-part of the Object's GUID. On TrinityCore, low GUIDs are unique for all objects of the same type within a map. On MaNGOS and cMaNGOS, low GUIDs are unique only on the same map, requiring instanceId and low GUID to identify a creature. ### Synopsis `guidLow = Object:GetGUIDLow()` ### Arguments None. ### Returns `**number** guidLow` _Valid numbers_: integers from 0 to 4,294,967,295. ``` -------------------------------- ### Pet:CreateBaseAtCreature Source: https://www.azerothcore.org/eluna/Pet/CreateBaseAtCreature.html Creates the Pet's base stats and properties from an existing Creature. ```APIDOC ## Pet:CreateBaseAtCreature ### Description Creates the Pet's base stats and properties from an existing Creature. ### Method `success = Pet:CreateBaseAtCreature( creature )` ### Arguments #### creature (Creature) The creature to base the pet on. ### Returns #### success (boolean) `true` if successful, `false` otherwise. ``` -------------------------------- ### Unit:SetCreatorGUID Source: https://www.azerothcore.org/eluna/Unit/SetCreatorGUID.html Sets the creator GUID for a unit. This method takes a numerical GUID as an argument and assigns it as the creator identifier for the unit. ```APIDOC ## Unit:SetCreatorGUID ### Description Sets the creator GUID for a unit. This method takes a numerical GUID as an argument and assigns it as the creator identifier for the unit. ### Method `Unit:SetCreatorGUID( guid )` ### Parameters #### Arguments - **guid** (number) - Required - The GUID to set as the creator. Valid numbers are integers from 0 to 18,446,744,073,709,551,615. ### Returns Nothing. ``` -------------------------------- ### Ticket:IsFromPlayer Source: https://www.azerothcore.org/eluna/Ticket/IsFromPlayer.html Returns true if the provided player GUID matches the GUID of the player who created the ticket, otherwise returns false. ```APIDOC ## Ticket:IsFromPlayer ### Description Returns true if the provided player GUID matches the GUID of the player who created the ticket, otherwise returns false. ### Method Signature `isSamePlayer = Ticket:IsFromPlayer( playerGuid ) ### Arguments * **playerGuid** (number) - Required - The GUID of the player to check. _Valid numbers_: integers from 0 to 18,446,744,073,709,551,615. ### Returns * **isSamePlayer** (boolean) - Description: See method description. ``` -------------------------------- ### Player:GroupCreate Source: https://www.azerothcore.org/eluna/Player/GroupCreate.html Creates a new Group with the creator Player as leader and invites another player to the group. ```APIDOC ## Player:GroupCreate ### Description Creates a new Group with the creator Player as leader. The method takes one player as an argument to invite to the newly created group. ### Method `Player:GroupCreate( invited )` ### Parameters #### Arguments * **invited** (Player) - The player to add to the group. ### Returns * **createdGroup** (Group) - The created group object, or nil if the group creation failed. ``` -------------------------------- ### Object:GetGUID Source: https://www.azerothcore.org/eluna/Object/GetGUID.html Returns the unique GUID of the object. The GUID is a unique identifier for the object, ensuring uniqueness across all maps in TrinityCore. ```APIDOC ## Method Object:GetGUID ### Description Returns the GUID of the Object. GUID is an unique identifier for the object. On TrinityCore this value is unique across all maps. ### Synopsis `guid = Object:GetGUID()` ### Arguments None. ### Returns `**number** guid` _Valid numbers_ : integers from 0 to 18,446,744,073,709,551,615. ``` -------------------------------- ### Player:StartTaxi Source: https://www.azerothcore.org/eluna/Player/StartTaxi.html Attempts to start the taxi/flying to the given pathID. This method takes a single argument, pathId, which specifies the taxi path to use. ```APIDOC ## Player:StartTaxi ### Description Attempts to start the taxi/flying to the given pathID. ### Method `Player:StartTaxi( pathId )` ### Parameters #### Arguments * **pathId** (number) - Required - PathId from DBC or Global:AddTaxiPath. Valid numbers: integers from 0 to 4,294,967,295. ### Returns Nothing. ``` -------------------------------- ### GameObject Methods Source: https://www.azerothcore.org/eluna/GameObject/index.html This section details the various methods available for interacting with GameObject instances. ```APIDOC ## GameObject Methods ### AddLoot Adds an Item to the loot of a GameObject. Requires a gameobject with loot_template set to 0. ### Despawn Despawns a GameObject. ### GetDisplayId Returns the display ID of the GameObject. ### GetGoState Returns the state of a GameObject. Below are client-side [GOState]s off of 3.3.5a. ### GetLootRecipient Returns the Player that can loot the GameObject. ### GetLootRecipientGroup Returns the Group that can loot the GameObject. ### GetLootState Returns the [LootState] of a GameObject. Below are [LootState]s off of 3.3.5a. ### GetSpawnId Returns the spawn ID for this GameObject. ### HasQuest Returns 'true' if the GameObject can give the specified Quest. ### IsActive Returns 'true' if the GameObject is active. ### IsSpawned Returns 'true' if the GameObject is spawned. ### IsTransport Returns 'true' if the GameObject is a transport. ### RemoveFromWorld Removes GameObject from the world. ### Respawn Respawns a GameObject. ### SaveToDB Saves GameObject to the database. ### SetGoState Sets the state of a GameObject. ### SetLootState Sets the [LootState] of a GameObject. Below are [LootState]s off of 3.3.5a. ### SetRespawnDelay Sets the respawn or despawn time for the gameobject. ### SetRespawnTime Sets the respawn or despawn time for the gameobject. ### UseDoorOrButton Activates a door or a button/lever. ``` -------------------------------- ### Get Player Count Source: https://www.azerothcore.org/eluna/Global/GetPlayerCount.html Call this function to get the current number of players in the world. It returns a numerical value representing the count. ```lua count = GetPlayerCount() ``` -------------------------------- ### SendMail Synopsis Source: https://www.azerothcore.org/eluna/Global/SendMail.html Illustrates the various overloads of the SendMail function, showing the different combinations of arguments that can be used to send mail. ```lua itemGUIDlow = SendMail( subject, text, receiverGUIDLow ) itemGUIDlow = SendMail( subject, text, receiverGUIDLow, senderGUIDLow ) itemGUIDlow = SendMail( subject, text, receiverGUIDLow, senderGUIDLow, stationary ) itemGUIDlow = SendMail( subject, text, receiverGUIDLow, senderGUIDLow, stationary, delay ) itemGUIDlow = SendMail( subject, text, receiverGUIDLow, senderGUIDLow, stationary, delay, money ) itemGUIDlow = SendMail( subject, text, receiverGUIDLow, senderGUIDLow, stationary, delay, money, cod ) itemGUIDlow = SendMail( subject, text, receiverGUIDLow, senderGUIDLow, stationary, delay, money, cod, entry ) itemGUIDlow = SendMail( subject, text, receiverGUIDLow, senderGUIDLow, stationary, delay, money, cod, entry, amount ) ``` -------------------------------- ### Unit:GetOwnerGUID Source: https://www.azerothcore.org/eluna/Unit/GetOwnerGUID.html Returns the Unit's owner's GUID. This method takes no arguments and returns a number representing the owner's GUID. ```APIDOC ## Unit:GetOwnerGUID ### Description Returns the Unit's owner's GUID. ### Method Unit:GetOwnerGUID() ### Arguments None. ### Returns - **number** ownerGUID - The GUID of the unit's owner. Valid numbers are integers from 0 to 18,446,744,073,709,551,615. ``` -------------------------------- ### Player:CanSeeDKPet Method Synopsis Source: https://www.azerothcore.org/eluna/Player/CanSeeDKPet.html This snippet shows the synopsis for the Player:CanSeeDKPet method. It takes no arguments and returns a boolean value. ```lua canSeeDKPet = Player:CanSeeDKPet() ``` -------------------------------- ### Unit: GetCharmerGUID Source: https://www.azerothcore.org/eluna/Unit/GetCharmerGUID.html Returns the Unit's charmer's GUID. This method takes no arguments and returns a number representing the charmer's GUID. ```APIDOC ## Unit: GetCharmerGUID ### Description Returns the Unit's charmer's GUID. ### Method None (this is a method call on a Unit object). ### Endpoint N/A (Lua API) ### Parameters None. ### Returns #### Success Response - **charmerGUID** (number) - The GUID of the unit's charmer. Valid numbers are integers from 0 to 18,446,744,073,709,551,615. ``` -------------------------------- ### Loot:GetSourceWorldObject Source: https://www.azerothcore.org/eluna/Loot/GetSourceWorldObject.html Retrieves the source WorldObject GUID for the given loot. This method does not take any arguments and returns a number representing the WorldObject's GUID. ```APIDOC ## Loot:GetSourceWorldObject ### Description Returns the source WorldObject GUID for this loot. ### Method Signature `sourceGUID = Loot:GetSourceWorldObject()` ### Arguments None. ### Returns * **number** sourceGUID - The source WorldObject GUID. Valid numbers are integers from 0 to 18,446,744,073,709,551,615. ``` -------------------------------- ### CreatePacket Source: https://www.azerothcore.org/eluna/Global/index.html Creates a WorldPacket. ```APIDOC ## CreatePacket ### Description Creates a WorldPacket. ### Method Not specified (assumed to be a script function call) ### Parameters - **opcode** (number) - The opcode for the packet. - **data** (string or table, optional) - The data to include in the packet. ### Request Example ```lua local packet = CreatePacket(123, "Hello") ``` ### Response - **packet** (object) - The created WorldPacket object. ``` -------------------------------- ### AuthDBExecute Source: https://www.azerothcore.org/eluna/Global/index.html Executes a SQL query on the login database. ```APIDOC ## AuthDBExecute ### Description Executes a SQL query on the login database. ### Method Not specified (assumed to be a script function call) ### Parameters - **query** (string) - The SQL query to execute. ### Request Example ```lua AuthDBExecute("UPDATE accounts SET ...") ``` ### Response None specified. ``` -------------------------------- ### Group:GetMemberGUID Source: https://www.azerothcore.org/eluna/Group/GetMemberGUID.html Returns a Group member's GUID by their name. This method takes the member's name as input and returns their numerical GUID. ```APIDOC ## Group:GetMemberGUID ### Description Returns a Group member's GUID by their name. ### Method `memberGUID = Group:GetMemberGUID( name )` ### Arguments #### name (string) - Required The Player's name. ### Returns #### memberGUID (number) A numerical GUID representing the member. Valid numbers are integers from 0 to 18,446,744,073,709,551,615. ``` -------------------------------- ### Global:GetGuildByLeaderGUID Source: https://www.azerothcore.org/eluna/Global/GetGuildByLeaderGUID.html Returns Guild by the leader's GUID. This function takes the GUID of a guild leader as input and returns the corresponding Guild object. ```APIDOC ## Global:GetGuildByLeaderGUID ### Description Returns Guild by the leader's GUID. ### Method `guild = GetGuildByLeaderGUID( guid )` ### Parameters #### Path Parameters - **guid** (number) - Required - The guid of a Guild leader. Valid numbers: integers from 0 to 18,446,744,073,709,551,615. ### Returns #### Success Response - **guild** (Guild) - See method description. ``` -------------------------------- ### GetCoreExpansion Source: https://www.azerothcore.org/eluna/Global/index.html Returns the emulator's supported expansion version. ```APIDOC ## GetCoreExpansion ### Description Returns emulator's supported expansion. ### Method Not specified (assumed to be a script function call) ### Parameters None ### Request Example ```lua local expansion = GetCoreExpansion() ``` ### Response - **expansion** (number) - The expansion version supported by the core. ``` -------------------------------- ### Loot:SetSourceWorldObject Source: https://www.azerothcore.org/eluna/Loot/SetSourceWorldObject.html Sets the source WorldObject GUID for this loot. This is a method within the Loot class that takes a single argument: the GUID of the WorldObject that is the source of the loot. ```APIDOC ## Loot:SetSourceWorldObject ### Description Sets the source WorldObject GUID for this loot. ### Method `Loot:SetSourceWorldObject( sourceGUID )` ### Parameters #### Arguments - **sourceGUID** (number) - Required - The source WorldObject GUID. Valid numbers are integers from 0 to 18,446,744,073,709,551,615. ### Returns Nothing. ``` -------------------------------- ### Player:AdvanceAllSkills Source: https://www.azerothcore.org/eluna/Player/AdvanceAllSkills.html Advances all of the Player's skills to the amount specified by the skillStep argument. ```APIDOC ## Player:AdvanceAllSkills ### Description Advances all of the Player's skills to the amount specified. ### Method `Player:AdvanceAllSkills( skillStep )` ### Parameters #### Arguments * **skillStep** (number) - Valid numbers: integers from 0 to 4,294,967,295. ### Returns Nothing. ``` -------------------------------- ### Get Creature's Current Waypoint ID Source: https://www.azerothcore.org/eluna/Creature/GetCurrentWaypointId.html Call this method on a creature object to get the ID of its current waypoint. This ID is a number between 0 and 4,294,967,295. ```lua wpId = Creature:GetCurrentWaypointId() ``` -------------------------------- ### Aura:GetCasterGUID Source: https://www.azerothcore.org/eluna/Aura/GetCasterGUID.html Returns the GUID of the Unit that casted the Spell that caused this Aura to be applied. This method takes no arguments and returns the caster's GUID as a decimal string. ```APIDOC ## Aura:GetCasterGUID ### Description Returns the GUID of the Unit that casted the Spell that caused this Aura to be applied. ### Method None (Method Call) ### Endpoint None (Method Call) ### Parameters None. ### Returns `**string** caster_guid` The GUID of the Unit as a decimal string. ``` -------------------------------- ### Player:CreatePet Source: https://www.azerothcore.org/eluna/Player/CreatePet.html Creates a tamed Pet from a Creature or creature entry. This method can be called in two ways: by providing a creature entry ID to create a pet from scratch, or by providing an existing creature object and an optional spell ID to tame it. ```APIDOC ## Player:CreatePet ### Description Creates a tamed Pet from a Creature or creature entry. Can be called with either: - `player:CreatePet(creatureEntry)` - creates pet from entry ID - `player:CreatePet(creature, spellID)` - tames existing creature ### Synopsis `pet = Player:CreatePet( creatureEntry, creature ) pet = Player:CreatePet( creatureEntry, creature, spellID )` ### Arguments `**number** creatureEntry` Creature entry ID (first form). _Valid numbers_ : integers from 0 to 4,294,967,295. `**Creature** creature` Target creature to tame (second form). `**number** spellID (0)` Spell used for taming (second form). _Valid numbers_ : integers from 0 to 4,294,967,295. ### Returns `**Pet** pet` The created pet, or `nil` if failed. ``` -------------------------------- ### Creature:AttackStart Source: https://www.azerothcore.org/eluna/Creature/AttackStart.html Initiates an attack from a Creature to a specified target. This method is part of the Creature class in the ALE Lua Engine. ```APIDOC ## Creature:AttackStart ### Description Make the Creature attack `target`. ### Method `Creature:AttackStart( target ) ### Parameters #### Arguments - **Unit** target - The unit to be targeted for the attack. ### Returns Nothing. ``` -------------------------------- ### Creature:HasQuest Source: https://www.azerothcore.org/eluna/Creature/HasQuest.html Determines if a creature is associated with starting a particular quest. It takes the quest ID as an argument and returns true if the creature starts the quest, false otherwise. ```APIDOC ## Creature:HasQuest ### Description Returns `true` if the Creature starts the Quest `questId`, and returns `false` otherwise. ### Method `hasQuest = Creature:HasQuest( questId )` ### Arguments #### Path Parameters - **questId** (number) - Required - The ID of a Quest. Valid numbers: integers from 0 to 4,294,967,295. ### Returns #### Success Response - **hasQuest** (boolean) - Returns `true` if the Creature starts the Quest `questId`, and returns `false` otherwise. ### Response Example { "hasQuest": true } ```