/LuaFunctions.cpp

https://github.com/zxyjwy/Eluna · C++ · 1267 lines · 1032 code · 106 blank · 129 comment · 17 complexity · cf9a327ef412c3ed96885473602bad3d MD5 · raw file

  1. /*
  2. * Copyright (C) 2010 - 2014 Eluna Lua Engine <http://emudevs.com/>
  3. * This program is free software licensed under GPL version 3
  4. * Please see the included DOCS/LICENSE.md for more information
  5. */
  6. // Eluna
  7. #include "LuaEngine.h"
  8. // Methods
  9. #include "GlobalMethods.h"
  10. #include "ObjectMethods.h"
  11. #include "WorldObjectMethods.h"
  12. #include "UnitMethods.h"
  13. #include "PlayerMethods.h"
  14. #include "CreatureMethods.h"
  15. #include "GroupMethods.h"
  16. #include "GuildMethods.h"
  17. #include "GameObjectMethods.h"
  18. #include "QueryMethods.h"
  19. #include "AuraMethods.h"
  20. #include "ItemMethods.h"
  21. #include "WorldPacketMethods.h"
  22. #include "SpellMethods.h"
  23. #include "QuestMethods.h"
  24. #include "MapMethods.h"
  25. #include "CorpseMethods.h"
  26. #include "WeatherMethods.h"
  27. #include "VehicleMethods.h"
  28. void RegisterGlobals(lua_State* L)
  29. {
  30. // Hooks
  31. lua_register(L, "RegisterPacketEvent", &LuaGlobalFunctions::RegisterPacketEvent); // RegisterPacketEvent(opcodeID, function)
  32. lua_register(L, "RegisterServerEvent", &LuaGlobalFunctions::RegisterServerEvent); // RegisterServerEvent(event, function)
  33. lua_register(L, "RegisterPlayerEvent", &LuaGlobalFunctions::RegisterPlayerEvent); // RegisterPlayerEvent(event, function)
  34. lua_register(L, "RegisterGuildEvent", &LuaGlobalFunctions::RegisterGuildEvent); // RegisterGuildEvent(event, function)
  35. lua_register(L, "RegisterGroupEvent", &LuaGlobalFunctions::RegisterGroupEvent); // RegisterGroupEvent(event, function)
  36. lua_register(L, "RegisterCreatureEvent", &LuaGlobalFunctions::RegisterCreatureEvent); // RegisterCreatureEvent(entry, event, function)
  37. lua_register(L, "RegisterCreatureGossipEvent", &LuaGlobalFunctions::RegisterCreatureGossipEvent); // RegisterCreatureGossipEvent(entry, event, function)
  38. lua_register(L, "RegisterGameObjectEvent", &LuaGlobalFunctions::RegisterGameObjectEvent); // RegisterGameObjectEvent(entry, event, function)
  39. lua_register(L, "RegisterGameObjectGossipEvent", &LuaGlobalFunctions::RegisterGameObjectGossipEvent); // RegisterGameObjectGossipEvent(entry, event, function)
  40. lua_register(L, "RegisterItemEvent", &LuaGlobalFunctions::RegisterItemEvent); // RegisterItemEvent(entry, event, function)
  41. lua_register(L, "RegisterItemGossipEvent", &LuaGlobalFunctions::RegisterItemGossipEvent); // RegisterItemGossipEvent(entry, event, function)
  42. lua_register(L, "RegisterPlayerGossipEvent", &LuaGlobalFunctions::RegisterPlayerGossipEvent); // RegisterPlayerGossipEvent(menu_id, event, function)
  43. // Getters
  44. lua_register(L, "GetLuaEngine", &LuaGlobalFunctions::GetLuaEngine); // GetLuaEngine() - Returns ElunaEngine
  45. lua_register(L, "GetCoreName", &LuaGlobalFunctions::GetCoreName); // GetCoreName() - Returns core name
  46. lua_register(L, "GetCoreVersion", &LuaGlobalFunctions::GetCoreVersion); // GetCoreVersion() - Returns core version string
  47. lua_register(L, "GetCoreExpansion", &LuaGlobalFunctions::GetCoreExpansion); // GetCoreExpansion() - Returns core expansion number (0 for classic, 1 for tbc, 2 for wotlk, 3 for cata), returns nil if not found.
  48. lua_register(L, "GetQuest", &LuaGlobalFunctions::GetQuest); // GetQuest(questId) - Returns quest object
  49. lua_register(L, "GetPlayerByGUID", &LuaGlobalFunctions::GetPlayerByGUID); // GetPlayerByGUID(guid) - Returns player object by GUID
  50. lua_register(L, "GetPlayerByName", &LuaGlobalFunctions::GetPlayerByName); // GetPlayerByName(name) - Returns player object by player name
  51. lua_register(L, "GetGameTime", &LuaGlobalFunctions::GetGameTime); // GetGameTime() - Returns game time
  52. lua_register(L, "GetPlayersInWorld", &LuaGlobalFunctions::GetPlayersInWorld); // GetPlayersInWorld([team, onlyGM]) - Returns a table with all player objects. Team can be 0 for ally, 1 for horde and 2 for neutral
  53. lua_register(L, "GetPlayersInMap", &LuaGlobalFunctions::GetPlayersInMap); // GetPlayersInWorld(mapId[, instanceId, team]) - Returns a table with all player objects in map. Team can be 0 for ally, 1 for horde and 2 for neutral
  54. lua_register(L, "GetGuildByName", &LuaGlobalFunctions::GetGuildByName); // GetGuildByName(name) - Returns guild object by the guild name
  55. lua_register(L, "GetGuildByLeaderGUID", &LuaGlobalFunctions::GetGuildByLeaderGUID); // GetGuildByLeaderGUID(guid) - Returns guild by it's leader's guid
  56. lua_register(L, "GetPlayerCount", &LuaGlobalFunctions::GetPlayerCount); // GetPlayerCount() - Returns the server's player count
  57. lua_register(L, "GetPlayerGUID", &LuaGlobalFunctions::GetPlayerGUID); // GetPlayerGUID(lowguid) - Generates GUID (uint64) string from player lowguid UNDOCUMENTED
  58. lua_register(L, "GetItemGUID", &LuaGlobalFunctions::GetItemGUID); // GetItemGUID(lowguid) - Generates GUID (uint64) string from item lowguid UNDOCUMENTED
  59. lua_register(L, "GetObjectGUID", &LuaGlobalFunctions::GetObjectGUID); // GetObjectGUID(lowguid, entry) - Generates GUID (uint64) string from gameobject lowguid and entry UNDOCUMENTED
  60. lua_register(L, "GetUnitGUID", &LuaGlobalFunctions::GetUnitGUID); // GetUnitGUID(lowguid, entry) - Generates GUID (uint64) string from unit (creature) lowguid and entry UNDOCUMENTED
  61. lua_register(L, "GetGUIDLow", &LuaGlobalFunctions::GetGUIDLow); // GetGUIDLow(guid) - Returns GUIDLow (uint32) from guid (uint64 as string) UNDOCUMENTED
  62. lua_register(L, "GetGUIDType", &LuaGlobalFunctions::GetGUIDType); // GetGUIDType(guid) - Returns Type (uint32) from guid (uint64 as string) UNDOCUMENTED
  63. lua_register(L, "GetGUIDEntry", &LuaGlobalFunctions::GetGUIDEntry); // GetGUIDEntry(guid) - Returns Entry (uint32) from guid (uint64 as string), may be always 0 UNDOCUMENTED
  64. lua_register(L, "bit_not", &LuaGlobalFunctions::bit_not); // bit_not(a) - Returns ~a UNDOCUMENTED
  65. lua_register(L, "bit_xor", &LuaGlobalFunctions::bit_xor); // bit_xor(a, b) - Returns a ^ b UNDOCUMENTED
  66. lua_register(L, "bit_rshift", &LuaGlobalFunctions::bit_rshift); // bit_rshift(a, b) - Returns a >> b UNDOCUMENTED
  67. lua_register(L, "bit_lshift", &LuaGlobalFunctions::bit_lshift); // bit_lshift(a, b) - Returns a << b UNDOCUMENTED
  68. lua_register(L, "bit_or", &LuaGlobalFunctions::bit_or); // bit_or(a, b) - Returns a | b UNDOCUMENTED
  69. lua_register(L, "bit_and", &LuaGlobalFunctions::bit_and); // bit_and(a, b) - Returns a & b UNDOCUMENTED
  70. lua_register(L, "GetItemLink", &LuaGlobalFunctions::GetItemLink); // GetItemLink(entry[, localeIndex]) - Returns the shift clickable link of the item. Item name translated if translate available for provided locale index UNDOCUMENTED
  71. lua_register(L, "GetMapById", &LuaGlobalFunctions::GetMapById); // GetMapById(mapId, instance) - Returns map object of id specified. UNDOCUMENTED
  72. // Other
  73. // lua_register(L, "ReloadEluna", &LuaGlobalFunctions::ReloadEluna); // ReloadEluna() - Reload's Eluna engine. Returns true if reload succesful.
  74. lua_register(L, "SendWorldMessage", &LuaGlobalFunctions::SendWorldMessage); // SendWorldMessage(msg) - Sends a broadcast message to everyone
  75. lua_register(L, "WorldDBQuery", &LuaGlobalFunctions::WorldDBQuery); // WorldDBQuery(sql) - Executes given SQL query to world database instantly and returns a QueryResult object
  76. lua_register(L, "WorldDBExecute", &LuaGlobalFunctions::WorldDBExecute); // WorldDBExecute(sql) - Executes given SQL query to world database (not instant)
  77. lua_register(L, "CharDBQuery", &LuaGlobalFunctions::CharDBQuery); // CharDBQuery(sql) - Executes given SQL query to character database instantly and returns a QueryResult object
  78. lua_register(L, "CharDBExecute", &LuaGlobalFunctions::CharDBExecute); // CharDBExecute(sql) - Executes given SQL query to character database (not instant)
  79. lua_register(L, "AuthDBQuery", &LuaGlobalFunctions::AuthDBQuery); // AuthDBQuery(sql) - Executes given SQL query to auth/logon database instantly and returns a QueryResult object
  80. lua_register(L, "AuthDBExecute", &LuaGlobalFunctions::AuthDBExecute); // AuthDBExecute(sql) - Executes given SQL query to auth/logon database (not instant)
  81. lua_register(L, "CreateLuaEvent", &LuaGlobalFunctions::CreateLuaEvent); // CreateLuaEvent(function, delay, calls) - Creates a global timed event. Returns Event ID. Calls set to 0 calls infinitely.
  82. lua_register(L, "RemoveEventById", &LuaGlobalFunctions::RemoveEventById); // RemoveEventById(eventId, [all_events]) - Removes a global timed event by it's ID. If all_events is true, can remove any timed event by ID (unit, gameobject, global..)
  83. lua_register(L, "RemoveEvents", &LuaGlobalFunctions::RemoveEvents); // RemoveEvents([all_events]) - Removes all global timed events. Removes all timed events (unit, gameobject, global) if all_events is true
  84. lua_register(L, "PerformIngameSpawn", &LuaGlobalFunctions::PerformIngameSpawn); // PerformIngameSpawn(spawntype, entry, mapid, instanceid, x, y, z, o[, save, DurOrResptime, phase]) - spawntype: 1 Creature, 2 Object. DurOrResptime is respawntime for gameobjects and despawntime for creatures if creature is not saved. Returns spawned creature/gameobject
  85. lua_register(L, "CreatePacket", &LuaGlobalFunctions::CreatePacket); // CreatePacket(opcode, size) - Creates a new packet object
  86. lua_register(L, "AddVendorItem", &LuaGlobalFunctions::AddVendorItem); // AddVendorItem(entry, itemId, maxcount, incrtime, extendedcost) - Adds an item to vendor entry.
  87. lua_register(L, "VendorRemoveItem", &LuaGlobalFunctions::VendorRemoveItem); // VendorRemoveItem(entry, item) - Removes an item from vendor entry
  88. lua_register(L, "VendorRemoveAllItems", &LuaGlobalFunctions::VendorRemoveAllItems); // VendorRemoveAllItems(entry) - Removes all items from vendor entry
  89. lua_register(L, "Kick", &LuaGlobalFunctions::Kick); // Kick(player) - Kicks given player
  90. lua_register(L, "Ban", &LuaGlobalFunctions::Ban); // Ban(banMode(integer), nameOrIP(string), duration(string), reason(string), player(whoBanned)) - Banmode: 0 account, 1 character, 2 IP
  91. lua_register(L, "SaveAllPlayers", &LuaGlobalFunctions::SaveAllPlayers); // SaveAllPlayers() - Saves all players
  92. lua_register(L, "SendMail", &LuaGlobalFunctions::SendMail); // SendMail(subject, text, receiverLowGUID[, senderLowGUID, stationary, delay, itemEntry, itemAmount, itemEntry2, itemAmount2...]) - Sends a mail to player with lowguid. use nil to use default values on optional arguments. UNDOCUMENTED
  93. lua_register(L, "AddTaxiPath", &LuaGlobalFunctions::AddTaxiPath); // AddTaxiPath(pathTable, mountA, mountH[, price, pathId]) - Adds a new taxi path. Returns the path's ID. Will replace an existing path if pathId provided and already used. path table structure: T = {{map, x, y, z[, actionFlag, delay, arrivalEvId, departEvId]}, {...}, ...} UDOCUMENTED
  94. lua_register(L, "AddCorpse", &LuaGlobalFunctions::AddCorpse); // AddCorpse(corpse) - Adds the player's corpse to the world. More specifically, the cell.
  95. lua_register(L, "RemoveCorpse", &LuaGlobalFunctions::RemoveCorpse); // RemoveCorpse(corpse) - Removes the player's corpse from the world.
  96. lua_register(L, "ConvertCorpseForPlayer", &LuaGlobalFunctions::ConvertCorpseForPlayer); // ConvertCorpseFromPlayer(guid[, insignia]) - Converts the player's corpse to bones. Adding insignia for PvP is optional (true or false).
  97. lua_register(L, "RemoveOldCorpses", &LuaGlobalFunctions::RemoveOldCorpses); // RemoveOldCorpses() - Converts (removes) old corpses that aren't bones.
  98. lua_register(L, "FindWeather", &LuaGlobalFunctions::FindWeather); // FindWeather(zoneId) - Finds the weather by zoneId and returns the weather
  99. lua_register(L, "AddWeather", &LuaGlobalFunctions::AddWeather); // AddWeather(zoneId) - Adds weather to the following zone, also returns weather
  100. lua_register(L, "RemoveWeather", &LuaGlobalFunctions::RemoveWeather); // RemoveWeather(zoneId) - Removes weather from a zone
  101. lua_register(L, "SendFineWeatherToPlayer", &LuaGlobalFunctions::SendFineWeatherToPlayer); // SendFineWeatherToPlayer(player) - Sends WEATHER_STATE_FINE weather to the
  102. }
  103. ElunaRegister<Object> ObjectMethods[] =
  104. {
  105. // Getters
  106. { "GetEntry", &LuaObject::GetEntry }, // :GetEntry() - Returns the object's entryId
  107. { "GetGUID", &LuaObject::GetGUID }, // :GetGUID() - Returns uint64 guid as hex string
  108. { "GetGUIDLow", &LuaObject::GetGUIDLow }, // :GetGUIDLow() - Returns uint32 guid (low guid) that is used in database.
  109. { "GetInt32Value", &LuaObject::GetInt32Value }, // :GetInt32Value(index) - returns an int value from object fields
  110. { "GetUInt32Value", &LuaObject::GetUInt32Value }, // :GetUInt32Value(index) - returns an uint value from object fields
  111. { "GetFloatValue", &LuaObject::GetFloatValue }, // :GetFloatValue(index) - returns a float value from object fields
  112. { "GetByteValue", &LuaObject::GetByteValue }, // :GetByteValue(index, offset) - returns a byte value from object fields
  113. { "GetUInt16Value", &LuaObject::GetUInt16Value }, // :GetUInt16Value(index, offset) - returns a uint16 value from object fields
  114. { "GetUInt64Value", &LuaObject::GetUInt64Value }, // :GetUInt64Value(index) - returns a uint64 value from object fields
  115. { "GetScale", &LuaObject::GetScale }, // :GetScale()
  116. { "GetTypeId", &LuaObject::GetTypeId }, // :GetTypeId() - Returns the object's typeId
  117. // Setters
  118. { "SetInt32Value", &LuaObject::SetInt32Value }, // :SetInt32Value(index, value) - Sets an int value for the object
  119. { "SetUInt32Value", &LuaObject::SetUInt32Value }, // :SetUInt32Value(index, value) - Sets an uint value for the object
  120. { "UpdateUInt32Value", &LuaObject::UpdateUInt32Value }, // :UpdateUInt32Value(index, value) - Updates an uint value for the object
  121. { "SetFloatValue", &LuaObject::SetFloatValue }, // :SetFloatValue(index, value) - Sets a float value for the object
  122. { "SetByteValue", &LuaObject::SetByteValue }, // :SetByteValue(index, offset, value) - Sets a byte value for the object
  123. { "SetUInt16Value", &LuaObject::SetUInt16Value }, // :SetUInt16Value(index, offset, value) - Sets an uint16 value for the object
  124. { "SetInt16Value", &LuaObject::SetInt16Value }, // :SetInt16Value(index, offset, value) - Sets an int16 value for the object
  125. { "SetUInt64Value", &LuaObject::SetUInt64Value }, // :SetUInt64Value(index, value) - Sets an uint64 value for the object
  126. { "SetScale", &LuaObject::SetScale }, // :SetScale(scale)
  127. { "SetFlag", &LuaObject::SetFlag }, // :SetFlag(index, flag)
  128. // Boolean
  129. { "IsInWorld", &LuaObject::IsInWorld }, // :IsInWorld() - Returns if the object is in world
  130. { "HasFlag", &LuaObject::HasFlag }, // :HasFlag(index, flag)
  131. // Other
  132. { "ToGameObject", &LuaObject::ToGameObject }, // :ToGameObject()
  133. { "ToUnit", &LuaObject::ToUnit }, // :ToUnit()
  134. { "ToCreature", &LuaObject::ToCreature }, // :ToCreature()
  135. { "ToPlayer", &LuaObject::ToPlayer }, // :ToPlayer()
  136. { "ToCorpse", &LuaObject::ToCorpse }, // :ToCorpse()
  137. { "RemoveFlag", &LuaObject::RemoveFlag }, // :RemoveFlag(index, flag)
  138. { NULL, NULL },
  139. };
  140. ElunaRegister<WorldObject> WorldObjectMethods[] =
  141. {
  142. // Getters
  143. { "GetName", &LuaWorldObject::GetName }, // :GetName()
  144. { "GetMap", &LuaWorldObject::GetMap }, // :GetMap() - Returns the WorldObject's current map object
  145. #if (!defined(TBC) && !defined(CLASSIC))
  146. { "GetPhaseMask", &LuaWorldObject::GetPhaseMask }, // :GetPhaseMask()
  147. #endif
  148. { "GetInstanceId", &LuaWorldObject::GetInstanceId }, // :GetInstanceId()
  149. { "GetAreaId", &LuaWorldObject::GetAreaId }, // :GetAreaId()
  150. { "GetZoneId", &LuaWorldObject::GetZoneId }, // :GetZoneId()
  151. { "GetMapId", &LuaWorldObject::GetMapId }, // :GetMapId() - Returns the WorldObject's current map ID
  152. { "GetX", &LuaWorldObject::GetX }, // :GetX()
  153. { "GetY", &LuaWorldObject::GetY }, // :GetY()
  154. { "GetZ", &LuaWorldObject::GetZ }, // :GetZ()
  155. { "GetO", &LuaWorldObject::GetO }, // :GetO()
  156. { "GetLocation", &LuaWorldObject::GetLocation }, // :GetLocation() - returns X, Y, Z and O co - ords (in that order)
  157. { "GetPlayersInRange", &LuaWorldObject::GetPlayersInRange }, // :GetPlayersInRange([range]) - Returns a table with players in range of the WorldObject.
  158. { "GetCreaturesInRange", &LuaWorldObject::GetCreaturesInRange }, // :GetCreaturesInRange([range, entry]) - Returns a table with creatures of given entry in range of the WorldObject.
  159. { "GetGameObjectsInRange", &LuaWorldObject::GetGameObjectsInRange }, // :GetGameObjectsInRange([range, entry]) - Returns a table with gameobjects of given entry in range of the WorldObject.
  160. { "GetNearestPlayer", &LuaWorldObject::GetNearestPlayer }, // :GetNearestPlayer([range]) - Returns nearest player in sight or given range.
  161. { "GetNearestGameObject", &LuaWorldObject::GetNearestGameObject }, // :GetNearestGameObject([range, entry]) - Returns nearest gameobject with given entry in sight or given range entry can be 0 or nil for any.
  162. { "GetNearestCreature", &LuaWorldObject::GetNearestCreature }, // :GetNearestCreature([range, entry]) - Returns nearest creature with given entry in sight or given range entry can be 0 or nil for any.
  163. { "GetNearObject", &LuaWorldObject::GetNearObject }, // :GetNearObject([nearest, range, typemask, entry, hostile]) - Returns nearest WorldObject or table of objects in given range with given typemask (can contain several types) with given entry if given. Hostile can be 0 for any, 1 hostile, 2 friendly
  164. { "GetWorldObject", &LuaWorldObject::GetWorldObject }, // :GetWorldObject(guid) - Returns a world object (creature, player, gameobject) from the guid. The world object returned must be on the same map as the world object in the arguments.
  165. { "GetDistance", &LuaWorldObject::GetDistance }, // :GetDistance(WorldObject or x, y, z) - Returns the distance between 2 objects or location
  166. { "GetRelativePoint", &LuaWorldObject::GetRelativePoint }, // :GetRelativePoint(dist, rad) - Returns the x, y and z of a point dist away from worldobject.
  167. { "GetAngle", &LuaWorldObject::GetAngle }, // :GetAngle(WorldObject or x, y) - Returns angle between world object and target or x and y coords.
  168. // Other
  169. { "SummonGameObject", &LuaWorldObject::SummonGameObject }, // :SummonGameObject(entry, x, y, z, o[, respawnDelay]) - Spawns an object to location. Returns the object or nil
  170. { "SpawnCreature", &LuaWorldObject::SpawnCreature }, // :SpawnCreature(entry, x, y, z, o[, spawnType, despawnDelay]) - Spawns a creature to location that despawns after given time (0 for infinite). Returns the creature or nil
  171. { "SendPacket", &LuaWorldObject::SendPacket }, // :SendPacket(packet) - Sends a specified packet to everyone around
  172. { NULL, NULL },
  173. };
  174. ElunaRegister<Unit> UnitMethods[] =
  175. {
  176. // Getters
  177. { "GetLevel", &LuaUnit::GetLevel }, // :GetLevel()
  178. { "GetHealth", &LuaUnit::GetHealth }, // :GetHealth()
  179. { "GetDisplayId", &LuaUnit::GetDisplayId }, // :GetDisplayId()
  180. { "GetNativeDisplayId", &LuaUnit::GetNativeDisplayId }, // :GetNativeDisplayId()
  181. { "GetPower", &LuaUnit::GetPower }, // :GetPower(index) - returns power at index. Index can be omitted
  182. { "GetMaxPower", &LuaUnit::GetMaxPower }, // :GetMaxPower(index) - returns power at index. Index can be omitted
  183. { "GetPowerType", &LuaUnit::GetPowerType }, // :GetPowerType() - Returns the power type
  184. { "GetMaxHealth", &LuaUnit::GetMaxHealth }, // :GetMaxHealth()
  185. { "GetHealthPct", &LuaUnit::GetHealthPct }, // :GetHealthPct()
  186. { "GetPowerPct", &LuaUnit::GetPowerPct }, // :GetPowerPct(power_id)
  187. { "GetGender", &LuaUnit::GetGender }, // :GetGender() - returns the gender where male = 0 female = 1
  188. { "GetRace", &LuaUnit::GetRace }, // :GetRace()
  189. { "GetClass", &LuaUnit::GetClass }, // :GetClass()
  190. { "GetClassAsString", &LuaUnit::GetClassAsString }, // :GetClassAsString()
  191. { "GetAura", &LuaUnit::GetAura }, // :GetAura(spellID) - returns aura object
  192. { "GetCombatTime", &LuaUnit::GetCombatTime }, // :GetCombatTime() - Returns how long the unit has been in combat
  193. { "GetFaction", &LuaUnit::GetFaction }, // :GetFaction() - Returns the unit's factionId
  194. { "GetCurrentSpell", &LuaUnit::GetCurrentSpell }, // :GetCurrentSpell(type) - Returns the currently casted spell of given type if any
  195. { "GetCreatureType", &LuaUnit::GetCreatureType }, // :GetCreatureType() - Returns the unit's type
  196. { "GetMountId", &LuaUnit::GetMountId }, // :GetMountId()
  197. { "GetOwnerGUID", &LuaUnit::GetOwnerGUID }, // :GetOwnerGUID() - Returns the GUID of the owner
  198. { "GetOwner", &LuaUnit::GetOwner }, // :GetOwner() - Returns the owner
  199. { "GetFriendlyUnitsInRange", &LuaUnit::GetFriendlyUnitsInRange }, // :GetFriendlyUnitsInRange([range]) - Returns a list of friendly units in range, can return nil
  200. { "GetUnfriendlyUnitsInRange", &LuaUnit::GetUnfriendlyUnitsInRange }, // :GetUnfriendlyUnitsInRange([range]) - Returns a list of unfriendly units in range, can return nil
  201. { "GetOwnerGUID", &LuaUnit::GetOwnerGUID }, // :GetOwnerGUID() - Returns the UNIT_FIELD_SUMMONEDBY owner
  202. { "GetCreatorGUID", &LuaUnit::GetCreatorGUID }, // :GetCreatorGUID() - Returns the UNIT_FIELD_CREATEDBY creator
  203. { "GetMinionGUID", &LuaUnit::GetMinionGUID }, // :GetMinionGUID() - Returns the UNIT_FIELD_SUMMON unit's minion GUID
  204. { "GetCharmerGUID", &LuaUnit::GetCharmerGUID }, // :GetCharmerGUID() - Returns the UNIT_FIELD_CHARMEDBY charmer
  205. { "GetCharmGUID", &LuaUnit::GetCharmGUID }, // :GetCharmGUID() - Returns the unit's UNIT_FIELD_CHARM guid
  206. { "GetPetGUID", &LuaUnit::GetPetGUID }, // :GetPetGUID() - Returns the unit's pet GUID
  207. #if (!defined(TBC) && !defined(CLASSIC))
  208. { "GetCritterGUID", &LuaUnit::GetCritterGUID }, // :GetCritterGUID() - Returns the critter's GUID
  209. #endif
  210. { "GetControllerGUID", &LuaUnit::GetControllerGUID }, // :GetControllerGUID() - Returns the Charmer or Owner GUID
  211. { "GetControllerGUIDS", &LuaUnit::GetControllerGUIDS }, // :GetControllerGUIDS() - Returns the charmer, owner or unit's own GUID
  212. { "GetStandState", &LuaUnit::GetStandState }, // :GetStandState() - Returns the unit's stand state
  213. { "GetVictim", &LuaUnit::GetVictim }, // :GetVictim() - Returns creature's current target
  214. { "GetStat", &LuaUnit::GetStat }, // :GetStat(stat)
  215. { "GetBaseSpellPower", &LuaUnit::GetBaseSpellPower }, // :GetBaseSpellPower()
  216. #if (!defined(TBC) && !defined(CLASSIC))
  217. { "GetVehicleKit", &LuaUnit::GetVehicleKit }, // :GetVehicleKit() - Gets unit's Vehicle kit if the unit is a vehicle
  218. // {"GetVehicle", &LuaUnit::GetVehicle}, // :GetVehicle() - Gets the Vehicle kit of the vehicle the unit is on
  219. #endif
  220. // Setters
  221. { "SetFaction", &LuaUnit::SetFaction }, // :SetFaction(factionId) - Sets the unit's faction
  222. { "SetLevel", &LuaUnit::SetLevel }, // :SetLevel(amount)
  223. { "SetHealth", &LuaUnit::SetHealth }, // :SetHealth(amount)
  224. { "SetMaxHealth", &LuaUnit::SetMaxHealth }, // :SetMaxHealth(amount)
  225. { "SetPower", &LuaUnit::SetPower }, // :SetPower(index, amount)
  226. { "SetMaxPower", &LuaUnit::SetMaxPower }, // :SetMaxPower(index, amount)
  227. { "SetDisplayId", &LuaUnit::SetDisplayId }, // :SetDisplayId(id)
  228. { "SetNativeDisplayId", &LuaUnit::SetNativeDisplayId }, // :SetNativeDisplayId(id)
  229. { "SetFacing", &LuaUnit::SetFacing }, // :SetFacing(o) - Sets the Unit facing to arg
  230. { "SetFacingToObject", &LuaUnit::SetFacingToObject }, // :SetFacingToObject(worldObject) - Sets the Unit facing towards the WorldObject
  231. #if (!defined(TBC) && !defined(CLASSIC))
  232. { "SetPhaseMask", &LuaUnit::SetPhaseMask }, // :SetPhaseMask(Phase[, update]) - Sets the phase of the unit
  233. #endif
  234. { "SetSpeed", &LuaUnit::SetSpeed }, // :SetSpeed(type, speed[, forced]) - Sets speed for the movement type (0 = walk, 1 = run ..)
  235. // {"SetStunned", &LuaUnit::SetStunned}, // :SetStunned([enable]) - Stuns or removes stun
  236. // {"SetRooted", &LuaUnit::SetRooted}, // :SetRooted([enable]) - Roots or removes root
  237. // {"SetConfused", &LuaUnit::SetConfused}, // :SetConfused([enable]) - Sets confused or removes confusion
  238. // {"SetFeared", &LuaUnit::SetFeared}, // :SetFeared([enable]) - Fears or removes fear
  239. { "SetPvP", &LuaUnit::SetPvP }, // :SetPvP([apply]) - Sets the units PvP on or off
  240. #if (!defined(TBC) && !defined(CLASSIC))
  241. { "SetFFA", &LuaUnit::SetFFA }, // :SetFFA([apply]) - Sets the units FFA tag on or off
  242. { "SetSanctuary", &LuaUnit::SetSanctuary }, // :SetSanctuary([apply]) - Enables or disables units sanctuary flag
  243. #endif
  244. // {"SetCanFly", &LuaUnit::SetCanFly}, // :SetCanFly(apply)
  245. // {"SetVisible", &LuaUnit::SetVisible}, // :SetVisible(x)
  246. { "SetOwnerGUID", &LuaUnit::SetOwnerGUID }, // :SetOwnerGUID(guid) - Sets the guid of the owner
  247. { "SetName", &LuaUnit::SetName }, // :SetName(name) - Sets the unit's name
  248. { "SetSheath", &LuaUnit::SetSheath }, // :SetSheath(SheathState) - Sets unit's sheathstate
  249. { "SetCreatorGUID", &LuaUnit::SetCreatorGUID }, // :SetOwnerGUID(uint64 ownerGUID) - Sets the owner's guid of a summoned creature, etc
  250. { "SetMinionGUID", &LuaUnit::SetMinionGUID }, // :SetCreatorGUID(uint64 creatorGUID) - Sets the UNIT_FIELD_CREATEDBY creator's guid
  251. { "SetCharmerGUID", &LuaUnit::SetCharmerGUID }, // :SetCharmerGUID(uint64 ownerGUID) - Sets the UNIT_FIELD_CHARMEDBY charmer GUID
  252. { "SetPetGUID", &LuaUnit::SetPetGUID }, // :SetPetGUID(uint64 guid) - Sets the pet's guid
  253. #if (!defined(TBC) && !defined(CLASSIC))
  254. { "SetCritterGUID", &LuaUnit::SetCritterGUID }, // :SetCritterGUID(uint64 guid) - Sets the critter's guid
  255. #endif
  256. { "SetWaterWalk", &LuaUnit::SetWaterWalk }, // :SetWaterWalk([enable]) - Sets WaterWalk on or off
  257. { "SetStandState", &LuaUnit::SetStandState }, // :SetStandState(state) - Sets the stand state (Stand, Kneel, sleep, etc) of the unit
  258. // Boolean
  259. { "IsAlive", &LuaUnit::IsAlive }, // :IsAlive()
  260. { "IsDead", &LuaUnit::IsDead }, // :IsDead() - Returns true if the unit is dead, false if they are alive
  261. { "IsDying", &LuaUnit::IsDying }, // :IsDying() - Returns true if the unit death state is JUST_DIED.
  262. { "IsPvPFlagged", &LuaUnit::IsPvPFlagged }, // :IsPvPFlagged()
  263. { "IsInCombat", &LuaUnit::IsInCombat }, // :IsInCombat()
  264. { "IsBanker", &LuaUnit::IsBanker }, // :IsBanker() - Returns true if the unit is a banker, false if not
  265. { "IsBattleMaster", &LuaUnit::IsBattleMaster }, // :IsBattleMaster() - Returns true if the unit is a battle master, false if not
  266. { "IsCharmed", &LuaUnit::IsCharmed }, // :IsCharmed() - Returns true if the unit is charmed, false if not
  267. { "IsArmorer", &LuaUnit::IsArmorer }, // :IsArmorer() - Returns true if the unit is an Armorer, false if not
  268. { "IsAttackingPlayer", &LuaUnit::IsAttackingPlayer }, // :IsAttackingPlayer() - Returns true if the unit is attacking a player, false if not
  269. { "IsInWater", &LuaUnit::IsInWater }, // :IsInWater() - Returns true if the unit is in water
  270. { "IsUnderWater", &LuaUnit::IsUnderWater }, // :IsUnderWater() - Returns true if the unit is under water
  271. { "IsAuctioneer", &LuaUnit::IsAuctioneer }, // :IsAuctioneer()
  272. { "IsGuildMaster", &LuaUnit::IsGuildMaster }, // :IsGuildMaster()
  273. { "IsInnkeeper", &LuaUnit::IsInnkeeper }, // :IsInnkeeper()
  274. { "IsTrainer", &LuaUnit::IsTrainer }, // :IsTrainer()
  275. { "IsGossip", &LuaUnit::IsGossip }, // :IsGossip()
  276. { "IsTaxi", &LuaUnit::IsTaxi }, // :IsTaxi()
  277. { "IsSpiritHealer", &LuaUnit::IsSpiritHealer }, // :IsSpiritHealer()
  278. { "IsSpiritGuide", &LuaUnit::IsSpiritGuide }, // :IsSpiritGuide()
  279. { "IsTabardDesigner", &LuaUnit::IsTabardDesigner }, // :IsSpiritGuide()
  280. { "IsServiceProvider", &LuaUnit::IsServiceProvider }, // :IsServiceProvider()
  281. { "IsSpiritService", &LuaUnit::IsSpiritService }, // :IsSpiritService()
  282. { "HealthBelowPct", &LuaUnit::HealthBelowPct }, // :HealthBelowPct(int32 pct)
  283. { "HealthAbovePct", &LuaUnit::HealthAbovePct }, // :HealthAbovePct(int32 pct)
  284. { "IsMounted", &LuaUnit::IsMounted }, // :IsMounted()
  285. { "AttackStop", &LuaUnit::AttackStop }, // :AttackStop()
  286. { "Attack", &LuaUnit::Attack }, // :Attack(who[, meleeAttack])
  287. // {"IsVisible", &LuaUnit::IsVisible}, // :IsVisible()
  288. // {"IsMoving", &LuaUnit::IsMoving}, // :IsMoving()
  289. // {"IsFlying", &LuaUnit::IsFlying}, // :IsFlying()
  290. { "IsStopped", &LuaUnit::IsStopped }, // :IsStopped()
  291. { "HasUnitState", &LuaUnit::HasUnitState }, // :HasUnitState(state) - state from UnitState enum
  292. { "IsQuestGiver", &LuaUnit::IsQuestGiver }, // :IsQuestGiver() - Returns true if the unit is a quest giver, false if not
  293. { "IsWithinDistInMap", &LuaUnit::IsWithinDistInMap }, // :IsWithinDistInMap(worldObject, radius) - Returns if the unit is within distance in map of the worldObject
  294. { "IsInAccessiblePlaceFor", &LuaUnit::IsInAccessiblePlaceFor }, // :IsInAccessiblePlaceFor(creature) - Returns if the unit is in an accessible place for the specified creature
  295. { "IsVendor", &LuaUnit::IsVendor }, // :IsVendor() - Returns if the unit is a vendor or not
  296. { "IsWithinLoS", &LuaUnit::IsWithinLoS }, // :IsWithinLoS(x, y, z)
  297. // {"IsRooted", &LuaUnit::IsRooted}, // :IsRooted()
  298. { "IsFullHealth", &LuaUnit::IsFullHealth }, // :IsFullHealth() - Returns if the unit is full health
  299. { "HasAura", &LuaUnit::HasAura }, // :HasAura(spellId) - Returns true if the unit has the aura from the spell
  300. { "IsStandState", &LuaUnit::IsStandState }, // :IsStandState() - Returns true if the unit is standing
  301. #ifndef CLASSIC
  302. { "IsOnVehicle", &LuaUnit::IsOnVehicle }, // :IsOnVehicle() - Checks if the unit is on a vehicle
  303. #endif
  304. // Other
  305. { "RegisterEvent", &LuaUnit::RegisterEvent }, // :RegisterEvent(function, delay, calls)
  306. { "RemoveEventById", &LuaUnit::RemoveEventById }, // :RemoveEventById(eventID)
  307. { "RemoveEvents", &LuaUnit::RemoveEvents }, // :RemoveEvents()
  308. { "AddAura", &LuaUnit::AddAura }, // :AddAura(spellId, target) - Adds an aura to the specified target
  309. { "RemoveAura", &LuaUnit::RemoveAura }, // :RemoveAura(spellId[, casterGUID]) - Removes an aura from the unit by the spellId, casterGUID(Original caster) is optional
  310. { "RemoveAllAuras", &LuaUnit::RemoveAllAuras }, // :RemoveAllAuras() - Removes all the unit's auras
  311. { "ClearInCombat", &LuaUnit::ClearInCombat }, // :ClearInCombat() - Clears the unit's combat list (unit will be out of combat), resets the timer to 0, etc
  312. { "DeMorph", &LuaUnit::DeMorph }, // :DeMorph() - Sets display back to native
  313. { "SendUnitWhisper", &LuaUnit::SendUnitWhisper }, // :SendUnitWhisper(msg, receiver[, bossWhisper]) - Sends a whisper to the receiver
  314. { "SendUnitEmote", &LuaUnit::SendUnitEmote }, // :SendUnitEmote(msg[, receiver, bossEmote]) - Sends a text emote
  315. { "SendUnitSay", &LuaUnit::SendUnitSay }, // :SendUnitSay(msg, language) - Sends a "Say" message with the specified language (all languages: 0)
  316. { "SendUnitYell", &LuaUnit::SendUnitYell }, // :SendUnitYell(msg, language) - Sends a "Yell" message with the specified language (all languages: 0)
  317. { "CastSpell", &LuaUnit::CastSpell }, // :CastSpell(target, spellID[, triggered]) - Casts spell on target (player/npc/creature), if triggered is true then instant cast
  318. { "CastSpellAoF", &LuaUnit::CastSpellAoF }, // :CastSpellAoF(x, y, z, spellID[, triggered]) - Casts the spell on coordinates, if triggered is false has mana cost and cast time
  319. { "PlayDirectSound", &LuaUnit::PlayDirectSound }, // :PlayDirectSound(soundId, player) - Unit plays soundID to player, or everyone around if no player
  320. { "PlayDistanceSound", &LuaUnit::PlayDistanceSound }, // :PlayDistanceSound(soundId, player) - Unit plays soundID to player, or everyone around if no player. The sound fades the further you are
  321. // {"Kill", &LuaUnit::Kill}, // :Kill(target, durabilityLoss) - Unit kills the target. Durabilityloss is true by default
  322. { "StopSpellCast", &LuaUnit::StopSpellCast }, // :StopSpellCast(spellId(optional)) - Stops the unit from casting a spell. If a spellId is defined, it will stop that unit from casting that spell
  323. { "InterruptSpell", &LuaUnit::InterruptSpell }, // :InterruptSpell(spellType, delayed(optional)) - Interrupts the unit's spell by the spellType. If delayed is true it will skip if the spell is delayed.
  324. { "SendChatMessageToPlayer", &LuaUnit::SendChatMessageToPlayer }, // :SendChatMessageToPlayer(type, lang, msg, target) - Unit sends a chat message to the given target player
  325. { "Emote", &LuaUnit::Emote }, // :Emote(emote)
  326. { "CountPctFromCurHealth", &LuaUnit::CountPctFromCurHealth }, // :CountPctFromCurHealth(int32 pct)
  327. { "CountPctFromMaxHealth", &LuaUnit::CountPctFromMaxHealth }, // :CountPctFromMaxHealth()
  328. { "Dismount", &LuaUnit::Dismount }, // :Dismount() - Dismounts the unit.
  329. { "Mount", &LuaUnit::Mount }, // :Mount(displayId) - Mounts the unit on the specified displayId.
  330. // {"RestoreDisplayId", &LuaUnit::RestoreDisplayId}, // :RestoreDisplayId()
  331. // {"RestoreFaction", &LuaUnit::RestoreFaction}, // :RestoreFaction()
  332. // {"RemoveBindSightAuras", &LuaUnit::RemoveBindSightAuras}, // :RemoveBindSightAuras()
  333. // {"RemoveCharmAuras", &LuaUnit::RemoveCharmAuras}, // :RemoveCharmAuras()
  334. { "ClearThreatList", &LuaUnit::ClearThreatList }, // :ClearThreatList()
  335. { "ClearUnitState", &LuaUnit::ClearUnitState }, // :ClearUnitState(state)
  336. { "AddUnitState", &LuaUnit::AddUnitState }, // :AddUnitState(state)
  337. // {"DisableMelee", &LuaUnit::DisableMelee}, // :DisableMelee([disable]) - if true, enables
  338. // {"SummonGuardian", &LuaUnit::SummonGuardian}, // :SummonGuardian(entry, x, y, z, o[, duration]) - summons a guardian to location. Scales with summoner, is friendly to him and guards him.
  339. { "NearTeleport", &LuaUnit::NearTeleport }, // :NearTeleport(x, y, z, o) - Teleports to give coordinates. Does not leave combat or unsummon pet.
  340. { "MoveIdle", &LuaUnit::MoveIdle }, // :MoveIdle()
  341. { "MoveRandom", &LuaUnit::MoveRandom }, // :MoveRandom(radius)
  342. { "MoveHome", &LuaUnit::MoveHome }, // :MoveHome()
  343. { "MoveFollow", &LuaUnit::MoveFollow }, // :MoveFollow(target[, dist, angle])
  344. { "MoveChase", &LuaUnit::MoveChase }, // :MoveChase(target[, dist, angle])
  345. { "MoveConfused", &LuaUnit::MoveConfused }, // :MoveConfused()
  346. { "MoveFleeing", &LuaUnit::MoveFleeing }, // :MoveFleeing(enemy[, time])
  347. { "MoveTo", &LuaUnit::MoveTo }, // :MoveTo(id, x, y, z[, genPath]) - Moves to point. id is sent to WP reach hook. genPath defaults to true
  348. #if (!defined(TBC) && !defined(CLASSIC))
  349. { "MoveJump", &LuaUnit::MoveJump }, // :MoveJump(x, y, z, zSpeed, maxHeight, id)
  350. #endif
  351. { "MoveStop", &LuaUnit::MoveStop }, // :MoveStop()
  352. { "MoveExpire", &LuaUnit::MoveExpire }, // :MoveExpire([reset])
  353. { "MoveClear", &LuaUnit::MoveClear }, // :MoveClear([reset])
  354. { NULL, NULL },
  355. };
  356. ElunaRegister<Player> PlayerMethods[] =
  357. {
  358. // Getters
  359. { "GetSelection", &LuaPlayer::GetSelection }, // :GetSelection()
  360. { "GetGMRank", &LuaPlayer::GetGMRank }, // :GetSecurity()
  361. { "GetGuildId", &LuaPlayer::GetGuildId }, // :GetGuildId() - nil on no guild
  362. { "GetCoinage", &LuaPlayer::GetCoinage }, // :GetCoinage()
  363. { "GetTeam", &LuaPlayer::GetTeam }, // :GetTeam() - returns the player's team. 0 for ally, 1 for horde
  364. { "GetItemCount", &LuaPlayer::GetItemCount }, // :GetItemCount(item_id[, check_bank])
  365. { "GetGroup", &LuaPlayer::GetGroup }, // :GetGroup()
  366. { "GetGuild", &LuaPlayer::GetGuild }, // :GetGuild()
  367. { "GetAccountId", &LuaPlayer::GetAccountId }, // :GetAccountId()
  368. { "GetAccountName", &LuaPlayer::GetAccountName }, // :GetAccountName()
  369. #ifndef CATA
  370. #ifndef CLASSIC
  371. { "GetArenaPoints", &LuaPlayer::GetArenaPoints }, // :GetArenaPoints()
  372. { "GetHonorPoints", &LuaPlayer::GetHonorPoints }, // :GetHonorPoints()
  373. #endif
  374. #endif
  375. { "GetLifetimeKills", &LuaPlayer::GetLifetimeKills }, // :GetLifetimeKills() - Returns the player's lifetime (honorable) kills
  376. { "GetPlayerIP", &LuaPlayer::GetPlayerIP }, // :GetPlayerIP() - Returns the player's IP Address
  377. { "GetLevelPlayedTime", &LuaPlayer::GetLevelPlayedTime }, // :GetLevelPlayedTime() - Returns the player's played time at that level
  378. { "GetTotalPlayedTime", &LuaPlayer::GetTotalPlayedTime }, // :GetTotalPlayedTime() - Returns the total played time of that player
  379. { "GetItemByPos", &LuaPlayer::GetItemByPos }, // :GetItemByPos(bag, slot) - Returns item in given slot in a bag (bag: 19-22 slot : 0-35) or inventory (bag: -1 slot : 0-38)
  380. { "GetReputation", &LuaPlayer::GetReputation }, // :GetReputation(faction) - Gets player's reputation with given faction
  381. { "GetItemByEntry", &LuaPlayer::GetItemByEntry }, // :GetItemByEntry(entry) - Gets an item if the player has it
  382. { "GetEquippedItemBySlot", &LuaPlayer::GetEquippedItemBySlot }, // :GetEquippedItemBySlot(slotId) - Returns equipped item by slot
  383. { "GetQuestLevel", &LuaPlayer::GetQuestLevel }, // :GetQuestLevel(quest) - Returns quest's level
  384. { "GetChatTag", &LuaPlayer::GetChatTag }, // :GetChatTag() - Returns player chat tag ID
  385. { "GetRestBonus", &LuaPlayer::GetRestBonus }, // :GetRestBonus() - Gets player's rest bonus
  386. { "GetRestType", &LuaPlayer::GetRestType }, // :GetRestType() - Returns the player's rest type
  387. #ifdef WOTLK
  388. { "GetPhaseMaskForSpawn", &LuaPlayer::GetPhaseMaskForSpawn }, // :GetPhaseMaskForSpawn() - Gets the real phasemask for spawning things. Used if the player is in GM mode
  389. #endif
  390. { "GetReqKillOrCastCurrentCount", &LuaPlayer::GetReqKillOrCastCurrentCount }, // :GetReqKillOrCastCurrentCount(questId, entry) - Gets the objective (kill or cast) current count done
  391. { "GetQuestStatus", &LuaPlayer::GetQuestStatus }, // :GetQuestStatus(entry) - Gets the quest's status
  392. { "GetInGameTime", &LuaPlayer::GetInGameTime }, // :GetInGameTime() - Returns player's ingame time
  393. { "GetComboPoints", &LuaPlayer::GetComboPoints }, // :GetComboPoints() - Returns player's combo points
  394. { "GetComboTarget", &LuaPlayer::GetComboTarget }, // :GetComboTarget() - Returns the player's combo target
  395. { "GetGuildName", &LuaPlayer::GetGuildName }, // :GetGuildName() - Returns player's guild's name or nil
  396. { "GetFreeTalentPoints", &LuaPlayer::GetFreeTalentPoints }, // :GetFreeTalentPoints() - Returns the amount of unused talent points
  397. #if (!defined(TBC) && !defined(CLASSIC))
  398. { "GetActiveSpec", &LuaPlayer::GetActiveSpec }, // :GetActiveSpec() - Returns the active specID
  399. { "GetSpecsCount", &LuaPlayer::GetSpecsCount }, // :GetSpecsCount() - Returns the player's spec count
  400. #endif
  401. { "GetSpellCooldownDelay", &LuaPlayer::GetSpellCooldownDelay }, // :GetSpellCooldownDelay(spellId) - Returns the spell's cooldown
  402. { "GetGuildRank", &LuaPlayer::GetGuildRank }, // :GetGuildRank() - Gets the player's guild rank
  403. { "GetDifficulty", &LuaPlayer::GetDifficulty }, // :GetDifficulty([isRaid]) - Returns the current difficulty
  404. { "GetHealthBonusFromStamina", &LuaPlayer::GetHealthBonusFromStamina }, // :GetHealthBonusFromStamina() - Returns the HP bonus from stamina
  405. { "GetManaBonusFromIntellect", &LuaPlayer::GetManaBonusFromIntellect }, // :GetManaBonusFromIntellect() - Returns the mana bonus from intellect
  406. { "GetMaxSkillValue", &LuaPlayer::GetMaxSkillValue }, // :GetMaxSkillValue(skill) - Gets max skill value for the given skill
  407. { "GetPureMaxSkillValue", &LuaPlayer::GetPureMaxSkillValue }, // :GetPureMaxSkillValue(skill) - Gets max base skill value
  408. { "GetSkillValue", &LuaPlayer::GetSkillValue }, // :GetSkillValue(skill) - Gets current skill value
  409. { "GetBaseSkillValue", &LuaPlayer::GetBaseSkillValue }, // :GetBaseSkillValue(skill) - Gets current base skill value (no temp bonus)
  410. { "GetPureSkillValue", &LuaPlayer::GetPureSkillValue }, // :GetPureSkillValue(skill) - Gets current base skill value (no bonuses)
  411. { "GetSkillPermBonusValue", &LuaPlayer::GetSkillPermBonusValue }, // :GetSkillPermBonusValue(skill) - Returns current permanent bonus
  412. { "GetSkillTempBonusValue", &LuaPlayer::GetSkillTempBonusValue }, // :GetSkillTempBonusValue(skill) - Returns current temp bonus
  413. { "GetReputationRank", &LuaPlayer::GetReputationRank }, // :GetReputationRank(faction) - Returns the reputation rank with given faction
  414. { "GetSpellCooldowns", &LuaPlayer::GetSpellCooldowns }, // :GetSpellCooldowns() - Gets a table where spellIDs are the keys and values are cooldowns
  415. { "GetDrunkValue", &LuaPlayer::GetDrunkValue }, // :GetDrunkValue() - Returns the current drunkness value
  416. { "GetBattlegroundId", &LuaPlayer::GetBattlegroundId }, // :GetBattlegroundId() - Returns the player's current battleground ID
  417. { "GetBattlegroundTypeId", &LuaPlayer::GetBattlegroundTypeId }, // :GetBattlegroundTypeId() - Returns the player's current battleground type ID
  418. { "GetXPRestBonus", &LuaPlayer::GetXPRestBonus }, // :GetXPRestBonus(xp) - Returns the rested bonus XP from given XP
  419. { "GetRestTime", &LuaPlayer::GetRestTime }, // :GetRestTime() - Returns the timed rested
  420. { "GetGroupInvite", &LuaPlayer::GetGroupInvite }, // :GetGroupInvite() - Returns the group invited to
  421. { "GetSubGroup", &LuaPlayer::GetSubGroup }, // :GetSubGroup() - Gets the player's current subgroup ID
  422. { "GetNextRandomRaidMember", &LuaPlayer::GetNextRandomRaidMember }, // :GetNextRandomRaidMember(radius) - Gets a random raid member in given radius
  423. { "GetOriginalGroup", &LuaPlayer::GetOriginalGroup }, // :GetOriginalGroup() - Gets the original group object
  424. { "GetOriginalSubGroup", &LuaPlayer::GetOriginalSubGroup }, // :GetOriginalSubGroup() - Returns the original subgroup ID
  425. #ifndef MANGOS
  426. { "GetChampioningFaction", &LuaPlayer::GetChampioningFaction }, // :GetChampioningFaction() - Returns the player's championing faction
  427. #endif
  428. { "GetLatency", &LuaPlayer::GetLatency }, // :GetLatency() - Returns player's latency
  429. // {"GetRecruiterId", &LuaPlayer::GetRecruiterId}, // :GetRecruiterId() - Returns player's recruiter's ID
  430. { "GetDbLocaleIndex", &LuaPlayer::GetDbLocaleIndex }, // :GetDbLocaleIndex() - Returns locale index
  431. { "GetDbcLocale", &LuaPlayer::GetDbcLocale }, // :GetDbcLocale() - Returns DBC locale
  432. { "GetCorpse", &LuaPlayer::GetCorpse }, // :GetCorpse() - Returns the player's corpse
  433. { "GetGossipTextId", &LuaPlayer::GetGossipTextId }, // :GetGossipTextId(worldObject) - Returns the WorldObject's gossip textId
  434. { "GetQuestRewardStatus", &LuaPlayer::GetQuestRewardStatus }, // :GetQuestRewardStatus(questId) - Returns the true/false of the quest reward status
  435. #ifndef CATA
  436. { "GetShieldBlockValue", &LuaPlayer::GetShieldBlockValue }, // :GetShieldBlockValue() - Returns block value
  437. #endif
  438. #ifdef CLASSIC
  439. {"GetHonorStoredKills", &LuaPlayer::GetHonorStoredKills}, // :GetHonorStoredKills(on/off)
  440. {"GetRankPoints", &LuaPlayer::GetRankPoints}, // :GetRankPoints()
  441. {"GetHonorLastWeekStandingPos", &LuaPlayer::GetHonorLastWeekStandingPos}, // :GetHonorLastWeekStandingPos()
  442. #endif
  443. // Setters
  444. { "AdvanceSkillsToMax", &LuaPlayer::AdvanceSkillsToMax }, // :AdvanceSkillsToMax() - Advances all currently known skills to the currently known max level
  445. { "AdvanceSkill", &LuaPlayer::AdvanceSkill }, // :AdvanceSkill(skill_id, step) - Advances skill by ID and the amount(step)
  446. { "AdvanceAllSkills", &LuaPlayer::AdvanceAllSkills }, // :AdvanceAllSkills(value) - Advances all current skills to your input(value)
  447. { "AddLifetimeKills", &LuaPlayer::AddLifetimeKills }, // :AddLifetimeKills(val) - Adds lifetime (honorable) kills to your current lifetime kills
  448. { "SetCoinage", &LuaPlayer::SetCoinage }, // :SetCoinage(amount) - sets plr's coinage to this
  449. #ifndef CLASSIC
  450. { "SetKnownTitle", &LuaPlayer::SetKnownTitle }, // :SetKnownTitle(id)
  451. { "UnsetKnownTitle", &LuaPlayer::UnsetKnownTitle }, // :UnsetKnownTitle(id)
  452. #endif
  453. { "SetBindPoint", &LuaPlayer::SetBindPoint }, // :SetBindPoint(x, y, z, map, areaid) - sets home for hearthstone
  454. #ifndef CATA
  455. #ifndef CLASSIC
  456. { "SetArenaPoints", &LuaPlayer::SetArenaPoints }, // :SetArenaPoints(amount)
  457. { "SetHonorPoints", &LuaPlayer::SetHonorPoints }, // :SetHonorPoints(amount)
  458. #endif
  459. #endif
  460. #ifdef CLASSIC
  461. {"SetHonorStoredKills", &LuaPlayer::SetHonorStoredKills}, // :SetHonorStoredKills(kills, [on/off])
  462. {"SetRankPoints", &LuaPlayer::SetRankPoints}, // :SetRankPoints(rankPoints)
  463. {"SetHonorLastWeekStandingPos", &LuaPlayer::SetHonorLastWeekStandingPos}, // :SetHonorLastWeekStandingPos(standingPos)
  464. #endif
  465. { "SetLifetimeKills", &LuaPlayer::SetLifetimeKills }, // :SetLifetimeKills(val) - Sets the overall lifetime (honorable) kills of the player
  466. { "SetGameMaster", &LuaPlayer::SetGameMaster }, // :SetGameMaster([on]) - Sets GM mode on or off
  467. { "SetGMChat", &LuaPlayer::SetGMChat }, // :SetGMChat([on]) - Sets GM chat on or off
  468. { "SetTaxiCheat", &LuaPlayer::SetTaxiCheat }, // :SetTaxiCheat([on]) - Sets taxi cheat on or off
  469. { "SetGMVisible", &LuaPlayer::SetGMVisible }, // :SetGMVisible([on]) - Sets gm visibility on or off
  470. { "SetPvPDeath", &LuaPlayer::SetPvPDeath }, // :SetPvPDeath([on]) - Sets PvP death on or off
  471. { "SetAcceptWhispers", &LuaPlayer::SetAcceptWhispers }, // :SetAcceptWhispers([on]) - Sets whisper accepting death on or off
  472. { "SetRestBonus", &LuaPlayer::SetRestBonus }, // :SetRestBonus(bonusrate) - Sets new restbonus rate
  473. { "SetRestType", &LuaPlayer::SetRestType }, // :SetRestType() - Sets rest type
  474. { "SetQuestStatus", &LuaPlayer::SetQuestStatus }, // :SetQuestStatus(entry, status) - Sets the quest's status
  475. { "SetReputation", &LuaPlayer::SetReputation }, // :SetReputation(faction, value) - Sets the faction reputation for the player
  476. { "SetFreeTalentPoints", &LuaPlayer::SetFreeTalentPoints }, // :SetFreeTalentPoints(points) - Sets the amount of unused talent points
  477. { "SetGuildRank", &LuaPlayer::SetGuildRank }, // :SetGuildRank(rank) - Sets player's guild rank
  478. // {"SetMovement", &LuaPlayer::SetMovement}, // :SetMovement(type) - Sets player's movement type
  479. { "SetSkill", &LuaPlayer::SetSkill }, // :SetSkill(skill, step, currVal, maxVal) - Sets the skill's boundaries and value
  480. { "SetFactionForRace", &LuaPlayer::SetFactionForRace }, // :SetFactionForRace(race) - Sets the faction by raceID
  481. { "SetDrunkValue", &LuaPlayer::SetDrunkValue }, // :SetDrunkValue(newDrunkValue) - Sets drunkness value
  482. { "SetRestTime", &LuaPlayer::SetRestTime }, // :SetRestTime(value) - Sets the rested time
  483. { "SetAtLoginFlag", &LuaPlayer::SetAtLoginFlag }, // :SetAtLoginFlag(flag) - Adds an at login flag
  484. { "SetPlayerLock", &LuaPlayer::SetPlayerLock }, // :SetPlayerLock(on/off)
  485. { "SetGender", &LuaPlayer::SetGender }, // :SetGender(value) - 0 = male 1 = female
  486. { "SetSheath", &LuaPlayer::SetSheath }, // :SetSheath(SheathState) - Sets player's sheathstate
  487. #ifdef MANGOS
  488. { "SetFFA", &LuaPlayer::SetFFA }, // :SetFFA([apply]) - Sets the units FFA tag on or off
  489. #endif
  490. // Boolean
  491. { "IsInGroup", &LuaPlayer::IsInGroup }, // :IsInGroup()
  492. { "IsInGuild", &LuaPlayer::IsInGuild }, // :IsInGuild()
  493. { "IsGM", &LuaPlayer::IsGM }, // :IsGM()
  494. { "IsAlliance", &LuaPlayer::IsAlliance }, // :IsAlliance()
  495. { "IsHorde", &LuaPlayer::IsHorde }, // :IsHorde()
  496. #ifndef CLASSIC
  497. { "HasTitle", &LuaPlayer::HasTitle }, // :HasTitle(id)
  498. #endif
  499. { "HasItem", &LuaPlayer::HasItem }, // :HasItem(itemId[, count, check_bank]) - Returns true if the player has the item(itemId) and specified count, else it will return false
  500. { "Teleport", &LuaPlayer::Teleport }, // :Teleport(Map, X, Y, Z, O) - Teleports player to specified co - ordinates. Returns true if success and false if not
  501. { "AddItem", &LuaPlayer::AddItem }, // :AddItem(id, amount) - Adds amount of item to player. Returns true if success and false if not
  502. #ifndef CLASSIC
  503. { "IsInArenaTeam", &LuaPlayer::IsInArenaTeam }, // :IsInArenaTeam(type) - type : 0 = 2v2, 1 = 3v3, 2 = 5v5
  504. #endif
  505. { "CanEquipItem", &LuaPlayer::CanEquipItem }, // :CanEquipItem(entry/item, slot) - Returns true if the player can equip given item/item entry
  506. { "IsFalling", &LuaPlayer::IsFalling }, // :IsFalling() - Returns true if the unit is falling
  507. { "ToggleAFK", &LuaPlayer::ToggleAFK }, // :ToggleAFK() - Toggles AFK state for player
  508. { "ToggleDND", &LuaPlayer::ToggleDND }, // :ToggleDND() - Toggles DND state for player
  509. { "IsAFK", &LuaPlayer::IsAFK }, // :IsAFK() - Returns true if the player is afk
  510. { "IsDND", &LuaPlayer::IsDND }, // :IsDND() - Returns true if the player is in dnd mode
  511. { "IsAcceptingWhispers", &LuaPlayer::IsAcceptingWhispers }, // :IsAcceptWhispers() - Returns true if the player accepts whispers
  512. { "IsGMChat", &LuaPlayer::IsGMChat }, // :IsGMChat() - Returns true if the player has GM chat on
  513. { "IsTaxiCheater", &LuaPlayer::IsTaxiCheater }, // :IsTaxiCheater() - Returns true if the player has taxi cheat on
  514. { "IsGMVisible", &LuaPlayer::IsGMVisible }, // :IsGMVisible() - Returns true if the player is GM visible
  515. { "HasQuest", &LuaPlayer::HasQuest }, // :HasQuest(entry) - Returns true if player has the quest
  516. { "InBattlegroundQueue", &LuaPlayer::InBattlegroundQueue }, // :InBattlegroundQueue() - Returns true if the player is in a battleground queue
  517. // {"IsImmuneToEnvironmentalDamage", &LuaPlayer::IsImmuneToEnvironmentalDamage}, // :IsImmuneToEnvironmentalDamage() - Returns true if the player is immune to enviromental damage
  518. { "CanSpeak", &LuaPlayer::CanSpeak }, // :CanSpeak() - Returns true if the player can speak
  519. { "HasAtLoginFlag", &LuaPlayer::HasAtLoginFlag }, // :HasAtLoginFlag(flag) - returns true if the player has the login flag
  520. // {"InRandomLfgDungeon", &LuaPlayer::InRandomLfgDungeon}, // :InRandomLfgDungeon() - Returns true if the player is in a random LFG dungeon
  521. // {"HasPendingBind", &LuaPlayer::HasPendingBind}, // :HasPendingBind() - Returns true if the player has a pending instance bind
  522. #if (!defined(TBC) && !defined(CLASSIC))
  523. { "HasAchieved", &LuaPlayer::HasAchieved }, // :HasAchieved(achievementID) - Returns true if the player has achieved the achievement
  524. #endif
  525. { "CanUninviteFromGroup", &LuaPlayer::CanUninviteFromGroup }, // :CanUninviteFromGroup() - Returns true if the player can uninvite from group
  526. { "IsRested", &LuaPlayer::IsRested }, // :IsRested() - Returns true if the player is rested
  527. // {"CanFlyInZone", &LuaPlayer::CanFlyInZone}, // :CanFlyInZone(mapid, zone) - Returns true if the player can fly in the area
  528. // {"IsNeverVisible", &LuaPlayer::IsNeverVisible}, // :IsNeverVisible() - Returns true if the player is never visible
  529. { "IsVisibleForPlayer", &LuaPlayer::IsVisibleForPlayer }, // :IsVisibleForPlayer(player) - Returns true if the player is visible for the target player
  530. // {"IsUsingLfg", &LuaPlayer::IsUsingLfg}, // :IsUsingLfg() - Returns true if the player is using LFG
  531. { "HasQuestForItem", &LuaPlayer::HasQuestForItem }, // :HasQuestForItem(entry) - Returns true if the player has the quest for the item
  532. { "HasQuestForGO", &LuaPlayer::HasQuestForGO }, // :HasQuestForGO(entry) - Returns true if the player has the quest for the gameobject
  533. { "CanShareQuest", &LuaPlayer::CanShareQuest }, // :CanShareQuest(entry) - Returns true if the quest entry is shareable by the player
  534. // {"HasReceivedQuestReward", &LuaPlayer::HasReceivedQuestReward}, // :HasReceivedQuestReward(entry) - Returns true if the player has recieved the quest's reward
  535. #if (!defined(TBC) && !defined(CLASSIC))
  536. { "HasTalent", &LuaPlayer::HasTalent }, // :HasTalent(talentId, spec) - Returns true if the player has the talent in given spec
  537. #endif
  538. { "IsInSameGroupWith", &LuaPlayer::IsInSameGroupWith }, // :IsInSameGroupWith(player) - Returns true if the players are in the same group
  539. { "IsInSameRaidWith", &LuaPlayer::IsInSameRaidWith }, // :IsInSameRaidWith(player) - Returns true if the players are in the same raid
  540. { "IsGroupVisibleFor", &LuaPlayer::IsGroupVisibleFor }, // :IsGroupVisibleFor(player) - Player is group visible for the target
  541. { "HasSkill", &LuaPlayer::HasSkill }, // :HasSkill(skill) - Returns true if the player has the skill
  542. { "IsHonorOrXPTarget", &LuaPlayer::IsHonorOrXPTarget }, // :IsHonorOrXPTarget(victim) - Returns true if the victim gives honor or XP
  543. { "CanParry", &LuaPlayer::CanParry }, // :CanParry() - Returns true if the player can parry
  544. { "CanBlock", &LuaPlayer::CanBlock }, // :CanBlock() - Returns true if the player can block
  545. #if (!defined(TBC) && !defined(CLASSIC))
  546. { "CanTitanGrip", &LuaPlayer::CanTitanGrip }, // :CanTitanGrip() - Returns true if the player has titan grip
  547. #endif
  548. { "InBattleground", &LuaPlayer::InBattleground }, // :InBattleground() - Returns true if the player is in a battleground
  549. #ifndef CLASSIC
  550. { "InArena", &LuaPlayer::InArena }, // :InArena() - Returns true if the player is in an arena
  551. #endif
  552. // {"IsOutdoorPvPActive", &LuaPlayer::IsOutdoorPvPActive}, // :IsOutdoorPvPActive() - Returns true if the player is outdoor pvp active
  553. // {"IsARecruiter", &LuaPlayer::IsARecruiter}, // :IsARecruiter() - Returns true if the player is a recruiter
  554. { "CanUseItem", &LuaPlayer::CanUseItem }, // :CanUseItem(item/entry) - Returns true if the player can use the item or item entry
  555. { "HasSpell", &LuaPlayer::HasSpell }, // :HasSpell(id)
  556. { "HasSpellCooldown", &LuaPlayer::HasSpellCooldown }, // :HasSpellCooldown(spellId) - Returns true if the spell is on cooldown
  557. { "IsInWater", &LuaPlayer::IsInWater }, // :IsInWater() - Returns true if the player is in water
  558. #ifndef CLASSIC
  559. { "CanFly", &LuaPlayer::CanFly }, // :CanFly() - Returns true if the player can fly
  560. #endif
  561. { "IsMoving", &LuaPlayer::IsMoving }, // :IsMoving()
  562. #ifndef CLASSIC
  563. { "IsFlying", &LuaPlayer::IsFlying }, // :IsFlying()
  564. #endif
  565. // Gossip
  566. { "GossipMenuAddItem", &LuaPlayer::GossipMenuAddItem }, // :GossipMenuAddItem(icon, msg, sender, intid[, code, popup, money])
  567. { "GossipSendMenu", &LuaPlayer::GossipSendMenu }, // :GossipSendMenu(npc_text, unit[, menu_id]) - If unit is a player, you need to use a menu_id. menu_id is used to hook the gossip select function to the menu
  568. { "GossipComplete", &LuaPlayer::GossipComplete }, // :GossipComplete()
  569. { "GossipClearMenu", &LuaPlayer::GossipClearMenu }, // :GossipClearMenu() - Clears the gossip menu of options. Pretty much only useful with player gossip. Need to use before creating a new menu for the player
  570. // Other
  571. { "SendClearCooldowns", &LuaPlayer::SendClearCooldowns }, // :SendClearCooldowns(spellId, (unit)target) - Clears the cooldown of the target with a specified spellId
  572. { "SendBroadcastMessage", &LuaPlayer::SendBroadcastMessage }, // :SendBroadcastMessage(message)
  573. { "SendAreaTriggerMessage", &LuaPlayer::SendAreaTriggerMessage }, // :SendAreaTriggerMessage(message) - Sends a yellow message in the middle of your screen
  574. { "SendNotification", &LuaPlayer::SendNotification }, // :SendNotification(message) - Sends a red message in the middle of your screen
  575. { "SendPacket", &LuaPlayer::SendPacket }, // :SendPacket(packet, selfOnly) - Sends a packet to player or everyone around also if selfOnly is false
  576. { "SendAddonMessage", &LuaPlayer::SendAddonMessage }, // :SendAddonMessage(prefix, message, channel, receiver) - Sends an addon message to the player.
  577. { "SendVendorWindow", &LuaPlayer::SendVendorWindow }, // :SendVendorWindow(unit) - Sends the unit's vendor window to the player
  578. { "ModifyMoney", &LuaPlayer::ModifyMoney }, // :ModifyMoney(amount[, sendError]) - Modifies (does not set) money (copper count) of the player. Amount can be negative to remove copper
  579. { "LearnSpell", &LuaPlayer::LearnSpell }, // :LearnSpell(id) - learns the given spell
  580. { "RemoveItem", &LuaPlayer::RemoveItem }, // :RemoveItem(item/entry, amount) - Removes amount of item from player
  581. { "RemoveLifetimeKills", &LuaPlayer::RemoveLifetimeKills }, // :RemoveLifetimeKills(val) - Removes a specified amount(val) of the player's lifetime (honorable) kills
  582. { "ResurrectPlayer", &LuaPlayer::ResurrectPlayer }, // :ResurrectPlayer([percent[, sickness(bool)]]) - Resurrects the player at percentage, player gets resurrection sickness if sickness set to true
  583. { "PlaySoundToPlayer", &LuaPlayer::PlaySoundToPlayer }, // :PlaySoundToPlayer(soundId) - Plays the specified sound to the player
  584. { "EquipItem", &LuaPlayer::EquipItem }, // :EquipItem(entry/item, slot) - Equips given item or item entry for player to given slot. Returns the equipped item or nil
  585. { "ResetSpellCooldown", &LuaPlayer::ResetSpellCooldown }, // :ResetSpellCooldown(spellId, update(bool~optional)) - Resets cooldown of the specified spellId. If update is true, it will send WorldPacket SMSG_CLEAR_COOLDOWN to the player, else it will just clear the spellId from m_spellCooldowns. This is true by default
  586. { "ResetTypeCooldowns", &LuaPlayer::ResetTypeCooldowns }, // :ResetTypeCooldowns(category, update(bool~optional)) - Resets all cooldowns for the spell category(type). If update is true, it will send WorldPacket SMSG_CLEAR_COOLDOWN to the player, else it will just clear the spellId from m_spellCooldowns. This is true by default
  587. { "ResetAllCooldowns", &LuaPlayer::ResetAllCooldowns }, // :ResetAllCooldowns() - Resets all spell cooldowns
  588. { "GiveLevel", &LuaPlayer::GiveLevel }, // :GiveLevel(level) - Gives levels to the player
  589. { "GiveXP", &LuaPlayer::GiveXP }, // :GiveXP(xp[, victim, pureXP, triggerHook]) - Gives XP to the player. If pure is false, bonuses are count in. If triggerHook is false, GiveXp hook is not triggered.
  590. // {"RemovePet", &LuaPlayer::RemovePet}, // :RemovePet([mode, returnreagent]) - Removes the player's pet. Mode determines if the pet is saved and how
  591. // {"SummonPet", &LuaPlayer::SummonPet}, // :SummonPet(entry, x, y, z, o, petType, despwtime) - Summons a pet for the player
  592. { "Say", &LuaPlayer::Say }, // :Say(text, lang) - The player says the text
  593. { "Yell", &LuaPlayer::Yell }, // :Yell(text, lang) - The player yells the text
  594. { "TextEmote", &LuaPlayer::TextEmote }, // :TextEmote(text) - The player does a textemote with the text
  595. { "Whisper", &LuaPlayer::Whisper }, // :Whisper(text, lang, receiverGuid) - The player whispers the text to the guid
  596. { "CompleteQuest", &LuaPlayer::CompleteQuest }, // :CompleteQuest(entry) - Completes a quest by entry
  597. { "IncompleteQuest", &LuaPlayer::IncompleteQuest }, // :IncompleteQuest(entry) - Uncompletes the quest by entry for the player
  598. { "FailQuest", &LuaPlayer::FailQuest }, // :FailQuest(entry) - Player fails the quest entry
  599. // {"RemoveActiveQuest", &LuaPlayer::RemoveActiveQuest}, // :RemoveActiveQuest(entry) - Removes an active quest
  600. // {"RemoveRewardedQuest", &LuaPlayer::RemoveRewardedQuest}, // :RemoveRewardedQuest(entry) - Removes a rewarded quest
  601. { "AreaExploredOrEventHappens", &LuaPlayer::AreaExploredOrEventHappens }, // :AreaExploredOrEventHappens(questId) - Satisfies an area or event requrement for the questId
  602. { "GroupEventHappens", &LuaPlayer::GroupEventHappens }, // :GroupEventHappens(questId, worldObject) - Satisfies a group event for the questId with the world object
  603. { "KilledMonsterCredit", &LuaPlayer::KilledMonsterCredit }, // :KilledMonsterCredit(entry) - Satisfies a monsterkill for the player
  604. // {"KilledPlayerCredit", &LuaPlayer::KilledPlayerCredit}, // :KilledPlayerCredit() - Satisfies a player kill for the player
  605. // {"KillGOCredit", &LuaPlayer::KillGOCredit}, // :KillGOCredit(GOEntry[, GUID]) - Credits the player for destroying a GO, guid is optional
  606. { "TalkedToCreature", &LuaPlayer::TalkedToCreature }, // :TalkedToCreature(npcEntry, creature) - Satisfies creature talk objective for the player
  607. #if (!defined(TBC) && !defined(CLASSIC))
  608. { "ResetPetTalents", &LuaPlayer::ResetPetTalents }, // :ResetPetTalents() - Resets player's pet's talents
  609. #endif
  610. { "AddComboPoints", &LuaPlayer::AddComboPoints }, // :AddComboPoints(target, count[, spell]) - Adds combo points to the target for the player
  611. // {"GainSpellComboPoints", &LuaPlayer::GainSpellComboPoints}, // :GainSpellComboPoints(amount) - Player gains spell combo points
  612. { "ClearComboPoints", &LuaPlayer::ClearComboPoints }, // :ClearComboPoints() - Clears player's combo points
  613. { "RemoveSpell", &LuaPlayer::RemoveSpell }, // :RemoveSpell(entry[, disabled, learn_low_rank]) - Removes (unlearn) the given spell
  614. { "ResetTalents", &LuaPlayer::ResetTalents }, // :ResetTalents([no_cost]) - Resets player's talents
  615. { "ResetTalentsCost", &LuaPlayer::ResetTalentsCost }, // :ResetTalentsCost() - Returns the reset talents cost
  616. // {"AddTalent", &LuaPlayer::AddTalent}, // :AddTalent(spellid, spec, learning) - Adds a talent spell for the player to given spec
  617. { "RemoveFromGroup", &LuaPlayer::RemoveFromGroup }, // :RemoveFromGroup() - Removes the player from his group
  618. { "KillPlayer", &LuaPlayer::KillPlayer }, // :KillPlayer() - Kills the player
  619. { "DurabilityLossAll", &LuaPlayer::DurabilityLossAll }, // :DurabilityLossAll(percent[, inventory]) - The player's items lose durability. Inventory true by default
  620. { "DurabilityLoss", &LuaPlayer::DurabilityLoss }, // :DurabilityLoss(item, percent) - The given item loses durability
  621. { "DurabilityPointsLoss", &LuaPlayer::DurabilityPointsLoss }, // :DurabilityPointsLoss(item, points) - The given item loses durability
  622. { "DurabilityPointsLossAll", &LuaPlayer::DurabilityPointsLossAll }, // :DurabilityPointsLossAll(points, inventory) - Player's items lose durability
  623. { "DurabilityPointLossForEquipSlot", &LuaPlayer::DurabilityPointLossForEquipSlot }, // :DurabilityPointLossForEquipSlot(slot) - Causes durability loss for the item in the given slot
  624. { "DurabilityRepairAll", &LuaPlayer::DurabilityRepairAll }, // :DurabilityRepairAll([has_cost, discount, guildBank]) - Repairs all durability
  625. { "DurabilityRepair", &LuaPlayer::DurabilityRepair }, // :DurabilityRepair(position[, has_cost, discount, guildBank]) - Repairs item durability of item in given position
  626. #ifndef CATA
  627. #ifndef CLASSIC
  628. { "ModifyHonorPoints", &LuaPlayer::ModifyHonorPoints }, // :ModifyHonorPoints(amount) - Modifies the player's honor points
  629. { "ModifyArenaPoints", &LuaPlayer::ModifyArenaPoints }, // :ModifyArenaPoints(amount) - Modifies the player's arena points
  630. #endif
  631. #endif
  632. { "LeaveBattleground", &LuaPlayer::LeaveBattleground }, // :LeaveBattleground([teleToEntryPoint]) - The player leaves the battleground
  633. // {"BindToInstance", &LuaPlayer::BindToInstance}, // :BindToInstance() - Binds the player to the current instance
  634. { "UnbindInstance", &LuaPlayer::UnbindInstance }, // :UnbindInstance(map, difficulty) - Unbinds the player from an instance
  635. { "RemoveFromBattlegroundRaid", &LuaPlayer::RemoveFromBattlegroundRaid }, // :RemoveFromBattlegroundRaid() - Removes the player from a battleground or battlefield raid
  636. #if (!defined(TBC) && !defined(CLASSIC))
  637. { "ResetAchievements", &LuaPlayer::ResetAchievements }, // :ResetAchievements() - Resets playeräs achievements
  638. #endif
  639. { "KickPlayer", &LuaPlayer::KickPlayer }, // :KickPlayer() - Kicks player from server
  640. { "LogoutPlayer", &LuaPlayer::LogoutPlayer }, // :LogoutPlayer([save]) - Logs the player out and saves if true
  641. { "SendTrainerList", &LuaPlayer::SendTrainerList }, // :SendTrainerList(WorldObject) - Sends trainer list from object to player
  642. { "SendListInventory", &LuaPlayer::SendListInventory }, // :SendListInventory(WorldObject) - Sends vendor list from object to player
  643. { "SendShowBank", &LuaPlayer::SendShowBank }, // :SendShowBank(WorldObject) - Sends bank window from object to player
  644. { "SendTabardVendorActivate", &LuaPlayer::SendTabardVendorActivate }, // :SendTabardVendorActivate(WorldObject) - Sends tabard vendor window from object to player
  645. { "SendSpiritResurrect", &LuaPlayer::SendSpiritResurrect }, // :SendSpiritResurrect() - Sends resurrect window to player
  646. { "SendTaxiMenu", &LuaPlayer::SendTaxiMenu }, // :SendTaxiMenu(creature) - Sends flight window to player from creature
  647. { "RewardQuest", &LuaPlayer::RewardQuest }, // :RewardQuest(entry) - Gives quest rewards for the player
  648. { "SendAuctionMenu", &LuaPlayer::SendAuctionMenu }, // :SendAuctionMenu(unit) - Sends auction window to player. Auction house is sent by object.
  649. { "SendShowMailBox", &LuaPlayer::SendShowMailBox }, // :SendShowMailBox([guid]) - Sends mail window to player. Sent by guid if provided (valid mailbox required for < wotlk)
  650. { "StartTaxi", &LuaPlayer::StartTaxi }, // :StartTaxi(pathId) - player starts the given flight path
  651. { "GossipSendPOI", &LuaPlayer::GossipSendPOI }, // :GossipSendPOI(X, Y, Icon, Flags, Data, Name) - Sends a point of interest to the player
  652. { "GossipAddQuests", &LuaPlayer::GossipAddQuests }, // :GossipAddQuests(unit) - Adds unit's quests to player's gossip menu
  653. { "SendQuestTemplate", &LuaPlayer::SendQuestTemplate }, // :SendQuestTemplate(questId, activeAccept) -- Sends quest template to player
  654. { "SpawnBones", &LuaPlayer::SpawnBones }, // :SpawnBones() - Removes the player's corpse and spawns bones
  655. { "RemovedInsignia", &LuaPlayer::RemovedInsignia }, // :RemovedInsignia(looter) - Looter removes the player's corpse, looting the player and replacing with lootable bones
  656. { "SendGuildInvite", &LuaPlayer::SendGuildInvite }, // :SendGuildInvite(player) - Sends a guild invite to the specific player
  657. { "CreateCorpse", &LuaPlayer::CreateCorpse }, // :CreateCorpse() - Creates the player's corpse
  658. { "Mute", &LuaPlayer::Mute }, // :Mute(time[, reason]) - Mutes the player for given time in seconds.
  659. { "SummonPlayer", &LuaPlayer::SummonPlayer }, // :SummonPlayer(player, map, x, y, z, zoneId[, delay]) - Sends a popup to the player asking if he wants to be summoned if yes, teleported to coords. ZoneID defines the location name shown in the popup Delay is the time until the popup closes automatically.
  660. { "SaveToDB", &LuaPlayer::SaveToDB }, // :SaveToDB() - Saves to database
  661. #ifdef CLASSIC
  662. {"UpdateHonor", &LuaPlayer::UpdateHonor}, // :UpdateHonor() - Updates Player Honor
  663. {"ResetHonor", &LuaPlayer::ResetHonor}, // :ResetHonor() - Resets Player Honor
  664. {"ClearHonorInfo", &LuaPlayer::ClearHonorInfo}, // :ClearHonorInfo() - Clear Player Honor Info
  665. #endif
  666. { NULL, NULL },
  667. };
  668. ElunaRegister<Creature> CreatureMethods[] =
  669. {
  670. // Getters
  671. { "GetAITarget", &LuaCreature::GetAITarget }, // :GetAITarget(type[, playeronly, position, distance, aura]) - Get an unit in threat list
  672. { "GetAITargets", &LuaCreature::GetAITargets }, // :GetAITargets() - Get units in threat list
  673. { "GetAITargetsCount", &LuaCreature::GetAITargetsCount }, // :GetAITargetsCount() - Get threat list size
  674. { "GetHomePosition", &LuaCreature::GetHomePosition }, // :GetHomePosition() - Returns x,y,z,o of spawn position
  675. { "GetCorpseDelay", &LuaCreature::GetCorpseDelay }, // :GetCorpseDelay() - Returns corpse delay
  676. { "GetCreatureSpellCooldownDelay", &LuaCreature::GetCreatureSpellCooldownDelay }, // :GetCreatureSpellCooldownDelay(spellId) - Returns spell cooldown delay
  677. { "GetScriptId", &LuaCreature::GetScriptId }, // :GetScriptId() - Returns creature's script ID
  678. { "GetAIName", &LuaCreature::GetAIName }, // :GetAIName() - Returns creature's AI name
  679. { "GetScriptName", &LuaCreature::GetScriptName }, // :GetScriptName() - Returns creature's script name
  680. { "GetReactState", &LuaCreature::GetReactState }, // :GetReactState() - Returns creature's react state
  681. { "GetAttackDistance", &LuaCreature::GetAttackDistance }, // :GetAttackDistance(unit) - Returns attack distance to unit
  682. { "GetAggroRange", &LuaCreature::GetAggroRange }, // :GetAggroRange(unit) - Returns aggro distance to unit
  683. { "GetDefaultMovementType", &LuaCreature::GetDefaultMovementType }, // :GetDefaultMovementType() - Returns default movement type
  684. { "GetRespawnDelay", &LuaCreature::GetRespawnDelay }, // :GetRespawnDelay() - Returns respawn delay
  685. { "GetRespawnRadius", &LuaCreature::GetRespawnRadius }, // :GetRespawnRadius() - Returns respawn radius
  686. // {"GetWaypointPath", &LuaCreature::GetWaypointPath}, // :GetWaypointPath() - Returns waypoint path ID
  687. // {"GetCurrentWaypointId", &LuaCreature::GetCurrentWaypointId}, // :GetCurrentWaypointId() - Returns waypoint ID
  688. // {"GetLootMode", &LuaCreature::GetLootMode}, // :GetLootMode() - Returns loot mode
  689. { "GetLootRecipient", &LuaCreature::GetLootRecipient }, // :GetLootRecipient() - Returns loot receiver
  690. { "GetLootRecipientGroup", &LuaCreature::GetLootRecipientGroup }, // :GetLootRecipientGroup() - Returns loot receiver group
  691. { "GetNPCFlags", &LuaCreature::GetNPCFlags }, // :GetNPCFlags() - Returns NPC flags
  692. #ifndef CATA
  693. { "GetShieldBlockValue", &LuaCreature::GetShieldBlockValue }, // :GetShieldBlockValue() - Returns block value
  694. #endif
  695. // Setters
  696. { "SetHover", &LuaCreature::SetHover }, // :SetHover([enable]) - Sets hover on or off
  697. // {"SetDisableGravity", &LuaCreature::SetDisableGravity}, // :SetDisableGravity([disable, packetOnly]) - Disables or enables gravity
  698. { "SetReactState", &LuaCreature::SetReactState }, // :SetReactState(state) - Sets react state
  699. { "SetNoCallAssistance", &LuaCreature::SetNoCallAssistance }, // :SetNoCallAssistance([noCall]) - Sets call assistance to false or true
  700. { "SetNoSearchAssistance", &LuaCreature::SetNoSearchAssistance }, // :SetNoSearchAssistance([noSearch]) - Sets assistance searhing to false or true
  701. { "SetDefaultMovementType", &LuaCreature::SetDefaultMovementType }, // :SetDefaultMovementType(type) - Sets default movement type
  702. { "SetRespawnDelay", &LuaCreature::SetRespawnDelay }, // :SetRespawnDelay(delay) - Sets the respawn delay
  703. { "SetRespawnRadius", &LuaCreature::SetRespawnRadius }, // :SetRespawnRadius(dist) - Sets the respawn radius
  704. { "SetInCombatWithZone", &LuaCreature::SetInCombatWithZone }, // :SetInCombatWithZone() - Sets the creature in combat with everyone in zone
  705. { "SetDisableReputationGain", &LuaCreature::SetDisableReputationGain }, // :SetDisableReputationGain([disable]) - Disables or enables reputation gain from creature
  706. // {"SetLootMode", &LuaCreature::SetLootMode}, // :SetLootMode(lootMode) - Sets the lootmode
  707. { "SetNPCFlags", &LuaCreature::SetNPCFlags }, // :SetNPCFlags(flags) - Sets NPC flags
  708. { "SetDeathState", &LuaCreature::SetDeathState }, // :SetDeathState(value) - 0 = alive 1 = just died 2 = corpse 3 = dead
  709. { "SetWalk", &LuaCreature::SetWalk }, // :SetWalk([enable]) - If false, creature runs, otherwise walks
  710. // Booleans
  711. { "IsWorldBoss", &LuaCreature::IsWorldBoss }, // :IsWorldBoss() - Returns true if the creature is a WorldBoss, false if not
  712. { "IsRacialLeader", &LuaCreature::IsRacialLeader }, // :IsRacialLeader() - Returns true if the creature is a racial leader, false if not
  713. { "IsCivilian", &LuaCreature::IsCivilian }, // :IsCivilian() - Returns true if the creature is a civilian, false if not
  714. // {"IsTrigger", &LuaCreature::IsTrigger}, // :IsTrigger() - Returns true if the creature is a trigger, false if not
  715. { "IsGuard", &LuaCreature::IsGuard }, // :IsGuard() - Returns true if the creature is a guard, false if not
  716. { "IsElite", &LuaCreature::IsElite }, // :IsElite() - Returns true if the creature is an elite, false if not
  717. { "IsInEvadeMode", &LuaCreature::IsInEvadeMode }, // :IsInEvadeMode() - Returns true if the creature is in evade mode, false if not
  718. { "HasCategoryCooldown", &LuaCreature::HasCategoryCooldown }, // :HasCategoryCooldown(spellId) - Returns true if the creature has a cooldown for the spell's category
  719. { "CanWalk", &LuaCreature::CanWalk }, // :CanWalk() - Returns true if the creature can walk
  720. { "CanSwim", &LuaCreature::CanSwim }, // :CanSwim() - Returns true if the creature can swim
  721. { "HasReactState", &LuaCreature::HasReactState }, // :HasReactState(state) - Returns true if the creature has react state
  722. // {"CanStartAttack", &LuaCreature::CanStartAttack}, // :CanStartAttack(unit[, force]) - Returns true if the creature can attack the unit
  723. { "HasSearchedAssistance", &LuaCreature::HasSearchedAssistance }, // :HasSearchedAssistance() - Returns true if the creature has searched assistance
  724. { "CanAssistTo", &LuaCreature::CanAssistTo }, // :CanAssistTo(unit, enemy[, checkfaction]) - Returns true if the creature can assist unit with enemy
  725. { "IsTargetAcceptable", &LuaCreature::IsTargetAcceptable }, // :IsTargetAcceptable(unit) - Returns true if the creature can target unit
  726. { "HasInvolvedQuest", &LuaCreature::HasInvolvedQuest }, // :HasInvolvedQuest(questId) - Returns true if the creature can finish the quest for players
  727. { "IsRegeneratingHealth", &LuaCreature::IsRegeneratingHealth }, // :IsRegeneratingHealth() - Returns true if the creature is regenerating health
  728. { "IsReputationGainDisabled", &LuaCreature::IsReputationGainDisabled }, // :IsReputationGainDisabled() - Returns true if the creature has reputation gain disabled
  729. // {"IsDamageEnoughForLootingAndReward", &LuaCreature::IsDamageEnoughForLootingAndReward}, // :IsDamageEnoughForLootingAndReward()
  730. // {"HasLootMode", &LuaCreature::HasLootMode},
  731. { "HasSpell", &LuaCreature::HasSpell }, // :HasSpell(id)
  732. { "HasQuest", &LuaCreature::HasQuest }, // :HasQuest(id)
  733. { "HasSpellCooldown", &LuaCreature::HasSpellCooldown }, // :HasSpellCooldown(spellId) - Returns true if the spell is on cooldown
  734. { "CanFly", &LuaCreature::CanFly }, // :CanFly() - Returns true if the creature can fly
  735. // Other
  736. // {"Despawn", &LuaCreature::Despawn}, // :Despawn([despawnDelay]) - Creature despawns after given time
  737. { "FleeToGetAssistance", &LuaCreature::FleeToGetAssistance }, // :FleeToGetAssistance() - Creature flees for assistance
  738. { "CallForHelp", &LuaCreature::CallForHelp }, // :CallForHelp(radius) - Creature calls for help from units in radius
  739. { "CallAssistance", &LuaCreature::CallAssistance }, // :CallAssistance() - Creature calls for assistance
  740. { "RemoveCorpse", &LuaCreature::RemoveCorpse }, // :RemoveCorpse([setSpawnTime]) - Removes corpse
  741. { "DespawnOrUnsummon", &LuaCreature::DespawnOrUnsummon }, // :DespawnOrUnsummon([Delay]) - Despawns the creature after delay if given
  742. { "Respawn", &LuaCreature::Respawn }, // :Respawn([force]) - Respawns the creature
  743. // {"AddLootMode", &LuaCreature::AddLootMode}, // :AddLootMode(lootMode)
  744. // {"DealDamage", &LuaCreature::DealDamage}, // :DealDamage(target, amount) - Deals damage to target (if target) : if no target, unit will damage self
  745. // {"SendCreatureTalk", &LuaCreature::SendCreatureTalk}, // :SendCreatureTalk(id, playerGUID) - Sends a chat message to a playerGUID (player) by id. Id can be found in creature_text under the 'group_id' column
  746. { "AttackStart", &LuaCreature::AttackStart }, // :AttackStart(target) - Creature attacks the specified target
  747. // {"ResetLootMode", &LuaCreature::ResetLootMode},
  748. // {"RemoveLootMode", &LuaCreature::RemoveLootMode},
  749. { "SaveToDB", &LuaCreature::SaveToDB }, // :SaveToDB() - Saves to database
  750. { "SelectVictim", &LuaCreature::SelectVictim }, // :SelectVictim() - Selects a victim
  751. { "MoveWaypoint", &LuaCreature::MoveWaypoint }, // :MoveWaypoint()
  752. { NULL, NULL },
  753. };
  754. ElunaRegister<GameObject> GameObjectMethods[] =
  755. {
  756. // Getters
  757. { "GetDisplayId", &LuaGameObject::GetDisplayId }, // :GetDisplayId()
  758. { "GetGoState", &LuaGameObject::GetGoState }, // :GetGoState() - Returns state
  759. { "GetLootState", &LuaGameObject::GetLootState }, // :GetLootState() - Returns loot state
  760. // Setters
  761. { "SetGoState", &LuaGameObject::SetGoState },
  762. { "SetLootState", &LuaGameObject::SetLootState },
  763. // Boolean
  764. { "IsTransport", &LuaGameObject::IsTransport }, // :IsTransport()
  765. // {"IsDestructible", &LuaGameObject::IsDestructible}, // :IsDestructible()
  766. { "IsActive", &LuaGameObject::IsActive }, // :IsActive()
  767. { "HasQuest", &LuaGameObject::HasQuest }, // :HasQuest(questId)
  768. { "IsSpawned", &LuaGameObject::IsSpawned }, // :IsSpawned()
  769. // Other
  770. { "RegisterEvent", &LuaGameObject::RegisterEvent }, // :RegisterEvent(function, delay, calls)
  771. { "RemoveEventById", &LuaGameObject::RemoveEventById }, // :RemoveEventById(eventID)
  772. { "RemoveEvents", &LuaGameObject::RemoveEvents }, // :RemoveEvents()
  773. { "RemoveFromWorld", &LuaGameObject::RemoveFromWorld }, // :RemoveFromWorld(del)
  774. { "UseDoorOrButton", &LuaGameObject::UseDoorOrButton }, // :UseDoorOrButton(delay) - Activates/closes/opens after X delay UNDOCUMENTED
  775. { "Despawn", &LuaGameObject::Despawn }, // :Despawn([delay]) - Despawns the object after delay
  776. { "Respawn", &LuaGameObject::Respawn }, // :Respawn([delay]) - respawns the object after delay
  777. { "SaveToDB", &LuaGameObject::SaveToDB }, // :SaveToDB() - Saves to database
  778. { NULL, NULL },
  779. };
  780. ElunaRegister<Item> ItemMethods[] =
  781. {
  782. // Getters
  783. { "GetOwnerGUID", &LuaItem::GetOwnerGUID }, // :GetOwnerGUID() - Returns the owner's guid
  784. { "GetOwner", &LuaItem::GetOwner }, // :GetOwner() - Returns the owner object (player)
  785. { "GetCount", &LuaItem::GetCount }, // :GetCount() - Returns item stack count
  786. { "GetMaxStackCount", &LuaItem::GetMaxStackCount }, // :GetMaxStackCount() - Returns item max stack count
  787. { "GetSlot", &LuaItem::GetSlot }, // :GetSlot() - returns the slot the item is in
  788. { "GetBagSlot", &LuaItem::GetBagSlot }, // :GetBagSlot() - returns the bagslot of the bag the item is in
  789. { "GetEnchantmentId", &LuaItem::GetEnchantmentId }, // :GetEnchantmentId(enchant_slot) - Returns the enchantment in given slot. (permanent = 0)
  790. { "GetSpellId", &LuaItem::GetSpellId }, // :GetSpellId(index) - Returns spellID at given index (0 - 4)
  791. { "GetSpellTrigger", &LuaItem::GetSpellTrigger }, // :GetSpellTrigger(index) - Returns spell trigger at given index (0 - 4)
  792. { "GetItemLink", &LuaItem::GetItemLink }, // :GetItemLink([localeID]) - Returns the shift clickable link of the item. Name translated if locale given and exists
  793. { "GetClass", &LuaItem::GetClass }, // :GetClass()
  794. { "GetSubClass", &LuaItem::GetSubClass }, // :GetSubClass()
  795. { "GetName", &LuaItem::GetName }, // :GetName()
  796. { "GetDisplayId", &LuaItem::GetDisplayId }, // :GetDisplayId()
  797. { "GetQuality", &LuaItem::GetQuality }, // :GetQuality()
  798. { "GetBuyCount", &LuaItem::GetBuyCount }, // :GetBuyCount()
  799. { "GetBuyPrice", &LuaItem::GetBuyPrice }, // :GetBuyPrice()
  800. { "GetSellPrice", &LuaItem::GetSellPrice }, // :GetSellPrice()
  801. { "GetInventoryType", &LuaItem::GetInventoryType }, // :GetInventoryType()
  802. { "GetAllowableClass", &LuaItem::GetAllowableClass }, // :GetAllowableClass()
  803. { "GetAllowableRace", &LuaItem::GetAllowableRace }, // :GetAllowableRace()
  804. { "GetItemLevel", &LuaItem::GetItemLevel }, // :GetItemLevel()
  805. { "GetRequiredLevel", &LuaItem::GetRequiredLevel }, // :GetRequiredLevel()
  806. #ifdef WOTLK
  807. { "GetStatsCount", &LuaItem::GetStatsCount }, // :GetStatsCount()
  808. #endif
  809. { "GetRandomProperty", &LuaItem::GetRandomProperty }, // :GetRandomProperty()
  810. #ifndef CLASSIC
  811. { "GetRandomSuffix", &LuaItem::GetRandomSuffix }, // :GetRandomSuffix()
  812. #endif
  813. { "GetItemSet", &LuaItem::GetItemSet }, // :GetItemSet()
  814. { "GetBagSize", &LuaItem::GetBagSize }, // :GetBagSize()
  815. // Setters
  816. { "SetOwner", &LuaItem::SetOwner }, // :SetOwner(player) - Sets the owner of the item
  817. { "SetBinding", &LuaItem::SetBinding }, // :SetBinding(bound) - Sets the item binding to true or false
  818. { "SetCount", &LuaItem::SetCount }, // :SetCount(count) - Sets the item count
  819. // Boolean
  820. { "IsSoulBound", &LuaItem::IsSoulBound }, // :IsSoulBound() - Returns true if the item is soulbound
  821. #if (!defined(TBC) && !defined(CLASSIC))
  822. { "IsBoundAccountWide", &LuaItem::IsBoundAccountWide }, // :IsBoundAccountWide() - Returns true if the item is account bound
  823. #endif
  824. { "IsBoundByEnchant", &LuaItem::IsBoundByEnchant }, // :IsBoundByEnchant() - Returns true if the item is bound with an enchant
  825. { "IsNotBoundToPlayer", &LuaItem::IsNotBoundToPlayer }, // :IsNotBoundToPlayer(player) - Returns true if the item is not bound with player
  826. { "IsLocked", &LuaItem::IsLocked }, // :IsLocked() - Returns true if the item is locked
  827. { "IsBag", &LuaItem::IsBag }, // :IsBag() - Returns true if the item is a bag
  828. #ifndef CLASSIC
  829. { "IsCurrencyToken", &LuaItem::IsCurrencyToken }, // :IsCurrencyToken() - Returns true if the item is a currency token
  830. #endif
  831. { "IsNotEmptyBag", &LuaItem::IsNotEmptyBag }, // :IsNotEmptyBag() - Returns true if the item is not an empty bag
  832. { "IsBroken", &LuaItem::IsBroken }, // :IsBroken() - Returns true if the item is broken
  833. { "CanBeTraded", &LuaItem::CanBeTraded }, // :CanBeTraded() - Returns true if the item can be traded
  834. { "IsInTrade", &LuaItem::IsInTrade }, // :IsInTrade() - Returns true if the item is in trade
  835. { "IsInBag", &LuaItem::IsInBag }, // :IsInBag() - Returns true if the item is in a bag
  836. { "IsEquipped", &LuaItem::IsEquipped }, // :IsEquipped() - Returns true if the item is equipped
  837. { "HasQuest", &LuaItem::HasQuest }, // :HasQuest(questId) - Returns true if the item starts the quest
  838. { "IsPotion", &LuaItem::IsPotion }, // :IsPotion() - Returns true if the item is a potion
  839. #ifndef CATA
  840. { "IsWeaponVellum", &LuaItem::IsWeaponVellum }, // :IsWeaponVellum() - Returns true if the item is a weapon vellum
  841. { "IsArmorVellum", &LuaItem::IsArmorVellum }, // :IsArmorVellum() - Returns true if the item is an armor vellum
  842. #endif
  843. { "IsConjuredConsumable", &LuaItem::IsConjuredConsumable }, // :IsConjuredConsumable() - Returns true if the item is a conjured consumable
  844. // {"IsRefundExpired", &LuaItem::IsRefundExpired}, // :IsRefundExpired() - Returns true if the item's refund time has expired
  845. { "SetEnchantment", &LuaItem::SetEnchantment }, // :SetEnchantment(enchantid, enchantmentslot) - Sets a new enchantment for the item. Returns true on success
  846. { "ClearEnchantment", &LuaItem::ClearEnchantment }, // :ClearEnchantment(enchantmentslot) - Removes the enchantment from the item if one exists. Returns true on success
  847. // Other
  848. { "SaveToDB", &LuaItem::SaveToDB }, // :SaveToDB() - Saves to database
  849. { NULL, NULL },
  850. };
  851. ElunaRegister<Aura> AuraMethods[] =
  852. {
  853. // Getters
  854. { "GetCaster", &LuaAura::GetCaster }, // :GetCaster() - Returns caster as object
  855. { "GetCasterGUID", &LuaAura::GetCasterGUID }, // :GetCasterGUID() - Returns caster as GUID
  856. { "GetCasterLevel", &LuaAura::GetCasterLevel }, // :GetCasterLevel() - Returns casters level
  857. { "GetDuration", &LuaAura::GetDuration }, // :GetDuration() - Returns remaining duration
  858. { "GetMaxDuration", &LuaAura::GetMaxDuration }, // :GetMaxDuration() - Returns maximum duration
  859. { "GetCharges", &LuaAura::GetCharges }, // :GetCharges() - Returns remaining charges
  860. { "GetAuraId", &LuaAura::GetAuraId }, // :GetAuraId() - Returns aura ID
  861. { "GetStackAmount", &LuaAura::GetStackAmount }, // :GetStackAmount() - Returns current stack amount
  862. { "GetOwner", &LuaAura::GetOwner }, // :GetOwner() - Gets the unit wearing the aura
  863. // Setters
  864. { "SetDuration", &LuaAura::SetDuration }, // :SetDuration(duration) - Sets remaining duration
  865. { "SetMaxDuration", &LuaAura::SetMaxDuration }, // :SetMaxDuration(duration) - Sets maximum duration
  866. { "SetStackAmount", &LuaAura::SetStackAmount }, // :SetStackAmount(amount) - Sets current stack amount
  867. // Other
  868. { "Remove", &LuaAura::Remove }, // :Remove() - Removes the aura
  869. { NULL, NULL },
  870. };
  871. ElunaRegister<Spell> SpellMethods[] =
  872. {
  873. // Getters
  874. { "GetCaster", &LuaSpell::GetCaster }, // :GetCaster() - Returns the spell's caster (UNIT)
  875. { "GetCastTime", &LuaSpell::GetCastTime }, // :GetCastTime() - Returns the spell cast time
  876. { "GetEntry", &LuaSpell::GetId }, // :GetEntry() - Returns the spell's ID
  877. { "GetDuration", &LuaSpell::GetDuration }, // :GetDuration() - Returns the spell's duration
  878. { "GetPowerCost", &LuaSpell::GetPowerCost }, // :GetPowerCost() - Returns the spell's power cost (mana, energy, rage, etc)
  879. { "GetTargetDest", &LuaSpell::GetTargetDest }, // :GetTargetDest() - Returns the target destination (x,y,z,o,map) or nil. Orientation and map may be 0.
  880. { "GetTarget", &LuaSpell::GetTarget }, // :GetTarget() - Returns spell cast target (item, worldobject)
  881. // Setters
  882. { "SetAutoRepeat", &LuaSpell::SetAutoRepeat }, // :SetAutoRepeat(boolean)
  883. // Boolean
  884. { "IsAutoRepeat", &LuaSpell::IsAutoRepeat }, // :IsAutoRepeat()
  885. // Other
  886. { "Cancel", &LuaSpell::cancel }, // :Cancel() - Cancels the spell casting
  887. { "Cast", &LuaSpell::Cast }, // :Cast(skipCheck) - Casts the spell (if true, removes the check for instant spells, etc)
  888. { "Finish", &LuaSpell::Finish }, // :Finish() - Finishes the spell (SPELL_STATE_FINISH)
  889. { NULL, NULL },
  890. };
  891. ElunaRegister<Quest> QuestMethods[] =
  892. {
  893. // Getters
  894. { "GetId", &LuaQuest::GetId }, // :GetId() - Returns the quest's Id
  895. { "GetLevel", &LuaQuest::GetLevel }, // :GetLevel() - Returns the quest's level
  896. // {"GetMaxLevel", &LuaQuest::GetMaxLevel}, // :GetMaxLevel() - Returns the quest's max level
  897. { "GetMinLevel", &LuaQuest::GetMinLevel }, // :GetMinLevel() - Returns the quest's min level
  898. { "GetNextQuestId", &LuaQuest::GetNextQuestId }, // :GetNextQuestId() - Returns the quest's next quest ID
  899. { "GetPrevQuestId", &LuaQuest::GetPrevQuestId }, // :GetPrevQuestId() - Returns the quest's previous quest ID
  900. { "GetNextQuestInChain", &LuaQuest::GetNextQuestInChain }, // :GetNexQuestInChain() - Returns the next quest in its chain
  901. { "GetFlags", &LuaQuest::GetFlags }, // :GetFlags() - Returns the quest's flags
  902. { "GetType", &LuaQuest::GetType }, // :GetType() - Returns the quest's type
  903. // Boolean
  904. { "HasFlag", &LuaQuest::HasFlag }, // :HasFlag(flag) - Returns true or false if the quest has the specified flag
  905. #ifndef CLASSIC
  906. { "IsDaily", &LuaQuest::IsDaily }, // :IsDaily() - Returns true or false if the quest is a daily
  907. #endif
  908. { "IsRepeatable", &LuaQuest::IsRepeatable }, // :IsRepeatable() - Returns true or false if the quest is repeatable
  909. // Setters
  910. { "SetFlag", &LuaQuest::SetFlag }, // :SetFlag(flag) - Sets the flag of the quest by the specified flag
  911. { NULL, NULL },
  912. };
  913. ElunaRegister<Group> GroupMethods[] =
  914. {
  915. // Getters
  916. { "GetMembers", &LuaGroup::GetMembers }, // :GetMembers() - returns a table the players in this group. (Online?)
  917. { "GetLeaderGUID", &LuaGroup::GetLeaderGUID },
  918. { "GetLeader", &LuaGroup::GetLeader },
  919. { "GetGUID", &LuaGroup::GetGUID },
  920. { "GetMemberGroup", &LuaGroup::GetMemberGroup }, // :GetMemberGroup(player) - Returns the player's subgroup ID
  921. { "GetMemberGUID", &LuaGroup::GetMemberGUID }, // :GetMemberGUID("name") - Returns the member's GUID
  922. { "GetMembersCount", &LuaGroup::GetMembersCount }, // :GetMembersCount() - Returns the member count of the group
  923. // Setters
  924. { "SetLeader", &LuaGroup::ChangeLeader }, // :SetLeader(Player) - Sets the player as the new leader
  925. { "SetMembersGroup", &LuaGroup::ChangeMembersGroup }, // :ChangeMembersGroup(player, subGroup) - Changes the member's subgroup
  926. { "SetTargetIcon", &LuaGroup::SetTargetIcon }, // :SetTargetIcon(icon, targetguid[, setterguid]) - Sets target's icon for group. target 0 to clear.
  927. // Boolean
  928. { "IsLeader", &LuaGroup::IsLeader }, // :IsLeader(GUID)
  929. { "AddInvite", &LuaGroup::AddInvite }, // :AddInvite(player) - Adds a an invite to player. Returns true if succesful
  930. { "RemoveMember", &LuaGroup::RemoveMember }, // :RemoveMember(player) - Removes player from group. Returns true on success
  931. { "Disband", &LuaGroup::Disband }, // :Disband() - Disbands the group
  932. { "IsFull", &LuaGroup::IsFull }, // :IsFull() - Returns true if the group is full
  933. // {"IsLFGGroup", &LuaGroup::isLFGGroup}, // :IsLFGGroup() - Returns true if the group is an LFG group
  934. { "IsRaidGroup", &LuaGroup::isRaidGroup }, // :IsRaidGroup() - Returns true if the group is a raid group
  935. { "IsBGGroup", &LuaGroup::isBGGroup }, // :IsBGGroup() - Returns true if the group is a battleground group
  936. // {"IsBFGroup", &LuaGroup::isBFGroup}, // :IsBFGroup() - Returns true if the group is a battlefield group
  937. { "IsMember", &LuaGroup::IsMember }, // :IsMember(player) - Returns true if the player is a member of the group
  938. { "IsAssistant", &LuaGroup::IsAssistant }, // :IsAssistant(player) - returns true if the player is an assistant in the group
  939. { "SameSubGroup", &LuaGroup::SameSubGroup }, // :SameSubGroup(player1, player2) - Returns true if the players are in the same subgroup in the group
  940. { "HasFreeSlotSubGroup", &LuaGroup::HasFreeSlotSubGroup }, // :HasFreeSlotSubGroup(subGroup) - Returns true if the subgroupID has free slots
  941. // Other
  942. { "SendPacket", &LuaGroup::SendPacket }, // :SendPacket(packet, sendToPlayersInBattleground[, ignoreguid]) - Sends a specified packet to the group with the choice (true/false) to send it to players in a battleground. Optionally ignores given player guid
  943. // {"ConvertToLFG", &LuaGroup::ConvertToLFG}, // :ConvertToLFG() - Converts the group to an LFG group
  944. { "ConvertToRaid", &LuaGroup::ConvertToRaid }, // :ConvertToRaid() - Converts the group to a raid group
  945. { NULL, NULL },
  946. };
  947. ElunaRegister<Guild> GuildMethods[] =
  948. {
  949. // Getters
  950. { "GetMembers", &LuaGuild::GetMembers }, // :GetMembers() - returns a table containing the players in this guild. (Online?)
  951. { "GetLeader", &LuaGuild::GetLeader }, // :GetLeader() - Returns the guild learder's object
  952. { "GetLeaderGUID", &LuaGuild::GetLeaderGUID }, // :GetLeaderGUID() - Returns the guild learder's guid
  953. { "GetId", &LuaGuild::GetId }, // :GetId() - Gets the guild's ID
  954. { "GetName", &LuaGuild::GetName }, // :GetName() - Gets the guild name
  955. { "GetMOTD", &LuaGuild::GetMOTD }, // :GetMOTD() - Gets the guild MOTD string
  956. { "GetInfo", &LuaGuild::GetInfo }, // :GetInfo() - Gets the guild info string
  957. { "GetMemberCount", &LuaGuild::GetMemberCount }, // :GetMemberCount() - Returns the amount of players in the guild
  958. // Setters
  959. #ifndef CLASSIC
  960. { "SetBankTabText", &LuaGuild::SetBankTabText }, // :SetBankTabText(tabId, text)
  961. #endif
  962. { "SetMemberRank", &LuaGuild::ChangeMemberRank }, // :SetMemberRank(player, newRank) - Sets the player rank in the guild to the new rank
  963. #ifndef CATA
  964. { "SetLeader", &LuaGuild::SetLeader }, // :SetLeader() - Sets the guild's leader
  965. #endif
  966. // Boolean
  967. // Other
  968. { "ChangeMemberRank", &LuaGuild::ChangeMemberRank }, // :ChangeMemberRank(player, rankId) - Changes players rank to rank specified
  969. { "SendPacket", &LuaGuild::SendPacket }, // :SendPacket(packet) - sends packet to guild
  970. { "SendPacketToRanked", &LuaGuild::SendPacketToRanked }, // :SendPacketToRanked(packet, rankId) - sends packet to guild, specifying a rankId will only send the packet to your ranked members
  971. { "Disband", &LuaGuild::Disband }, // :Disband() - Disbands the guild
  972. { "AddMember", &LuaGuild::AddMember }, // :AddMember(player, rank) - adds the player to the guild. Rank is optional
  973. { "DeleteMember", &LuaGuild::DeleteMember }, // :DeleteMember(player, disbanding, kicked) - Deletes the player from the guild. Disbanding and kicked are optional bools
  974. #ifndef CLASSIC
  975. { "DepositBankMoney", &LuaGuild::DepositBankMoney }, // :DepositBankMoney(money) - Deposits money into the guild bank
  976. { "WithdrawBankMoney", &LuaGuild::WithdrawBankMoney }, // :WithdrawBankMoney(money) - Withdraws money from the guild bank
  977. #endif
  978. { NULL, NULL },
  979. };
  980. #if (!defined(TBC) && !defined(CLASSIC))
  981. ElunaRegister<Vehicle> VehicleMethods[] =
  982. {
  983. // Getters
  984. { "GetOwner", &LuaVehicle::GetOwner }, // :GetOwner() - Returns the the vehicle unit
  985. { "GetEntry", &LuaVehicle::GetEntry }, // :GetEntry() - Returns vehicle ID
  986. { "GetPassenger", &LuaVehicle::GetPassenger }, // :GetPassenger(seatId) - Returns the passenger by seatId
  987. // Boolean
  988. { "IsOnBoard", &LuaVehicle::IsOnBoard }, // :IsOnBoard(unit) - Returns true if the unit is on board
  989. // Other
  990. { "AddPassenger", &LuaVehicle::AddPassenger }, // :AddPassenger(passenger, seatId) - Adds a vehicle passenger
  991. { "RemovePassenger", &LuaVehicle::RemovePassenger }, // :RemovePassenger(passenger) - Removes the passenger from the vehicle
  992. { NULL, NULL },
  993. };
  994. #endif
  995. ElunaRegister<QueryResult> QueryMethods[] =
  996. {
  997. { "NextRow", &LuaQuery::NextRow }, // :NextRow() - Advances to next rown in the query. Returns true if there is a next row, otherwise false
  998. { "GetColumnCount", &LuaQuery::GetColumnCount }, // :GetColumnCount() - Gets the column count of the query
  999. { "GetRowCount", &LuaQuery::GetRowCount }, // :GetRowCount() - Gets the row count of the query
  1000. { "GetBool", &LuaQuery::GetBool }, // :GetBool(column) - returns a bool from a number column (for example tinyint)
  1001. { "GetUInt8", &LuaQuery::GetUInt8 }, // :GetUInt8(column) - returns the value of an unsigned tinyint column
  1002. { "GetUInt16", &LuaQuery::GetUInt16 }, // :GetUInt16(column) - returns the value of a unsigned smallint column
  1003. { "GetUInt32", &LuaQuery::GetUInt32 }, // :GetUInt32(column) - returns the value of an unsigned int or mediumint column
  1004. { "GetUInt64", &LuaQuery::GetUInt64 }, // :GetUInt64(column) - returns the value of an unsigned bigint column as string
  1005. { "GetInt8", &LuaQuery::GetInt8 }, // :GetInt8(column) - returns the value of an tinyint column
  1006. { "GetInt16", &LuaQuery::GetInt16 }, // :GetInt16(column) - returns the value of a smallint column
  1007. { "GetInt32", &LuaQuery::GetInt32 }, // :GetInt32(column) - returns the value of an int or mediumint column
  1008. { "GetInt64", &LuaQuery::GetInt64 }, // :GetInt64(column) - returns the value of a bigint column as string
  1009. { "GetFloat", &LuaQuery::GetFloat }, // :GetFloat(column) - returns the value of a float column
  1010. { "GetDouble", &LuaQuery::GetDouble }, // :GetDouble(column) - returns the value of a double column
  1011. { "GetString", &LuaQuery::GetString }, // :GetString(column) - returns the value of a string column
  1012. { "IsNull", &LuaQuery::IsNull }, // :IsNull(column) - returns true if the column is null
  1013. { NULL, NULL },
  1014. };
  1015. ElunaRegister<WorldPacket> PacketMethods[] =
  1016. {
  1017. // Getters
  1018. { "GetOpcode", &LuaPacket::GetOpcode }, // :GetOpcode() - Returns an opcode
  1019. { "GetSize", &LuaPacket::GetSize }, // :GetSize() - Returns the packet size
  1020. // Setters
  1021. { "SetOpcode", &LuaPacket::SetOpcode }, // :SetOpcode(opcode) - Sets the opcode by specifying an opcode
  1022. // Readers
  1023. { "ReadByte", &LuaPacket::ReadByte }, // :ReadByte() - Reads an int8 value
  1024. { "ReadUByte", &LuaPacket::ReadUByte }, // :ReadUByte() - Reads an uint8 value
  1025. { "ReadShort", &LuaPacket::ReadShort }, // :ReadShort() - Reads an int16 value
  1026. { "ReadUShort", &LuaPacket::ReadUShort }, // :ReadUShort() - Reads an uint16 value
  1027. { "ReadLong", &LuaPacket::ReadLong }, // :ReadLong() - Reads an int32 value
  1028. { "ReadULong", &LuaPacket::ReadULong }, // :ReadULong() - Reads an uint32 value
  1029. { "ReadGUID", &LuaPacket::ReadGUID }, // :ReadGUID() - Reads an uint64 value
  1030. { "ReadString", &LuaPacket::ReadString }, // :ReadString() - Reads a string value
  1031. { "ReadFloat", &LuaPacket::ReadFloat }, // :ReadFloat() - Reads a float value
  1032. { "ReadDouble", &LuaPacket::ReadDouble }, // :ReadDouble() - Reads a double value
  1033. // Writers
  1034. { "WriteByte", &LuaPacket::WriteByte }, // :WriteByte(val) - Writes an int8 value
  1035. { "WriteUByte", &LuaPacket::WriteUByte }, // :WriteUByte(val) - Writes a uint8 value
  1036. { "WriteShort", &LuaPacket::WriteShort }, // :WriteShort(val) - Writes an int16 value
  1037. { "WriteUShort", &LuaPacket::WriteUShort }, // :WriteUShort(val) - Writes a uint16 value
  1038. { "WriteLong", &LuaPacket::WriteLong }, // :WriteLong(val) - Writes an int32 value
  1039. { "WriteULong", &LuaPacket::WriteULong }, // :WriteULong(val) - Writes a uint32 value
  1040. { "WriteGUID", &LuaPacket::WriteGUID }, // :WriteGUID(guid) - Writes a uint64 value
  1041. { "WriteString", &LuaPacket::WriteString }, // :WriteString(val) - Writes a string value
  1042. { "WriteFloat", &LuaPacket::WriteFloat }, // :WriteFloat(val) - Writes a float value
  1043. { "WriteDouble", &LuaPacket::WriteDouble }, // :WriteDouble(val) - Writes a double value
  1044. { NULL, NULL },
  1045. };
  1046. ElunaRegister<Map> MapMethods[] =
  1047. {
  1048. // Getters
  1049. { "GetName", &LuaMap::GetName }, // :GetName() - Returns the map's name UNDOCUMENTED
  1050. { "GetDifficulty", &LuaMap::GetDifficulty }, // :GetDifficulty() - Returns the map's difficulty UNDOCUMENTED
  1051. { "GetInstanceId", &LuaMap::GetInstanceId }, // :GetInstanceId() - Returns the map's instance ID UNDOCUMENTED
  1052. { "GetPlayerCount", &LuaMap::GetPlayerCount }, // :GetPlayerCount() - Returns the amount of players on map except GM's UNDOCUMENTED
  1053. { "GetMapId", &LuaMap::GetMapId }, // :GetMapId() - Returns the map's ID UNDOCUMENTED
  1054. { "GetAreaId", &LuaMap::GetAreaId }, // :GetAreaId(x, y, z) - Returns the map's area ID based on coords UNDOCUMENTED
  1055. { "GetHeight", &LuaMap::GetHeight }, // :GetHeight(x, y[, phasemask]) - Returns ground Z coordinate. UNDOCUMENTED
  1056. // Booleans
  1057. #ifndef CLASSIC
  1058. { "IsArena", &LuaMap::IsArena }, // :IsArena() - Returns the true if the map is an arena, else false UNDOCUMENTED
  1059. #endif
  1060. { "IsBattleground", &LuaMap::IsBattleground }, // :IsBattleground() - Returns the true if the map is a battleground, else false UNDOCUMENTED
  1061. { "IsDungeon", &LuaMap::IsDungeon }, // :IsDungeon() - Returns the true if the map is a dungeon , else false UNDOCUMENTED
  1062. { "IsEmpty", &LuaMap::IsEmpty }, // :IsEmpty() - Returns the true if the map is empty, else false UNDOCUMENTED
  1063. #ifndef CLASSIC
  1064. { "IsHeroic", &LuaMap::IsHeroic }, // :IsHeroic() - Returns the true if the map is a heroic dungeon, else false UNDOCUMENTED
  1065. #endif
  1066. { "IsRaid", &LuaMap::IsRaid }, // :IsRaid() - Returns the true if the map is a raid map, else false UNDOCUMENTED
  1067. { NULL, NULL },
  1068. };
  1069. ElunaRegister<Corpse> CorpseMethods[] =
  1070. {
  1071. { "GetOwnerGUID", &LuaCorpse::GetOwnerGUID }, // :GetOwnerGUID() - Returns the corpse owner GUID
  1072. { "GetGhostTime", &LuaCorpse::GetGhostTime }, // :GetGhostTime() - Returns the ghost time of a corpse
  1073. { "GetType", &LuaCorpse::GetType }, // :GetType() - Returns the (CorpseType) of a corpse
  1074. { "ResetGhostTime", &LuaCorpse::ResetGhostTime }, // :ResetGhostTime() - Resets the corpse's ghost time
  1075. { "SaveToDB", &LuaCorpse::SaveToDB }, // :SaveToDB() - Saves to database
  1076. { "DeleteBonesFromWorld", &LuaCorpse::DeleteBonesFromWorld }, // :DeleteBonesFromWorld() - Deletes all bones from the world
  1077. { NULL, NULL }
  1078. };
  1079. ElunaRegister<Weather> WeatherMethods[] =
  1080. {
  1081. // Getters
  1082. { "GetZoneId", &LuaWeather::GetZoneId }, // :GetZoneId() - Returns the weather's zoneId
  1083. // Setters
  1084. { "SetWeather", &LuaWeather::SetWeather }, // :SetWeather(weatherType, grade) - Sets the weather by weather type and grade
  1085. // Boolean
  1086. { "Regenerate", &LuaWeather::Regenerate }, // :Regenerate() - Calculates weather, returns true if the weather changed
  1087. { "UpdateWeather", &LuaWeather::UpdateWeather }, // :UpdateWeather() - Updates the weather in a zone that has players in it, returns false if players aren't found
  1088. // Other
  1089. { "SendWeatherUpdateToPlayer", &LuaWeather::SendWeatherUpdateToPlayer }, // :SendWeatherUpdateToPlayer(player) - Sends weather update to the player
  1090. { NULL, NULL }
  1091. };
  1092. ElunaRegister<AuctionHouseObject> AuctionMethods[] =
  1093. {
  1094. { NULL, NULL }
  1095. };
  1096. template<typename T> const char* ElunaTemplate<T>::tname = NULL;
  1097. template<typename T> bool ElunaTemplate<T>::manageMemory = false;
  1098. #if (!defined(TBC) && !defined(CLASSIC))
  1099. // fix compile error about accessing vehicle destructor
  1100. template<> int ElunaTemplate<Vehicle>::gcT(lua_State* L) { return 0; }
  1101. #endif
  1102. void RegisterFunctions(lua_State* L)
  1103. {
  1104. RegisterGlobals(L);
  1105. lua_settop(L, 0); // clean stack
  1106. ElunaTemplate<Object>::Register(L, "Object");
  1107. ElunaTemplate<Object>::SetMethods(L, ObjectMethods);
  1108. ElunaTemplate<WorldObject>::Register(L, "WorldObject");
  1109. ElunaTemplate<WorldObject>::SetMethods(L, ObjectMethods);
  1110. ElunaTemplate<WorldObject>::SetMethods(L, WorldObjectMethods);
  1111. ElunaTemplate<Unit>::Register(L, "Unit");
  1112. ElunaTemplate<Unit>::SetMethods(L, ObjectMethods);
  1113. ElunaTemplate<Unit>::SetMethods(L, WorldObjectMethods);
  1114. ElunaTemplate<Unit>::SetMethods(L, UnitMethods);
  1115. ElunaTemplate<Player>::Register(L, "Player");
  1116. ElunaTemplate<Player>::SetMethods(L, ObjectMethods);
  1117. ElunaTemplate<Player>::SetMethods(L, WorldObjectMethods);
  1118. ElunaTemplate<Player>::SetMethods(L, UnitMethods);
  1119. ElunaTemplate<Player>::SetMethods(L, PlayerMethods);
  1120. ElunaTemplate<Creature>::Register(L, "Creature");
  1121. ElunaTemplate<Creature>::SetMethods(L, ObjectMethods);
  1122. ElunaTemplate<Creature>::SetMethods(L, WorldObjectMethods);
  1123. ElunaTemplate<Creature>::SetMethods(L, UnitMethods);
  1124. ElunaTemplate<Creature>::SetMethods(L, CreatureMethods);
  1125. ElunaTemplate<GameObject>::Register(L, "GameObject");
  1126. ElunaTemplate<GameObject>::SetMethods(L, ObjectMethods);
  1127. ElunaTemplate<GameObject>::SetMethods(L, WorldObjectMethods);
  1128. ElunaTemplate<GameObject>::SetMethods(L, GameObjectMethods);
  1129. ElunaTemplate<Corpse>::Register(L, "Corpse");
  1130. ElunaTemplate<Corpse>::SetMethods(L, ObjectMethods);
  1131. ElunaTemplate<Corpse>::SetMethods(L, WorldObjectMethods);
  1132. ElunaTemplate<Corpse>::SetMethods(L, CorpseMethods);
  1133. ElunaTemplate<Item>::Register(L, "Item");
  1134. ElunaTemplate<Item>::SetMethods(L, ObjectMethods);
  1135. ElunaTemplate<Item>::SetMethods(L, ItemMethods);
  1136. #if (!defined(TBC) && !defined(CLASSIC))
  1137. ElunaTemplate<Vehicle>::Register(L, "Vehicle");
  1138. ElunaTemplate<Vehicle>::SetMethods(L, VehicleMethods);
  1139. #endif
  1140. ElunaTemplate<Group>::Register(L, "Group");
  1141. ElunaTemplate<Group>::SetMethods(L, GroupMethods);
  1142. ElunaTemplate<Guild>::Register(L, "Guild");
  1143. ElunaTemplate<Guild>::SetMethods(L, GuildMethods);
  1144. ElunaTemplate<Aura>::Register(L, "Aura");
  1145. ElunaTemplate<Aura>::SetMethods(L, AuraMethods);
  1146. ElunaTemplate<Spell>::Register(L, "Spell");
  1147. ElunaTemplate<Spell>::SetMethods(L, SpellMethods);
  1148. ElunaTemplate<Quest>::Register(L, "Quest");
  1149. ElunaTemplate<Quest>::SetMethods(L, QuestMethods);
  1150. ElunaTemplate<Map>::Register(L, "Map");
  1151. ElunaTemplate<Map>::SetMethods(L, MapMethods);
  1152. ElunaTemplate<Weather>::Register(L, "Weather");
  1153. ElunaTemplate<Weather>::SetMethods(L, WeatherMethods);
  1154. ElunaTemplate<AuctionHouseObject>::Register(L, "AuctionHouseObject");
  1155. ElunaTemplate<AuctionHouseObject>::SetMethods(L, AuctionMethods);
  1156. ElunaTemplate<WorldPacket>::Register(L, "WorldPacket", true);
  1157. ElunaTemplate<WorldPacket>::SetMethods(L, PacketMethods);
  1158. ElunaTemplate<QueryResult>::Register(L, "QueryResult", true);
  1159. ElunaTemplate<QueryResult>::SetMethods(L, QueryMethods);
  1160. lua_settop(L, 0); // clean stack
  1161. }