diff --git a/GroupMethods.h b/GroupMethods.h index 4a6ef41..9f4a791 100644 --- a/GroupMethods.h +++ b/GroupMethods.h @@ -23,13 +23,13 @@ namespace LuaGroup return 1; } - int isRaidGroup(lua_State* L, Group* group) + int IsRaidGroup(lua_State* L, Group* group) { Eluna::Push(L, group->isRaidGroup()); return 1; } - int isBGGroup(lua_State* L, Group* group) + int IsBGGroup(lua_State* L, Group* group) { Eluna::Push(L, group->isBGGroup()); return 1; @@ -73,13 +73,13 @@ namespace LuaGroup return 1; } - /*int isLFGGroup(lua_State* L, Group* group) // TODO: Implementation + /*int IsLFGGroup(lua_State* L, Group* group) // TODO: Implementation { Eluna::Push(L, group->isLFGGroup()); return 1; }*/ - /*int isBFGroup(lua_State* L, Group* group) // TODO: Implementation + /*int IsBFGroup(lua_State* L, Group* group) // TODO: Implementation { Eluna::Push(L, group->isBFGroup()); return 1; @@ -169,7 +169,7 @@ namespace LuaGroup } /* OTHER */ - int ChangeLeader(lua_State* L, Group* group) + int SetLeader(lua_State* L, Group* group) { Player* leader = Eluna::CHECKOBJ(L, 2); @@ -213,7 +213,7 @@ namespace LuaGroup return 0; } - int ChangeMembersGroup(lua_State* L, Group* group) + int SetMembersGroup(lua_State* L, Group* group) { Player* player = Eluna::CHECKOBJ(L, 2); uint8 groupID = Eluna::CHECKVAL(L, 3); diff --git a/GuildMethods.h b/GuildMethods.h index 34a5344..d76e9db 100644 --- a/GuildMethods.h +++ b/GuildMethods.h @@ -166,7 +166,7 @@ namespace LuaGuild return 0; } - int ChangeMemberRank(lua_State* L, Guild* guild) + int SetMemberRank(lua_State* L, Guild* guild) { Player* player = Eluna::CHECKOBJ(L, 2); uint8 newRank = Eluna::CHECKVAL(L, 3); diff --git a/ItemMethods.h b/ItemMethods.h index 3ea68f8..fda2dee 100644 --- a/ItemMethods.h +++ b/ItemMethods.h @@ -215,12 +215,6 @@ namespace LuaItem return 1; } - int GetGUID(lua_State* L, Item* item) - { - Eluna::Push(L, item->GetGUIDLow()); - return 1; - } - int GetOwnerGUID(lua_State* L, Item* item) { #ifdef MANGOS @@ -261,12 +255,6 @@ namespace LuaItem return 1; } - int GetGUIDLow(lua_State* L, Item* item) - { - Eluna::Push(L, item->GetGUIDLow()); - return 1; - } - int GetEnchantmentId(lua_State* L, Item* item) { uint32 enchant_slot = Eluna::CHECKVAL(L, 2); diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index b46e6e5..6d83c6a 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -8,7 +8,7 @@ #include "HookMgr.h" #include "LuaEngine.h" #include "Includes.h" -// Methods +// Method includes #include "GlobalMethods.h" #include "ObjectMethods.h" #include "WorldObjectMethods.h" @@ -210,7 +210,6 @@ ElunaRegister UnitMethods[] = { "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() - { "GetOwnerGUID", &LuaUnit::GetOwnerGUID }, // :GetOwnerGUID() - Returns the GUID of the owner { "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 @@ -312,7 +311,7 @@ ElunaRegister UnitMethods[] = { "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 { "IsWithinLoS", &LuaUnit::IsWithinLoS }, // :IsWithinLoS(x, y, z) - // {"IsRooted", &LuaUnit::IsRooted}, // :IsRooted() + {"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 { "IsStandState", &LuaUnit::IsStandState }, // :IsStandState() - Returns true if the unit is standing @@ -751,6 +750,8 @@ ElunaRegister CreatureMethods[] = { "IsCombatAllowed", &LuaCreature::IsCombatAllowed }, // :IsCombatAllowed() - Returns true if the creature has combat allowed // {"CanStartAttack", &LuaCreature::CanStartAttack}, // :CanStartAttack(unit[, force]) - Returns true if the creature can attack the unit { "HasSearchedAssistance", &LuaCreature::HasSearchedAssistance }, // :HasSearchedAssistance() - Returns true if the creature has searched assistance + { "IsTappedBy", &LuaCreature::IsTappedBy }, // :IsTappedBy(player) + { "HasLootRecipient", &LuaCreature::HasLootRecipient }, // :HasLootRecipient() - Returns true if the creature has a loot recipient { "CanAssistTo", &LuaCreature::CanAssistTo }, // :CanAssistTo(unit, enemy[, checkfaction]) - Returns true if the creature can assist unit with enemy { "IsTargetAcceptable", &LuaCreature::IsTargetAcceptable }, // :IsTargetAcceptable(unit) - Returns true if the creature can target unit { "HasInvolvedQuest", &LuaCreature::HasInvolvedQuest }, // :HasInvolvedQuest(questId) - Returns true if the creature can finish the quest for players @@ -919,7 +920,7 @@ ElunaRegister SpellMethods[] = // Getters { "GetCaster", &LuaSpell::GetCaster }, // :GetCaster() - Returns the spell's caster (UNIT) { "GetCastTime", &LuaSpell::GetCastTime }, // :GetCastTime() - Returns the spell cast time - { "GetEntry", &LuaSpell::GetId }, // :GetEntry() - Returns the spell's ID + { "GetEntry", &LuaSpell::GetEntry }, // :GetEntry() - Returns the spell's ID { "GetDuration", &LuaSpell::GetDuration }, // :GetDuration() - Returns the spell's duration { "GetPowerCost", &LuaSpell::GetPowerCost }, // :GetPowerCost() - Returns the spell's power cost (mana, energy, rage, etc) { "GetTargetDest", &LuaSpell::GetTargetDest }, // :GetTargetDest() - Returns the target destination (x,y,z,o,map) or nil. Orientation and map may be 0. @@ -932,7 +933,7 @@ ElunaRegister SpellMethods[] = { "IsAutoRepeat", &LuaSpell::IsAutoRepeat }, // :IsAutoRepeat() // Other - { "Cancel", &LuaSpell::cancel }, // :Cancel() - Cancels the spell casting + { "Cancel", &LuaSpell::Cancel }, // :Cancel() - Cancels the spell casting { "Cast", &LuaSpell::Cast }, // :Cast(skipCheck) - Casts the spell (if true, removes the check for instant spells, etc) { "Finish", &LuaSpell::Finish }, // :Finish() - Finishes the spell (SPELL_STATE_FINISH) @@ -974,8 +975,8 @@ ElunaRegister GroupMethods[] = { "GetMembersCount", &LuaGroup::GetMembersCount }, // :GetMembersCount() - Returns the member count of the group // Setters - { "SetLeader", &LuaGroup::ChangeLeader }, // :SetLeader(Player) - Sets the player as the new leader - { "SetMembersGroup", &LuaGroup::ChangeMembersGroup }, // :ChangeMembersGroup(player, subGroup) - Changes the member's subgroup + { "SetLeader", &LuaGroup::SetLeader }, // :SetLeader(Player) - Sets the player as the new leader + { "SetMembersGroup", &LuaGroup::SetMembersGroup }, // :ChangeMembersGroup(player, subGroup) - Changes the member's subgroup { "SetTargetIcon", &LuaGroup::SetTargetIcon }, // :SetTargetIcon(icon, targetguid[, setterguid]) - Sets target's icon for group. target 0 to clear. // Boolean @@ -984,10 +985,10 @@ ElunaRegister GroupMethods[] = { "RemoveMember", &LuaGroup::RemoveMember }, // :RemoveMember(player) - Removes player from group. Returns true on success { "Disband", &LuaGroup::Disband }, // :Disband() - Disbands the group { "IsFull", &LuaGroup::IsFull }, // :IsFull() - Returns true if the group is full - // {"IsLFGGroup", &LuaGroup::isLFGGroup}, // :IsLFGGroup() - Returns true if the group is an LFG group - { "IsRaidGroup", &LuaGroup::isRaidGroup }, // :IsRaidGroup() - Returns true if the group is a raid group - { "IsBGGroup", &LuaGroup::isBGGroup }, // :IsBGGroup() - Returns true if the group is a battleground group - // {"IsBFGroup", &LuaGroup::isBFGroup}, // :IsBFGroup() - Returns true if the group is a battlefield group + // {"IsLFGGroup", &LuaGroup::IsLFGGroup}, // :IsLFGGroup() - Returns true if the group is an LFG group + { "IsRaidGroup", &LuaGroup::IsRaidGroup }, // :IsRaidGroup() - Returns true if the group is a raid group + { "IsBGGroup", &LuaGroup::IsBGGroup }, // :IsBGGroup() - Returns true if the group is a battleground group + // {"IsBFGroup", &LuaGroup::IsBFGroup}, // :IsBFGroup() - Returns true if the group is a battlefield group { "IsMember", &LuaGroup::IsMember }, // :IsMember(player) - Returns true if the player is a member of the group { "IsAssistant", &LuaGroup::IsAssistant }, // :IsAssistant(player) - returns true if the player is an assistant in the group { "SameSubGroup", &LuaGroup::SameSubGroup }, // :SameSubGroup(player1, player2) - Returns true if the players are in the same subgroup in the group @@ -1017,7 +1018,7 @@ ElunaRegister GuildMethods[] = #ifndef CLASSIC { "SetBankTabText", &LuaGuild::SetBankTabText }, // :SetBankTabText(tabId, text) #endif - { "SetMemberRank", &LuaGuild::ChangeMemberRank }, // :SetMemberRank(player, newRank) - Sets the player rank in the guild to the new rank + { "SetMemberRank", &LuaGuild::SetMemberRank }, // :SetMemberRank(player, newRank) - Sets the player rank in the guild to the new rank #ifndef CATA { "SetLeader", &LuaGuild::SetLeader }, // :SetLeader() - Sets the guild's leader #endif @@ -1025,7 +1026,6 @@ ElunaRegister GuildMethods[] = // Boolean // Other - { "ChangeMemberRank", &LuaGuild::ChangeMemberRank }, // :ChangeMemberRank(player, rankId) - Changes players rank to rank specified { "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 diff --git a/PlayerMethods.h b/PlayerMethods.h index 66fd467..fcce8d7 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -286,14 +286,6 @@ namespace LuaPlayer return 1; } - int IsActiveQuest(lua_State* L, Player* player) - { - uint32 entry = Eluna::CHECKVAL(L, 2); - - Eluna::Push(L, player->IsActiveQuest(entry)); - return 1; - } - int IsGroupVisibleFor(lua_State* L, Player* player) { Player* target = Eluna::CHECKOBJ(L, 2); @@ -2038,13 +2030,6 @@ namespace LuaPlayer return 0; } - int SendPacketToPlayer(lua_State* L, Player* player) - { - WorldPacket* data = Eluna::CHECKOBJ(L, 2); - player->GetSession()->SendPacket(data); - return 0; - } - int SendPacket(lua_State* L, Player* player) { WorldPacket* data = Eluna::CHECKOBJ(L, 2); diff --git a/SpellMethods.h b/SpellMethods.h index f0c09bd..af3c4e9 100644 --- a/SpellMethods.h +++ b/SpellMethods.h @@ -29,7 +29,7 @@ namespace LuaSpell return 1; } - int GetId(lua_State* L, Spell* spell) + int GetEntry(lua_State* L, Spell* spell) { Eluna::Push(L, spell->m_spellInfo->Id); return 1; @@ -112,7 +112,7 @@ namespace LuaSpell return 0; } - int cancel(lua_State* /*L*/, Spell* spell) + int Cancel(lua_State* /*L*/, Spell* spell) { spell->cancel(); return 0; diff --git a/UnitMethods.h b/UnitMethods.h index 0f8b7d7..10376fd 100644 --- a/UnitMethods.h +++ b/UnitMethods.h @@ -272,12 +272,6 @@ namespace LuaUnit return 1; } - int IsInWorld(lua_State* L, Unit* unit) - { - Eluna::Push(L, unit->IsInWorld()); - return 1; - } - int IsPvPFlagged(lua_State* L, Unit* unit) { Eluna::Push(L, unit->IsPvP()); @@ -400,34 +394,12 @@ namespace LuaUnit return 1; } - int GetMap(lua_State* L, Unit* unit) - { - Map* map = unit->GetMap(); - Eluna::Push(L, map); - return 1; - } - int GetMountId(lua_State* L, Unit* unit) { Eluna::Push(L, unit->GetMountID()); return 1; } - int GetDistance(lua_State* L, Unit* unit) - { - WorldObject* obj = Eluna::CHECKOBJ(L, 2, false); - if (obj && obj->IsInWorld()) - Eluna::Push(L, unit->GetDistance(obj)); - else - { - float X = Eluna::CHECKVAL(L, 2); - float Y = Eluna::CHECKVAL(L, 3); - float Z = Eluna::CHECKVAL(L, 4); - Eluna::Push(L, unit->GetDistance(X, Y, Z)); - } - return 1; - } - int GetCreatorGUID(lua_State* L, Unit* unit) { #ifdef MANGOS