mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Eluna remove unused method bodies, Rename method bodies correctly, enable some methods implemented on mangos and TC already..
This commit is contained in:
@@ -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<Player>(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<Player>(L, 2);
|
||||
uint8 groupID = Eluna::CHECKVAL<uint8>(L, 3);
|
||||
|
||||
@@ -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<Player>(L, 2);
|
||||
uint8 newRank = Eluna::CHECKVAL<uint8>(L, 3);
|
||||
|
||||
@@ -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<uint32>(L, 2);
|
||||
|
||||
@@ -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<Unit> 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<Unit> 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<Creature> 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<Spell> 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<Spell> 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<Group> 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<Group> 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<Guild> 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<Guild> 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
|
||||
|
||||
@@ -286,14 +286,6 @@ namespace LuaPlayer
|
||||
return 1;
|
||||
}
|
||||
|
||||
int IsActiveQuest(lua_State* L, Player* player)
|
||||
{
|
||||
uint32 entry = Eluna::CHECKVAL<uint32>(L, 2);
|
||||
|
||||
Eluna::Push(L, player->IsActiveQuest(entry));
|
||||
return 1;
|
||||
}
|
||||
|
||||
int IsGroupVisibleFor(lua_State* L, Player* player)
|
||||
{
|
||||
Player* target = Eluna::CHECKOBJ<Player>(L, 2);
|
||||
@@ -2038,13 +2030,6 @@ namespace LuaPlayer
|
||||
return 0;
|
||||
}
|
||||
|
||||
int SendPacketToPlayer(lua_State* L, Player* player)
|
||||
{
|
||||
WorldPacket* data = Eluna::CHECKOBJ<WorldPacket>(L, 2);
|
||||
player->GetSession()->SendPacket(data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int SendPacket(lua_State* L, Player* player)
|
||||
{
|
||||
WorldPacket* data = Eluna::CHECKOBJ<WorldPacket>(L, 2);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<WorldObject>(L, 2, false);
|
||||
if (obj && obj->IsInWorld())
|
||||
Eluna::Push(L, unit->GetDistance(obj));
|
||||
else
|
||||
{
|
||||
float X = Eluna::CHECKVAL<float>(L, 2);
|
||||
float Y = Eluna::CHECKVAL<float>(L, 3);
|
||||
float Z = Eluna::CHECKVAL<float>(L, 4);
|
||||
Eluna::Push(L, unit->GetDistance(X, Y, Z));
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int GetCreatorGUID(lua_State* L, Unit* unit)
|
||||
{
|
||||
#ifdef MANGOS
|
||||
|
||||
Reference in New Issue
Block a user