diff --git a/BindingMap.h b/BindingMap.h index a3b5331..313d489 100644 --- a/BindingMap.h +++ b/BindingMap.h @@ -67,8 +67,7 @@ public: BindingMap(lua_State* L) : L(L), maxBindingID(0) - { - } + { } /* * Insert a new binding from `key` to `ref`, which lasts for `shots`-many pushes. @@ -224,7 +223,7 @@ struct EventKey EventKey(T event_id) : event_id(event_id) - {} + { } }; /* @@ -240,7 +239,7 @@ struct EntryKey EntryKey(T event_id, uint32 entry) : event_id(event_id), entry(entry) - {} + { } }; /* @@ -258,7 +257,7 @@ struct UniqueObjectKey event_id(event_id), guid(guid), instance_id(instance_id) - {} + { } }; diff --git a/CreatureMethods.h b/CreatureMethods.h index 6099021..9ab2c23 100644 --- a/CreatureMethods.h +++ b/CreatureMethods.h @@ -14,8 +14,6 @@ */ namespace LuaCreature { - /* BOOLEAN */ - /** * Returns `true` if the [Creature] is set to not give reputation when killed, * and returns `false` otherwise. @@ -368,12 +366,25 @@ namespace LuaCreature return 1; } + /** + * Returns true if the [Creature] is damaged enough for looting + * + * @return bool isDamagedEnough + */ int IsDamageEnoughForLootingAndReward(Eluna* /*E*/, lua_State* L, Creature* creature) { Eluna::Push(L, creature->IsDamageEnoughForLootingAndReward()); return 1; } + /** + * Returns true if the [Creature] can start attacking specified target + * + * Does not work on most targets + * + * @param [Unit] target + * @param bool force = true : force [Creature] to attack + */ int CanStartAttack(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement core side { Unit* target = Eluna::CHECKOBJ(L, 2); @@ -383,6 +394,12 @@ namespace LuaCreature return 1; } + /** + * Returns true if [Creature] has the specified loot mode + * + * @param uint16 lootMode + * @return bool hasLootMode + */ int HasLootMode(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement LootMode features { uint16 lootMode = Eluna::CHECKVAL(L, 2); @@ -392,8 +409,6 @@ namespace LuaCreature } #endif - /* GETTERS */ - /** * Returns the time it takes for this [Creature] to respawn once killed. * @@ -853,8 +868,6 @@ namespace LuaCreature return 1; } - /* SETTERS */ - /** * Sets the [Creature]'s NPC flags to `flags`. * @@ -1091,8 +1104,6 @@ namespace LuaCreature return 0; } - /* OTHER */ - /** * Despawn this [Creature]. * @@ -1129,7 +1140,7 @@ namespace LuaCreature } /** - * Make the [Creature] start following it's waypoint path. + * Make the [Creature] start following its waypoint path. */ int MoveWaypoint(Eluna* /*E*/, lua_State* /*L*/, Creature* creature) { @@ -1229,12 +1240,20 @@ namespace LuaCreature } #ifdef TRINITY + /** + * Resets [Creature]'s loot mode to default + */ int ResetLootMode(Eluna* /*E*/, lua_State* /*L*/, Creature* creature) // TODO: Implement LootMode features { creature->ResetLootMode(); return 0; } + /** + * Removes specified loot mode from [Creature] + * + * @param uint16 lootMode + */ int RemoveLootMode(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement LootMode features { uint16 lootMode = Eluna::CHECKVAL(L, 2); @@ -1243,6 +1262,11 @@ namespace LuaCreature return 0; } + /** + * Adds a loot mode to the [Creature] + * + * @param uint16 lootMode + */ int AddLootMode(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement LootMode features { uint16 lootMode = Eluna::CHECKVAL(L, 2); diff --git a/ElunaQueryMethods.h b/ElunaQueryMethods.h index a8aec95..f8cfea7 100644 --- a/ElunaQueryMethods.h +++ b/ElunaQueryMethods.h @@ -28,7 +28,6 @@ namespace LuaQuery luaL_argerror(L, 2, "invalid field index"); } - /* BOOLEAN */ /** * Returns `true` if the specified column of the current row is `NULL`, otherwise `false`. * @@ -48,7 +47,6 @@ namespace LuaQuery return 1; } - /* GETTERS */ /** * Returns the number of columns in the result set. * @@ -247,8 +245,6 @@ namespace LuaQuery return 1; } - /* OTHER */ - /** * Advances the [ElunaQuery] to the next row in the result set. * diff --git a/GameObjectMethods.h b/GameObjectMethods.h index d9d8493..e7436e2 100644 --- a/GameObjectMethods.h +++ b/GameObjectMethods.h @@ -65,8 +65,8 @@ namespace LuaGameObject /*int IsDestructible(Eluna* E, lua_State* L, GameObject* go) // TODO: Implementation core side { - Eluna::Push(L, go->IsDestructibleBuilding()); - return 1; + Eluna::Push(L, go->IsDestructibleBuilding()); + return 1; }*/ /** diff --git a/GroupMethods.h b/GroupMethods.h index 8d5dfd8..a6213ea 100644 --- a/GroupMethods.h +++ b/GroupMethods.h @@ -152,14 +152,14 @@ namespace LuaGroup /*int IsLFGGroup(Eluna* E, lua_State* L, Group* group) // TODO: Implementation { - Eluna::Push(L, group->isLFGGroup()); - return 1; + Eluna::Push(L, group->isLFGGroup()); + return 1; }*/ /*int IsBFGroup(Eluna* E, lua_State* L, Group* group) // TODO: Implementation { - Eluna::Push(L, group->isBFGroup()); - return 1; + Eluna::Push(L, group->isBFGroup()); + return 1; }*/ /** @@ -395,8 +395,8 @@ namespace LuaGroup /*int ConvertToLFG(Eluna* E, lua_State* L, Group* group) // TODO: Implementation { - group->ConvertToLFG(); - return 0; + group->ConvertToLFG(); + return 0; }*/ }; #endif diff --git a/GuildHooks.cpp b/GuildHooks.cpp index 5d1079a..1d52019 100644 --- a/GuildHooks.cpp +++ b/GuildHooks.cpp @@ -70,7 +70,7 @@ void Eluna::OnDisband(Guild* guild) CallAllFunctions(GuildEventBindings, key); } -void Eluna::OnMemberWitdrawMoney(Guild* guild, Player* player, uint32& amount, bool isRepair) // isRepair not a part of Mangos, implement? +void Eluna::OnMemberWitdrawMoney(Guild* guild, Player* player, uint32& amount, bool isRepair) { START_HOOK(GUILD_EVENT_ON_MONEY_WITHDRAW); Push(guild); diff --git a/GuildMethods.h b/GuildMethods.h index 2ce5edb..b4d5079 100644 --- a/GuildMethods.h +++ b/GuildMethods.h @@ -12,7 +12,6 @@ */ namespace LuaGuild { - /* GETTERS */ /** * Returns a table with the [Player]s in this [Guild] * @@ -139,7 +138,6 @@ namespace LuaGuild return 1; } - /* SETTERS */ #ifndef CATA /** * Sets the leader of this [Guild] @@ -179,7 +177,6 @@ namespace LuaGuild } #endif - /* OTHER */ // SendPacketToGuild(packet) /** * Sends a [WorldPacket] to all the [Player]s in the [Guild] @@ -272,6 +269,12 @@ namespace LuaGuild #ifndef CLASSIC // Move to Player methods + /** + * Windraws money from the [Guild] bank + * + * @param [Player] player + * @param uint32 money + */ int WithdrawBankMoney(Eluna* /*E*/, lua_State* L, Guild* guild) { Player* player = Eluna::CHECKOBJ(L, 2); @@ -287,6 +290,12 @@ namespace LuaGuild } // Move to Player methods + /** + * Deposits money to the [Guild] bank + * + * @param [Player] player + * @param uint32 money + */ int DepositBankMoney(Eluna* /*E*/, lua_State* L, Guild* guild) { Player* player = Eluna::CHECKOBJ(L, 2); diff --git a/Hooks.h b/Hooks.h index 2d28351..539d3d9 100644 --- a/Hooks.h +++ b/Hooks.h @@ -143,7 +143,7 @@ namespace Hooks AUCTION_EVENT_ON_SUCCESSFUL = 28, // (event, auctionId, owner, item, expireTime, buyout, startBid, currentBid, bidderGUIDLow) AUCTION_EVENT_ON_EXPIRE = 29, // (event, auctionId, owner, item, expireTime, buyout, startBid, currentBid, bidderGUIDLow) - // AddOns + // AddOns ADDON_EVENT_ON_MESSAGE = 30, // (event, sender, type, prefix, msg, target) - target can be nil/whisper_target/guild/group/channel. Can return false WORLD_EVENT_ON_DELETE_CREATURE = 31, // (event, creature) diff --git a/ItemMethods.h b/ItemMethods.h index 76ff215..763ff4e 100644 --- a/ItemMethods.h +++ b/ItemMethods.h @@ -12,7 +12,6 @@ */ namespace LuaItem { - /* BOOLEAN */ /** * Returns 'true' if the [Item] is soulbound, 'false' otherwise * @@ -231,15 +230,11 @@ namespace LuaItem return 1; } - /* - * int IsRefundExpired(Eluna* E, lua_State* L, Item* item)// TODO: Implement core support - * { - * Eluna::Push(L, item->IsRefundExpired()); - * return 1; - * } - */ - - /* GETTERS */ + /*int IsRefundExpired(Eluna* E, lua_State* L, Item* item)// TODO: Implement core support + { + Eluna::Push(L, item->IsRefundExpired()); + return 1; + }*/ /** * Returns the chat link of the [Item] @@ -295,12 +290,8 @@ namespace LuaItem } if (suffix) { - //std::string test(suffix[(name != temp->Name1) ? loc_idx : DEFAULT_LOCALE]); - //if (!test.empty()) - //{ name += ' '; name += suffix[(name != temp->Name1) ? locale : uint8(DEFAULT_LOCALE)]; - /*}*/ } } #endif @@ -631,7 +622,6 @@ namespace LuaItem return 1; } - /* SETTERS */ /** * Sets the [Player] specified as the owner of the [Item] * diff --git a/LuaEngine.cpp b/LuaEngine.cpp index ccd99aa..8bae655 100644 --- a/LuaEngine.cpp +++ b/LuaEngine.cpp @@ -169,7 +169,6 @@ CreatureUniqueBindings(NULL) OpenLua(); // Replace this with map insert if making multithread version - // // Set event manager. Must be after setting sEluna // on multithread have a map of state pointers and here insert this pointer to the map and then save a pointer of that pointer to the EventMgr diff --git a/LuaEngine.h b/LuaEngine.h index cd77e47..7d6cc0f 100644 --- a/LuaEngine.h +++ b/LuaEngine.h @@ -139,8 +139,8 @@ private: static std::string lua_requirepath; uint32 event_level; - // When a hook pushes arguments to be passed to event handlers - // this is used to keep track of how many arguments were pushed. + // When a hook pushes arguments to be passed to event handlers, + // this is used to keep track of how many arguments were pushed. uint8 push_counter; bool enabled; @@ -160,8 +160,8 @@ private: void CloseLua(); void DestroyBindStores(); void CreateBindStores(); - bool ExecuteCall(int params, int res); void InvalidateObjects(); + bool ExecuteCall(int params, int res); // Use ReloadEluna() to make eluna reload // This is called on world update to reload eluna diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index 9bb063b..e6e2548 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -40,20 +40,20 @@ extern "C" ElunaGlobal::ElunaRegister GlobalMethods[] = { // Hooks - { "RegisterPacketEvent", &LuaGlobalFunctions::RegisterPacketEvent }, // RegisterPacketEvent(opcodeID, event, function) - { "RegisterServerEvent", &LuaGlobalFunctions::RegisterServerEvent }, // RegisterServerEvent(event, function) - { "RegisterPlayerEvent", &LuaGlobalFunctions::RegisterPlayerEvent }, // RegisterPlayerEvent(event, function) - { "RegisterGuildEvent", &LuaGlobalFunctions::RegisterGuildEvent }, // RegisterGuildEvent(event, function) - { "RegisterGroupEvent", &LuaGlobalFunctions::RegisterGroupEvent }, // RegisterGroupEvent(event, function) - { "RegisterCreatureEvent", &LuaGlobalFunctions::RegisterCreatureEvent }, // RegisterCreatureEvent(entry, event, function) - { "RegisterUniqueCreatureEvent", &LuaGlobalFunctions::RegisterUniqueCreatureEvent }, // RegisterUniqueCreatureEvent(guid, instance, event, function) - { "RegisterCreatureGossipEvent", &LuaGlobalFunctions::RegisterCreatureGossipEvent }, // RegisterCreatureGossipEvent(entry, event, function) - { "RegisterGameObjectEvent", &LuaGlobalFunctions::RegisterGameObjectEvent }, // RegisterGameObjectEvent(entry, event, function) - { "RegisterGameObjectGossipEvent", &LuaGlobalFunctions::RegisterGameObjectGossipEvent }, // RegisterGameObjectGossipEvent(entry, event, function) - { "RegisterItemEvent", &LuaGlobalFunctions::RegisterItemEvent }, // RegisterItemEvent(entry, event, function) - { "RegisterItemGossipEvent", &LuaGlobalFunctions::RegisterItemGossipEvent }, // RegisterItemGossipEvent(entry, event, function) - { "RegisterPlayerGossipEvent", &LuaGlobalFunctions::RegisterPlayerGossipEvent }, // RegisterPlayerGossipEvent(menu_id, event, function) - { "RegisterBGEvent", &LuaGlobalFunctions::RegisterBGEvent }, // RegisterBGEvent(event, function) + { "RegisterPacketEvent", &LuaGlobalFunctions::RegisterPacketEvent }, + { "RegisterServerEvent", &LuaGlobalFunctions::RegisterServerEvent }, + { "RegisterPlayerEvent", &LuaGlobalFunctions::RegisterPlayerEvent }, + { "RegisterGuildEvent", &LuaGlobalFunctions::RegisterGuildEvent }, + { "RegisterGroupEvent", &LuaGlobalFunctions::RegisterGroupEvent }, + { "RegisterCreatureEvent", &LuaGlobalFunctions::RegisterCreatureEvent }, + { "RegisterUniqueCreatureEvent", &LuaGlobalFunctions::RegisterUniqueCreatureEvent }, + { "RegisterCreatureGossipEvent", &LuaGlobalFunctions::RegisterCreatureGossipEvent }, + { "RegisterGameObjectEvent", &LuaGlobalFunctions::RegisterGameObjectEvent }, + { "RegisterGameObjectGossipEvent", &LuaGlobalFunctions::RegisterGameObjectGossipEvent }, + { "RegisterItemEvent", &LuaGlobalFunctions::RegisterItemEvent }, + { "RegisterItemGossipEvent", &LuaGlobalFunctions::RegisterItemGossipEvent }, + { "RegisterPlayerGossipEvent", &LuaGlobalFunctions::RegisterPlayerGossipEvent }, + { "RegisterBGEvent", &LuaGlobalFunctions::RegisterBGEvent }, { "RegisterMapEvent", &LuaGlobalFunctions::RegisterMapEvent }, { "RegisterInstanceEvent", &LuaGlobalFunctions::RegisterInstanceEvent }, @@ -145,605 +145,605 @@ ElunaGlobal::ElunaRegister GlobalMethods[] = { "CreateInt64", &LuaGlobalFunctions::CreateLongLong }, { "CreateUint64", &LuaGlobalFunctions::CreateULongLong }, - { NULL, NULL }, + { NULL, NULL } }; ElunaRegister ObjectMethods[] = { // Getters - { "GetEntry", &LuaObject::GetEntry }, // :GetEntry() - Returns the object's entryId - { "GetGUID", &LuaObject::GetGUID }, // :GetGUID() - Returns uint64 guid as hex string - { "GetGUIDLow", &LuaObject::GetGUIDLow }, // :GetGUIDLow() - Returns uint32 guid (low guid) that is used to differentiate objects of same type. - { "GetInt32Value", &LuaObject::GetInt32Value }, // :GetInt32Value(index) - returns an int value from object fields - { "GetUInt32Value", &LuaObject::GetUInt32Value }, // :GetUInt32Value(index) - returns an uint value from object fields - { "GetFloatValue", &LuaObject::GetFloatValue }, // :GetFloatValue(index) - returns a float value from object fields - { "GetByteValue", &LuaObject::GetByteValue }, // :GetByteValue(index, offset) - returns a byte value from object fields - { "GetUInt16Value", &LuaObject::GetUInt16Value }, // :GetUInt16Value(index, offset) - returns a uint16 value from object fields - { "GetUInt64Value", &LuaObject::GetUInt64Value }, // :GetUInt64Value(index) - returns a uint64 value from object fields - { "GetScale", &LuaObject::GetScale }, // :GetScale() - { "GetTypeId", &LuaObject::GetTypeId }, // :GetTypeId() - Returns the object's typeId + { "GetEntry", &LuaObject::GetEntry }, + { "GetGUID", &LuaObject::GetGUID }, + { "GetGUIDLow", &LuaObject::GetGUIDLow }, + { "GetInt32Value", &LuaObject::GetInt32Value }, + { "GetUInt32Value", &LuaObject::GetUInt32Value }, + { "GetFloatValue", &LuaObject::GetFloatValue }, + { "GetByteValue", &LuaObject::GetByteValue }, + { "GetUInt16Value", &LuaObject::GetUInt16Value }, + { "GetUInt64Value", &LuaObject::GetUInt64Value }, + { "GetScale", &LuaObject::GetScale }, + { "GetTypeId", &LuaObject::GetTypeId }, // Setters - { "SetInt32Value", &LuaObject::SetInt32Value }, // :SetInt32Value(index, value) - Sets an int value for the object - { "SetUInt32Value", &LuaObject::SetUInt32Value }, // :SetUInt32Value(index, value) - Sets an uint value for the object - { "UpdateUInt32Value", &LuaObject::UpdateUInt32Value }, // :UpdateUInt32Value(index, value) - Sets an uint value for the object - { "SetFloatValue", &LuaObject::SetFloatValue }, // :SetFloatValue(index, value) - Sets a float value for the object - { "SetByteValue", &LuaObject::SetByteValue }, // :SetByteValue(index, offset, value) - Sets a byte value for the object - { "SetUInt16Value", &LuaObject::SetUInt16Value }, // :SetUInt16Value(index, offset, value) - Sets an uint16 value for the object - { "SetInt16Value", &LuaObject::SetInt16Value }, // :SetInt16Value(index, offset, value) - Sets an int16 value for the object - { "SetUInt64Value", &LuaObject::SetUInt64Value }, // :SetUInt64Value(index, value) - Sets an uint64 value for the object - { "SetScale", &LuaObject::SetScale }, // :SetScale(scale) - { "SetFlag", &LuaObject::SetFlag }, // :SetFlag(index, flag) + { "SetInt32Value", &LuaObject::SetInt32Value }, + { "SetUInt32Value", &LuaObject::SetUInt32Value }, + { "UpdateUInt32Value", &LuaObject::UpdateUInt32Value }, + { "SetFloatValue", &LuaObject::SetFloatValue }, + { "SetByteValue", &LuaObject::SetByteValue }, + { "SetUInt16Value", &LuaObject::SetUInt16Value }, + { "SetInt16Value", &LuaObject::SetInt16Value }, + { "SetUInt64Value", &LuaObject::SetUInt64Value }, + { "SetScale", &LuaObject::SetScale }, + { "SetFlag", &LuaObject::SetFlag }, // Boolean - { "IsInWorld", &LuaObject::IsInWorld }, // :IsInWorld() - Returns if the object is in world - { "HasFlag", &LuaObject::HasFlag }, // :HasFlag(index, flag) + { "IsInWorld", &LuaObject::IsInWorld }, + { "HasFlag", &LuaObject::HasFlag }, // Other - { "ToGameObject", &LuaObject::ToGameObject }, // :ToGameObject() - { "ToUnit", &LuaObject::ToUnit }, // :ToUnit() - { "ToCreature", &LuaObject::ToCreature }, // :ToCreature() - { "ToPlayer", &LuaObject::ToPlayer }, // :ToPlayer() - { "ToCorpse", &LuaObject::ToCorpse }, // :ToCorpse() - { "RemoveFlag", &LuaObject::RemoveFlag }, // :RemoveFlag(index, flag) + { "ToGameObject", &LuaObject::ToGameObject }, + { "ToUnit", &LuaObject::ToUnit }, + { "ToCreature", &LuaObject::ToCreature }, + { "ToPlayer", &LuaObject::ToPlayer }, + { "ToCorpse", &LuaObject::ToCorpse }, + { "RemoveFlag", &LuaObject::RemoveFlag }, - { NULL, NULL }, + { NULL, NULL } }; ElunaRegister WorldObjectMethods[] = { // Getters - { "GetName", &LuaWorldObject::GetName }, // :GetName() - { "GetMap", &LuaWorldObject::GetMap }, // :GetMap() - Returns the WorldObject's current map object + { "GetName", &LuaWorldObject::GetName }, + { "GetMap", &LuaWorldObject::GetMap }, #if (!defined(TBC) && !defined(CLASSIC)) - { "GetPhaseMask", &LuaWorldObject::GetPhaseMask }, // :GetPhaseMask() + { "GetPhaseMask", &LuaWorldObject::GetPhaseMask }, #endif - { "GetInstanceId", &LuaWorldObject::GetInstanceId }, // :GetInstanceId() - { "GetAreaId", &LuaWorldObject::GetAreaId }, // :GetAreaId() - { "GetZoneId", &LuaWorldObject::GetZoneId }, // :GetZoneId() - { "GetMapId", &LuaWorldObject::GetMapId }, // :GetMapId() - Returns the WorldObject's current map ID - { "GetX", &LuaWorldObject::GetX }, // :GetX() - { "GetY", &LuaWorldObject::GetY }, // :GetY() - { "GetZ", &LuaWorldObject::GetZ }, // :GetZ() - { "GetO", &LuaWorldObject::GetO }, // :GetO() - { "GetLocation", &LuaWorldObject::GetLocation }, // :GetLocation() - returns X, Y, Z and O co - ords (in that order) - { "GetPlayersInRange", &LuaWorldObject::GetPlayersInRange }, // :GetPlayersInRange([range]) - Returns a table with players in range of the WorldObject. - { "GetCreaturesInRange", &LuaWorldObject::GetCreaturesInRange }, // :GetCreaturesInRange([range, entry]) - Returns a table with creatures of given entry in range of the WorldObject. - { "GetGameObjectsInRange", &LuaWorldObject::GetGameObjectsInRange }, // :GetGameObjectsInRange([range, entry]) - Returns a table with gameobjects of given entry in range of the WorldObject. - { "GetNearestPlayer", &LuaWorldObject::GetNearestPlayer }, // :GetNearestPlayer([range]) - Returns nearest player in sight or given range. - { "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. - { "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. + { "GetInstanceId", &LuaWorldObject::GetInstanceId }, + { "GetAreaId", &LuaWorldObject::GetAreaId }, + { "GetZoneId", &LuaWorldObject::GetZoneId }, + { "GetMapId", &LuaWorldObject::GetMapId }, + { "GetX", &LuaWorldObject::GetX }, + { "GetY", &LuaWorldObject::GetY }, + { "GetZ", &LuaWorldObject::GetZ }, + { "GetO", &LuaWorldObject::GetO }, + { "GetLocation", &LuaWorldObject::GetLocation }, + { "GetPlayersInRange", &LuaWorldObject::GetPlayersInRange }, + { "GetCreaturesInRange", &LuaWorldObject::GetCreaturesInRange }, + { "GetGameObjectsInRange", &LuaWorldObject::GetGameObjectsInRange }, + { "GetNearestPlayer", &LuaWorldObject::GetNearestPlayer }, + { "GetNearestGameObject", &LuaWorldObject::GetNearestGameObject }, + { "GetNearestCreature", &LuaWorldObject::GetNearestCreature }, { "GetNearObject", &LuaWorldObject::GetNearObject }, { "GetNearObjects", &LuaWorldObject::GetNearObjects }, { "GetDistance", &LuaWorldObject::GetDistance }, { "GetExactDistance", &LuaWorldObject::GetExactDistance }, { "GetDistance2d", &LuaWorldObject::GetDistance2d }, { "GetExactDistance2d", &LuaWorldObject::GetExactDistance2d }, - { "GetRelativePoint", &LuaWorldObject::GetRelativePoint }, // :GetRelativePoint(dist, rad) - Returns the x, y and z of a point dist away from worldobject. - { "GetAngle", &LuaWorldObject::GetAngle }, // :GetAngle(WorldObject or x, y) - Returns angle between world object and target or x and y coords. + { "GetRelativePoint", &LuaWorldObject::GetRelativePoint }, + { "GetAngle", &LuaWorldObject::GetAngle }, // Boolean { "IsWithinLoS", &LuaWorldObject::IsWithinLoS }, // Other - { "SummonGameObject", &LuaWorldObject::SummonGameObject }, // :SummonGameObject(entry, x, y, z, o[, respawnDelay]) - Spawns an object to location. Returns the object or nil - { "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 - { "SendPacket", &LuaWorldObject::SendPacket }, // :SendPacket(packet) - Sends a specified packet to everyone around + { "SummonGameObject", &LuaWorldObject::SummonGameObject }, + { "SpawnCreature", &LuaWorldObject::SpawnCreature }, + { "SendPacket", &LuaWorldObject::SendPacket }, { "RegisterEvent", &LuaWorldObject::RegisterEvent }, { "RemoveEventById", &LuaWorldObject::RemoveEventById }, { "RemoveEvents", &LuaWorldObject::RemoveEvents }, - { NULL, NULL }, + { NULL, NULL } }; ElunaRegister UnitMethods[] = { // Getters - { "GetLevel", &LuaUnit::GetLevel }, // :GetLevel() - { "GetHealth", &LuaUnit::GetHealth }, // :GetHealth() - { "GetDisplayId", &LuaUnit::GetDisplayId }, // :GetDisplayId() - { "GetNativeDisplayId", &LuaUnit::GetNativeDisplayId }, // :GetNativeDisplayId() - { "GetPower", &LuaUnit::GetPower }, // :GetPower([type]) - returns power for power type. type can be omitted - { "GetMaxPower", &LuaUnit::GetMaxPower }, // :GetMaxPower([type]) - returns max power for power type. type can be omitted - { "GetPowerType", &LuaUnit::GetPowerType }, // :GetPowerType() - Returns the power type tye unit uses - { "GetMaxHealth", &LuaUnit::GetMaxHealth }, // :GetMaxHealth() - { "GetHealthPct", &LuaUnit::GetHealthPct }, // :GetHealthPct() - { "GetPowerPct", &LuaUnit::GetPowerPct }, // :GetPowerPct([type]) - returns power percent for power type. type can be omitted - { "GetGender", &LuaUnit::GetGender }, // :GetGender() - returns the gender where male = 0 female = 1 - { "GetRace", &LuaUnit::GetRace }, // :GetRace() - { "GetClass", &LuaUnit::GetClass }, // :GetClass() - { "GetRaceAsString", &LuaUnit::GetRaceAsString }, // :GetRaceAsString([locale]) - { "GetClassAsString", &LuaUnit::GetClassAsString }, // :GetClassAsString([locale]) - { "GetAura", &LuaUnit::GetAura }, // :GetAura(spellID) - returns aura object - { "GetCombatTime", &LuaUnit::GetCombatTime }, // :GetCombatTime() - Returns how long the unit has been in combat - { "GetFaction", &LuaUnit::GetFaction }, // :GetFaction() - Returns the unit's factionId - { "GetCurrentSpell", &LuaUnit::GetCurrentSpell }, // :GetCurrentSpell(type) - Returns the currently casted spell of given type if any - { "GetCreatureType", &LuaUnit::GetCreatureType }, // :GetCreatureType() - Returns the unit's type - { "GetMountId", &LuaUnit::GetMountId }, // :GetMountId() - { "GetOwner", &LuaUnit::GetOwner }, // :GetOwner() - Returns the owner - { "GetFriendlyUnitsInRange", &LuaUnit::GetFriendlyUnitsInRange }, // :GetFriendlyUnitsInRange([range]) - Returns a list of friendly units in range, can return nil - { "GetUnfriendlyUnitsInRange", &LuaUnit::GetUnfriendlyUnitsInRange }, // :GetUnfriendlyUnitsInRange([range]) - Returns a list of unfriendly units in range, can return nil - { "GetOwnerGUID", &LuaUnit::GetOwnerGUID }, // :GetOwnerGUID() - Returns the UNIT_FIELD_SUMMONEDBY owner - { "GetCreatorGUID", &LuaUnit::GetCreatorGUID }, // :GetCreatorGUID() - Returns the UNIT_FIELD_CREATEDBY creator - { "GetMinionGUID", &LuaUnit::GetPetGUID }, // :GetMinionGUID() - Decapreted. GetMinionGUID is same as GetPetGUID - { "GetCharmerGUID", &LuaUnit::GetCharmerGUID }, // :GetCharmerGUID() - Returns the UNIT_FIELD_CHARMEDBY charmer - { "GetCharmGUID", &LuaUnit::GetCharmGUID }, // :GetCharmGUID() - Returns the unit's UNIT_FIELD_CHARM guid - { "GetPetGUID", &LuaUnit::GetPetGUID }, // :GetPetGUID() - Returns the unit's pet GUID + { "GetLevel", &LuaUnit::GetLevel }, + { "GetHealth", &LuaUnit::GetHealth }, + { "GetDisplayId", &LuaUnit::GetDisplayId }, + { "GetNativeDisplayId", &LuaUnit::GetNativeDisplayId }, + { "GetPower", &LuaUnit::GetPower }, + { "GetMaxPower", &LuaUnit::GetMaxPower }, + { "GetPowerType", &LuaUnit::GetPowerType }, + { "GetMaxHealth", &LuaUnit::GetMaxHealth }, + { "GetHealthPct", &LuaUnit::GetHealthPct }, + { "GetPowerPct", &LuaUnit::GetPowerPct }, + { "GetGender", &LuaUnit::GetGender }, + { "GetRace", &LuaUnit::GetRace }, + { "GetClass", &LuaUnit::GetClass }, + { "GetRaceAsString", &LuaUnit::GetRaceAsString }, + { "GetClassAsString", &LuaUnit::GetClassAsString }, + { "GetAura", &LuaUnit::GetAura }, + { "GetCombatTime", &LuaUnit::GetCombatTime }, + { "GetFaction", &LuaUnit::GetFaction }, + { "GetCurrentSpell", &LuaUnit::GetCurrentSpell }, + { "GetCreatureType", &LuaUnit::GetCreatureType }, + { "GetMountId", &LuaUnit::GetMountId }, + { "GetOwner", &LuaUnit::GetOwner }, + { "GetFriendlyUnitsInRange", &LuaUnit::GetFriendlyUnitsInRange }, + { "GetUnfriendlyUnitsInRange", &LuaUnit::GetUnfriendlyUnitsInRange }, + { "GetOwnerGUID", &LuaUnit::GetOwnerGUID }, + { "GetCreatorGUID", &LuaUnit::GetCreatorGUID }, + { "GetMinionGUID", &LuaUnit::GetPetGUID }, + { "GetCharmerGUID", &LuaUnit::GetCharmerGUID }, + { "GetCharmGUID", &LuaUnit::GetCharmGUID }, + { "GetPetGUID", &LuaUnit::GetPetGUID }, #if (!defined(TBC) && !defined(CLASSIC)) - { "GetCritterGUID", &LuaUnit::GetCritterGUID }, // :GetCritterGUID() - Returns the critter's GUID + { "GetCritterGUID", &LuaUnit::GetCritterGUID }, #endif - { "GetControllerGUID", &LuaUnit::GetControllerGUID }, // :GetControllerGUID() - Returns the Charmer or Owner GUID - { "GetControllerGUIDS", &LuaUnit::GetControllerGUIDS }, // :GetControllerGUIDS() - Returns the charmer, owner or unit's own GUID - { "GetStandState", &LuaUnit::GetStandState }, // :GetStandState() - Returns the unit's stand state - { "GetVictim", &LuaUnit::GetVictim }, // :GetVictim() - Returns creature's current target - { "GetSpeed", &LuaUnit::GetSpeed }, // :GetSpeed(movementType) - Returns the unit's speed - { "GetStat", &LuaUnit::GetStat }, // :GetStat(stat) - { "GetBaseSpellPower", &LuaUnit::GetBaseSpellPower }, // :GetBaseSpellPower() + { "GetControllerGUID", &LuaUnit::GetControllerGUID }, + { "GetControllerGUIDS", &LuaUnit::GetControllerGUIDS }, + { "GetStandState", &LuaUnit::GetStandState }, + { "GetVictim", &LuaUnit::GetVictim }, + { "GetSpeed", &LuaUnit::GetSpeed }, + { "GetStat", &LuaUnit::GetStat }, + { "GetBaseSpellPower", &LuaUnit::GetBaseSpellPower }, #if (!defined(TBC) && !defined(CLASSIC)) - { "GetVehicleKit", &LuaUnit::GetVehicleKit }, // :GetVehicleKit() - Gets unit's Vehicle kit if the unit is a vehicle - // {"GetVehicle", &LuaUnit::GetVehicle}, // :GetVehicle() - Gets the Vehicle kit of the vehicle the unit is on + { "GetVehicleKit", &LuaUnit::GetVehicleKit }, + // {"GetVehicle", &LuaUnit::GetVehicle}, // :GetVehicle() - UNDOCUMENTED - Gets the Vehicle kit of the vehicle the unit is on #endif { "GetMovementType", &LuaUnit::GetMovementType }, // Setters - { "SetFaction", &LuaUnit::SetFaction }, // :SetFaction(factionId) - Sets the unit's faction - { "SetLevel", &LuaUnit::SetLevel }, // :SetLevel(amount) - { "SetHealth", &LuaUnit::SetHealth }, // :SetHealth(amount) - { "SetMaxHealth", &LuaUnit::SetMaxHealth }, // :SetMaxHealth(amount) - { "SetPower", &LuaUnit::SetPower }, // :SetPower([type,] amount) - { "SetMaxPower", &LuaUnit::SetMaxPower }, // :SetMaxPower([type,] amount) - { "SetPowerType", &LuaUnit::SetPowerType }, // :SetPowerType(type) - { "SetDisplayId", &LuaUnit::SetDisplayId }, // :SetDisplayId(id) - { "SetNativeDisplayId", &LuaUnit::SetNativeDisplayId }, // :SetNativeDisplayId(id) - { "SetFacing", &LuaUnit::SetFacing }, // :SetFacing(o) - Sets the Unit facing / orientation to arg - { "SetFacingToObject", &LuaUnit::SetFacingToObject }, // :SetFacingToObject(worldObject) - Sets the Unit facing / orientation towards the WorldObject + { "SetFaction", &LuaUnit::SetFaction }, + { "SetLevel", &LuaUnit::SetLevel }, + { "SetHealth", &LuaUnit::SetHealth }, + { "SetMaxHealth", &LuaUnit::SetMaxHealth }, + { "SetPower", &LuaUnit::SetPower }, + { "SetMaxPower", &LuaUnit::SetMaxPower }, + { "SetPowerType", &LuaUnit::SetPowerType }, + { "SetDisplayId", &LuaUnit::SetDisplayId }, + { "SetNativeDisplayId", &LuaUnit::SetNativeDisplayId }, + { "SetFacing", &LuaUnit::SetFacing }, + { "SetFacingToObject", &LuaUnit::SetFacingToObject }, #if (!defined(TBC) && !defined(CLASSIC)) - { "SetPhaseMask", &LuaUnit::SetPhaseMask }, // :SetPhaseMask(Phase[, update]) - Sets the phase of the unit + { "SetPhaseMask", &LuaUnit::SetPhaseMask }, #endif - { "SetSpeed", &LuaUnit::SetSpeed }, // :SetSpeed(type, speed[, forced]) - Sets speed for the movement type (0 = walk, 1 = run ..) - // {"SetStunned", &LuaUnit::SetStunned}, // :SetStunned([enable]) - Stuns or removes stun - {"SetRooted", &LuaUnit::SetRooted}, // :SetRooted([enable]) - Roots or removes root - {"SetConfused", &LuaUnit::SetConfused}, // :SetConfused([enable]) - Sets confused or removes confusion - {"SetFeared", &LuaUnit::SetFeared}, // :SetFeared([enable]) - Fears or removes fear - { "SetPvP", &LuaUnit::SetPvP }, // :SetPvP([apply]) - Sets the units PvP on or off + { "SetSpeed", &LuaUnit::SetSpeed }, + // {"SetStunned", &LuaUnit::SetStunned}, // :SetStunned([enable]) - UNDOCUMENTED - Stuns or removes stun + {"SetRooted", &LuaUnit::SetRooted}, + {"SetConfused", &LuaUnit::SetConfused}, + {"SetFeared", &LuaUnit::SetFeared}, + { "SetPvP", &LuaUnit::SetPvP }, #if (!defined(TBC) && !defined(CLASSIC)) - { "SetFFA", &LuaUnit::SetFFA }, // :SetFFA([apply]) - Sets the units FFA tag on or off - { "SetSanctuary", &LuaUnit::SetSanctuary }, // :SetSanctuary([apply]) - Enables or disables units sanctuary flag + { "SetFFA", &LuaUnit::SetFFA }, + { "SetSanctuary", &LuaUnit::SetSanctuary }, #endif - // {"SetCanFly", &LuaUnit::SetCanFly}, // :SetCanFly(apply) - // {"SetVisible", &LuaUnit::SetVisible}, // :SetVisible(x) - { "SetOwnerGUID", &LuaUnit::SetOwnerGUID }, // :SetOwnerGUID(guid) - Sets the guid of the owner - { "SetName", &LuaUnit::SetName }, // :SetName(name) - Sets the unit's name - { "SetSheath", &LuaUnit::SetSheath }, // :SetSheath(SheathState) - Sets unit's sheathstate - { "SetCreatorGUID", &LuaUnit::SetCreatorGUID }, // :SetOwnerGUID(uint64 ownerGUID) - Sets the owner's guid of a summoned creature, etc - { "SetMinionGUID", &LuaUnit::SetPetGUID }, // Decapreted. Same as SetPetGUID - { "SetCharmerGUID", &LuaUnit::SetCharmerGUID }, // :SetCharmerGUID(uint64 ownerGUID) - Sets the UNIT_FIELD_CHARMEDBY charmer GUID - { "SetPetGUID", &LuaUnit::SetPetGUID }, // :SetPetGUID(uint64 guid) - Sets the pet's guid + // {"SetCanFly", &LuaUnit::SetCanFly}, // :SetCanFly(apply) - UNDOCUMENTED + // {"SetVisible", &LuaUnit::SetVisible}, // :SetVisible(x) - UNDOCUMENTED + { "SetOwnerGUID", &LuaUnit::SetOwnerGUID }, + { "SetName", &LuaUnit::SetName }, + { "SetSheath", &LuaUnit::SetSheath }, + { "SetCreatorGUID", &LuaUnit::SetCreatorGUID }, + { "SetMinionGUID", &LuaUnit::SetPetGUID }, + { "SetCharmerGUID", &LuaUnit::SetCharmerGUID }, + { "SetPetGUID", &LuaUnit::SetPetGUID }, #if (!defined(TBC) && !defined(CLASSIC)) - { "SetCritterGUID", &LuaUnit::SetCritterGUID }, // :SetCritterGUID(uint64 guid) - Sets the critter's guid + { "SetCritterGUID", &LuaUnit::SetCritterGUID }, #endif - { "SetWaterWalk", &LuaUnit::SetWaterWalk }, // :SetWaterWalk([enable]) - Sets WaterWalk on or off - { "SetStandState", &LuaUnit::SetStandState }, // :SetStandState(state) - Sets the stand state (Stand, Kneel, sleep, etc) of the unit + { "SetWaterWalk", &LuaUnit::SetWaterWalk }, + { "SetStandState", &LuaUnit::SetStandState }, // Boolean - { "IsAlive", &LuaUnit::IsAlive }, // :IsAlive() - { "IsDead", &LuaUnit::IsDead }, // :IsDead() - Returns true if the unit is dead, false if they are alive - { "IsDying", &LuaUnit::IsDying }, // :IsDying() - Returns true if the unit death state is JUST_DIED. - { "IsPvPFlagged", &LuaUnit::IsPvPFlagged }, // :IsPvPFlagged() - { "IsInCombat", &LuaUnit::IsInCombat }, // :IsInCombat() - { "IsBanker", &LuaUnit::IsBanker }, // :IsBanker() - Returns true if the unit is a banker, false if not - { "IsBattleMaster", &LuaUnit::IsBattleMaster }, // :IsBattleMaster() - Returns true if the unit is a battle master, false if not - { "IsCharmed", &LuaUnit::IsCharmed }, // :IsCharmed() - Returns true if the unit is charmed, false if not - { "IsArmorer", &LuaUnit::IsArmorer }, // :IsArmorer() - Returns true if the unit is an Armorer, false if not - { "IsAttackingPlayer", &LuaUnit::IsAttackingPlayer }, // :IsAttackingPlayer() - Returns true if the unit is attacking a player, false if not - { "IsInWater", &LuaUnit::IsInWater }, // :IsInWater() - Returns true if the unit is in water - { "IsUnderWater", &LuaUnit::IsUnderWater }, // :IsUnderWater() - Returns true if the unit is under water - { "IsAuctioneer", &LuaUnit::IsAuctioneer }, // :IsAuctioneer() - { "IsGuildMaster", &LuaUnit::IsGuildMaster }, // :IsGuildMaster() - { "IsInnkeeper", &LuaUnit::IsInnkeeper }, // :IsInnkeeper() - { "IsTrainer", &LuaUnit::IsTrainer }, // :IsTrainer() - { "IsGossip", &LuaUnit::IsGossip }, // :IsGossip() - { "IsTaxi", &LuaUnit::IsTaxi }, // :IsTaxi() - { "IsSpiritHealer", &LuaUnit::IsSpiritHealer }, // :IsSpiritHealer() - { "IsSpiritGuide", &LuaUnit::IsSpiritGuide }, // :IsSpiritGuide() - { "IsTabardDesigner", &LuaUnit::IsTabardDesigner }, // :IsTabardDesigner() - { "IsServiceProvider", &LuaUnit::IsServiceProvider }, // :IsServiceProvider() - { "IsSpiritService", &LuaUnit::IsSpiritService }, // :IsSpiritService() - { "HealthBelowPct", &LuaUnit::HealthBelowPct }, // :HealthBelowPct(int32 pct) - { "HealthAbovePct", &LuaUnit::HealthAbovePct }, // :HealthAbovePct(int32 pct) - { "IsMounted", &LuaUnit::IsMounted }, // :IsMounted() - { "AttackStop", &LuaUnit::AttackStop }, // :AttackStop() - { "Attack", &LuaUnit::Attack }, // :Attack(who[, meleeAttack]) - // {"IsVisible", &LuaUnit::IsVisible}, // :IsVisible() - // {"IsMoving", &LuaUnit::IsMoving}, // :IsMoving() - // {"IsFlying", &LuaUnit::IsFlying}, // :IsFlying() - { "IsStopped", &LuaUnit::IsStopped }, // :IsStopped() - { "HasUnitState", &LuaUnit::HasUnitState }, // :HasUnitState(state) - state from UnitState enum - { "IsQuestGiver", &LuaUnit::IsQuestGiver }, // :IsQuestGiver() - Returns true if the unit is a quest giver, false if not - { "IsWithinDistInMap", &LuaUnit::IsWithinDistInMap }, // :IsWithinDistInMap(worldObject, radius) - Returns if the unit is within distance in map of the worldObject - { "IsInAccessiblePlaceFor", &LuaUnit::IsInAccessiblePlaceFor }, // :IsInAccessiblePlaceFor(creature) - Returns if the unit is in an accessible place for the specified creature - { "IsVendor", &LuaUnit::IsVendor }, // :IsVendor() - Returns if the unit is a vendor or not - { "IsRooted", &LuaUnit::IsRooted }, // :IsRooted() - { "IsFullHealth", &LuaUnit::IsFullHealth }, // :IsFullHealth() - Returns if the unit is full health - { "HasAura", &LuaUnit::HasAura }, // :HasAura(spellId) - Returns true if the unit has the aura from the spell + { "IsAlive", &LuaUnit::IsAlive }, + { "IsDead", &LuaUnit::IsDead }, + { "IsDying", &LuaUnit::IsDying }, + { "IsPvPFlagged", &LuaUnit::IsPvPFlagged }, + { "IsInCombat", &LuaUnit::IsInCombat }, + { "IsBanker", &LuaUnit::IsBanker }, + { "IsBattleMaster", &LuaUnit::IsBattleMaster }, + { "IsCharmed", &LuaUnit::IsCharmed }, + { "IsArmorer", &LuaUnit::IsArmorer }, + { "IsAttackingPlayer", &LuaUnit::IsAttackingPlayer }, + { "IsInWater", &LuaUnit::IsInWater }, + { "IsUnderWater", &LuaUnit::IsUnderWater }, + { "IsAuctioneer", &LuaUnit::IsAuctioneer }, + { "IsGuildMaster", &LuaUnit::IsGuildMaster }, + { "IsInnkeeper", &LuaUnit::IsInnkeeper }, + { "IsTrainer", &LuaUnit::IsTrainer }, + { "IsGossip", &LuaUnit::IsGossip }, + { "IsTaxi", &LuaUnit::IsTaxi }, + { "IsSpiritHealer", &LuaUnit::IsSpiritHealer }, + { "IsSpiritGuide", &LuaUnit::IsSpiritGuide }, + { "IsTabardDesigner", &LuaUnit::IsTabardDesigner }, + { "IsServiceProvider", &LuaUnit::IsServiceProvider }, + { "IsSpiritService", &LuaUnit::IsSpiritService }, + { "HealthBelowPct", &LuaUnit::HealthBelowPct }, + { "HealthAbovePct", &LuaUnit::HealthAbovePct }, + { "IsMounted", &LuaUnit::IsMounted }, + { "AttackStop", &LuaUnit::AttackStop }, + { "Attack", &LuaUnit::Attack }, + // {"IsVisible", &LuaUnit::IsVisible}, // :IsVisible() - UNDOCUMENTED + // {"IsMoving", &LuaUnit::IsMoving}, // :IsMoving() - UNDOCUMENTED + // {"IsFlying", &LuaUnit::IsFlying}, // :IsFlying() - UNDOCUMENTED + { "IsStopped", &LuaUnit::IsStopped }, + { "HasUnitState", &LuaUnit::HasUnitState }, + { "IsQuestGiver", &LuaUnit::IsQuestGiver }, + { "IsWithinDistInMap", &LuaUnit::IsWithinDistInMap }, + { "IsInAccessiblePlaceFor", &LuaUnit::IsInAccessiblePlaceFor }, + { "IsVendor", &LuaUnit::IsVendor }, + { "IsRooted", &LuaUnit::IsRooted }, + { "IsFullHealth", &LuaUnit::IsFullHealth }, + { "HasAura", &LuaUnit::HasAura }, { "IsCasting", &LuaUnit::IsCasting }, - { "IsStandState", &LuaUnit::IsStandState }, // :IsStandState() - Returns true if the unit is standing + { "IsStandState", &LuaUnit::IsStandState }, #ifndef CLASSIC - { "IsOnVehicle", &LuaUnit::IsOnVehicle }, // :IsOnVehicle() - Checks if the unit is on a vehicle + { "IsOnVehicle", &LuaUnit::IsOnVehicle }, #endif // Other - { "AddAura", &LuaUnit::AddAura }, // :AddAura(spellId, target) - Adds an aura to the specified target - { "RemoveAura", &LuaUnit::RemoveAura }, // :RemoveAura(spellId[, casterGUID]) - Removes an aura from the unit by the spellId, casterGUID(Original caster) is optional - { "RemoveAllAuras", &LuaUnit::RemoveAllAuras }, // :RemoveAllAuras() - Removes all the unit's auras - { "ClearInCombat", &LuaUnit::ClearInCombat }, // :ClearInCombat() - Clears the unit's combat list (unit will be out of combat), resets the timer to 0, etc - { "DeMorph", &LuaUnit::DeMorph }, // :DeMorph() - Sets display back to native - { "SendUnitWhisper", &LuaUnit::SendUnitWhisper }, // :SendUnitWhisper(msg, lang, receiver[, bossWhisper]) - Sends a whisper to the receiver - { "SendUnitEmote", &LuaUnit::SendUnitEmote }, // :SendUnitEmote(msg[, receiver, bossEmote]) - Sends a text emote - { "SendUnitSay", &LuaUnit::SendUnitSay }, // :SendUnitSay(msg, language) - Sends a "Say" message with the specified language (all languages: 0) - { "SendUnitYell", &LuaUnit::SendUnitYell }, // :SendUnitYell(msg, language) - Sends a "Yell" message with the specified language (all languages: 0) - { "CastSpell", &LuaUnit::CastSpell }, // :CastSpell(target, spellID[, triggered]) - Casts spell on target (player/npc/creature), if triggered is true then instant cast - { "CastCustomSpell", &LuaUnit::CastCustomSpell }, // :CastCustomSpell([Unit] target, uint32 spell, bool triggered = false, int32 bp0 = nil, int32 bp1 = nil, int32 bp2 = nil, [Item] castItem = nil, uint64 originalCaster = 0) - Casts spell on target (player/npc/creature), if triggered is true then instant cast. pb0, 1 and 2 are modifiers for the base points of the spell. - { "CastSpellAoF", &LuaUnit::CastSpellAoF }, // :CastSpellAoF(x, y, z, spellID[, triggered]) - Casts the spell on coordinates, if triggered is false has mana cost and cast time - { "PlayDirectSound", &LuaUnit::PlayDirectSound }, // :PlayDirectSound(soundId[, player]) - Unit plays soundID to player, or everyone around if no player - { "PlayDistanceSound", &LuaUnit::PlayDistanceSound }, // :PlayDistanceSound(soundId[, player]) - Unit plays soundID to player, or everyone around if no player. The sound fades the further you are - { "Kill", &LuaUnit::Kill }, // :Kill(target, durabilityLoss) - Unit kills the target. Durabilityloss is true by default - { "StopSpellCast", &LuaUnit::StopSpellCast }, // :StopSpellCast([spellId]) - Stops the unit from casting a spell. If a spellId is defined, it will stop that unit from casting that spell - { "InterruptSpell", &LuaUnit::InterruptSpell }, // :InterruptSpell(spellType[, delayed]) - Interrupts the unit's spell by the spellType. If delayed is true it will skip if the spell is delayed. - { "SendChatMessageToPlayer", &LuaUnit::SendChatMessageToPlayer }, // :SendChatMessageToPlayer(type, lang, msg, target) - Unit sends a chat message to the given target player - { "Emote", &LuaUnit::Emote }, // :Emote(emote) - { "CountPctFromCurHealth", &LuaUnit::CountPctFromCurHealth }, // :CountPctFromCurHealth(int32 pct) - { "CountPctFromMaxHealth", &LuaUnit::CountPctFromMaxHealth }, // :CountPctFromMaxHealth() - { "Dismount", &LuaUnit::Dismount }, // :Dismount() - Dismounts the unit. - { "Mount", &LuaUnit::Mount }, // :Mount(displayId) - Mounts the unit on the specified displayId. - // {"RestoreDisplayId", &LuaUnit::RestoreDisplayId}, // :RestoreDisplayId() - // {"RestoreFaction", &LuaUnit::RestoreFaction}, // :RestoreFaction() - // {"RemoveBindSightAuras", &LuaUnit::RemoveBindSightAuras}, // :RemoveBindSightAuras() - // {"RemoveCharmAuras", &LuaUnit::RemoveCharmAuras}, // :RemoveCharmAuras() - { "ClearThreatList", &LuaUnit::ClearThreatList }, // :ClearThreatList() - { "ClearUnitState", &LuaUnit::ClearUnitState }, // :ClearUnitState(state) - { "AddUnitState", &LuaUnit::AddUnitState }, // :AddUnitState(state) - // {"DisableMelee", &LuaUnit::DisableMelee}, // :DisableMelee([disable]) - if true, enables - // {"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. - { "NearTeleport", &LuaUnit::NearTeleport }, // :NearTeleport(x, y, z, o) - Teleports to give coordinates. Does not leave combat or unsummon pet. - { "MoveIdle", &LuaUnit::MoveIdle }, // :MoveIdle() - { "MoveRandom", &LuaUnit::MoveRandom }, // :MoveRandom(radius) - { "MoveHome", &LuaUnit::MoveHome }, // :MoveHome() - { "MoveFollow", &LuaUnit::MoveFollow }, // :MoveFollow(target[, dist, angle]) - { "MoveChase", &LuaUnit::MoveChase }, // :MoveChase(target[, dist, angle]) - { "MoveConfused", &LuaUnit::MoveConfused }, // :MoveConfused() - { "MoveFleeing", &LuaUnit::MoveFleeing }, // :MoveFleeing(enemy[, time]) - { "MoveTo", &LuaUnit::MoveTo }, // :MoveTo(id, x, y, z[, genPath]) - Moves to point. id is sent to WP reach hook. genPath defaults to true + { "AddAura", &LuaUnit::AddAura }, + { "RemoveAura", &LuaUnit::RemoveAura }, + { "RemoveAllAuras", &LuaUnit::RemoveAllAuras }, + { "ClearInCombat", &LuaUnit::ClearInCombat }, + { "DeMorph", &LuaUnit::DeMorph }, + { "SendUnitWhisper", &LuaUnit::SendUnitWhisper }, + { "SendUnitEmote", &LuaUnit::SendUnitEmote }, + { "SendUnitSay", &LuaUnit::SendUnitSay }, + { "SendUnitYell", &LuaUnit::SendUnitYell }, + { "CastSpell", &LuaUnit::CastSpell }, + { "CastCustomSpell", &LuaUnit::CastCustomSpell }, + { "CastSpellAoF", &LuaUnit::CastSpellAoF }, + { "PlayDirectSound", &LuaUnit::PlayDirectSound }, + { "PlayDistanceSound", &LuaUnit::PlayDistanceSound }, + { "Kill", &LuaUnit::Kill }, + { "StopSpellCast", &LuaUnit::StopSpellCast }, + { "InterruptSpell", &LuaUnit::InterruptSpell }, + { "SendChatMessageToPlayer", &LuaUnit::SendChatMessageToPlayer }, + { "Emote", &LuaUnit::Emote }, + { "CountPctFromCurHealth", &LuaUnit::CountPctFromCurHealth }, + { "CountPctFromMaxHealth", &LuaUnit::CountPctFromMaxHealth }, + { "Dismount", &LuaUnit::Dismount }, + { "Mount", &LuaUnit::Mount }, + // {"RestoreDisplayId", &LuaUnit::RestoreDisplayId}, // :RestoreDisplayId() - UNDOCUMENTED + // {"RestoreFaction", &LuaUnit::RestoreFaction}, // :RestoreFaction() - UNDOCUMENTED + // {"RemoveBindSightAuras", &LuaUnit::RemoveBindSightAuras}, // :RemoveBindSightAuras() - UNDOCUMENTED + // {"RemoveCharmAuras", &LuaUnit::RemoveCharmAuras}, // :RemoveCharmAuras() - UNDOCUMENTED + { "ClearThreatList", &LuaUnit::ClearThreatList }, + { "ClearUnitState", &LuaUnit::ClearUnitState }, + { "AddUnitState", &LuaUnit::AddUnitState }, + // {"DisableMelee", &LuaUnit::DisableMelee}, // :DisableMelee([disable]) - UNDOCUMENTED - if true, enables + // {"SummonGuardian", &LuaUnit::SummonGuardian}, // :SummonGuardian(entry, x, y, z, o[, duration]) - UNDOCUMENTED - summons a guardian to location. Scales with summoner, is friendly to him and guards him. + { "NearTeleport", &LuaUnit::NearTeleport }, + { "MoveIdle", &LuaUnit::MoveIdle }, + { "MoveRandom", &LuaUnit::MoveRandom }, + { "MoveHome", &LuaUnit::MoveHome }, + { "MoveFollow", &LuaUnit::MoveFollow }, + { "MoveChase", &LuaUnit::MoveChase }, + { "MoveConfused", &LuaUnit::MoveConfused }, + { "MoveFleeing", &LuaUnit::MoveFleeing }, + { "MoveTo", &LuaUnit::MoveTo }, #if (!defined(TBC) && !defined(CLASSIC)) - { "MoveJump", &LuaUnit::MoveJump }, // :MoveJump(x, y, z, zSpeed, maxHeight, id) + { "MoveJump", &LuaUnit::MoveJump }, #endif - { "MoveStop", &LuaUnit::MoveStop }, // :MoveStop() - { "MoveExpire", &LuaUnit::MoveExpire }, // :MoveExpire([reset]) - { "MoveClear", &LuaUnit::MoveClear }, // :MoveClear([reset]) - { "DealDamage", &LuaUnit::DealDamage }, // :DealDamage(target, amount[, durabilityloss]) - Deals damage to target, durabilityloss is true by default - { "DealHeal", &LuaUnit::DealHeal }, // :DealDamage(target, amount, spell[, critical]) - Heals target by given amount. This will be logged as being healed by spell as critical if true. + { "MoveStop", &LuaUnit::MoveStop }, + { "MoveExpire", &LuaUnit::MoveExpire }, + { "MoveClear", &LuaUnit::MoveClear }, + { "DealDamage", &LuaUnit::DealDamage }, + { "DealHeal", &LuaUnit::DealHeal }, { "AddThreat", &LuaUnit::AddThreat }, - { NULL, NULL }, + { NULL, NULL } }; ElunaRegister PlayerMethods[] = { // Getters - { "GetSelection", &LuaPlayer::GetSelection }, // :GetSelection() - { "GetGMRank", &LuaPlayer::GetGMRank }, // :GetSecurity() - { "GetGuildId", &LuaPlayer::GetGuildId }, // :GetGuildId() - nil on no guild - { "GetCoinage", &LuaPlayer::GetCoinage }, // :GetCoinage() - { "GetTeam", &LuaPlayer::GetTeam }, // :GetTeam() - returns the player's team. 0 for ally, 1 for horde - { "GetItemCount", &LuaPlayer::GetItemCount }, // :GetItemCount(item_id[, check_bank]) - { "GetGroup", &LuaPlayer::GetGroup }, // :GetGroup() - { "GetGuild", &LuaPlayer::GetGuild }, // :GetGuild() - { "GetAccountId", &LuaPlayer::GetAccountId }, // :GetAccountId() - { "GetAccountName", &LuaPlayer::GetAccountName }, // :GetAccountName() + { "GetSelection", &LuaPlayer::GetSelection }, + { "GetGMRank", &LuaPlayer::GetGMRank }, + { "GetGuildId", &LuaPlayer::GetGuildId }, + { "GetCoinage", &LuaPlayer::GetCoinage }, + { "GetTeam", &LuaPlayer::GetTeam }, + { "GetItemCount", &LuaPlayer::GetItemCount }, + { "GetGroup", &LuaPlayer::GetGroup }, + { "GetGuild", &LuaPlayer::GetGuild }, + { "GetAccountId", &LuaPlayer::GetAccountId }, + { "GetAccountName", &LuaPlayer::GetAccountName }, #ifndef CATA #ifndef CLASSIC - { "GetArenaPoints", &LuaPlayer::GetArenaPoints }, // :GetArenaPoints() - { "GetHonorPoints", &LuaPlayer::GetHonorPoints }, // :GetHonorPoints() + { "GetArenaPoints", &LuaPlayer::GetArenaPoints }, + { "GetHonorPoints", &LuaPlayer::GetHonorPoints }, #endif #endif - { "GetLifetimeKills", &LuaPlayer::GetLifetimeKills }, // :GetLifetimeKills() - Returns the player's lifetime (honorable) kills - { "GetPlayerIP", &LuaPlayer::GetPlayerIP }, // :GetPlayerIP() - Returns the player's IP Address - { "GetLevelPlayedTime", &LuaPlayer::GetLevelPlayedTime }, // :GetLevelPlayedTime() - Returns the player's played time at that level - { "GetTotalPlayedTime", &LuaPlayer::GetTotalPlayedTime }, // :GetTotalPlayedTime() - Returns the total played time of that player - { "GetItemByPos", &LuaPlayer::GetItemByPos }, // :GetItemByPos(bag, slot) - Returns item in given slot in a bag (bag: 19-22 slot: 0-35) or inventory (bag: 255 slot : 0-38) - { "GetItemByEntry", &LuaPlayer::GetItemByEntry }, // :GetItemByEntry(entry) - Gets an item if the player has it + { "GetLifetimeKills", &LuaPlayer::GetLifetimeKills }, + { "GetPlayerIP", &LuaPlayer::GetPlayerIP }, + { "GetLevelPlayedTime", &LuaPlayer::GetLevelPlayedTime }, + { "GetTotalPlayedTime", &LuaPlayer::GetTotalPlayedTime }, + { "GetItemByPos", &LuaPlayer::GetItemByPos }, + { "GetItemByEntry", &LuaPlayer::GetItemByEntry }, { "GetItemByGUID", &LuaPlayer::GetItemByGUID }, - { "GetReputation", &LuaPlayer::GetReputation }, // :GetReputation(faction) - Gets player's reputation with given faction - { "GetEquippedItemBySlot", &LuaPlayer::GetEquippedItemBySlot }, // :GetEquippedItemBySlot(slotId) - Returns equipped item by slot - { "GetQuestLevel", &LuaPlayer::GetQuestLevel }, // :GetQuestLevel(quest) - Returns quest's level - { "GetChatTag", &LuaPlayer::GetChatTag }, // :GetChatTag() - Returns player chat tag ID - { "GetRestBonus", &LuaPlayer::GetRestBonus }, // :GetRestBonus() - Gets player's rest bonus + { "GetReputation", &LuaPlayer::GetReputation }, + { "GetEquippedItemBySlot", &LuaPlayer::GetEquippedItemBySlot }, + { "GetQuestLevel", &LuaPlayer::GetQuestLevel }, + { "GetChatTag", &LuaPlayer::GetChatTag }, + { "GetRestBonus", &LuaPlayer::GetRestBonus }, #ifdef WOTLK - { "GetPhaseMaskForSpawn", &LuaPlayer::GetPhaseMaskForSpawn }, // :GetPhaseMaskForSpawn() - Gets the real phasemask for spawning things. Used if the player is in GM mode + { "GetPhaseMaskForSpawn", &LuaPlayer::GetPhaseMaskForSpawn }, #endif - { "GetReqKillOrCastCurrentCount", &LuaPlayer::GetReqKillOrCastCurrentCount }, // :GetReqKillOrCastCurrentCount(questId, entry) - Gets the objective (kill or cast) current count done - { "GetQuestStatus", &LuaPlayer::GetQuestStatus }, // :GetQuestStatus(entry) - Gets the quest's status - { "GetInGameTime", &LuaPlayer::GetInGameTime }, // :GetInGameTime() - Returns player's ingame time - { "GetComboPoints", &LuaPlayer::GetComboPoints }, // :GetComboPoints() - Returns player's combo points - { "GetComboTarget", &LuaPlayer::GetComboTarget }, // :GetComboTarget() - Returns the player's combo target - { "GetGuildName", &LuaPlayer::GetGuildName }, // :GetGuildName() - Returns player's guild's name or nil - { "GetFreeTalentPoints", &LuaPlayer::GetFreeTalentPoints }, // :GetFreeTalentPoints() - Returns the amount of unused talent points + { "GetReqKillOrCastCurrentCount", &LuaPlayer::GetReqKillOrCastCurrentCount }, + { "GetQuestStatus", &LuaPlayer::GetQuestStatus }, + { "GetInGameTime", &LuaPlayer::GetInGameTime }, + { "GetComboPoints", &LuaPlayer::GetComboPoints }, + { "GetComboTarget", &LuaPlayer::GetComboTarget }, + { "GetGuildName", &LuaPlayer::GetGuildName }, + { "GetFreeTalentPoints", &LuaPlayer::GetFreeTalentPoints }, #if (!defined(TBC) && !defined(CLASSIC)) - { "GetActiveSpec", &LuaPlayer::GetActiveSpec }, // :GetActiveSpec() - Returns the active specID - { "GetSpecsCount", &LuaPlayer::GetSpecsCount }, // :GetSpecsCount() - Returns the player's spec count + { "GetActiveSpec", &LuaPlayer::GetActiveSpec }, + { "GetSpecsCount", &LuaPlayer::GetSpecsCount }, #endif - { "GetSpellCooldownDelay", &LuaPlayer::GetSpellCooldownDelay }, // :GetSpellCooldownDelay(spellId) - Returns the spell's cooldown - { "GetGuildRank", &LuaPlayer::GetGuildRank }, // :GetGuildRank() - Gets the player's guild rank - { "GetDifficulty", &LuaPlayer::GetDifficulty }, // :GetDifficulty([isRaid]) - Returns the current difficulty - { "GetHealthBonusFromStamina", &LuaPlayer::GetHealthBonusFromStamina }, // :GetHealthBonusFromStamina() - Returns the HP bonus from stamina - { "GetManaBonusFromIntellect", &LuaPlayer::GetManaBonusFromIntellect }, // :GetManaBonusFromIntellect() - Returns the mana bonus from intellect - { "GetMaxSkillValue", &LuaPlayer::GetMaxSkillValue }, // :GetMaxSkillValue(skill) - Gets max skill value for the given skill - { "GetPureMaxSkillValue", &LuaPlayer::GetPureMaxSkillValue }, // :GetPureMaxSkillValue(skill) - Gets max base skill value - { "GetSkillValue", &LuaPlayer::GetSkillValue }, // :GetSkillValue(skill) - Gets current skill value - { "GetBaseSkillValue", &LuaPlayer::GetBaseSkillValue }, // :GetBaseSkillValue(skill) - Gets current base skill value (no temp bonus) - { "GetPureSkillValue", &LuaPlayer::GetPureSkillValue }, // :GetPureSkillValue(skill) - Gets current base skill value (no bonuses) - { "GetSkillPermBonusValue", &LuaPlayer::GetSkillPermBonusValue }, // :GetSkillPermBonusValue(skill) - Returns current permanent bonus - { "GetSkillTempBonusValue", &LuaPlayer::GetSkillTempBonusValue }, // :GetSkillTempBonusValue(skill) - Returns current temp bonus - { "GetReputationRank", &LuaPlayer::GetReputationRank }, // :GetReputationRank(faction) - Returns the reputation rank with given faction - { "GetDrunkValue", &LuaPlayer::GetDrunkValue }, // :GetDrunkValue() - Returns the current drunkness value - { "GetBattlegroundId", &LuaPlayer::GetBattlegroundId }, // :GetBattlegroundId() - Returns the player's current battleground ID - { "GetBattlegroundTypeId", &LuaPlayer::GetBattlegroundTypeId }, // :GetBattlegroundTypeId() - Returns the player's current battleground type ID - { "GetXPRestBonus", &LuaPlayer::GetXPRestBonus }, // :GetXPRestBonus(xp) - Returns the rested bonus XP from given XP - { "GetGroupInvite", &LuaPlayer::GetGroupInvite }, // :GetGroupInvite() - Returns the group invited to - { "GetSubGroup", &LuaPlayer::GetSubGroup }, // :GetSubGroup() - Gets the player's current subgroup ID - { "GetNextRandomRaidMember", &LuaPlayer::GetNextRandomRaidMember }, // :GetNextRandomRaidMember(radius) - Gets a random raid member in given radius - { "GetOriginalGroup", &LuaPlayer::GetOriginalGroup }, // :GetOriginalGroup() - Gets the original group object - { "GetOriginalSubGroup", &LuaPlayer::GetOriginalSubGroup }, // :GetOriginalSubGroup() - Returns the original subgroup ID + { "GetSpellCooldownDelay", &LuaPlayer::GetSpellCooldownDelay }, + { "GetGuildRank", &LuaPlayer::GetGuildRank }, + { "GetDifficulty", &LuaPlayer::GetDifficulty }, + { "GetHealthBonusFromStamina", &LuaPlayer::GetHealthBonusFromStamina }, + { "GetManaBonusFromIntellect", &LuaPlayer::GetManaBonusFromIntellect }, + { "GetMaxSkillValue", &LuaPlayer::GetMaxSkillValue }, + { "GetPureMaxSkillValue", &LuaPlayer::GetPureMaxSkillValue }, + { "GetSkillValue", &LuaPlayer::GetSkillValue }, + { "GetBaseSkillValue", &LuaPlayer::GetBaseSkillValue }, + { "GetPureSkillValue", &LuaPlayer::GetPureSkillValue }, + { "GetSkillPermBonusValue", &LuaPlayer::GetSkillPermBonusValue }, + { "GetSkillTempBonusValue", &LuaPlayer::GetSkillTempBonusValue }, + { "GetReputationRank", &LuaPlayer::GetReputationRank }, + { "GetDrunkValue", &LuaPlayer::GetDrunkValue }, + { "GetBattlegroundId", &LuaPlayer::GetBattlegroundId }, + { "GetBattlegroundTypeId", &LuaPlayer::GetBattlegroundTypeId }, + { "GetXPRestBonus", &LuaPlayer::GetXPRestBonus }, + { "GetGroupInvite", &LuaPlayer::GetGroupInvite }, + { "GetSubGroup", &LuaPlayer::GetSubGroup }, + { "GetNextRandomRaidMember", &LuaPlayer::GetNextRandomRaidMember }, + { "GetOriginalGroup", &LuaPlayer::GetOriginalGroup }, + { "GetOriginalSubGroup", &LuaPlayer::GetOriginalSubGroup }, #ifdef TRINITY - { "GetChampioningFaction", &LuaPlayer::GetChampioningFaction }, // :GetChampioningFaction() - Returns the player's championing faction + { "GetChampioningFaction", &LuaPlayer::GetChampioningFaction }, #endif - { "GetLatency", &LuaPlayer::GetLatency }, // :GetLatency() - Returns player's latency - // {"GetRecruiterId", &LuaPlayer::GetRecruiterId}, // :GetRecruiterId() - Returns player's recruiter's ID - { "GetDbLocaleIndex", &LuaPlayer::GetDbLocaleIndex }, // :GetDbLocaleIndex() - Returns locale index - { "GetDbcLocale", &LuaPlayer::GetDbcLocale }, // :GetDbcLocale() - Returns DBC locale - { "GetCorpse", &LuaPlayer::GetCorpse }, // :GetCorpse() - Returns the player's corpse - { "GetGossipTextId", &LuaPlayer::GetGossipTextId }, // :GetGossipTextId(worldObject) - Returns the WorldObject's gossip textId - { "GetQuestRewardStatus", &LuaPlayer::GetQuestRewardStatus }, // :GetQuestRewardStatus(questId) - Returns the true/false of the quest reward status + { "GetLatency", &LuaPlayer::GetLatency }, + // {"GetRecruiterId", &LuaPlayer::GetRecruiterId}, // :GetRecruiterId() - UNDOCUMENTED - Returns player's recruiter's ID + { "GetDbLocaleIndex", &LuaPlayer::GetDbLocaleIndex }, + { "GetDbcLocale", &LuaPlayer::GetDbcLocale }, + { "GetCorpse", &LuaPlayer::GetCorpse }, + { "GetGossipTextId", &LuaPlayer::GetGossipTextId }, + { "GetQuestRewardStatus", &LuaPlayer::GetQuestRewardStatus }, #ifndef CATA - { "GetShieldBlockValue", &LuaPlayer::GetShieldBlockValue }, // :GetShieldBlockValue() - Returns block value + { "GetShieldBlockValue", &LuaPlayer::GetShieldBlockValue }, #endif #ifdef CLASSIC - { "GetHonorStoredKills", &LuaPlayer::GetHonorStoredKills }, // :GetHonorStoredKills(on/off) - { "GetRankPoints", &LuaPlayer::GetRankPoints }, // :GetRankPoints() - { "GetHonorLastWeekStandingPos", &LuaPlayer::GetHonorLastWeekStandingPos }, // :GetHonorLastWeekStandingPos() + { "GetHonorStoredKills", &LuaPlayer::GetHonorStoredKills }, + { "GetRankPoints", &LuaPlayer::GetRankPoints }, + { "GetHonorLastWeekStandingPos", &LuaPlayer::GetHonorLastWeekStandingPos }, #endif // Setters - { "AdvanceSkillsToMax", &LuaPlayer::AdvanceSkillsToMax }, // :AdvanceSkillsToMax() - Advances all currently known skills to the currently known max level - { "AdvanceSkill", &LuaPlayer::AdvanceSkill }, // :AdvanceSkill(skill_id, step) - Advances skill by ID and the amount(step) - { "AdvanceAllSkills", &LuaPlayer::AdvanceAllSkills }, // :AdvanceAllSkills(value) - Advances all current skills to your input(value) - { "AddLifetimeKills", &LuaPlayer::AddLifetimeKills }, // :AddLifetimeKills(val) - Adds lifetime (honorable) kills to your current lifetime kills - { "SetCoinage", &LuaPlayer::SetCoinage }, // :SetCoinage(amount) - sets plr's coinage to this + { "AdvanceSkillsToMax", &LuaPlayer::AdvanceSkillsToMax }, + { "AdvanceSkill", &LuaPlayer::AdvanceSkill }, + { "AdvanceAllSkills", &LuaPlayer::AdvanceAllSkills }, + { "AddLifetimeKills", &LuaPlayer::AddLifetimeKills }, + { "SetCoinage", &LuaPlayer::SetCoinage }, #ifndef CLASSIC - { "SetKnownTitle", &LuaPlayer::SetKnownTitle }, // :SetKnownTitle(id) - { "UnsetKnownTitle", &LuaPlayer::UnsetKnownTitle }, // :UnsetKnownTitle(id) + { "SetKnownTitle", &LuaPlayer::SetKnownTitle }, + { "UnsetKnownTitle", &LuaPlayer::UnsetKnownTitle }, #endif - { "SetBindPoint", &LuaPlayer::SetBindPoint }, // :SetBindPoint(x, y, z, map, areaid) - sets home for hearthstone + { "SetBindPoint", &LuaPlayer::SetBindPoint }, #ifndef CATA #ifndef CLASSIC - { "SetArenaPoints", &LuaPlayer::SetArenaPoints }, // :SetArenaPoints(amount) - { "SetHonorPoints", &LuaPlayer::SetHonorPoints }, // :SetHonorPoints(amount) + { "SetArenaPoints", &LuaPlayer::SetArenaPoints }, + { "SetHonorPoints", &LuaPlayer::SetHonorPoints }, #endif #endif #ifdef CLASSIC - { "SetHonorStoredKills", &LuaPlayer::SetHonorStoredKills }, // :SetHonorStoredKills(kills, [on/off]) - { "SetRankPoints", &LuaPlayer::SetRankPoints }, // :SetRankPoints(rankPoints) - { "SetHonorLastWeekStandingPos", &LuaPlayer::SetHonorLastWeekStandingPos }, // :SetHonorLastWeekStandingPos(standingPos) + { "SetHonorStoredKills", &LuaPlayer::SetHonorStoredKills }, + { "SetRankPoints", &LuaPlayer::SetRankPoints }, + { "SetHonorLastWeekStandingPos", &LuaPlayer::SetHonorLastWeekStandingPos }, #endif - { "SetLifetimeKills", &LuaPlayer::SetLifetimeKills }, // :SetLifetimeKills(val) - Sets the overall lifetime (honorable) kills of the player - { "SetGameMaster", &LuaPlayer::SetGameMaster }, // :SetGameMaster([on]) - Sets GM mode on or off - { "SetGMChat", &LuaPlayer::SetGMChat }, // :SetGMChat([on]) - Sets GM chat on or off - { "SetTaxiCheat", &LuaPlayer::SetTaxiCheat }, // :SetTaxiCheat([on]) - Sets taxi cheat on or off - { "SetGMVisible", &LuaPlayer::SetGMVisible }, // :SetGMVisible([on]) - Sets gm visibility on or off - { "SetPvPDeath", &LuaPlayer::SetPvPDeath }, // :SetPvPDeath([on]) - Sets PvP death on or off - { "SetAcceptWhispers", &LuaPlayer::SetAcceptWhispers }, // :SetAcceptWhispers([on]) - Sets whisper accepting death on or off - { "SetRestBonus", &LuaPlayer::SetRestBonus }, // :SetRestBonus(bonusrate) - Sets new restbonus rate - { "SetQuestStatus", &LuaPlayer::SetQuestStatus }, // :SetQuestStatus(entry, status) - Sets the quest's status - { "SetReputation", &LuaPlayer::SetReputation }, // :SetReputation(faction, value) - Sets the faction reputation for the player - { "SetFreeTalentPoints", &LuaPlayer::SetFreeTalentPoints }, // :SetFreeTalentPoints(points) - Sets the amount of unused talent points - { "SetGuildRank", &LuaPlayer::SetGuildRank }, // :SetGuildRank(rank) - Sets player's guild rank - // {"SetMovement", &LuaPlayer::SetMovement}, // :SetMovement(type) - Sets player's movement type - { "SetSkill", &LuaPlayer::SetSkill }, // :SetSkill(skill, step, currVal, maxVal) - Sets the skill's boundaries and value - { "SetFactionForRace", &LuaPlayer::SetFactionForRace }, // :SetFactionForRace(race) - Sets the faction by raceID - { "SetDrunkValue", &LuaPlayer::SetDrunkValue }, // :SetDrunkValue(newDrunkValue) - Sets drunkness value - { "SetAtLoginFlag", &LuaPlayer::SetAtLoginFlag }, // :SetAtLoginFlag(flag) - Adds an at login flag - { "SetPlayerLock", &LuaPlayer::SetPlayerLock }, // :SetPlayerLock(on/off) - { "SetGender", &LuaPlayer::SetGender }, // :SetGender(value) - 0 = male 1 = female - { "SetSheath", &LuaPlayer::SetSheath }, // :SetSheath(SheathState) - Sets player's sheathstate + { "SetLifetimeKills", &LuaPlayer::SetLifetimeKills }, + { "SetGameMaster", &LuaPlayer::SetGameMaster }, + { "SetGMChat", &LuaPlayer::SetGMChat }, + { "SetTaxiCheat", &LuaPlayer::SetTaxiCheat }, + { "SetGMVisible", &LuaPlayer::SetGMVisible }, + { "SetPvPDeath", &LuaPlayer::SetPvPDeath }, + { "SetAcceptWhispers", &LuaPlayer::SetAcceptWhispers }, + { "SetRestBonus", &LuaPlayer::SetRestBonus }, + { "SetQuestStatus", &LuaPlayer::SetQuestStatus }, + { "SetReputation", &LuaPlayer::SetReputation }, + { "SetFreeTalentPoints", &LuaPlayer::SetFreeTalentPoints }, + { "SetGuildRank", &LuaPlayer::SetGuildRank }, + // {"SetMovement", &LuaPlayer::SetMovement}, // :SetMovement(type) - UNDOCUMENTED - Sets player's movement type + { "SetSkill", &LuaPlayer::SetSkill }, + { "SetFactionForRace", &LuaPlayer::SetFactionForRace }, + { "SetDrunkValue", &LuaPlayer::SetDrunkValue }, + { "SetAtLoginFlag", &LuaPlayer::SetAtLoginFlag }, + { "SetPlayerLock", &LuaPlayer::SetPlayerLock }, + { "SetGender", &LuaPlayer::SetGender }, + { "SetSheath", &LuaPlayer::SetSheath }, #ifndef TRINITY - { "SetFFA", &LuaPlayer::SetFFA }, // :SetFFA([apply]) - Sets the units FFA tag on or off + { "SetFFA", &LuaPlayer::SetFFA }, #endif // Boolean - { "IsInGroup", &LuaPlayer::IsInGroup }, // :IsInGroup() - { "IsInGuild", &LuaPlayer::IsInGuild }, // :IsInGuild() - { "IsGM", &LuaPlayer::IsGM }, // :IsGM() - { "IsAlliance", &LuaPlayer::IsAlliance }, // :IsAlliance() - { "IsHorde", &LuaPlayer::IsHorde }, // :IsHorde() + { "IsInGroup", &LuaPlayer::IsInGroup }, + { "IsInGuild", &LuaPlayer::IsInGuild }, + { "IsGM", &LuaPlayer::IsGM }, + { "IsAlliance", &LuaPlayer::IsAlliance }, + { "IsHorde", &LuaPlayer::IsHorde }, #ifndef CLASSIC - { "HasTitle", &LuaPlayer::HasTitle }, // :HasTitle(id) + { "HasTitle", &LuaPlayer::HasTitle }, #endif - { "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 - { "Teleport", &LuaPlayer::Teleport }, // :Teleport(Map, X, Y, Z, O) - Teleports player to specified co - ordinates. Returns true if success and false if not - { "AddItem", &LuaPlayer::AddItem }, // :AddItem(id, amount) - Adds amount of item to player. Returns true if success and false if not + { "HasItem", &LuaPlayer::HasItem }, + { "Teleport", &LuaPlayer::Teleport }, + { "AddItem", &LuaPlayer::AddItem }, #ifndef CLASSIC - { "IsInArenaTeam", &LuaPlayer::IsInArenaTeam }, // :IsInArenaTeam(type) - type : 0 = 2v2, 1 = 3v3, 2 = 5v5 + { "IsInArenaTeam", &LuaPlayer::IsInArenaTeam }, #endif { "CanCompleteQuest", &LuaPlayer::CanCompleteQuest }, - { "CanEquipItem", &LuaPlayer::CanEquipItem }, // :CanEquipItem(entry/item, slot) - Returns true if the player can equip given item/item entry - { "IsFalling", &LuaPlayer::IsFalling }, // :IsFalling() - Returns true if the unit is falling - { "ToggleAFK", &LuaPlayer::ToggleAFK }, // :ToggleAFK() - Toggles AFK state for player - { "ToggleDND", &LuaPlayer::ToggleDND }, // :ToggleDND() - Toggles DND state for player - { "IsAFK", &LuaPlayer::IsAFK }, // :IsAFK() - Returns true if the player is afk - { "IsDND", &LuaPlayer::IsDND }, // :IsDND() - Returns true if the player is in dnd mode - { "IsAcceptingWhispers", &LuaPlayer::IsAcceptingWhispers }, // :IsAcceptWhispers() - Returns true if the player accepts whispers - { "IsGMChat", &LuaPlayer::IsGMChat }, // :IsGMChat() - Returns true if the player has GM chat on - { "IsTaxiCheater", &LuaPlayer::IsTaxiCheater }, // :IsTaxiCheater() - Returns true if the player has taxi cheat on - { "IsGMVisible", &LuaPlayer::IsGMVisible }, // :IsGMVisible() - Returns true if the player is GM visible - { "HasQuest", &LuaPlayer::HasQuest }, // :HasQuest(entry) - Returns true if player has the quest - { "InBattlegroundQueue", &LuaPlayer::InBattlegroundQueue }, // :InBattlegroundQueue() - Returns true if the player is in a battleground queue - // {"IsImmuneToEnvironmentalDamage", &LuaPlayer::IsImmuneToEnvironmentalDamage}, // :IsImmuneToEnvironmentalDamage() - Returns true if the player is immune to enviromental damage - { "CanSpeak", &LuaPlayer::CanSpeak }, // :CanSpeak() - Returns true if the player can speak - { "HasAtLoginFlag", &LuaPlayer::HasAtLoginFlag }, // :HasAtLoginFlag(flag) - returns true if the player has the login flag - // {"InRandomLfgDungeon", &LuaPlayer::InRandomLfgDungeon}, // :InRandomLfgDungeon() - Returns true if the player is in a random LFG dungeon - // {"HasPendingBind", &LuaPlayer::HasPendingBind}, // :HasPendingBind() - Returns true if the player has a pending instance bind + { "CanEquipItem", &LuaPlayer::CanEquipItem }, + { "IsFalling", &LuaPlayer::IsFalling }, + { "ToggleAFK", &LuaPlayer::ToggleAFK }, + { "ToggleDND", &LuaPlayer::ToggleDND }, + { "IsAFK", &LuaPlayer::IsAFK }, + { "IsDND", &LuaPlayer::IsDND }, + { "IsAcceptingWhispers", &LuaPlayer::IsAcceptingWhispers }, + { "IsGMChat", &LuaPlayer::IsGMChat }, + { "IsTaxiCheater", &LuaPlayer::IsTaxiCheater }, + { "IsGMVisible", &LuaPlayer::IsGMVisible }, + { "HasQuest", &LuaPlayer::HasQuest }, + { "InBattlegroundQueue", &LuaPlayer::InBattlegroundQueue }, + // {"IsImmuneToEnvironmentalDamage", &LuaPlayer::IsImmuneToEnvironmentalDamage}, // :IsImmuneToEnvironmentalDamage() - UNDOCUMENTED - Returns true if the player is immune to environmental damage + { "CanSpeak", &LuaPlayer::CanSpeak }, + { "HasAtLoginFlag", &LuaPlayer::HasAtLoginFlag }, + // {"InRandomLfgDungeon", &LuaPlayer::InRandomLfgDungeon}, // :InRandomLfgDungeon() - UNDOCUMENTED - Returns true if the player is in a random LFG dungeon + // {"HasPendingBind", &LuaPlayer::HasPendingBind}, // :HasPendingBind() - UNDOCUMENTED - Returns true if the player has a pending instance bind #if (!defined(TBC) && !defined(CLASSIC)) - { "HasAchieved", &LuaPlayer::HasAchieved }, // :HasAchieved(achievementID) - Returns true if the player has achieved the achievement + { "HasAchieved", &LuaPlayer::HasAchieved }, #endif - { "CanUninviteFromGroup", &LuaPlayer::CanUninviteFromGroup }, // :CanUninviteFromGroup() - Returns true if the player can uninvite from group - { "IsRested", &LuaPlayer::IsRested }, // :IsRested() - Returns true if the player is rested - // {"CanFlyInZone", &LuaPlayer::CanFlyInZone}, // :CanFlyInZone(mapid, zone) - Returns true if the player can fly in the area - // {"IsNeverVisible", &LuaPlayer::IsNeverVisible}, // :IsNeverVisible() - Returns true if the player is never visible - { "IsVisibleForPlayer", &LuaPlayer::IsVisibleForPlayer }, // :IsVisibleForPlayer(player) - Returns true if the player is visible for the target player - // {"IsUsingLfg", &LuaPlayer::IsUsingLfg}, // :IsUsingLfg() - Returns true if the player is using LFG - { "HasQuestForItem", &LuaPlayer::HasQuestForItem }, // :HasQuestForItem(entry) - Returns true if the player has the quest for the item - { "HasQuestForGO", &LuaPlayer::HasQuestForGO }, // :HasQuestForGO(entry) - Returns true if the player has the quest for the gameobject - { "CanShareQuest", &LuaPlayer::CanShareQuest }, // :CanShareQuest(entry) - Returns true if the quest entry is shareable by the player - // {"HasReceivedQuestReward", &LuaPlayer::HasReceivedQuestReward}, // :HasReceivedQuestReward(entry) - Returns true if the player has recieved the quest's reward + { "CanUninviteFromGroup", &LuaPlayer::CanUninviteFromGroup }, + { "IsRested", &LuaPlayer::IsRested }, + // {"CanFlyInZone", &LuaPlayer::CanFlyInZone}, // :CanFlyInZone(mapid, zone) - UNDOCUMENTED - Returns true if the player can fly in the area + // {"IsNeverVisible", &LuaPlayer::IsNeverVisible}, // :IsNeverVisible() - UNDOCUMENTED - Returns true if the player is never visible + { "IsVisibleForPlayer", &LuaPlayer::IsVisibleForPlayer }, + // {"IsUsingLfg", &LuaPlayer::IsUsingLfg}, // :IsUsingLfg() - UNDOCUMENTED - Returns true if the player is using LFG + { "HasQuestForItem", &LuaPlayer::HasQuestForItem }, + { "HasQuestForGO", &LuaPlayer::HasQuestForGO }, + { "CanShareQuest", &LuaPlayer::CanShareQuest }, + // {"HasReceivedQuestReward", &LuaPlayer::HasReceivedQuestReward}, // :HasReceivedQuestReward(entry) - UNDOCUMENTED - Returns true if the player has recieved the quest's reward #if (!defined(TBC) && !defined(CLASSIC)) - { "HasTalent", &LuaPlayer::HasTalent }, // :HasTalent(talentId, spec) - Returns true if the player has the talent in given spec + { "HasTalent", &LuaPlayer::HasTalent }, #endif - { "IsInSameGroupWith", &LuaPlayer::IsInSameGroupWith }, // :IsInSameGroupWith(player) - Returns true if the players are in the same group - { "IsInSameRaidWith", &LuaPlayer::IsInSameRaidWith }, // :IsInSameRaidWith(player) - Returns true if the players are in the same raid - { "IsGroupVisibleFor", &LuaPlayer::IsGroupVisibleFor }, // :IsGroupVisibleFor(player) - Player is group visible for the target - { "HasSkill", &LuaPlayer::HasSkill }, // :HasSkill(skill) - Returns true if the player has the skill - { "IsHonorOrXPTarget", &LuaPlayer::IsHonorOrXPTarget }, // :IsHonorOrXPTarget(victim) - Returns true if the victim gives honor or XP - { "CanParry", &LuaPlayer::CanParry }, // :CanParry() - Returns true if the player can parry - { "CanBlock", &LuaPlayer::CanBlock }, // :CanBlock() - Returns true if the player can block + { "IsInSameGroupWith", &LuaPlayer::IsInSameGroupWith }, + { "IsInSameRaidWith", &LuaPlayer::IsInSameRaidWith }, + { "IsGroupVisibleFor", &LuaPlayer::IsGroupVisibleFor }, + { "HasSkill", &LuaPlayer::HasSkill }, + { "IsHonorOrXPTarget", &LuaPlayer::IsHonorOrXPTarget }, + { "CanParry", &LuaPlayer::CanParry }, + { "CanBlock", &LuaPlayer::CanBlock }, #if (!defined(TBC) && !defined(CLASSIC)) - { "CanTitanGrip", &LuaPlayer::CanTitanGrip }, // :CanTitanGrip() - Returns true if the player has titan grip + { "CanTitanGrip", &LuaPlayer::CanTitanGrip }, #endif - { "InBattleground", &LuaPlayer::InBattleground }, // :InBattleground() - Returns true if the player is in a battleground + { "InBattleground", &LuaPlayer::InBattleground }, #ifndef CLASSIC - { "InArena", &LuaPlayer::InArena }, // :InArena() - Returns true if the player is in an arena + { "InArena", &LuaPlayer::InArena }, #endif - // {"IsOutdoorPvPActive", &LuaPlayer::IsOutdoorPvPActive}, // :IsOutdoorPvPActive() - Returns true if the player is outdoor pvp active - // {"IsARecruiter", &LuaPlayer::IsARecruiter}, // :IsARecruiter() - Returns true if the player is a recruiter - { "CanUseItem", &LuaPlayer::CanUseItem }, // :CanUseItem(item/entry) - Returns true if the player can use the item or item entry - { "HasSpell", &LuaPlayer::HasSpell }, // :HasSpell(id) - { "HasSpellCooldown", &LuaPlayer::HasSpellCooldown }, // :HasSpellCooldown(spellId) - Returns true if the spell is on cooldown - { "IsInWater", &LuaPlayer::IsInWater }, // :IsInWater() - Returns true if the player is in water + // {"IsOutdoorPvPActive", &LuaPlayer::IsOutdoorPvPActive}, // :IsOutdoorPvPActive() - UNDOCUMENTED - Returns true if the player is outdoor pvp active + // {"IsARecruiter", &LuaPlayer::IsARecruiter}, // :IsARecruiter() - UNDOCUMENTED - Returns true if the player is a recruiter + { "CanUseItem", &LuaPlayer::CanUseItem }, + { "HasSpell", &LuaPlayer::HasSpell }, + { "HasSpellCooldown", &LuaPlayer::HasSpellCooldown }, + { "IsInWater", &LuaPlayer::IsInWater }, #ifndef CLASSIC - { "CanFly", &LuaPlayer::CanFly }, // :CanFly() - Returns true if the player can fly + { "CanFly", &LuaPlayer::CanFly }, #endif - { "IsMoving", &LuaPlayer::IsMoving }, // :IsMoving() + { "IsMoving", &LuaPlayer::IsMoving }, #ifndef CLASSIC - { "IsFlying", &LuaPlayer::IsFlying }, // :IsFlying() + { "IsFlying", &LuaPlayer::IsFlying }, #endif // Gossip - { "GossipMenuAddItem", &LuaPlayer::GossipMenuAddItem }, // :GossipMenuAddItem(icon, msg, sender, intid[, code, popup, money]) - { "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 - { "GossipComplete", &LuaPlayer::GossipComplete }, // :GossipComplete() - { "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 + { "GossipMenuAddItem", &LuaPlayer::GossipMenuAddItem }, + { "GossipSendMenu", &LuaPlayer::GossipSendMenu }, + { "GossipComplete", &LuaPlayer::GossipComplete }, + { "GossipClearMenu", &LuaPlayer::GossipClearMenu }, // Other - { "SendClearCooldowns", &LuaPlayer::SendClearCooldowns }, // :SendClearCooldowns(spellId, (unit)target) - Clears the cooldown of the target with a specified spellId - { "SendBroadcastMessage", &LuaPlayer::SendBroadcastMessage }, // :SendBroadcastMessage(message) - { "SendAreaTriggerMessage", &LuaPlayer::SendAreaTriggerMessage }, // :SendAreaTriggerMessage(message) - Sends a yellow message in the middle of your screen - { "SendNotification", &LuaPlayer::SendNotification }, // :SendNotification(message) - Sends a red message in the middle of your screen - { "SendPacket", &LuaPlayer::SendPacket }, // :SendPacket(packet, selfOnly) - Sends a packet to player or everyone around also if selfOnly is false - { "SendAddonMessage", &LuaPlayer::SendAddonMessage }, // :SendAddonMessage(prefix, message, channel, receiver) - Sends an addon message to the player. - { "ModifyMoney", &LuaPlayer::ModifyMoney }, // :ModifyMoney(amount[, sendError]) - Modifies (does not set) money (copper count) of the player. Amount can be negative to remove copper - { "LearnSpell", &LuaPlayer::LearnSpell }, // :LearnSpell(id) - learns the given spell + { "SendClearCooldowns", &LuaPlayer::SendClearCooldowns }, + { "SendBroadcastMessage", &LuaPlayer::SendBroadcastMessage }, + { "SendAreaTriggerMessage", &LuaPlayer::SendAreaTriggerMessage }, + { "SendNotification", &LuaPlayer::SendNotification }, + { "SendPacket", &LuaPlayer::SendPacket }, + { "SendAddonMessage", &LuaPlayer::SendAddonMessage }, + { "ModifyMoney", &LuaPlayer::ModifyMoney }, + { "LearnSpell", &LuaPlayer::LearnSpell }, { "LearnTalent", &LuaPlayer::LearnTalent }, - { "RemoveItem", &LuaPlayer::RemoveItem }, // :RemoveItem(item/entry, amount) - Removes amount of item from player - { "RemoveLifetimeKills", &LuaPlayer::RemoveLifetimeKills }, // :RemoveLifetimeKills(val) - Removes a specified amount(val) of the player's lifetime (honorable) kills - { "ResurrectPlayer", &LuaPlayer::ResurrectPlayer }, // :ResurrectPlayer([percent[, sickness(bool)]]) - Resurrects the player at percentage, player gets resurrection sickness if sickness set to true - { "PlaySoundToPlayer", &LuaPlayer::PlaySoundToPlayer }, // :PlaySoundToPlayer(soundId) - Plays the specified sound to the player - { "EquipItem", &LuaPlayer::EquipItem }, // :EquipItem(entry/item, slot) - Equips given item or item entry for player to given slot. Returns the equipped item or nil - { "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 - { "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 - { "ResetAllCooldowns", &LuaPlayer::ResetAllCooldowns }, // :ResetAllCooldowns() - Resets all spell cooldowns - { "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. - // {"RemovePet", &LuaPlayer::RemovePet}, // :RemovePet([mode, returnreagent]) - Removes the player's pet. Mode determines if the pet is saved and how - // {"SummonPet", &LuaPlayer::SummonPet}, // :SummonPet(entry, x, y, z, o, petType, despwtime) - Summons a pet for the player - { "Say", &LuaPlayer::Say }, // :Say(text, lang) - The player says the text - { "Yell", &LuaPlayer::Yell }, // :Yell(text, lang) - The player yells the text - { "TextEmote", &LuaPlayer::TextEmote }, // :TextEmote(text) - The player does a textemote with the text - { "Whisper", &LuaPlayer::Whisper }, // :Whisper(text, lang, receiver) - The player whispers the text to the receiver - { "CompleteQuest", &LuaPlayer::CompleteQuest }, // :CompleteQuest(entry) - Completes a quest by entry - { "IncompleteQuest", &LuaPlayer::IncompleteQuest }, // :IncompleteQuest(entry) - Uncompletes the quest by entry for the player - { "FailQuest", &LuaPlayer::FailQuest }, // :FailQuest(entry) - Player fails the quest entry + { "RemoveItem", &LuaPlayer::RemoveItem }, + { "RemoveLifetimeKills", &LuaPlayer::RemoveLifetimeKills }, + { "ResurrectPlayer", &LuaPlayer::ResurrectPlayer }, + { "PlaySoundToPlayer", &LuaPlayer::PlaySoundToPlayer }, + { "EquipItem", &LuaPlayer::EquipItem }, + { "ResetSpellCooldown", &LuaPlayer::ResetSpellCooldown }, + { "ResetTypeCooldowns", &LuaPlayer::ResetTypeCooldowns }, + { "ResetAllCooldowns", &LuaPlayer::ResetAllCooldowns }, + { "GiveXP", &LuaPlayer::GiveXP }, // :GiveXP(xp[, victim, pureXP, triggerHook]) - UNDOCUMENTED - Gives XP to the player. If pure is false, bonuses are count in. If triggerHook is false, GiveXp hook is not triggered. + // {"RemovePet", &LuaPlayer::RemovePet}, // :RemovePet([mode, returnreagent]) - UNDOCUMENTED - Removes the player's pet. Mode determines if the pet is saved and how + // {"SummonPet", &LuaPlayer::SummonPet}, // :SummonPet(entry, x, y, z, o, petType, despwtime) - Summons a pet for the player + { "Say", &LuaPlayer::Say }, + { "Yell", &LuaPlayer::Yell }, + { "TextEmote", &LuaPlayer::TextEmote }, + { "Whisper", &LuaPlayer::Whisper }, + { "CompleteQuest", &LuaPlayer::CompleteQuest }, + { "IncompleteQuest", &LuaPlayer::IncompleteQuest }, + { "FailQuest", &LuaPlayer::FailQuest }, { "AddQuest", &LuaPlayer::AddQuest }, { "RemoveQuest", &LuaPlayer::RemoveQuest }, - // {"RemoveActiveQuest", &LuaPlayer::RemoveActiveQuest}, // :RemoveActiveQuest(entry) - Removes an active quest - // {"RemoveRewardedQuest", &LuaPlayer::RemoveRewardedQuest}, // :RemoveRewardedQuest(entry) - Removes a rewarded quest - { "AreaExploredOrEventHappens", &LuaPlayer::AreaExploredOrEventHappens }, // :AreaExploredOrEventHappens(questId) - Satisfies an area or event requrement for the questId - { "GroupEventHappens", &LuaPlayer::GroupEventHappens }, // :GroupEventHappens(questId, worldObject) - Satisfies a group event for the questId with the world object - { "KilledMonsterCredit", &LuaPlayer::KilledMonsterCredit }, // :KilledMonsterCredit(entry) - Satisfies a monsterkill for the player - // {"KilledPlayerCredit", &LuaPlayer::KilledPlayerCredit}, // :KilledPlayerCredit() - Satisfies a player kill for the player - // {"KillGOCredit", &LuaPlayer::KillGOCredit}, // :KillGOCredit(GOEntry[, GUID]) - Credits the player for destroying a GO, guid is optional - { "TalkedToCreature", &LuaPlayer::TalkedToCreature }, // :TalkedToCreature(npcEntry, creature) - Satisfies creature talk objective for the player + // {"RemoveActiveQuest", &LuaPlayer::RemoveActiveQuest}, // :RemoveActiveQuest(entry) - UNDOCUMENTED - Removes an active quest + // {"RemoveRewardedQuest", &LuaPlayer::RemoveRewardedQuest}, // :RemoveRewardedQuest(entry) - UNDOCUMENTED - Removes a rewarded quest + { "AreaExploredOrEventHappens", &LuaPlayer::AreaExploredOrEventHappens }, + { "GroupEventHappens", &LuaPlayer::GroupEventHappens }, + { "KilledMonsterCredit", &LuaPlayer::KilledMonsterCredit }, + // {"KilledPlayerCredit", &LuaPlayer::KilledPlayerCredit}, // :KilledPlayerCredit() - UNDOCUMENTED - Satisfies a player kill for the player + // {"KillGOCredit", &LuaPlayer::KillGOCredit}, // :KillGOCredit(GOEntry[, GUID]) - UNDOCUMENTED - Credits the player for destroying a GO, guid is optional + { "TalkedToCreature", &LuaPlayer::TalkedToCreature }, #if (!defined(TBC) && !defined(CLASSIC)) - { "ResetPetTalents", &LuaPlayer::ResetPetTalents }, // :ResetPetTalents() - Resets player's pet's talents + { "ResetPetTalents", &LuaPlayer::ResetPetTalents }, #endif - { "AddComboPoints", &LuaPlayer::AddComboPoints }, // :AddComboPoints(target, count[, spell]) - Adds combo points to the target for the player - // {"GainSpellComboPoints", &LuaPlayer::GainSpellComboPoints}, // :GainSpellComboPoints(amount) - Player gains spell combo points - { "ClearComboPoints", &LuaPlayer::ClearComboPoints }, // :ClearComboPoints() - Clears player's combo points - { "RemoveSpell", &LuaPlayer::RemoveSpell }, // :RemoveSpell(entry[, disabled, learn_low_rank]) - Removes (unlearn) the given spell - { "ResetTalents", &LuaPlayer::ResetTalents }, // :ResetTalents([no_cost]) - Resets player's talents - { "ResetTalentsCost", &LuaPlayer::ResetTalentsCost }, // :ResetTalentsCost() - Returns the reset talents cost - // {"AddTalent", &LuaPlayer::AddTalent}, // :AddTalent(spellid, spec, learning) - Adds a talent spell for the player to given spec - { "RemoveFromGroup", &LuaPlayer::RemoveFromGroup }, // :RemoveFromGroup() - Removes the player from his group - { "KillPlayer", &LuaPlayer::KillPlayer }, // :KillPlayer() - Kills the player - { "DurabilityLossAll", &LuaPlayer::DurabilityLossAll }, // :DurabilityLossAll(percent[, inventory]) - The player's items lose durability. Inventory true by default - { "DurabilityLoss", &LuaPlayer::DurabilityLoss }, // :DurabilityLoss(item, percent) - The given item loses durability - { "DurabilityPointsLoss", &LuaPlayer::DurabilityPointsLoss }, // :DurabilityPointsLoss(item, points) - The given item loses durability - { "DurabilityPointsLossAll", &LuaPlayer::DurabilityPointsLossAll }, // :DurabilityPointsLossAll(points, inventory) - Player's items lose durability - { "DurabilityPointLossForEquipSlot", &LuaPlayer::DurabilityPointLossForEquipSlot }, // :DurabilityPointLossForEquipSlot(slot) - Causes durability loss for the item in the given slot - { "DurabilityRepairAll", &LuaPlayer::DurabilityRepairAll }, // :DurabilityRepairAll([has_cost, discount, guildBank]) - Repairs all durability - { "DurabilityRepair", &LuaPlayer::DurabilityRepair }, // :DurabilityRepair(position[, has_cost, discount, guildBank]) - Repairs item durability of item in given position + { "AddComboPoints", &LuaPlayer::AddComboPoints }, + // {"GainSpellComboPoints", &LuaPlayer::GainSpellComboPoints}, // :GainSpellComboPoints(amount) - UNDOCUMENTED - Player gains spell combo points + { "ClearComboPoints", &LuaPlayer::ClearComboPoints }, + { "RemoveSpell", &LuaPlayer::RemoveSpell }, + { "ResetTalents", &LuaPlayer::ResetTalents }, + { "ResetTalentsCost", &LuaPlayer::ResetTalentsCost }, + // {"AddTalent", &LuaPlayer::AddTalent}, // :AddTalent(spellid, spec, learning) - UNDOCUMENTED - Adds a talent spell for the player to given spec + { "RemoveFromGroup", &LuaPlayer::RemoveFromGroup }, + { "KillPlayer", &LuaPlayer::KillPlayer }, + { "DurabilityLossAll", &LuaPlayer::DurabilityLossAll }, + { "DurabilityLoss", &LuaPlayer::DurabilityLoss }, + { "DurabilityPointsLoss", &LuaPlayer::DurabilityPointsLoss }, + { "DurabilityPointsLossAll", &LuaPlayer::DurabilityPointsLossAll }, + { "DurabilityPointLossForEquipSlot", &LuaPlayer::DurabilityPointLossForEquipSlot }, + { "DurabilityRepairAll", &LuaPlayer::DurabilityRepairAll }, + { "DurabilityRepair", &LuaPlayer::DurabilityRepair }, #ifndef CATA #ifndef CLASSIC - { "ModifyHonorPoints", &LuaPlayer::ModifyHonorPoints }, // :ModifyHonorPoints(amount) - Modifies the player's honor points - { "ModifyArenaPoints", &LuaPlayer::ModifyArenaPoints }, // :ModifyArenaPoints(amount) - Modifies the player's arena points + { "ModifyHonorPoints", &LuaPlayer::ModifyHonorPoints }, + { "ModifyArenaPoints", &LuaPlayer::ModifyArenaPoints }, #endif #endif - { "LeaveBattleground", &LuaPlayer::LeaveBattleground }, // :LeaveBattleground([teleToEntryPoint]) - The player leaves the battleground - // {"BindToInstance", &LuaPlayer::BindToInstance}, // :BindToInstance() - Binds the player to the current instance - { "UnbindInstance", &LuaPlayer::UnbindInstance }, // :UnbindInstance(map, difficulty) - Unbinds the player from an instance - { "UnbindAllInstances", &LuaPlayer::UnbindAllInstances }, // :UnbindAllInstances() - Unbinds the player from all instances - { "RemoveFromBattlegroundRaid", &LuaPlayer::RemoveFromBattlegroundRaid }, // :RemoveFromBattlegroundRaid() - Removes the player from a battleground or battlefield raid + { "LeaveBattleground", &LuaPlayer::LeaveBattleground }, + // {"BindToInstance", &LuaPlayer::BindToInstance}, // :BindToInstance() - UNDOCUMENTED - Binds the player to the current instance + { "UnbindInstance", &LuaPlayer::UnbindInstance }, + { "UnbindAllInstances", &LuaPlayer::UnbindAllInstances }, + { "RemoveFromBattlegroundRaid", &LuaPlayer::RemoveFromBattlegroundRaid }, #if (!defined(TBC) && !defined(CLASSIC)) - { "ResetAchievements", &LuaPlayer::ResetAchievements }, // :ResetAchievements() - Resets player�s achievements + { "ResetAchievements", &LuaPlayer::ResetAchievements }, #endif - { "KickPlayer", &LuaPlayer::KickPlayer }, // :KickPlayer() - Kicks player from server - { "LogoutPlayer", &LuaPlayer::LogoutPlayer }, // :LogoutPlayer([save]) - Logs the player out and saves if true - { "SendTrainerList", &LuaPlayer::SendTrainerList }, // :SendTrainerList(WorldObject) - Sends trainer list from object to player - { "SendListInventory", &LuaPlayer::SendListInventory }, // :SendListInventory(WorldObject) - Sends vendor list from object to player - { "SendShowBank", &LuaPlayer::SendShowBank }, // :SendShowBank(WorldObject) - Sends bank window from object to player - { "SendTabardVendorActivate", &LuaPlayer::SendTabardVendorActivate }, // :SendTabardVendorActivate(WorldObject) - Sends tabard vendor window from object to player - { "SendSpiritResurrect", &LuaPlayer::SendSpiritResurrect }, // :SendSpiritResurrect() - Sends resurrect window to player - { "SendTaxiMenu", &LuaPlayer::SendTaxiMenu }, // :SendTaxiMenu(creature) - Sends flight window to player from creature + { "KickPlayer", &LuaPlayer::KickPlayer }, + { "LogoutPlayer", &LuaPlayer::LogoutPlayer }, + { "SendTrainerList", &LuaPlayer::SendTrainerList }, + { "SendListInventory", &LuaPlayer::SendListInventory }, + { "SendShowBank", &LuaPlayer::SendShowBank }, + { "SendTabardVendorActivate", &LuaPlayer::SendTabardVendorActivate }, + { "SendSpiritResurrect", &LuaPlayer::SendSpiritResurrect }, + { "SendTaxiMenu", &LuaPlayer::SendTaxiMenu }, { "RewardQuest", &LuaPlayer::RewardQuest }, - { "SendAuctionMenu", &LuaPlayer::SendAuctionMenu }, // :SendAuctionMenu(unit) - Sends auction window to player. Auction house is sent by object. - { "SendShowMailBox", &LuaPlayer::SendShowMailBox }, // :SendShowMailBox([mailboxguid]) - Sends the mail window to player from the mailbox gameobject. The guid is required on patches below wotlk. - { "StartTaxi", &LuaPlayer::StartTaxi }, // :StartTaxi(pathId) - player starts the given flight path - { "GossipSendPOI", &LuaPlayer::GossipSendPOI }, // :GossipSendPOI(X, Y, Icon, Flags, Data, Name) - Sends a point of interest to the player - { "GossipAddQuests", &LuaPlayer::GossipAddQuests }, // :GossipAddQuests(unit) - Adds unit's quests to player's gossip menu - { "SendQuestTemplate", &LuaPlayer::SendQuestTemplate }, // :SendQuestTemplate(questId, activeAccept) -- Sends quest template to player - { "SpawnBones", &LuaPlayer::SpawnBones }, // :SpawnBones() - Removes the player's corpse and spawns bones - { "RemovedInsignia", &LuaPlayer::RemovedInsignia }, // :RemovedInsignia(looter) - Looter removes the player's corpse, looting the player and replacing with lootable bones - { "SendGuildInvite", &LuaPlayer::SendGuildInvite }, // :SendGuildInvite(player) - Sends a guild invite to the specific player - { "CreateCorpse", &LuaPlayer::CreateCorpse }, // :CreateCorpse() - Creates the player's corpse - { "Mute", &LuaPlayer::Mute }, // :Mute(time[, reason]) - Mutes the player for given time in seconds. - { "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. - { "SaveToDB", &LuaPlayer::SaveToDB }, // :SaveToDB() - Saves to database + { "SendAuctionMenu", &LuaPlayer::SendAuctionMenu }, + { "SendShowMailBox", &LuaPlayer::SendShowMailBox }, + { "StartTaxi", &LuaPlayer::StartTaxi }, + { "GossipSendPOI", &LuaPlayer::GossipSendPOI }, + { "GossipAddQuests", &LuaPlayer::GossipAddQuests }, + { "SendQuestTemplate", &LuaPlayer::SendQuestTemplate }, + { "SpawnBones", &LuaPlayer::SpawnBones }, + { "RemovedInsignia", &LuaPlayer::RemovedInsignia }, + { "SendGuildInvite", &LuaPlayer::SendGuildInvite }, + { "CreateCorpse", &LuaPlayer::CreateCorpse }, + { "Mute", &LuaPlayer::Mute }, + { "SummonPlayer", &LuaPlayer::SummonPlayer }, + { "SaveToDB", &LuaPlayer::SaveToDB }, { "GroupInvite", &LuaPlayer::GroupInvite }, { "GroupCreate", &LuaPlayer::GroupCreate }, #ifdef CLASSIC - { "UpdateHonor", &LuaPlayer::UpdateHonor }, // :UpdateHonor() - Updates Player Honor - { "ResetHonor", &LuaPlayer::ResetHonor }, // :ResetHonor() - Resets Player Honor - { "ClearHonorInfo", &LuaPlayer::ClearHonorInfo }, // :ClearHonorInfo() - Clear Player Honor Info + { "UpdateHonor", &LuaPlayer::UpdateHonor }, + { "ResetHonor", &LuaPlayer::ResetHonor }, + { "ClearHonorInfo", &LuaPlayer::ClearHonorInfo }, #endif - { NULL, NULL }, + { NULL, NULL } }; ElunaRegister CreatureMethods[] = @@ -796,7 +796,7 @@ ElunaRegister CreatureMethods[] = { "SetHomePosition", &LuaCreature::SetHomePosition }, { "SetEquipmentSlots", &LuaCreature::SetEquipmentSlots }, - // Booleans + // Boolean { "IsWorldBoss", &LuaCreature::IsWorldBoss }, { "IsRacialLeader", &LuaCreature::IsRacialLeader }, { "IsCivilian", &LuaCreature::IsCivilian }, @@ -848,7 +848,7 @@ ElunaRegister CreatureMethods[] = { "MoveWaypoint", &LuaCreature::MoveWaypoint }, { "UpdateEntry", &LuaCreature::UpdateEntry }, - { NULL, NULL }, + { NULL, NULL } }; ElunaRegister GameObjectMethods[] = @@ -868,7 +868,7 @@ ElunaRegister GameObjectMethods[] = // Boolean { "IsTransport", &LuaGameObject::IsTransport }, - // {"IsDestructible", &LuaGameObject::IsDestructible}, // :IsDestructible() + // {"IsDestructible", &LuaGameObject::IsDestructible}, // :IsDestructible() - UNDOCUMENTED { "IsActive", &LuaGameObject::IsActive }, { "HasQuest", &LuaGameObject::HasQuest }, { "IsSpawned", &LuaGameObject::IsSpawned }, @@ -880,83 +880,83 @@ ElunaRegister GameObjectMethods[] = { "Respawn", &LuaGameObject::Respawn }, { "SaveToDB", &LuaGameObject::SaveToDB }, - { NULL, NULL }, + { NULL, NULL } }; ElunaRegister ItemMethods[] = { // Getters - { "GetOwnerGUID", &LuaItem::GetOwnerGUID }, // :GetOwnerGUID() - Returns the owner's guid - { "GetOwner", &LuaItem::GetOwner }, // :GetOwner() - Returns the owner object (player) - { "GetCount", &LuaItem::GetCount }, // :GetCount() - Returns item stack count - { "GetMaxStackCount", &LuaItem::GetMaxStackCount }, // :GetMaxStackCount() - Returns item max stack count - { "GetSlot", &LuaItem::GetSlot }, // :GetSlot() - returns the slot the item is in - { "GetBagSlot", &LuaItem::GetBagSlot }, // :GetBagSlot() - returns the bagslot of the bag the item is in - { "GetEnchantmentId", &LuaItem::GetEnchantmentId }, // :GetEnchantmentId(enchant_slot) - Returns the enchantment in given slot. (permanent = 0) - { "GetSpellId", &LuaItem::GetSpellId }, // :GetSpellId(index) - Returns spellID at given index (0 - 4) - { "GetSpellTrigger", &LuaItem::GetSpellTrigger }, // :GetSpellTrigger(index) - Returns spell trigger at given index (0 - 4) - { "GetItemLink", &LuaItem::GetItemLink }, // :GetItemLink([localeID]) - Returns the shift clickable link of the item. Name translated if locale given and exists - { "GetClass", &LuaItem::GetClass }, // :GetClass() - { "GetSubClass", &LuaItem::GetSubClass }, // :GetSubClass() - { "GetName", &LuaItem::GetName }, // :GetName() - { "GetDisplayId", &LuaItem::GetDisplayId }, // :GetDisplayId() - { "GetQuality", &LuaItem::GetQuality }, // :GetQuality() - { "GetBuyCount", &LuaItem::GetBuyCount }, // :GetBuyCount() - { "GetBuyPrice", &LuaItem::GetBuyPrice }, // :GetBuyPrice() - { "GetSellPrice", &LuaItem::GetSellPrice }, // :GetSellPrice() - { "GetInventoryType", &LuaItem::GetInventoryType }, // :GetInventoryType() - { "GetAllowableClass", &LuaItem::GetAllowableClass }, // :GetAllowableClass() - { "GetAllowableRace", &LuaItem::GetAllowableRace }, // :GetAllowableRace() - { "GetItemLevel", &LuaItem::GetItemLevel }, // :GetItemLevel() - { "GetRequiredLevel", &LuaItem::GetRequiredLevel }, // :GetRequiredLevel() + { "GetOwnerGUID", &LuaItem::GetOwnerGUID }, + { "GetOwner", &LuaItem::GetOwner }, + { "GetCount", &LuaItem::GetCount }, + { "GetMaxStackCount", &LuaItem::GetMaxStackCount }, + { "GetSlot", &LuaItem::GetSlot }, + { "GetBagSlot", &LuaItem::GetBagSlot }, + { "GetEnchantmentId", &LuaItem::GetEnchantmentId }, + { "GetSpellId", &LuaItem::GetSpellId }, + { "GetSpellTrigger", &LuaItem::GetSpellTrigger }, + { "GetItemLink", &LuaItem::GetItemLink }, + { "GetClass", &LuaItem::GetClass }, + { "GetSubClass", &LuaItem::GetSubClass }, + { "GetName", &LuaItem::GetName }, + { "GetDisplayId", &LuaItem::GetDisplayId }, + { "GetQuality", &LuaItem::GetQuality }, + { "GetBuyCount", &LuaItem::GetBuyCount }, + { "GetBuyPrice", &LuaItem::GetBuyPrice }, + { "GetSellPrice", &LuaItem::GetSellPrice }, + { "GetInventoryType", &LuaItem::GetInventoryType }, + { "GetAllowableClass", &LuaItem::GetAllowableClass }, + { "GetAllowableRace", &LuaItem::GetAllowableRace }, + { "GetItemLevel", &LuaItem::GetItemLevel }, + { "GetRequiredLevel", &LuaItem::GetRequiredLevel }, #ifdef WOTLK - { "GetStatsCount", &LuaItem::GetStatsCount }, // :GetStatsCount() + { "GetStatsCount", &LuaItem::GetStatsCount }, #endif - { "GetRandomProperty", &LuaItem::GetRandomProperty }, // :GetRandomProperty() + { "GetRandomProperty", &LuaItem::GetRandomProperty }, #ifndef CLASSIC - { "GetRandomSuffix", &LuaItem::GetRandomSuffix }, // :GetRandomSuffix() + { "GetRandomSuffix", &LuaItem::GetRandomSuffix }, #endif - { "GetItemSet", &LuaItem::GetItemSet }, // :GetItemSet() - { "GetBagSize", &LuaItem::GetBagSize }, // :GetBagSize() + { "GetItemSet", &LuaItem::GetItemSet }, + { "GetBagSize", &LuaItem::GetBagSize }, // Setters - { "SetOwner", &LuaItem::SetOwner }, // :SetOwner(player) - Sets the owner of the item - { "SetBinding", &LuaItem::SetBinding }, // :SetBinding(bound) - Sets the item binding to true or false - { "SetCount", &LuaItem::SetCount }, // :SetCount(count) - Sets the item count + { "SetOwner", &LuaItem::SetOwner }, + { "SetBinding", &LuaItem::SetBinding }, + { "SetCount", &LuaItem::SetCount }, // Boolean - { "IsSoulBound", &LuaItem::IsSoulBound }, // :IsSoulBound() - Returns true if the item is soulbound + { "IsSoulBound", &LuaItem::IsSoulBound }, #if (!defined(TBC) && !defined(CLASSIC)) - { "IsBoundAccountWide", &LuaItem::IsBoundAccountWide }, // :IsBoundAccountWide() - Returns true if the item is account bound + { "IsBoundAccountWide", &LuaItem::IsBoundAccountWide }, #endif - { "IsBoundByEnchant", &LuaItem::IsBoundByEnchant }, // :IsBoundByEnchant() - Returns true if the item is bound with an enchant - { "IsNotBoundToPlayer", &LuaItem::IsNotBoundToPlayer }, // :IsNotBoundToPlayer(player) - Returns true if the item is not bound with player - { "IsLocked", &LuaItem::IsLocked }, // :IsLocked() - Returns true if the item is locked - { "IsBag", &LuaItem::IsBag }, // :IsBag() - Returns true if the item is a bag + { "IsBoundByEnchant", &LuaItem::IsBoundByEnchant }, + { "IsNotBoundToPlayer", &LuaItem::IsNotBoundToPlayer }, + { "IsLocked", &LuaItem::IsLocked }, + { "IsBag", &LuaItem::IsBag }, #ifndef CLASSIC - { "IsCurrencyToken", &LuaItem::IsCurrencyToken }, // :IsCurrencyToken() - Returns true if the item is a currency token + { "IsCurrencyToken", &LuaItem::IsCurrencyToken }, #endif - { "IsNotEmptyBag", &LuaItem::IsNotEmptyBag }, // :IsNotEmptyBag() - Returns true if the item is not an empty bag - { "IsBroken", &LuaItem::IsBroken }, // :IsBroken() - Returns true if the item is broken - { "CanBeTraded", &LuaItem::CanBeTraded }, // :CanBeTraded() - Returns true if the item can be traded - { "IsInTrade", &LuaItem::IsInTrade }, // :IsInTrade() - Returns true if the item is in trade - { "IsInBag", &LuaItem::IsInBag }, // :IsInBag() - Returns true if the item is in a bag - { "IsEquipped", &LuaItem::IsEquipped }, // :IsEquipped() - Returns true if the item is equipped - { "HasQuest", &LuaItem::HasQuest }, // :HasQuest(questId) - Returns true if the item starts the quest - { "IsPotion", &LuaItem::IsPotion }, // :IsPotion() - Returns true if the item is a potion + { "IsNotEmptyBag", &LuaItem::IsNotEmptyBag }, + { "IsBroken", &LuaItem::IsBroken }, + { "CanBeTraded", &LuaItem::CanBeTraded }, + { "IsInTrade", &LuaItem::IsInTrade }, + { "IsInBag", &LuaItem::IsInBag }, + { "IsEquipped", &LuaItem::IsEquipped }, + { "HasQuest", &LuaItem::HasQuest }, + { "IsPotion", &LuaItem::IsPotion }, #ifndef CATA - { "IsWeaponVellum", &LuaItem::IsWeaponVellum }, // :IsWeaponVellum() - Returns true if the item is a weapon vellum - { "IsArmorVellum", &LuaItem::IsArmorVellum }, // :IsArmorVellum() - Returns true if the item is an armor vellum + { "IsWeaponVellum", &LuaItem::IsWeaponVellum }, + { "IsArmorVellum", &LuaItem::IsArmorVellum }, #endif - { "IsConjuredConsumable", &LuaItem::IsConjuredConsumable }, // :IsConjuredConsumable() - Returns true if the item is a conjured consumable - // {"IsRefundExpired", &LuaItem::IsRefundExpired}, // :IsRefundExpired() - Returns true if the item's refund time has expired - { "SetEnchantment", &LuaItem::SetEnchantment }, // :SetEnchantment(enchantid, enchantmentslot) - Sets a new enchantment for the item. Returns true on success - { "ClearEnchantment", &LuaItem::ClearEnchantment }, // :ClearEnchantment(enchantmentslot) - Removes the enchantment from the item if one exists. Returns true on success + { "IsConjuredConsumable", &LuaItem::IsConjuredConsumable }, + //{"IsRefundExpired", &LuaItem::IsRefundExpired}, // :IsRefundExpired() - UNDOCUMENTED - Returns true if the item's refund time has expired + { "SetEnchantment", &LuaItem::SetEnchantment }, + { "ClearEnchantment", &LuaItem::ClearEnchantment }, // Other - { "SaveToDB", &LuaItem::SaveToDB }, // :SaveToDB() - Saves to database + { "SaveToDB", &LuaItem::SaveToDB }, - { NULL, NULL }, + { NULL, NULL } }; ElunaRegister AuraMethods[] = @@ -979,7 +979,7 @@ ElunaRegister AuraMethods[] = // Other { "Remove", &LuaAura::Remove }, - { NULL, NULL }, + { NULL, NULL } }; ElunaRegister SpellMethods[] = @@ -1004,7 +1004,7 @@ ElunaRegister SpellMethods[] = { "Cast", &LuaSpell::Cast }, { "Finish", &LuaSpell::Finish }, - { NULL, NULL }, + { NULL, NULL } }; ElunaRegister QuestMethods[] = @@ -1012,7 +1012,7 @@ ElunaRegister QuestMethods[] = // Getters { "GetId", &LuaQuest::GetId }, { "GetLevel", &LuaQuest::GetLevel }, - // {"GetMaxLevel", &LuaQuest::GetMaxLevel}, // :GetMaxLevel() - Returns the quest's max level + // {"GetMaxLevel", &LuaQuest::GetMaxLevel}, // :GetMaxLevel() - UNDOCUMENTED - Returns the quest's max level { "GetMinLevel", &LuaQuest::GetMinLevel }, { "GetNextQuestId", &LuaQuest::GetNextQuestId }, { "GetPrevQuestId", &LuaQuest::GetPrevQuestId }, @@ -1027,7 +1027,7 @@ ElunaRegister QuestMethods[] = #endif { "IsRepeatable", &LuaQuest::IsRepeatable }, - { NULL, NULL }, + { NULL, NULL } }; ElunaRegister GroupMethods[] = @@ -1051,10 +1051,10 @@ ElunaRegister GroupMethods[] = { "RemoveMember", &LuaGroup::RemoveMember }, { "Disband", &LuaGroup::Disband }, { "IsFull", &LuaGroup::IsFull }, - // {"IsLFGGroup", &LuaGroup::IsLFGGroup}, // :IsLFGGroup() - Returns true if the group is an LFG group + // {"IsLFGGroup", &LuaGroup::IsLFGGroup}, // :IsLFGGroup() - UNDOCUMENTED - Returns true if the group is an LFG group { "IsRaidGroup", &LuaGroup::IsRaidGroup }, { "IsBGGroup", &LuaGroup::IsBGGroup }, - // {"IsBFGroup", &LuaGroup::IsBFGroup}, // :IsBFGroup() - Returns true if the group is a battlefield group + // {"IsBFGroup", &LuaGroup::IsBFGroup}, // :IsBFGroup() - UNDOCUMENTED - Returns true if the group is a battlefield group { "IsMember", &LuaGroup::IsMember }, { "IsAssistant", &LuaGroup::IsAssistant }, { "SameSubGroup", &LuaGroup::SameSubGroup }, @@ -1062,47 +1062,45 @@ ElunaRegister GroupMethods[] = // Other { "SendPacket", &LuaGroup::SendPacket }, - // {"ConvertToLFG", &LuaGroup::ConvertToLFG}, // :ConvertToLFG() - Converts the group to an LFG group + // {"ConvertToLFG", &LuaGroup::ConvertToLFG}, // :ConvertToLFG() - UNDOCUMENTED - Converts the group to an LFG group { "ConvertToRaid", &LuaGroup::ConvertToRaid }, - { NULL, NULL }, + { NULL, NULL } }; ElunaRegister GuildMethods[] = { // Getters - { "GetMembers", &LuaGuild::GetMembers }, // :GetMembers() - returns a table containing the players in this guild. (Online?) - { "GetLeader", &LuaGuild::GetLeader }, // :GetLeader() - Returns the guild learder's object - { "GetLeaderGUID", &LuaGuild::GetLeaderGUID }, // :GetLeaderGUID() - Returns the guild learder's guid - { "GetId", &LuaGuild::GetId }, // :GetId() - Gets the guild's ID - { "GetName", &LuaGuild::GetName }, // :GetName() - Gets the guild name - { "GetMOTD", &LuaGuild::GetMOTD }, // :GetMOTD() - Gets the guild MOTD string - { "GetInfo", &LuaGuild::GetInfo }, // :GetInfo() - Gets the guild info string - { "GetMemberCount", &LuaGuild::GetMemberCount }, // :GetMemberCount() - Returns the amount of players in the guild + { "GetMembers", &LuaGuild::GetMembers }, + { "GetLeader", &LuaGuild::GetLeader }, + { "GetLeaderGUID", &LuaGuild::GetLeaderGUID }, + { "GetId", &LuaGuild::GetId }, + { "GetName", &LuaGuild::GetName }, + { "GetMOTD", &LuaGuild::GetMOTD }, + { "GetInfo", &LuaGuild::GetInfo }, + { "GetMemberCount", &LuaGuild::GetMemberCount }, // Setters #ifndef CLASSIC - { "SetBankTabText", &LuaGuild::SetBankTabText }, // :SetBankTabText(tabId, text) + { "SetBankTabText", &LuaGuild::SetBankTabText }, #endif - { "SetMemberRank", &LuaGuild::SetMemberRank }, // :SetMemberRank(player, newRank) - Sets the player rank in the guild to the new rank + { "SetMemberRank", &LuaGuild::SetMemberRank }, #ifndef CATA - { "SetLeader", &LuaGuild::SetLeader }, // :SetLeader() - Sets the guild's leader + { "SetLeader", &LuaGuild::SetLeader }, #endif - // Boolean - // Other - { "SendPacket", &LuaGuild::SendPacket }, // :SendPacket(packet) - sends packet to guild - { "SendPacketToRanked", &LuaGuild::SendPacketToRanked }, // :SendPacketToRanked(packet, rankId) - sends packet to guild, specifying a rankId will only send the packet to your ranked members - { "Disband", &LuaGuild::Disband }, // :Disband() - Disbands the guild - { "AddMember", &LuaGuild::AddMember }, // :AddMember(player, rank) - adds the player to the guild. Rank is optional - { "DeleteMember", &LuaGuild::DeleteMember }, // :DeleteMember(player, disbanding, kicked) - Deletes the player from the guild. Disbanding and kicked are optional bools + { "SendPacket", &LuaGuild::SendPacket }, + { "SendPacketToRanked", &LuaGuild::SendPacketToRanked }, + { "Disband", &LuaGuild::Disband }, + { "AddMember", &LuaGuild::AddMember }, + { "DeleteMember", &LuaGuild::DeleteMember }, #ifndef CLASSIC - { "DepositBankMoney", &LuaGuild::DepositBankMoney }, // :DepositBankMoney(money) - Deposits money into the guild bank - { "WithdrawBankMoney", &LuaGuild::WithdrawBankMoney }, // :WithdrawBankMoney(money) - Withdraws money from the guild bank + { "DepositBankMoney", &LuaGuild::DepositBankMoney }, + { "WithdrawBankMoney", &LuaGuild::WithdrawBankMoney }, #endif - { NULL, NULL }, + { NULL, NULL } }; #ifndef CLASSIC @@ -1110,44 +1108,46 @@ ElunaRegister GuildMethods[] = ElunaRegister VehicleMethods[] = { // Getters - { "GetOwner", &LuaVehicle::GetOwner }, // :GetOwner() - Returns the the vehicle unit - { "GetEntry", &LuaVehicle::GetEntry }, // :GetEntry() - Returns vehicle ID - { "GetPassenger", &LuaVehicle::GetPassenger }, // :GetPassenger(seatId) - Returns the passenger by seatId + { "GetOwner", &LuaVehicle::GetOwner }, + { "GetEntry", &LuaVehicle::GetEntry }, + { "GetPassenger", &LuaVehicle::GetPassenger }, // Boolean - { "IsOnBoard", &LuaVehicle::IsOnBoard }, // :IsOnBoard(unit) - Returns true if the unit is on board + { "IsOnBoard", &LuaVehicle::IsOnBoard }, // Other - { "AddPassenger", &LuaVehicle::AddPassenger }, // :AddPassenger(passenger, seatId) - Adds a vehicle passenger - { "RemovePassenger", &LuaVehicle::RemovePassenger }, // :RemovePassenger(passenger) - Removes the passenger from the vehicle + { "AddPassenger", &LuaVehicle::AddPassenger }, + { "RemovePassenger", &LuaVehicle::RemovePassenger }, - { NULL, NULL }, + { NULL, NULL } }; #endif #endif ElunaRegister QueryMethods[] = { - { "NextRow", &LuaQuery::NextRow }, // :NextRow() - Advances to next rown in the query. Returns true if there is a next row, otherwise false - { "GetColumnCount", &LuaQuery::GetColumnCount }, // :GetColumnCount() - Gets the column count of the query - { "GetRowCount", &LuaQuery::GetRowCount }, // :GetRowCount() - Gets the row count of the query + // Getters + { "GetColumnCount", &LuaQuery::GetColumnCount }, + { "GetRowCount", &LuaQuery::GetRowCount }, { "GetRow", &LuaQuery::GetRow }, + { "GetBool", &LuaQuery::GetBool }, + { "GetUInt8", &LuaQuery::GetUInt8 }, + { "GetUInt16", &LuaQuery::GetUInt16 }, + { "GetUInt32", &LuaQuery::GetUInt32 }, + { "GetUInt64", &LuaQuery::GetUInt64 }, + { "GetInt8", &LuaQuery::GetInt8 }, + { "GetInt16", &LuaQuery::GetInt16 }, + { "GetInt32", &LuaQuery::GetInt32 }, + { "GetInt64", &LuaQuery::GetInt64 }, + { "GetFloat", &LuaQuery::GetFloat }, + { "GetDouble", &LuaQuery::GetDouble }, + { "GetString", &LuaQuery::GetString }, - { "GetBool", &LuaQuery::GetBool }, // :GetBool(column) - returns a bool from a number column (for example tinyint) - { "GetUInt8", &LuaQuery::GetUInt8 }, // :GetUInt8(column) - returns the value of an unsigned tinyint column - { "GetUInt16", &LuaQuery::GetUInt16 }, // :GetUInt16(column) - returns the value of a unsigned smallint column - { "GetUInt32", &LuaQuery::GetUInt32 }, // :GetUInt32(column) - returns the value of an unsigned int or mediumint column - { "GetUInt64", &LuaQuery::GetUInt64 }, // :GetUInt64(column) - returns the value of an unsigned bigint column as string - { "GetInt8", &LuaQuery::GetInt8 }, // :GetInt8(column) - returns the value of an tinyint column - { "GetInt16", &LuaQuery::GetInt16 }, // :GetInt16(column) - returns the value of a smallint column - { "GetInt32", &LuaQuery::GetInt32 }, // :GetInt32(column) - returns the value of an int or mediumint column - { "GetInt64", &LuaQuery::GetInt64 }, // :GetInt64(column) - returns the value of a bigint column as string - { "GetFloat", &LuaQuery::GetFloat }, // :GetFloat(column) - returns the value of a float column - { "GetDouble", &LuaQuery::GetDouble }, // :GetDouble(column) - returns the value of a double column - { "GetString", &LuaQuery::GetString }, // :GetString(column) - returns the value of a string column, always returns a string - { "IsNull", &LuaQuery::IsNull }, // :IsNull(column) - returns true if the column is null + // Boolean + { "NextRow", &LuaQuery::NextRow }, + { "IsNull", &LuaQuery::IsNull }, - { NULL, NULL }, + { NULL, NULL } }; ElunaRegister PacketMethods[] = @@ -1172,59 +1172,62 @@ ElunaRegister PacketMethods[] = { "ReadDouble", &LuaPacket::ReadDouble }, // Writers - { "WriteByte", &LuaPacket::WriteByte }, // :WriteByte(val) - Writes an int8 value - { "WriteUByte", &LuaPacket::WriteUByte }, // :WriteUByte(val) - Writes a uint8 value - { "WriteShort", &LuaPacket::WriteShort }, // :WriteShort(val) - Writes an int16 value - { "WriteUShort", &LuaPacket::WriteUShort }, // :WriteUShort(val) - Writes a uint16 value - { "WriteLong", &LuaPacket::WriteLong }, // :WriteLong(val) - Writes an int32 value - { "WriteULong", &LuaPacket::WriteULong }, // :WriteULong(val) - Writes a uint32 value - { "WriteGUID", &LuaPacket::WriteGUID }, // :WriteGUID(guid) - Writes a uint64 value - { "WriteString", &LuaPacket::WriteString }, // :WriteString(val) - Writes a string value - { "WriteFloat", &LuaPacket::WriteFloat }, // :WriteFloat(val) - Writes a float value - { "WriteDouble", &LuaPacket::WriteDouble }, // :WriteDouble(val) - Writes a double value + { "WriteByte", &LuaPacket::WriteByte }, + { "WriteUByte", &LuaPacket::WriteUByte }, + { "WriteShort", &LuaPacket::WriteShort }, + { "WriteUShort", &LuaPacket::WriteUShort }, + { "WriteLong", &LuaPacket::WriteLong }, + { "WriteULong", &LuaPacket::WriteULong }, + { "WriteGUID", &LuaPacket::WriteGUID }, + { "WriteString", &LuaPacket::WriteString }, + { "WriteFloat", &LuaPacket::WriteFloat }, + { "WriteDouble", &LuaPacket::WriteDouble }, - { NULL, NULL }, + { NULL, NULL } }; ElunaRegister MapMethods[] = { // Getters - { "GetName", &LuaMap::GetName }, // :GetName() - Returns the map's name UNDOCUMENTED - { "GetDifficulty", &LuaMap::GetDifficulty }, // :GetDifficulty() - Returns the map's difficulty UNDOCUMENTED - { "GetInstanceId", &LuaMap::GetInstanceId }, // :GetInstanceId() - Returns the map's instance ID UNDOCUMENTED + { "GetName", &LuaMap::GetName }, + { "GetDifficulty", &LuaMap::GetDifficulty }, + { "GetInstanceId", &LuaMap::GetInstanceId }, { "GetInstanceData", &LuaMap::GetInstanceData }, - { "GetPlayerCount", &LuaMap::GetPlayerCount }, // :GetPlayerCount() - Returns the amount of players on map except GM's UNDOCUMENTED - { "GetMapId", &LuaMap::GetMapId }, // :GetMapId() - Returns the map's ID UNDOCUMENTED - { "GetAreaId", &LuaMap::GetAreaId }, // :GetAreaId(x, y, z) - Returns the map's area ID based on coords UNDOCUMENTED - { "GetHeight", &LuaMap::GetHeight }, // :GetHeight(x, y[, phasemask]) - Returns ground Z coordinate. UNDOCUMENTED - { "GetWorldObject", &LuaMap::GetWorldObject }, // :GetWorldObject(guid) - Returns a worldobject (player, creature, gameobject..) from the map by it's guid + { "GetPlayerCount", &LuaMap::GetPlayerCount }, + { "GetMapId", &LuaMap::GetMapId }, + { "GetAreaId", &LuaMap::GetAreaId }, + { "GetHeight", &LuaMap::GetHeight }, + { "GetWorldObject", &LuaMap::GetWorldObject }, // Setters { "SetWeather", &LuaMap::SetWeather }, - // Booleans + // Boolean #ifndef CLASSIC - { "IsArena", &LuaMap::IsArena }, // :IsArena() - Returns the true if the map is an arena, else false UNDOCUMENTED + { "IsArena", &LuaMap::IsArena }, #endif - { "IsBattleground", &LuaMap::IsBattleground }, // :IsBattleground() - Returns the true if the map is a battleground, else false UNDOCUMENTED - { "IsDungeon", &LuaMap::IsDungeon }, // :IsDungeon() - Returns the true if the map is a dungeon , else false UNDOCUMENTED - { "IsEmpty", &LuaMap::IsEmpty }, // :IsEmpty() - Returns the true if the map is empty, else false UNDOCUMENTED + { "IsBattleground", &LuaMap::IsBattleground }, + { "IsDungeon", &LuaMap::IsDungeon }, + { "IsEmpty", &LuaMap::IsEmpty }, #ifndef CLASSIC - { "IsHeroic", &LuaMap::IsHeroic }, // :IsHeroic() - Returns the true if the map is a heroic dungeon, else false UNDOCUMENTED + { "IsHeroic", &LuaMap::IsHeroic }, #endif - { "IsRaid", &LuaMap::IsRaid }, // :IsRaid() - Returns the true if the map is a raid map, else false UNDOCUMENTED + { "IsRaid", &LuaMap::IsRaid }, // Other { "SaveInstanceData", &LuaMap::SaveInstanceData }, - { NULL, NULL }, + { NULL, NULL } }; ElunaRegister CorpseMethods[] = { + // Getters { "GetOwnerGUID", &LuaCorpse::GetOwnerGUID }, { "GetGhostTime", &LuaCorpse::GetGhostTime }, { "GetType", &LuaCorpse::GetType }, + + // Other { "ResetGhostTime", &LuaCorpse::ResetGhostTime }, { "SaveToDB", &LuaCorpse::SaveToDB }, { "DeleteBonesFromWorld", &LuaCorpse::DeleteBonesFromWorld }, @@ -1259,8 +1262,6 @@ ElunaRegister BattleGroundMethods[] = { "GetWinner", &LuaBattleGround::GetWinner }, { "GetStatus", &LuaBattleGround::GetStatus }, - // Setters - { NULL, NULL } }; diff --git a/ObjectMethods.h b/ObjectMethods.h index c5b0fb6..5dac70b 100644 --- a/ObjectMethods.h +++ b/ObjectMethods.h @@ -24,7 +24,6 @@ */ namespace LuaObject { - /* BOOLEAN */ /** * Returns `true` if the specified flag is set, otherwise `false`. * @@ -52,7 +51,6 @@ namespace LuaObject return 1; } - /* GETTERS */ /** * Returns the data at the specified index, casted to a signed 32-bit integer. * @@ -224,7 +222,6 @@ namespace LuaObject return 0; } - /* SETTERS */ /** * Sets the specified flag in the data value at the specified index. * @@ -376,7 +373,6 @@ namespace LuaObject return 0; } - /* OTHER */ /** * Removes a flag from the value at the specified index. * diff --git a/PlayerHooks.cpp b/PlayerHooks.cpp index 4759024..93ee9b9 100644 --- a/PlayerHooks.cpp +++ b/PlayerHooks.cpp @@ -39,7 +39,6 @@ void Eluna::OnLearnTalents(Player* pPlayer, uint32 talentId, uint32 talentRank, CallAllFunctions(PlayerEventBindings, key); } -// Player bool Eluna::OnCommand(Player* player, const char* text) { // If from console, player is NULL diff --git a/PlayerMethods.h b/PlayerMethods.h index 9856c0f..5d720ca 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -12,7 +12,6 @@ */ namespace LuaPlayer { - /* BOOLEAN */ #if (!defined(TBC) && !defined(CLASSIC)) /** * Returns 'true' if the [Player] can Titan Grip, 'false' otherwise. @@ -102,6 +101,12 @@ namespace LuaPlayer return 1; } + /** + * Returns true if [Player] has specified login flag + * + * @param uint32 flag + * @return bool hasLoginFlag + */ int HasAtLoginFlag(Eluna* /*E*/, lua_State* L, Player* player) { uint32 flag = Eluna::CHECKVAL(L, 2); @@ -110,6 +115,12 @@ namespace LuaPlayer return 1; } + /** + * Returns true if [Player] has [Quest] for [GameObject] + * + * @param int32 entry : entry of a [GameObject] + * @return bool hasQuest + */ int HasQuestForGO(Eluna* /*E*/, lua_State* L, Player* player) { int32 entry = Eluna::CHECKVAL(L, 2); @@ -260,6 +271,12 @@ namespace LuaPlayer #endif #ifdef CLASSIC + /** + * Returns [Player] kills + * + * @param bool honorable = true : if victims are honorable + * @return uint32 kills + */ int GetHonorStoredKills(Eluna* /*E*/, lua_State* L, Player* player) { bool honorable = Eluna::CHECKVAL(L, 2, true); @@ -268,12 +285,22 @@ namespace LuaPlayer return 1; } + /** + * Returns rank points + * + * @return float rankPoints + */ int GetRankPoints(Eluna* /*E*/, lua_State* L, Player* player) { Eluna::Push(L, player->GetRankPoints()); return 1; } + /** + * Returns last week's standing position + * + * @return int32 standingPos + */ int GetHonorLastWeekStandingPos(Eluna* /*E*/, lua_State* L, Player* player) { Eluna::Push(L, player->GetHonorLastWeekStandingPos()); @@ -648,64 +675,63 @@ namespace LuaPlayer /*int HasReceivedQuestReward(Eluna* E, lua_State* L, Player* player) { - uint32 entry = Eluna::CHECKVAL(L, 2); + uint32 entry = Eluna::CHECKVAL(L, 2); - Eluna::Push(L, player->IsQuestRewarded(entry)); - return 1; + Eluna::Push(L, player->IsQuestRewarded(entry)); + return 1; }*/ /*int IsOutdoorPvPActive(Eluna* E, lua_State* L, Player* player) { - Eluna::Push(L, player->IsOutdoorPvPActive()); - return 1; + Eluna::Push(L, player->IsOutdoorPvPActive()); + return 1; }*/ /*int IsImmuneToEnvironmentalDamage(Eluna* E, lua_State* L, Player* player) { - Eluna::Push(L, player->IsImmuneToEnvironmentalDamage()); - return 1; + Eluna::Push(L, player->IsImmuneToEnvironmentalDamage()); + return 1; }*/ /*int InRandomLfgDungeon(Eluna* E, lua_State* L, Player* player) { - Eluna::Push(L, player->inRandomLfgDungeon()); - return 1; + Eluna::Push(L, player->inRandomLfgDungeon()); + return 1; }*/ /*int IsUsingLfg(Eluna* E, lua_State* L, Player* player) { - Eluna::Push(L, player->isUsingLfg()); - return 1; + Eluna::Push(L, player->isUsingLfg()); + return 1; }*/ /*int IsNeverVisible(Eluna* E, lua_State* L, Player* player) { - Eluna::Push(L, player->IsNeverVisible()); - return 1; + Eluna::Push(L, player->IsNeverVisible()); + return 1; }*/ /*int CanFlyInZone(Eluna* E, lua_State* L, Player* player) { - uint32 mapid = Eluna::CHECKVAL(L, 2); - uint32 zone = Eluna::CHECKVAL(L, 2); + uint32 mapid = Eluna::CHECKVAL(L, 2); + uint32 zone = Eluna::CHECKVAL(L, 2); - Eluna::Push(L, player->IsKnowHowFlyIn(mapid, zone)); - return 1; + Eluna::Push(L, player->IsKnowHowFlyIn(mapid, zone)); + return 1; }*/ /*int HasPendingBind(Eluna* E, lua_State* L, Player* player) { - Eluna::Push(L, player->PendingHasPendingBind()); - return 1; + Eluna::Push(L, player->PendingHasPendingBind()); + return 1; }*/ /*int IsARecruiter(Eluna* E, lua_State* L, Player* player) { - Eluna::Push(L, player->GetSession()->IsARecruiter() || (player->GetSession()->GetRecruiterId() != 0)); - return 1; + Eluna::Push(L, player->GetSession()->IsARecruiter() || (player->GetSession()->GetRecruiterId() != 0)); + return 1; }*/ - /* GETTERS */ #if (!defined(TBC) && !defined(CLASSIC)) /** * Returns the amount of available specs the [Player] currently has @@ -869,12 +895,23 @@ namespace LuaPlayer return 1; } + /** + * Returns [Group] invitation + * + * @return [Group] group + */ int GetGroupInvite(Eluna* /*E*/, lua_State* L, Player* player) { Eluna::Push(L, player->GetGroupInvite()); return 1; } + /** + * Returns rested experience bonus + * + * @param uint32 xp + * @return uint32 xpBonus + */ int GetXPRestBonus(Eluna* /*E*/, lua_State* L, Player* player) { uint32 xp = Eluna::CHECKVAL(L, 2); @@ -938,6 +975,12 @@ namespace LuaPlayer return 1; } + /** + * Returns skill temporary bonus value + * + * @param uint32 skill + * @param int16 bonusVal + */ int GetSkillTempBonusValue(Eluna* /*E*/, lua_State* L, Player* player) { uint32 skill = Eluna::CHECKVAL(L, 2); @@ -946,6 +989,12 @@ namespace LuaPlayer return 1; } + /** + * Returns skill permanent bonus value + * + * @param uint32 skill + * @param int16 bonusVal + */ int GetSkillPermBonusValue(Eluna* /*E*/, lua_State* L, Player* player) { uint32 skill = Eluna::CHECKVAL(L, 2); @@ -954,6 +1003,12 @@ namespace LuaPlayer return 1; } + /** + * Returns skill value without bonus' + * + * @param uint32 skill + * @return uint16 pureVal + */ int GetPureSkillValue(Eluna* /*E*/, lua_State* L, Player* player) { uint32 skill = Eluna::CHECKVAL(L, 2); @@ -962,6 +1017,12 @@ namespace LuaPlayer return 1; } + /** + * Returns base skill value + * + * @param uint32 skill + * @return uint16 baseVal + */ int GetBaseSkillValue(Eluna* /*E*/, lua_State* L, Player* player) { uint32 skill = Eluna::CHECKVAL(L, 2); @@ -970,6 +1031,12 @@ namespace LuaPlayer return 1; } + /** + * Returns skill value + * + * @param uint32 skill + * @return uint16 val + */ int GetSkillValue(Eluna* /*E*/, lua_State* L, Player* player) { uint32 skill = Eluna::CHECKVAL(L, 2); @@ -978,6 +1045,12 @@ namespace LuaPlayer return 1; } + /** + * Returns max value of specified skill without bonus' + * + * @param uint32 skill + * @return uint16 pureVal + */ int GetPureMaxSkillValue(Eluna* /*E*/, lua_State* L, Player* player) { uint32 skill = Eluna::CHECKVAL(L, 2); @@ -986,6 +1059,12 @@ namespace LuaPlayer return 1; } + /** + * Returns max value of specified skill + * + * @param uint32 skill + * @return uint16 val + */ int GetMaxSkillValue(Eluna* /*E*/, lua_State* L, Player* player) { uint32 skill = Eluna::CHECKVAL(L, 2); @@ -994,18 +1073,34 @@ namespace LuaPlayer return 1; } + /** + * Returns mana bonus from amount of intellect + * + * @return float bonus + */ int GetManaBonusFromIntellect(Eluna* /*E*/, lua_State* L, Player* player) { Eluna::Push(L, player->GetManaBonusFromIntellect()); return 1; } + /** + * Returns health bonus from amount of stamina + * + * @return float bonus + */ int GetHealthBonusFromStamina(Eluna* /*E*/, lua_State* L, Player* player) { Eluna::Push(L, player->GetHealthBonusFromStamina()); return 1; } + /** + * Returns raid or dungeon difficulty + * + * @param bool isRaid = true : argument is TrinityCore only + * @return int32 difficulty + */ int GetDifficulty(Eluna* /*E*/, lua_State* L, Player* player) { #ifdef TBC @@ -1068,6 +1163,11 @@ namespace LuaPlayer return 1; } + /** + * Returns [Unit] target combo points are on + * + * @return [Unit] target + */ int GetComboTarget(Eluna* /*E*/, lua_State* L, Player* player) { #ifndef TRINITY @@ -1078,6 +1178,11 @@ namespace LuaPlayer return 1; } + /** + * Returns [Player]'s combo points + * + * @return uint8 comboPoints + */ int GetComboPoints(Eluna* /*E*/, lua_State* L, Player* player) { Eluna::Push(L, player->GetComboPoints()); @@ -1123,6 +1228,13 @@ namespace LuaPlayer return 1; } + /** + * Returns [Quest] required [Creature] or [GameObject] count + * + * @param uint32 quest : entry of a quest + * @param int32 entry : entry of required [Creature] + * @return uint16 count + */ int GetReqKillOrCastCurrentCount(Eluna* /*E*/, lua_State* L, Player* player) { uint32 questId = Eluna::CHECKVAL(L, 2); @@ -1178,6 +1290,11 @@ namespace LuaPlayer return 1; } + /** + * Returns active GM chat tag + * + * @return uint8 tag + */ int GetChatTag(Eluna* /*E*/, lua_State* L, Player* player) { Eluna::Push(L, player->GetChatTag()); @@ -1461,29 +1578,27 @@ namespace LuaPlayer /*int GetRecruiterId(Eluna* E, lua_State* L, Player* player) { - Eluna::Push(L, player->GetSession()->GetRecruiterId()); - return 1; + Eluna::Push(L, player->GetSession()->GetRecruiterId()); + return 1; }*/ /*int GetSelectedPlayer(Eluna* E, lua_State* L, Player* player) { - Eluna::Push(L, player->GetSelectedPlayer()); - return 1; + Eluna::Push(L, player->GetSelectedPlayer()); + return 1; }*/ /*int GetSelectedUnit(Eluna* E, lua_State* L, Player* player) { - Eluna::Push(L, player->GetSelectedUnit()); - return 1; + Eluna::Push(L, player->GetSelectedUnit()); + return 1; }*/ /*int GetNearbyGameObject(Eluna* E, lua_State* L, Player* player) { - Eluna::Push(L, ChatHandler(player->GetSession()).GetNearbyGameObject()); - return 1; + Eluna::Push(L, ChatHandler(player->GetSession()).GetNearbyGameObject()); + return 1; }*/ - - /* SETTERS */ /** * Locks the player controls and disallows all movement and casting. @@ -1561,6 +1676,14 @@ namespace LuaPlayer return 0; } + /** + * Sets (increases) skill of the [Player] + * + * @param uint16 id + * @param uint16 step + * @param uint16 currVal + * @param uint16 maxVal + */ int SetSkill(Eluna* /*E*/, lua_State* L, Player* player) { uint16 id = Eluna::CHECKVAL(L, 2); @@ -1620,6 +1743,12 @@ namespace LuaPlayer return 0; } + /** + * Sets [Quest] state + * + * @param uint32 entry : entry of a quest + * @param uint32 status + */ int SetQuestStatus(Eluna* /*E*/, lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); @@ -1657,6 +1786,11 @@ namespace LuaPlayer return 0; } + /** + * Toggles PvP Death + * + * @param bool on = true + */ int SetPvPDeath(Eluna* /*E*/, lua_State* L, Player* player) { bool on = Eluna::CHECKVAL(L, 2, true); @@ -1691,6 +1825,11 @@ namespace LuaPlayer return 0; } + /** + * Toggle Blizz (GM) tag + * + * @param bool on = true + */ int SetGMChat(Eluna* /*E*/, lua_State* L, Player* player) { bool on = Eluna::CHECKVAL(L, 2, true); @@ -1772,6 +1911,12 @@ namespace LuaPlayer #endif #ifdef CLASSIC + /** + * Sets kills + * + * @param uint32 kills + * @param bool honorable = true : if victims were honorable + */ int SetHonorStoredKills(Eluna* /*E*/, lua_State* L, Player* player) { uint32 kills = Eluna::CHECKVAL(L, 2); @@ -1781,6 +1926,11 @@ namespace LuaPlayer return 0; } + /** + * Sets rank points + * + * @param float rankPoints + */ int SetRankPoints(Eluna* /*E*/, lua_State* L, Player* player) { float rankPoints = Eluna::CHECKVAL(L, 2); @@ -1789,6 +1939,11 @@ namespace LuaPlayer return 0; } + /** + * Sets last week's honor standing position + * + * @param int32 standingPos + */ int SetHonorLastWeekStandingPos(Eluna* /*E*/, lua_State* L, Player* player) { int32 standingPos = Eluna::CHECKVAL(L, 2); @@ -1881,13 +2036,12 @@ namespace LuaPlayer /*int SetMovement(Eluna* E, lua_State* L, Player* player) { - int32 pType = Eluna::CHECKVAL(L, 2); + int32 pType = Eluna::CHECKVAL(L, 2); - player->SetMovement((PlayerMovementType)pType); - return 0; + player->SetMovement((PlayerMovementType)pType); + return 0; }*/ - /* OTHER */ #if (!defined(TBC) && !defined(CLASSIC)) /** * Resets the [Player]s pets talent points @@ -2028,6 +2182,9 @@ namespace LuaPlayer return 0; } + /** + * Creates the [Player]'s corpse + */ int CreateCorpse(Eluna* /*E*/, lua_State* /*L*/, Player* player) { player->CreateCorpse(); @@ -2261,6 +2418,15 @@ namespace LuaPlayer return 0; } + /** + * Repairs [Item] at specified position. Returns total repair cost + * + * @param uint16 position + * @param bool cost = true + * @param float discountMod + * @param bool guildBank = false + * @return uint32 totalCost + */ int DurabilityRepair(Eluna* /*E*/, lua_State* L, Player* player) { uint16 position = Eluna::CHECKVAL(L, 2); @@ -2276,6 +2442,14 @@ namespace LuaPlayer return 1; } + /** + * Repairs all [Item]s. Returns total repair cost + * + * @param bool cost = true + * @param float discountMod = 1 + * @param bool guidBank = false + * @return uint32 totalCost + */ int DurabilityRepairAll(Eluna* /*E*/, lua_State* L, Player* player) { bool cost = Eluna::CHECKVAL(L, 2, true); @@ -2290,6 +2464,11 @@ namespace LuaPlayer return 1; } + /** + * Sets durability loss for an [Item] in the specified slot + * + * @param int32 slot + */ int DurabilityPointLossForEquipSlot(Eluna* /*E*/, lua_State* L, Player* player) { int32 slot = Eluna::CHECKVAL(L, 2); @@ -2299,6 +2478,14 @@ namespace LuaPlayer return 0; } + /** + * Sets durability loss on all [Item]s equipped + * + * If inventory is true, sets durability loss for [Item]s in bags + * + * @param int32 points + * @param bool inventory = true + */ int DurabilityPointsLossAll(Eluna* /*E*/, lua_State* L, Player* player) { int32 points = Eluna::CHECKVAL(L, 2); @@ -2308,6 +2495,12 @@ namespace LuaPlayer return 0; } + /** + * Sets durability loss for the specified [Item] + * + * @param [Item] item + * @param int32 points + */ int DurabilityPointsLoss(Eluna* /*E*/, lua_State* L, Player* player) { Item* item = Eluna::CHECKOBJ(L, 2); @@ -2317,6 +2510,12 @@ namespace LuaPlayer return 0; } + /** + * Damages specified [Item] + * + * @param [Item] item + * @param double percent + */ int DurabilityLoss(Eluna* /*E*/, lua_State* L, Player* player) { Item* item = Eluna::CHECKOBJ(L, 2); @@ -2326,6 +2525,12 @@ namespace LuaPlayer return 0; } + /** + * Damages all [Item]s equipped. If inventory is true, damages [Item]s in bags + * + * @param double percent + * @param bool inventory = true + */ int DurabilityLossAll(Eluna* /*E*/, lua_State* L, Player* player) { double percent = Eluna::CHECKVAL(L, 2); @@ -2399,6 +2604,13 @@ namespace LuaPlayer return 0; } + /** + * Removes the [Spell] from the [Player] + * + * @param uint32 entry : entry of a [Spell] + * @param bool disabled = false + * @param bool learnLowRank = true + */ int RemoveSpell(Eluna* /*E*/, lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); @@ -2422,6 +2634,12 @@ namespace LuaPlayer return 0; } + /** + * Adds combo points to the [Player] + * + * @param [Unit] target + * @param int8 count + */ int AddComboPoints(Eluna* /*E*/, lua_State* L, Player* player) { Unit* target = Eluna::CHECKOBJ(L, 2); @@ -2431,6 +2649,12 @@ namespace LuaPlayer return 0; } + /** + * Gives [Quest] monster talked to credit + * + * @param uint32 entry : entry of a [Creature] + * @param [Creature] creature + */ int TalkedToCreature(Eluna* /*E*/, lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); @@ -2440,6 +2664,11 @@ namespace LuaPlayer return 0; } + /** + * Gives [Quest] monster killed credit + * + * @param uint32 entry : entry of a [Creature] + */ int KilledMonsterCredit(Eluna* /*E*/, lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); @@ -2448,6 +2677,12 @@ namespace LuaPlayer return 0; } + /** + * Completes a [Quest] if in a [Group] + * + * @param uint32 quest : entry of a quest + * @param [WorldObject] obj + */ int GroupEventHappens(Eluna* /*E*/, lua_State* L, Player* player) { uint32 questId = Eluna::CHECKVAL(L, 2); @@ -2457,6 +2692,11 @@ namespace LuaPlayer return 0; } + /** + * Completes the [Quest] if a [Quest] area is explored, or completes the [Quest] + * + * @param uint32 quest : entry of a [Quest] + */ int AreaExploredOrEventHappens(Eluna* /*E*/, lua_State* L, Player* player) { uint32 questId = Eluna::CHECKVAL(L, 2); @@ -2466,9 +2706,9 @@ namespace LuaPlayer } /** - * Sets the given quest entry failed for the [Player]. + * Sets the given [Quest] entry failed for the [Player]. * - * @param uint32 entry : quest entry + * @param uint32 entry : entry of a [Quest] */ int FailQuest(Eluna* /*E*/, lua_State* L, Player* player) { @@ -2715,6 +2955,14 @@ namespace LuaPlayer return 0; } + /** + * Sends whisper text from the [Player] + * + * @param string text + * @param uint32 lang : language the [Player] will speak + * @param [Player] receiver : is the [Player] that will receive the whisper, if TrinityCore + * @param uint64 guid : is the GUID of a [Player] that will receive the whisper, not TrinityCore + */ int Whisper(Eluna* /*E*/, lua_State* L, Player* player) { std::string text = Eluna::CHECKVAL(L, 2); @@ -2745,6 +2993,12 @@ namespace LuaPlayer return 0; } + /** + * Sends yell text from the [Player] + * + * @param string text : text for the [Player] to yells + * @param uint32 lang : language the [Player] will speak + */ int Yell(Eluna* /*E*/, lua_State* L, Player* player) { std::string text = Eluna::CHECKVAL(L, 2); @@ -2757,6 +3011,12 @@ namespace LuaPlayer return 0; } + /** + * Sends say text from the [Player] + * + * @param string text : text for the [Player] to say + * @param uint32 lang : language the [Player] will speak + */ int Say(Eluna* /*E*/, lua_State* L, Player* player) { std::string text = Eluna::CHECKVAL(L, 2); @@ -2769,6 +3029,12 @@ namespace LuaPlayer return 0; } + /** + * Gives the [Player] experience + * + * @param uint32 xp : experience to give + * @param [Unit] victim = nil + */ int GiveXP(Eluna* /*E*/, lua_State* L, Player* player) { uint32 xp = Eluna::CHECKVAL(L, 2); @@ -3063,6 +3329,11 @@ namespace LuaPlayer return 0; } + /** + * Removes specified amount of lifetime kills + * + * @param uint32 val : kills to remove + */ int RemoveLifetimeKills(Eluna* /*E*/, lua_State* L, Player* player) { uint32 val = Eluna::CHECKVAL(L, 2); @@ -3073,6 +3344,12 @@ namespace LuaPlayer return 0; } + /** + * Resets cooldown of the specified spell + * + * @param uint32 spellId + * @param bool update = true + */ int ResetSpellCooldown(Eluna* /*E*/, lua_State* L, Player* player) { uint32 spellId = Eluna::CHECKVAL(L, 2); @@ -3085,6 +3362,12 @@ namespace LuaPlayer return 0; } + /** + * Resets cooldown of the specified category + * + * @param uint32 category + * @param bool update = true + */ int ResetTypeCooldowns(Eluna* /*E*/, lua_State* L, Player* player) { uint32 category = Eluna::CHECKVAL(L, 2); @@ -3103,7 +3386,7 @@ namespace LuaPlayer } /** - * Resets all of the [Player]s cooldowns + * Resets all of the [Player]'s cooldowns */ int ResetAllCooldowns(Eluna* /*E*/, lua_State* /*L*/, Player* player) { @@ -3115,6 +3398,12 @@ namespace LuaPlayer return 0; } + /** + * Clears a cooldown of the specified spell + * + * @param uint32 spellId : entry of a spell + * @param [Unit] target + */ int SendClearCooldowns(Eluna* /*E*/, lua_State* L, Player* player) { uint32 spellId = Eluna::CHECKVAL(L, 2); @@ -3127,6 +3416,7 @@ namespace LuaPlayer #endif return 0; } + /** * Sends a Broadcast Message to the [Player] * @@ -3183,6 +3473,16 @@ namespace LuaPlayer return 0; } + /** + * Sends addon message to the [Player] receiver + * + * @param string prefix + * @param string message + * @param uint8 channel + * @param [Player] receiver + * @param string fullMsg + * + */ int SendAddonMessage(Eluna* /*E*/, lua_State* L, Player* player) { std::string prefix = Eluna::CHECKVAL(L, 2); @@ -3371,6 +3671,13 @@ namespace LuaPlayer return 0; } + /** + * Plays sound to [Player] + * + * See [Unit]:PlayDirectSound + * + * @param uint32 sound : entry of a sound + */ int PlaySoundToPlayer(Eluna* /*E*/, lua_State* L, Player* player) { uint32 soundId = Eluna::CHECKVAL(L, 2); @@ -3395,6 +3702,16 @@ namespace LuaPlayer return 0; } + /** + * Sends POI to the location on your map + * + * @param float x + * @param float y + * @param uint32 icon : map icon to show + * @param uint32 flags + * @param uint32 data + * @param string iconText + */ int GossipSendPOI(Eluna* /*E*/, lua_State* L, Player* player) { float x = Eluna::CHECKVAL(L, 2); @@ -3456,12 +3773,20 @@ namespace LuaPlayer return 0; } + /** + * Converts [Player]'s corpse to bones + */ int SpawnBones(Eluna* /*E*/, lua_State* /*L*/, Player* player) { player->SpawnCorpseBones(); return 0; } + /** + * Loots [Player]'s bones for insignia + * + * @param [Player] looter + */ int RemovedInsignia(Eluna* /*E*/, lua_State* L, Player* player) { Player* looter = Eluna::CHECKOBJ(L, 2); diff --git a/QuestMethods.h b/QuestMethods.h index d2071ef..b157775 100644 --- a/QuestMethods.h +++ b/QuestMethods.h @@ -180,8 +180,8 @@ namespace LuaQuest /*int GetMaxLevel(Eluna* E, lua_State* L, Quest* quest) { - Eluna::Push(L, quest->GetMaxLevel()); - return 1; + Eluna::Push(L, quest->GetMaxLevel()); + return 1; }*/ }; #endif diff --git a/ServerHooks.cpp b/ServerHooks.cpp index 69cb5be..2ab3da7 100644 --- a/ServerHooks.cpp +++ b/ServerHooks.cpp @@ -85,7 +85,7 @@ void Eluna::OnLuaStateOpen() CallAllFunctions(ServerEventBindings, key); } -// areatrigger +// AreaTrigger bool Eluna::OnAreaTrigger(Player* pPlayer, AreaTriggerEntry const* pTrigger) { START_HOOK_WITH_RETVAL(TRIGGER_EVENT_ON_TRIGGER, false); @@ -94,7 +94,7 @@ bool Eluna::OnAreaTrigger(Player* pPlayer, AreaTriggerEntry const* pTrigger) return CallAllFunctionsBool(ServerEventBindings, key); } -// weather +// Weather void Eluna::OnChange(Weather* weather, uint32 zone, WeatherState state, float grade) { START_HOOK(WEATHER_EVENT_ON_CHANGE); diff --git a/UnitMethods.h b/UnitMethods.h index cd454cb..b333086 100644 --- a/UnitMethods.h +++ b/UnitMethods.h @@ -12,7 +12,13 @@ */ namespace LuaUnit { - /* BOOLEAN */ + /** + * The [Unit] tries to attack a given target + * + * @param [Unit] who : [Unit] to attack + * @param bool meleeAttack = false: attack with melee or not + * @return didAttack : if the [Unit] did not attack + */ int Attack(Eluna* /*E*/, lua_State* L, Unit* unit) { Unit* who = Eluna::CHECKOBJ(L, 2); @@ -22,6 +28,11 @@ namespace LuaUnit return 1; } + /** + * The [Unit] stops attacking its target + * + * @return bool isAttacking : if the [Unit] wasn't attacking already + */ int AttackStop(Eluna* /*E*/, lua_State* L, Unit* unit) { Eluna::Push(L, unit->AttackStop()); @@ -574,23 +585,21 @@ namespace LuaUnit /*int IsVisible(Eluna* E, lua_State* L, Unit* unit) { - Eluna::Push(L, unit->IsVisible()); - return 1; + Eluna::Push(L, unit->IsVisible()); + return 1; }*/ /*int IsMoving(Eluna* E, lua_State* L, Unit* unit) { - Eluna::Push(L, unit->isMoving()); - return 1; + Eluna::Push(L, unit->isMoving()); + return 1; }*/ /*int IsFlying(Eluna* E, lua_State* L, Unit* unit) { - Eluna::Push(L, unit->IsFlying()); - return 1; + Eluna::Push(L, unit->IsFlying()); + return 1; }*/ - - /* GETTERS */ /** * Returns the [Unit]'s owner. @@ -719,6 +728,12 @@ namespace LuaUnit return 1; } + /** + * Returns [Unit]'s specified stat + * + * @param uint32 statType + * @return float stat + */ int GetStat(Eluna* /*E*/, lua_State* L, Unit* unit) { uint32 stat = Eluna::CHECKVAL(L, 2); @@ -730,6 +745,12 @@ namespace LuaUnit return 1; } + /** + * Returns the [Unit]'s base spell power + * + * @param uint32 spellSchool + * @return uint32 spellPower + */ int GetBaseSpellPower(Eluna* /*E*/, lua_State* L, Unit* unit) { uint32 spellschool = Eluna::CHECKVAL(L, 2); @@ -1142,6 +1163,11 @@ namespace LuaUnit return 1; } + /** + * Returns the [Unit]'s combat timer + * + * @return uint32 combatTimer + */ int GetCombatTime(Eluna* /*E*/, lua_State* L, Unit* unit) { Eluna::Push(L, unit->GetCombatTimer()); @@ -1225,6 +1251,11 @@ namespace LuaUnit } #if (!defined(TBC) && !defined(CLASSIC)) + /** + * Returns [Unit]'s [Vehicle] methods + * + * @return [Vehicle] vehicle + */ int GetVehicleKit(Eluna* /*E*/, lua_State* L, Unit* unit) { #ifndef TRINITY @@ -1243,6 +1274,11 @@ namespace LuaUnit } */ + /** + * Returns the Critter Guid + * + * @return uint64 critterGuid + */ int GetCritterGUID(Eluna* /*E*/, lua_State* L, Unit* unit) { #ifndef TRINITY @@ -1327,8 +1363,6 @@ namespace LuaUnit return 1; } - /* SETTERS */ - /** * Sets the [Unit]'s owner GUID to given GUID. * @@ -1636,6 +1670,11 @@ namespace LuaUnit return 0; } + /** + * Sets creator GUID + * + * @param uint64 guid + */ int SetCreatorGUID(Eluna* /*E*/, lua_State* L, Unit* unit) { uint64 guid = Eluna::CHECKVAL(L, 2); @@ -1647,6 +1686,11 @@ namespace LuaUnit return 0; } + /** + * Sets charmer GUID + * + * @param uint64 guid + */ int SetCharmerGUID(Eluna* /*E*/, lua_State* L, Unit* unit) { uint64 guid = Eluna::CHECKVAL(L, 2); @@ -1658,6 +1702,11 @@ namespace LuaUnit return 0; } + /** + * Sets pet GUID + * + * @param uint64 guid + */ int SetPetGUID(Eluna* /*E*/, lua_State* L, Unit* unit) { uint64 guid = Eluna::CHECKVAL(L, 2); @@ -1669,6 +1718,11 @@ namespace LuaUnit return 0; } + /** + * Toggles (Sets) [Unit]'s water walking + * + * @param bool enable = true + */ int SetWaterWalk(Eluna* /*E*/, lua_State* L, Unit* unit) { bool enable = Eluna::CHECKVAL(L, 2, true); @@ -1680,6 +1734,11 @@ namespace LuaUnit return 0; } + /** + * Sets the [Unit]'s stand state + * + * @param uint8 state : stand state + */ int SetStandState(Eluna* /*E*/, lua_State* L, Unit* unit) { uint8 state = Eluna::CHECKVAL(L, 2); @@ -1820,20 +1879,18 @@ namespace LuaUnit /*int SetCanFly(Eluna* E, lua_State* L, Unit* unit) { - bool apply = Eluna::CHECKVAL(L, 2, true); - unit->SetCanFly(apply); - return 0; + bool apply = Eluna::CHECKVAL(L, 2, true); + unit->SetCanFly(apply); + return 0; }*/ /*int SetVisible(Eluna* E, lua_State* L, Unit* unit) { - bool x = Eluna::CHECKVAL(L, 2, true); - unit->SetVisible(x); - return 0; + bool x = Eluna::CHECKVAL(L, 2, true); + unit->SetVisible(x); + return 0; }*/ - /* OTHER */ - /** * Clears the [Unit]'s threat list. */ @@ -1890,18 +1947,36 @@ namespace LuaUnit return 0; } + /** + * Returns calculated percentage from Health + * + * @return int32 percentage + */ int CountPctFromCurHealth(Eluna* /*E*/, lua_State* L, Unit* unit) { Eluna::Push(L, unit->CountPctFromCurHealth(Eluna::CHECKVAL(L, 2))); return 1; } + /** + * Returns calculated percentage from Max Health + * + * @return int32 percentage + */ int CountPctFromMaxHealth(Eluna* /*E*/, lua_State* L, Unit* unit) { Eluna::Push(L, unit->CountPctFromMaxHealth(Eluna::CHECKVAL(L, 2))); return 1; } + /** + * Sends chat message to [Player] + * + * @param uint8 type : chat, whisper, etc + * @param uint32 lang : language to speak + * @param string msg + * @param [Player] target + */ int SendChatMessageToPlayer(Eluna* /*E*/, lua_State* L, Unit* unit) { uint8 type = Eluna::CHECKVAL(L, 2); @@ -1924,19 +1999,27 @@ namespace LuaUnit return 0; } - // static void PrepareMove(Unit* unit) - // { - // unit->GetMotionMaster()->MovementExpired(); // Chase - // unit->StopMoving(); // Some - // unit->GetMotionMaster()->Clear(); // all - // } + /*static void PrepareMove(Unit* unit) + { + unit->GetMotionMaster()->MovementExpired(); // Chase + unit->StopMoving(); // Some + unit->GetMotionMaster()->Clear(); // all + }*/ + /** + * Stops the [Unit]'s movement + */ int MoveStop(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) { unit->StopMoving(); return 0; } + /** + * The [Unit]'s movement expires and clears movement + * + * @param bool reset = true : cleans movement + */ int MoveExpire(Eluna* /*E*/, lua_State* L, Unit* unit) { bool reset = Eluna::CHECKVAL(L, 2, true); @@ -1944,6 +2027,11 @@ namespace LuaUnit return 0; } + /** + * Clears the [Unit]'s movement + * + * @param bool reset = true : clean movement + */ int MoveClear(Eluna* /*E*/, lua_State* L, Unit* unit) { bool reset = Eluna::CHECKVAL(L, 2, true); @@ -1951,12 +2039,20 @@ namespace LuaUnit return 0; } + /** + * The [Unit] will be idle + */ int MoveIdle(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) { unit->GetMotionMaster()->MoveIdle(); return 0; } + /** + * The [Unit] will move at random + * + * @param float radius : limit on how far the [Unit] will move at random + */ int MoveRandom(Eluna* /*E*/, lua_State* L, Unit* unit) { float radius = Eluna::CHECKVAL(L, 2); @@ -1970,12 +2066,22 @@ namespace LuaUnit return 0; } + /** + * The [Unit] will move to its set home location + */ int MoveHome(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) { unit->GetMotionMaster()->MoveTargetedHome(); return 0; } + /** + * The [Unit] will follow the target + * + * @param [Unit] target : target to follow + * @param float dist = 0 : distance to start following + * @param float angle = 0 + */ int MoveFollow(Eluna* /*E*/, lua_State* L, Unit* unit) { Unit* target = Eluna::CHECKOBJ(L, 2); @@ -1985,6 +2091,13 @@ namespace LuaUnit return 0; } + /** + * The [Unit] will chase the target + * + * @param [Unit] target : target to chase + * @param float dist = 0 : distance start chasing + * @param float angle = 0 + */ int MoveChase(Eluna* /*E*/, lua_State* L, Unit* unit) { Unit* target = Eluna::CHECKOBJ(L, 2); @@ -1994,12 +2107,21 @@ namespace LuaUnit return 0; } + /** + * The [Unit] will move confused + */ int MoveConfused(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) { unit->GetMotionMaster()->MoveConfused(); return 0; } + /** + * The [Unit] will flee + * + * @param [Unit] target + * @param uint32 time = 0 : flee delay + */ int MoveFleeing(Eluna* /*E*/, lua_State* L, Unit* unit) { Unit* target = Eluna::CHECKOBJ(L, 2); @@ -2008,6 +2130,15 @@ namespace LuaUnit return 0; } + /** + * The [Unit] will move to the coordinates + * + * @param uint32 id : unique waypoint Id + * @param float x + * @param float y + * @param float z + * @param bool genPath = true : if true, generates path + */ int MoveTo(Eluna* /*E*/, lua_State* L, Unit* unit) { uint32 id = Eluna::CHECKVAL(L, 2); @@ -2020,6 +2151,16 @@ namespace LuaUnit } #if (!defined(TBC) && !defined(CLASSIC)) + /** + * Makes the [Unit] jump to the coordinates + * + * @param float x + * @param float y + * @param float z + * @param float zSpeed : start velocity + * @param float maxHeight : maximum height + * @param uint32 id = 0 : unique movement Id + */ int MoveJump(Eluna* /*E*/, lua_State* L, Unit* unit) { float x = Eluna::CHECKVAL(L, 2); @@ -2033,6 +2174,14 @@ namespace LuaUnit } #endif + /** + * The [Unit] will whisper the message to a [Player] + * + * @param string msg : message for the [Unit] to emote + * @param lang : language for the [Unit] to speak + * @param [Player] receiver : specific [Unit] to receive the message + * @param bool bossWhisper = false : is a boss whisper + */ int SendUnitWhisper(Eluna* /*E*/, lua_State* L, Unit* unit) { const char* msg = Eluna::CHECKVAL(L, 2); @@ -2048,6 +2197,13 @@ namespace LuaUnit return 0; } + /** + * The [Unit] will emote the message + * + * @param string msg : message for the [Unit] to emote + * @param [Unit] receiver = nil : specific [Unit] to receive the message + * @param bool bossEmote = false : is a boss emote + */ int SendUnitEmote(Eluna* /*E*/, lua_State* L, Unit* unit) { const char* msg = Eluna::CHECKVAL(L, 2); @@ -2062,6 +2218,12 @@ namespace LuaUnit return 0; } + /** + * The [Unit] will say the message + * + * @param string msg : message for the [Unit] to say + * @param uint32 language : language for the [Unit] to speak + */ int SendUnitSay(Eluna* /*E*/, lua_State* L, Unit* unit) { const char* msg = Eluna::CHECKVAL(L, 2); @@ -2075,6 +2237,12 @@ namespace LuaUnit return 0; } + /** + * The [Unit] will yell the message + * + * @param string msg : message for the [Unit] to yell + * @param uint32 language : language for the [Unit] to speak + */ int SendUnitYell(Eluna* /*E*/, lua_State* L, Unit* unit) { const char* msg = Eluna::CHECKVAL(L, 2); @@ -2168,12 +2336,20 @@ namespace LuaUnit return 0; } + /** + * Clears the [Unit]'s combat + */ int ClearInCombat(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) { unit->ClearInCombat(); return 0; } + /** + * Stops the [Unit]'s current spell cast + * + * @param uint32 spell = 0 : entry of a spell + */ int StopSpellCast(Eluna* /*E*/, lua_State* L, Unit* unit) { uint32 spellId = Eluna::CHECKVAL(L, 2, 0); @@ -2181,6 +2357,14 @@ namespace LuaUnit return 0; } + /** + * Interrupts [Unit]'s spell state, casting, etc. + * + * if spell is not interruptible, it will return + * + * @param int32 spellType : type of spell to interrupt + * @param bool delayed = true : skips if the spell is delayed + */ int InterruptSpell(Eluna* /*E*/, lua_State* L, Unit* unit) { int spellType = Eluna::CHECKVAL(L, 2); @@ -2271,6 +2455,12 @@ namespace LuaUnit return 0; } + /** + * The [Unit] plays a sound to a [Player], if no [Player] it will play the sound to everyone near + * + * @param uint32 sound : entry of a sound + * @param [Player] player : [Player] to play the sound to + */ int PlayDirectSound(Eluna* /*E*/, lua_State* L, Unit* unit) { uint32 soundId = Eluna::CHECKVAL(L, 2); @@ -2285,6 +2475,15 @@ namespace LuaUnit return 0; } + /** + * The [Unit] plays a sound to a [Player] + * + * If no [Player] it will play the sound to everyone near + * Sound will fade the further you are + * + * @param uint32 sound : entry of a sound + * @param [Player] player : [Player] to play the sound to + */ int PlayDistanceSound(Eluna* /*E*/, lua_State* L, Unit* unit) { uint32 soundId = Eluna::CHECKVAL(L, 2); @@ -2526,26 +2725,26 @@ namespace LuaUnit /*int RestoreDisplayId(Eluna* E, lua_State* L, Unit* unit) { - unit->RestoreDisplayId(); - return 0; + unit->RestoreDisplayId(); + return 0; }*/ /*int RestoreFaction(Eluna* E, lua_State* L, Unit* unit) { - unit->RestoreFaction(); - return 0; + unit->RestoreFaction(); + return 0; }*/ /*int RemoveBindSightAuras(Eluna* E, lua_State* L, Unit* unit) { - unit->RemoveBindSightAuras(); - return 0; + unit->RemoveBindSightAuras(); + return 0; }*/ /*int RemoveCharmAuras(Eluna* E, lua_State* L, Unit* unit) { - unit->RemoveCharmAuras(); - return 0; + unit->RemoveCharmAuras(); + return 0; }*/ /*int DisableMelee(Eluna* E, lua_State* L, Unit* unit) diff --git a/VehicleHooks.cpp b/VehicleHooks.cpp index c43c679..54a6e5c 100644 --- a/VehicleHooks.cpp +++ b/VehicleHooks.cpp @@ -23,7 +23,6 @@ using namespace Hooks; return;\ LOCK_ELUNA -// Vehicle void Eluna::OnInstall(Vehicle* vehicle) { START_HOOK(VEHICLE_EVENT_ON_INSTALL); diff --git a/VehicleMethods.h b/VehicleMethods.h index cce421b..265c7ac 100644 --- a/VehicleMethods.h +++ b/VehicleMethods.h @@ -14,7 +14,12 @@ */ namespace LuaVehicle { - /* BOOLEAN */ + /** + * Returns true if the [Unit] passenger is on board + * + * @param [Unit] passenger + * @return bool isOnBoard + */ int IsOnBoard(Eluna* /*E*/, lua_State* L, Vehicle* vehicle) { Unit* passenger = Eluna::CHECKOBJ(L, 2); @@ -26,7 +31,11 @@ namespace LuaVehicle return 1; } - /* GETTERS */ + /** + * Returns the [Vehicle]'s owner + * + * @return [Unit] owner + */ int GetOwner(Eluna* /*E*/, lua_State* L, Vehicle* vehicle) { #ifndef TRINITY @@ -37,6 +46,11 @@ namespace LuaVehicle return 1; } + /** + * Returns the [Vehicle]'s entry + * + * @return uint32 entry + */ int GetEntry(Eluna* /*E*/, lua_State* L, Vehicle* vehicle) { #ifndef TRINITY @@ -47,6 +61,12 @@ namespace LuaVehicle return 1; } + /** + * Returns the [Vehicle]'s passenger in the specified seat + * + * @param int8 seat + * @return [Unit] passenger + */ int GetPassenger(Eluna* /*E*/, lua_State* L, Vehicle* vehicle) { int8 seatId = Eluna::CHECKVAL(L, 2); @@ -54,7 +74,12 @@ namespace LuaVehicle return 1; } - /* OTHER */ + /** + * Adds [Unit] passenger to a specified seat in the [Vehicle] + * + * @param [Unit] passenger + * @param int8 seat + */ int AddPassenger(Eluna* /*E*/, lua_State* L, Vehicle* vehicle) { Unit* passenger = Eluna::CHECKOBJ(L, 2); @@ -68,6 +93,11 @@ namespace LuaVehicle return 0; } + /** + * Removes [Unit] passenger from the [Vehicle] + * + * @param [Unit] passenger + */ int RemovePassenger(Eluna* /*E*/, lua_State* L, Vehicle* vehicle) { Unit* passenger = Eluna::CHECKOBJ(L, 2); @@ -80,6 +110,6 @@ namespace LuaVehicle } } -#endif -#endif -#endif \ No newline at end of file +#endif // CLASSIC +#endif // TBC +#endif // VEHICLEMETHODS_H \ No newline at end of file