From b7c379a42ca4d8a82dace5accc68c0ee354eddd1 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Sun, 19 Mar 2017 15:48:48 +0200 Subject: [PATCH] Change Eluna to a global variable Remove Eluna* from being passed. You can now get it through Eluna::GetEluna(L) Change function call cleanup to lua_settop instead of manual loop Explicitly delete the copy constructor and copy assignment operators --- AuraMethods.h | 24 +- BattleGroundMethods.h | 36 +-- CorpseMethods.h | 10 +- CreatureMethods.h | 156 ++++++------- ElunaQueryMethods.h | 34 +-- ElunaTemplate.h | 39 ++-- GameObjectMethods.h | 38 ++-- GlobalMethods.h | 293 ++++++++++++------------ GroupMethods.h | 50 ++-- GuildMethods.h | 36 +-- ItemMethods.h | 106 ++++----- LuaEngine.cpp | 4 + LuaEngine.h | 16 +- LuaFunctions.cpp | 2 +- MapMethods.h | 36 +-- ObjectMethods.h | 58 ++--- PlayerMethods.h | 516 +++++++++++++++++++++--------------------- QuestMethods.h | 24 +- SpellMethods.h | 24 +- UnitMethods.h | 332 +++++++++++++-------------- VehicleMethods.h | 12 +- WorldObjectMethods.h | 74 +++--- WorldPacketMethods.h | 46 ++-- 23 files changed, 990 insertions(+), 976 deletions(-) diff --git a/AuraMethods.h b/AuraMethods.h index df0b1d5..01b116e 100644 --- a/AuraMethods.h +++ b/AuraMethods.h @@ -26,7 +26,7 @@ namespace LuaAura * * @return [Unit] caster */ - int GetCaster(Eluna* /*E*/, lua_State* L, Aura* aura) + int GetCaster(lua_State* L, Aura* aura) { Eluna::Push(L, aura->GetCaster()); return 1; @@ -37,7 +37,7 @@ namespace LuaAura * * @return string caster_guid : the GUID of the Unit as a decimal string */ - int GetCasterGUID(Eluna* /*E*/, lua_State* L, Aura* aura) + int GetCasterGUID(lua_State* L, Aura* aura) { #ifndef TRINITY Eluna::Push(L, aura->GetCasterGuid()); @@ -52,7 +52,7 @@ namespace LuaAura * * @return uint32 caster_level */ - int GetCasterLevel(Eluna* /*E*/, lua_State* L, Aura* aura) + int GetCasterLevel(lua_State* L, Aura* aura) { Eluna::Push(L, aura->GetCaster()->getLevel()); return 1; @@ -63,7 +63,7 @@ namespace LuaAura * * @return int32 duration : amount of time left in milliseconds */ - int GetDuration(Eluna* /*E*/, lua_State* L, Aura* aura) + int GetDuration(lua_State* L, Aura* aura) { #ifndef TRINITY Eluna::Push(L, aura->GetAuraDuration()); @@ -78,7 +78,7 @@ namespace LuaAura * * @return uint32 aura_id */ - int GetAuraId(Eluna* /*E*/, lua_State* L, Aura* aura) + int GetAuraId(lua_State* L, Aura* aura) { Eluna::Push(L, aura->GetId()); return 1; @@ -92,7 +92,7 @@ namespace LuaAura * * @return int32 max_duration : the maximum duration of the Aura, in milliseconds */ - int GetMaxDuration(Eluna* /*E*/, lua_State* L, Aura* aura) + int GetMaxDuration(lua_State* L, Aura* aura) { #ifndef TRINITY Eluna::Push(L, aura->GetAuraMaxDuration()); @@ -109,7 +109,7 @@ namespace LuaAura * * @return uint32 stack_amount */ - int GetStackAmount(Eluna* /*E*/, lua_State* L, Aura* aura) + int GetStackAmount(lua_State* L, Aura* aura) { Eluna::Push(L, aura->GetStackAmount()); return 1; @@ -120,7 +120,7 @@ namespace LuaAura * * @return [Unit] owner */ - int GetOwner(Eluna* /*E*/, lua_State* L, Aura* aura) + int GetOwner(lua_State* L, Aura* aura) { #ifndef TRINITY Eluna::Push(L, aura->GetTarget()); @@ -135,7 +135,7 @@ namespace LuaAura * * @param int32 duration : the new duration of the Aura, in milliseconds */ - int SetDuration(Eluna* /*E*/, lua_State* L, Aura* aura) + int SetDuration(lua_State* L, Aura* aura) { int32 duration = Eluna::CHECKVAL(L, 2); #ifndef TRINITY @@ -159,7 +159,7 @@ namespace LuaAura * * @param int32 duration : the new maximum duration of the Aura, in milliseconds */ - int SetMaxDuration(Eluna* /*E*/, lua_State* L, Aura* aura) + int SetMaxDuration(lua_State* L, Aura* aura) { int32 duration = Eluna::CHECKVAL(L, 2); #ifndef TRINITY @@ -183,7 +183,7 @@ namespace LuaAura * * @param uint32 amount */ - int SetStackAmount(Eluna* /*E*/, lua_State* L, Aura* aura) + int SetStackAmount(lua_State* L, Aura* aura) { uint8 amount = Eluna::CHECKVAL(L, 2); #ifndef TRINITY @@ -197,7 +197,7 @@ namespace LuaAura /** * Remove this [Aura] from the [Unit] it is applied to. */ - int Remove(Eluna* /*E*/, lua_State* L, Aura* aura) + int Remove(lua_State* L, Aura* aura) { #ifndef TRINITY aura->GetTarget()->RemoveSpellAuraHolder(aura->GetHolder(), AURA_REMOVE_BY_CANCEL); diff --git a/BattleGroundMethods.h b/BattleGroundMethods.h index aecb192..9ae7d7f 100644 --- a/BattleGroundMethods.h +++ b/BattleGroundMethods.h @@ -19,7 +19,7 @@ namespace LuaBattleGround * * @return string name */ - int GetName(Eluna* /*E*/, lua_State* L, BattleGround* bg) + int GetName(lua_State* L, BattleGround* bg) { Eluna::Push(L, bg->GetName()); return 1; @@ -31,7 +31,7 @@ namespace LuaBattleGround * @param [Team] team : team ID * @return uint32 count */ - int GetAlivePlayersCountByTeam(Eluna* /*E*/, lua_State* L, BattleGround* bg) + int GetAlivePlayersCountByTeam(lua_State* L, BattleGround* bg) { uint32 team = Eluna::CHECKVAL(L, 2); @@ -44,7 +44,7 @@ namespace LuaBattleGround * * @return [Map] map */ - int GetMap(Eluna* /*E*/, lua_State* L, BattleGround* bg) + int GetMap(lua_State* L, BattleGround* bg) { Eluna::Push(L, bg->GetBgMap()); return 1; @@ -56,7 +56,7 @@ namespace LuaBattleGround * @param uint32 kills : amount of kills * @return uint32 bonusHonor */ - int GetBonusHonorFromKillCount(Eluna* /*E*/, lua_State* L, BattleGround* bg) + int GetBonusHonorFromKillCount(lua_State* L, BattleGround* bg) { uint32 kills = Eluna::CHECKVAL(L, 2); @@ -69,7 +69,7 @@ namespace LuaBattleGround * * @return [BattleGroundBracketId] bracketId */ - int GetBracketId(Eluna* /*E*/, lua_State* L, BattleGround* bg) + int GetBracketId(lua_State* L, BattleGround* bg) { Eluna::Push(L, bg->GetBracketId()); return 1; @@ -80,7 +80,7 @@ namespace LuaBattleGround * * @return uint32 endTime */ - int GetEndTime(Eluna* /*E*/, lua_State* L, BattleGround* bg) + int GetEndTime(lua_State* L, BattleGround* bg) { #ifdef CATA Eluna::Push(L, bg->GetRemainingTime()); @@ -96,7 +96,7 @@ namespace LuaBattleGround * @param [Team] team : team ID * @return uint32 freeSlots */ - int GetFreeSlotsForTeam(Eluna* /*E*/, lua_State* L, BattleGround* bg) + int GetFreeSlotsForTeam(lua_State* L, BattleGround* bg) { uint32 team = Eluna::CHECKVAL(L, 2); @@ -109,7 +109,7 @@ namespace LuaBattleGround * * @return uint32 instanceId */ - int GetInstanceId(Eluna* /*E*/, lua_State* L, BattleGround* bg) + int GetInstanceId(lua_State* L, BattleGround* bg) { Eluna::Push(L, bg->GetInstanceID()); return 1; @@ -120,7 +120,7 @@ namespace LuaBattleGround * * @return uint32 mapId */ - int GetMapId(Eluna* /*E*/, lua_State* L, BattleGround* bg) + int GetMapId(lua_State* L, BattleGround* bg) { Eluna::Push(L, bg->GetMapId()); return 1; @@ -131,7 +131,7 @@ namespace LuaBattleGround * * @return [BattleGroundTypeId] typeId */ - int GetTypeId(Eluna* /*E*/, lua_State* L, BattleGround* bg) + int GetTypeId(lua_State* L, BattleGround* bg) { Eluna::Push(L, bg->GetTypeID()); return 1; @@ -142,7 +142,7 @@ namespace LuaBattleGround * * @return uint32 maxLevel */ - int GetMaxLevel(Eluna* /*E*/, lua_State* L, BattleGround* bg) + int GetMaxLevel(lua_State* L, BattleGround* bg) { Eluna::Push(L, bg->GetMaxLevel()); return 1; @@ -153,7 +153,7 @@ namespace LuaBattleGround * * @return uint32 minLevel */ - int GetMinLevel(Eluna* /*E*/, lua_State* L, BattleGround* bg) + int GetMinLevel(lua_State* L, BattleGround* bg) { Eluna::Push(L, bg->GetMinLevel()); return 1; @@ -164,7 +164,7 @@ namespace LuaBattleGround * * @return uint32 maxPlayerCount */ - int GetMaxPlayers(Eluna* /*E*/, lua_State* L, BattleGround* bg) + int GetMaxPlayers(lua_State* L, BattleGround* bg) { Eluna::Push(L, bg->GetMaxPlayers()); return 1; @@ -175,7 +175,7 @@ namespace LuaBattleGround * * @return uint32 minPlayerCount */ - int GetMinPlayers(Eluna* /*E*/, lua_State* L, BattleGround* bg) + int GetMinPlayers(lua_State* L, BattleGround* bg) { Eluna::Push(L, bg->GetMinPlayers()); return 1; @@ -186,7 +186,7 @@ namespace LuaBattleGround * * @return uint32 maxTeamPlayerCount */ - int GetMaxPlayersPerTeam(Eluna* /*E*/, lua_State* L, BattleGround* bg) + int GetMaxPlayersPerTeam(lua_State* L, BattleGround* bg) { Eluna::Push(L, bg->GetMaxPlayersPerTeam()); return 1; @@ -197,7 +197,7 @@ namespace LuaBattleGround * * @return uint32 minTeamPlayerCount */ - int GetMinPlayersPerTeam(Eluna* /*E*/, lua_State* L, BattleGround* bg) + int GetMinPlayersPerTeam(lua_State* L, BattleGround* bg) { Eluna::Push(L, bg->GetMinPlayersPerTeam()); return 1; @@ -208,7 +208,7 @@ namespace LuaBattleGround * * @return [Team] team */ - int GetWinner(Eluna* /*E*/, lua_State* L, BattleGround* bg) + int GetWinner(lua_State* L, BattleGround* bg) { Eluna::Push(L, bg->GetWinner()); return 1; @@ -219,7 +219,7 @@ namespace LuaBattleGround * * @return [BattleGroundStatus] status */ - int GetStatus(Eluna* /*E*/, lua_State* L, BattleGround* bg) + int GetStatus(lua_State* L, BattleGround* bg) { Eluna::Push(L, bg->GetStatus()); return 1; diff --git a/CorpseMethods.h b/CorpseMethods.h index e9738b9..3aec562 100644 --- a/CorpseMethods.h +++ b/CorpseMethods.h @@ -19,7 +19,7 @@ namespace LuaCorpse * * @return uint64 ownerGUID */ - int GetOwnerGUID(Eluna* /*E*/, lua_State* L, Corpse* corpse) + int GetOwnerGUID(lua_State* L, Corpse* corpse) { #ifndef TRINITY Eluna::Push(L, corpse->GetOwnerGuid()); @@ -34,7 +34,7 @@ namespace LuaCorpse * * @return uint32 ghostTime */ - int GetGhostTime(Eluna* /*E*/, lua_State* L, Corpse* corpse) + int GetGhostTime(lua_State* L, Corpse* corpse) { Eluna::Push(L, corpse->GetGhostTime()); return 1; @@ -52,7 +52,7 @@ namespace LuaCorpse * * @return [CorpseType] corpseType */ - int GetType(Eluna* /*E*/, lua_State* L, Corpse* corpse) + int GetType(lua_State* L, Corpse* corpse) { Eluna::Push(L, corpse->GetType()); return 1; @@ -63,7 +63,7 @@ namespace LuaCorpse * * See [Corpse:GetGhostTime]. */ - int ResetGhostTime(Eluna* /*E*/, lua_State* /*L*/, Corpse* corpse) + int ResetGhostTime(lua_State* /*L*/, Corpse* corpse) { corpse->ResetGhostTime(); return 0; @@ -72,7 +72,7 @@ namespace LuaCorpse /** * Saves the [Corpse] to the database. */ - int SaveToDB(Eluna* /*E*/, lua_State* /*L*/, Corpse* corpse) + int SaveToDB(lua_State* /*L*/, Corpse* corpse) { corpse->SaveToDB(); return 0; diff --git a/CreatureMethods.h b/CreatureMethods.h index 443f028..8181b92 100644 --- a/CreatureMethods.h +++ b/CreatureMethods.h @@ -20,7 +20,7 @@ namespace LuaCreature * * @return bool reputationDisabled */ - int IsReputationGainDisabled(Eluna* /*E*/, lua_State* L, Creature* creature) + int IsReputationGainDisabled(lua_State* L, Creature* creature) { Eluna::Push(L, creature->IsReputationGainDisabled()); return 1; @@ -32,7 +32,7 @@ namespace LuaCreature * * @return bool regeneratesHealth */ - int CanRegenerateHealth(Eluna* /*E*/, lua_State* L, Creature* creature) + int CanRegenerateHealth(lua_State* L, Creature* creature) { #ifndef TRINITY Eluna::Push(L, creature->IsRegeneratingHealth()); @@ -49,7 +49,7 @@ namespace LuaCreature * @param uint32 questID : the ID of a [Quest] * @return bool completesQuest */ - int CanCompleteQuest(Eluna* /*E*/, lua_State* L, Creature* creature) + int CanCompleteQuest(lua_State* L, Creature* creature) { uint32 quest_id = Eluna::CHECKVAL(L, 2); @@ -68,7 +68,7 @@ namespace LuaCreature * @param bool mustBeDead = false : if `true`, only returns `true` if the [Creature] is also dead. Otherwise, it must be alive. * @return bool targetable */ - int IsTargetableForAttack(Eluna* /*E*/, lua_State* L, Creature* creature) + int IsTargetableForAttack(lua_State* L, Creature* creature) { bool mustBeDead = Eluna::CHECKVAL(L, 2, false); @@ -89,7 +89,7 @@ namespace LuaCreature * @param bool checkFaction = true : if `true`, the [Creature] must be the same faction as `friend` to assist * @return bool canAssist */ - int CanAssistTo(Eluna* /*E*/, lua_State* L, Creature* creature) + int CanAssistTo(lua_State* L, Creature* creature) { Unit* u = Eluna::CHECKOBJ(L, 2); Unit* enemy = Eluna::CHECKOBJ(L, 3); @@ -105,7 +105,7 @@ namespace LuaCreature * * @return bool searchedForAssistance */ - int HasSearchedAssistance(Eluna* /*E*/, lua_State* L, Creature* creature) + int HasSearchedAssistance(lua_State* L, Creature* creature) { Eluna::Push(L, creature->HasSearchedAssistance()); return 1; @@ -117,7 +117,7 @@ namespace LuaCreature * * @return bool tapped */ - int IsTappedBy(Eluna* /*E*/, lua_State* L, Creature* creature) + int IsTappedBy(lua_State* L, Creature* creature) { Player* player = Eluna::CHECKOBJ(L, 2); @@ -135,7 +135,7 @@ namespace LuaCreature * * @return bool hasLootRecipient */ - int HasLootRecipient(Eluna* /*E*/, lua_State* L, Creature* creature) + int HasLootRecipient(lua_State* L, Creature* creature) { #ifndef TRINITY Eluna::Push(L, creature->HasLootRecipient()); @@ -151,7 +151,7 @@ namespace LuaCreature * * @return bool canAggro */ - int CanAggro(Eluna* /*E*/, lua_State* L, Creature* creature) + int CanAggro(lua_State* L, Creature* creature) { #ifdef TRINITY Eluna::Push(L, !creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC)); @@ -168,7 +168,7 @@ namespace LuaCreature * * @return bool canSwim */ - int CanSwim(Eluna* /*E*/, lua_State* L, Creature* creature) + int CanSwim(lua_State* L, Creature* creature) { Eluna::Push(L, creature->CanSwim()); return 1; @@ -180,7 +180,7 @@ namespace LuaCreature * * @return bool canWalk */ - int CanWalk(Eluna* /*E*/, lua_State* L, Creature* creature) + int CanWalk(lua_State* L, Creature* creature) { Eluna::Push(L, creature->CanWalk()); return 1; @@ -192,7 +192,7 @@ namespace LuaCreature * * @return bool inEvadeMode */ - int IsInEvadeMode(Eluna* /*E*/, lua_State* L, Creature* creature) + int IsInEvadeMode(lua_State* L, Creature* creature) { Eluna::Push(L, creature->IsInEvadeMode()); return 1; @@ -204,7 +204,7 @@ namespace LuaCreature * * @return bool isElite */ - int IsElite(Eluna* /*E*/, lua_State* L, Creature* creature) + int IsElite(lua_State* L, Creature* creature) { #ifndef TRINITY Eluna::Push(L, creature->IsElite()); @@ -220,7 +220,7 @@ namespace LuaCreature * * @return bool isGuard */ - int IsGuard(Eluna* /*E*/, lua_State* L, Creature* creature) + int IsGuard(lua_State* L, Creature* creature) { Eluna::Push(L, creature->IsGuard()); return 1; @@ -232,7 +232,7 @@ namespace LuaCreature * * @return bool isCivilian */ - int IsCivilian(Eluna* /*E*/, lua_State* L, Creature* creature) + int IsCivilian(lua_State* L, Creature* creature) { Eluna::Push(L, creature->IsCivilian()); return 1; @@ -244,7 +244,7 @@ namespace LuaCreature * * @return bool isLeader */ - int IsRacialLeader(Eluna* /*E*/, lua_State* L, Creature* creature) + int IsRacialLeader(lua_State* L, Creature* creature) { Eluna::Push(L, creature->IsRacialLeader()); return 1; @@ -256,7 +256,7 @@ namespace LuaCreature * * @return bool isWorldBoss */ - int IsWorldBoss(Eluna* /*E*/, lua_State* L, Creature* creature) + int IsWorldBoss(lua_State* L, Creature* creature) { #ifndef TRINITY Eluna::Push(L, creature->IsWorldBoss()); @@ -273,7 +273,7 @@ namespace LuaCreature * @param uint32 spellId : the ID of a [Spell] * @return bool hasCooldown */ - int HasCategoryCooldown(Eluna* /*E*/, lua_State* L, Creature* creature) + int HasCategoryCooldown(lua_State* L, Creature* creature) { uint32 spell = Eluna::CHECKVAL(L, 2); @@ -295,7 +295,7 @@ namespace LuaCreature * @param uint32 spellId : the ID of a [Spell] * @return bool hasSpell */ - int HasSpell(Eluna* /*E*/, lua_State* L, Creature* creature) + int HasSpell(lua_State* L, Creature* creature) { uint32 id = Eluna::CHECKVAL(L, 2); @@ -310,7 +310,7 @@ namespace LuaCreature * @param uint32 questId : the ID of a [Quest] * @return bool hasQuest */ - int HasQuest(Eluna* /*E*/, lua_State* L, Creature* creature) + int HasQuest(lua_State* L, Creature* creature) { uint32 questId = Eluna::CHECKVAL(L, 2); @@ -329,7 +329,7 @@ namespace LuaCreature * @param uint32 spellId : the ID of a [Spell] * @return bool hasCooldown */ - int HasSpellCooldown(Eluna* /*E*/, lua_State* L, Creature* creature) + int HasSpellCooldown(lua_State* L, Creature* creature) { uint32 spellId = Eluna::CHECKVAL(L, 2); @@ -347,7 +347,7 @@ namespace LuaCreature * * @return bool canFly */ - int CanFly(Eluna* /*E*/, lua_State* L, Creature* creature) + int CanFly(lua_State* L, Creature* creature) { Eluna::Push(L, creature->CanFly()); return 1; @@ -360,7 +360,7 @@ namespace LuaCreature * * @return bool canFly */ - int IsTrigger(Eluna* /*E*/, lua_State* L, Creature* creature) + int IsTrigger(lua_State* L, Creature* creature) { Eluna::Push(L, creature->IsTrigger()); return 1; @@ -371,7 +371,7 @@ namespace LuaCreature * * @return bool isDamagedEnough */ - int IsDamageEnoughForLootingAndReward(Eluna* /*E*/, lua_State* L, Creature* creature) + int IsDamageEnoughForLootingAndReward(lua_State* L, Creature* creature) { Eluna::Push(L, creature->IsDamageEnoughForLootingAndReward()); return 1; @@ -385,7 +385,7 @@ namespace LuaCreature * @param [Unit] target * @param bool force = true : force [Creature] to attack */ - int CanStartAttack(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement core side + int CanStartAttack(lua_State* L, Creature* creature) // TODO: Implement core side { Unit* target = Eluna::CHECKOBJ(L, 2); bool force = Eluna::CHECKVAL(L, 3, true); @@ -400,7 +400,7 @@ namespace LuaCreature * @param uint16 lootMode * @return bool hasLootMode */ - int HasLootMode(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement LootMode features + int HasLootMode(lua_State* L, Creature* creature) // TODO: Implement LootMode features { uint16 lootMode = Eluna::CHECKVAL(L, 2); @@ -417,7 +417,7 @@ namespace LuaCreature * * @return uint32 respawnDelay : the respawn delay, in seconds */ - int GetRespawnDelay(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetRespawnDelay(lua_State* L, Creature* creature) { Eluna::Push(L, creature->GetRespawnDelay()); return 1; @@ -429,7 +429,7 @@ namespace LuaCreature * * @return float wanderRadius */ - int GetWanderRadius(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetWanderRadius(lua_State* L, Creature* creature) { Eluna::Push(L, creature->GetRespawnRadius()); return 1; @@ -441,7 +441,7 @@ namespace LuaCreature * * @return uint32 pathId */ - int GetWaypointPath(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetWaypointPath(lua_State* L, Creature* creature) { Eluna::Push(L, creature->GetWaypointPath()); return 1; @@ -453,7 +453,7 @@ namespace LuaCreature * * @return uint32 wpId */ - int GetCurrentWaypointId(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetCurrentWaypointId(lua_State* L, Creature* creature) { #ifdef TRINITY Eluna::Push(L, creature->GetCurrentWaypointID()); @@ -468,7 +468,7 @@ namespace LuaCreature * * @return [MovementGeneratorType] defaultMovementType */ - int GetDefaultMovementType(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetDefaultMovementType(lua_State* L, Creature* creature) { Eluna::Push(L, creature->GetDefaultMovementType()); return 1; @@ -480,7 +480,7 @@ namespace LuaCreature * @param [Unit] target * @return float aggroRange */ - int GetAggroRange(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetAggroRange(lua_State* L, Creature* creature) { Unit* target = Eluna::CHECKOBJ(L, 2); @@ -503,7 +503,7 @@ namespace LuaCreature * @param [Unit] target * @return float attackDistance */ - int GetAttackDistance(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetAttackDistance(lua_State* L, Creature* creature) { Unit* target = Eluna::CHECKOBJ(L, 2); @@ -516,7 +516,7 @@ namespace LuaCreature * * @return [Group] lootRecipientGroup : the group or `nil` */ - int GetLootRecipientGroup(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetLootRecipientGroup(lua_State* L, Creature* creature) { #ifndef TRINITY Eluna::Push(L, creature->GetGroupLootRecipient()); @@ -531,7 +531,7 @@ namespace LuaCreature * * @return [Player] lootRecipient : the player or `nil` */ - int GetLootRecipient(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetLootRecipient(lua_State* L, Creature* creature) { Eluna::Push(L, creature->GetLootRecipient()); return 1; @@ -546,7 +546,7 @@ namespace LuaCreature * * @return string scriptName */ - int GetScriptName(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetScriptName(lua_State* L, Creature* creature) { Eluna::Push(L, creature->GetScriptName()); return 1; @@ -561,7 +561,7 @@ namespace LuaCreature * * @return string AIName */ - int GetAIName(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetAIName(lua_State* L, Creature* creature) { Eluna::Push(L, creature->GetAIName()); return 1; @@ -575,7 +575,7 @@ namespace LuaCreature * * @return uint32 scriptID */ - int GetScriptId(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetScriptId(lua_State* L, Creature* creature) { Eluna::Push(L, creature->GetScriptId()); return 1; @@ -587,7 +587,7 @@ namespace LuaCreature * @param uint32 spellID * @return uint32 cooldown : the cooldown, in milliseconds */ - int GetCreatureSpellCooldownDelay(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetCreatureSpellCooldownDelay(lua_State* L, Creature* creature) { uint32 spell = Eluna::CHECKVAL(L, 2); @@ -607,7 +607,7 @@ namespace LuaCreature * * @return uint32 corpseDelay : the delay, in seconds */ - int GetCorpseDelay(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetCorpseDelay(lua_State* L, Creature* creature) { Eluna::Push(L, creature->GetCorpseDelay()); return 1; @@ -622,7 +622,7 @@ namespace LuaCreature * @return float z * @return float o */ - int GetHomePosition(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetHomePosition(lua_State* L, Creature* creature) { float x, y, z, o; #ifndef TRINITY @@ -647,7 +647,7 @@ namespace LuaCreature * @param float z * @param float o */ - int SetHomePosition(Eluna* /*E*/, lua_State* L, Creature* creature) + int SetHomePosition(lua_State* L, Creature* creature) { float x = Eluna::CHECKVAL(L, 2); float y = Eluna::CHECKVAL(L, 3); @@ -689,7 +689,7 @@ namespace LuaCreature * @param int32 aura = 0 : if positive, the target must have this [Aura]. If negative, the the target must not have this Aura * @return [Unit] target : the target, or `nil` */ - int GetAITarget(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetAITarget(lua_State* L, Creature* creature) { uint32 targetType = Eluna::CHECKVAL(L, 2); bool playerOnly = Eluna::CHECKVAL(L, 3, false); @@ -777,7 +777,7 @@ namespace LuaCreature * * @return table targets */ - int GetAITargets(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetAITargets(lua_State* L, Creature* creature) { lua_newtable(L); int tbl = lua_gettop(L); @@ -810,7 +810,7 @@ namespace LuaCreature * * @return int targetsCount */ - int GetAITargetsCount(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetAITargetsCount(lua_State* L, Creature* creature) { #ifdef MANGOS Eluna::Push(L, creature->GetThreatManager().getThreatList().size()); @@ -828,7 +828,7 @@ namespace LuaCreature * * @return [NPCFlags] npcFlags */ - int GetNPCFlags(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetNPCFlags(lua_State* L, Creature* creature) { Eluna::Push(L, creature->GetUInt32Value(UNIT_NPC_FLAGS)); return 1; @@ -840,7 +840,7 @@ namespace LuaCreature * * @return uint32 shieldBlockValue */ - int GetShieldBlockValue(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetShieldBlockValue(lua_State* L, Creature* creature) { Eluna::Push(L, creature->GetShieldBlockValue()); return 1; @@ -848,7 +848,7 @@ namespace LuaCreature #endif #ifdef TRINITY - int GetLootMode(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement LootMode features + int GetLootMode(lua_State* L, Creature* creature) // TODO: Implement LootMode features { Eluna::Push(L, creature->GetLootMode()); return 1; @@ -860,7 +860,7 @@ namespace LuaCreature * * @return uint32 dbguid */ - int GetDBTableGUIDLow(Eluna* /*E*/, lua_State* L, Creature* creature) + int GetDBTableGUIDLow(lua_State* L, Creature* creature) { #ifdef TRINITY Eluna::Push(L, creature->GetSpawnId()); @@ -876,7 +876,7 @@ namespace LuaCreature * * @param [NPCFlags] flags */ - int SetNPCFlags(Eluna* /*E*/, lua_State* L, Creature* creature) + int SetNPCFlags(lua_State* L, Creature* creature) { uint32 flags = Eluna::CHECKVAL(L, 2); @@ -890,7 +890,7 @@ namespace LuaCreature * * @param bool enable = true */ - int SetDisableGravity(Eluna* /*E*/, lua_State* L, Creature* creature) + int SetDisableGravity(lua_State* L, Creature* creature) { bool enable = Eluna::CHECKVAL(L, 2, true); @@ -903,7 +903,7 @@ namespace LuaCreature } #ifdef TRINITY - int SetLootMode(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement LootMode features + int SetLootMode(lua_State* L, Creature* creature) // TODO: Implement LootMode features { uint16 lootMode = Eluna::CHECKVAL(L, 2); @@ -917,7 +917,7 @@ namespace LuaCreature * * @param [DeathState] deathState */ - int SetDeathState(Eluna* /*E*/, lua_State* L, Creature* creature) + int SetDeathState(lua_State* L, Creature* creature) { int32 state = Eluna::CHECKVAL(L, 2); @@ -934,7 +934,7 @@ namespace LuaCreature * * @param bool enable = true : `true` to enable walking, `false` for running */ - int SetWalk(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Move same to Player ? + int SetWalk(lua_State* L, Creature* creature) // TODO: Move same to Player ? { bool enable = Eluna::CHECKVAL(L, 2, true); @@ -949,7 +949,7 @@ namespace LuaCreature * @param uint32 off_hand : off hand [Item]'s entry * @param uint32 ranged : ranged [Item]'s entry */ - int SetEquipmentSlots(Eluna* /*E*/, lua_State* L, Creature* creature) + int SetEquipmentSlots(lua_State* L, Creature* creature) { uint32 main_hand = Eluna::CHECKVAL(L, 2); uint32 off_hand = Eluna::CHECKVAL(L, 3); @@ -972,7 +972,7 @@ namespace LuaCreature * * @param bool allow = true : `true` to allow aggro, `false` to disable aggro */ - int SetAggroEnabled(Eluna* /*E*/, lua_State* L, Creature* creature) + int SetAggroEnabled(lua_State* L, Creature* creature) { bool allow = Eluna::CHECKVAL(L, 2, true); @@ -996,7 +996,7 @@ namespace LuaCreature * * @param bool disable = true : `true` to disable reputation, `false` to enable */ - int SetDisableReputationGain(Eluna* /*E*/, lua_State* L, Creature* creature) + int SetDisableReputationGain(lua_State* L, Creature* creature) { bool disable = Eluna::CHECKVAL(L, 2, true); @@ -1010,7 +1010,7 @@ namespace LuaCreature * This is used by raid bosses to prevent Players from using out-of-combat * actions once the encounter has begun. */ - int SetInCombatWithZone(Eluna* /*E*/, lua_State* /*L*/, Creature* creature) + int SetInCombatWithZone(lua_State* /*L*/, Creature* creature) { creature->SetInCombatWithZone(); return 0; @@ -1021,7 +1021,7 @@ namespace LuaCreature * * @param float distance */ - int SetWanderRadius(Eluna* /*E*/, lua_State* L, Creature* creature) + int SetWanderRadius(lua_State* L, Creature* creature) { float dist = Eluna::CHECKVAL(L, 2); @@ -1034,7 +1034,7 @@ namespace LuaCreature * * @param uint32 delay : the delay, in seconds */ - int SetRespawnDelay(Eluna* /*E*/, lua_State* L, Creature* creature) + int SetRespawnDelay(lua_State* L, Creature* creature) { uint32 delay = Eluna::CHECKVAL(L, 2); @@ -1047,7 +1047,7 @@ namespace LuaCreature * * @param [MovementGeneratorType] type */ - int SetDefaultMovementType(Eluna* /*E*/, lua_State* L, Creature* creature) + int SetDefaultMovementType(lua_State* L, Creature* creature) { int32 type = Eluna::CHECKVAL(L, 2); @@ -1060,7 +1060,7 @@ namespace LuaCreature * * @param bool enable = true : `true` to disable searching, `false` to allow */ - int SetNoSearchAssistance(Eluna* /*E*/, lua_State* L, Creature* creature) + int SetNoSearchAssistance(lua_State* L, Creature* creature) { bool val = Eluna::CHECKVAL(L, 2, true); @@ -1073,7 +1073,7 @@ namespace LuaCreature * * @param bool enable = true : `true` to disable calling for help, `false` to enable */ - int SetNoCallAssistance(Eluna* /*E*/, lua_State* L, Creature* creature) + int SetNoCallAssistance(lua_State* L, Creature* creature) { bool val = Eluna::CHECKVAL(L, 2, true); @@ -1086,7 +1086,7 @@ namespace LuaCreature * * @param bool enable = true : `true` to enable hovering, `false` to disable */ - int SetHover(Eluna* /*E*/, lua_State* L, Creature* creature) + int SetHover(lua_State* L, Creature* creature) { bool enable = Eluna::CHECKVAL(L, 2, true); @@ -1116,7 +1116,7 @@ namespace LuaCreature * * @param uint32 delay = 0 : dely to despawn in milliseconds */ - int DespawnOrUnsummon(Eluna* /*E*/, lua_State* L, Creature* creature) + int DespawnOrUnsummon(lua_State* L, Creature* creature) { uint32 msTimeToDespawn = Eluna::CHECKVAL(L, 2, 0); @@ -1131,7 +1131,7 @@ namespace LuaCreature /** * Respawn this [Creature]. */ - int Respawn(Eluna* /*E*/, lua_State* /*L*/, Creature* creature) + int Respawn(lua_State* /*L*/, Creature* creature) { creature->Respawn(); return 0; @@ -1140,7 +1140,7 @@ namespace LuaCreature /** * Remove this [Creature]'s corpse. */ - int RemoveCorpse(Eluna* /*E*/, lua_State* /*L*/, Creature* creature) + int RemoveCorpse(lua_State* /*L*/, Creature* creature) { creature->RemoveCorpse(); return 0; @@ -1149,7 +1149,7 @@ namespace LuaCreature /** * Make the [Creature] start following its waypoint path. */ - int MoveWaypoint(Eluna* /*E*/, lua_State* /*L*/, Creature* creature) + int MoveWaypoint(lua_State* /*L*/, Creature* creature) { #ifndef TRINITY creature->GetMotionMaster()->MoveWaypoint(); @@ -1162,7 +1162,7 @@ namespace LuaCreature /** * Make the [Creature] call for assistance in combat from other nearby [Creature]s. */ - int CallAssistance(Eluna* /*E*/, lua_State* /*L*/, Creature* creature) + int CallAssistance(lua_State* /*L*/, Creature* creature) { creature->CallAssistance(); return 0; @@ -1173,7 +1173,7 @@ namespace LuaCreature * * @param float radius */ - int CallForHelp(Eluna* /*E*/, lua_State* L, Creature* creature) + int CallForHelp(lua_State* L, Creature* creature) { float radius = Eluna::CHECKVAL(L, 2); @@ -1184,7 +1184,7 @@ namespace LuaCreature /** * Make the [Creature] flee combat to get assistance from a nearby friendly [Creature]. */ - int FleeToGetAssistance(Eluna* /*E*/, lua_State* /*L*/, Creature* creature) + int FleeToGetAssistance(lua_State* /*L*/, Creature* creature) { creature->DoFleeToGetAssistance(); return 0; @@ -1195,7 +1195,7 @@ namespace LuaCreature * * @param [Unit] target */ - int AttackStart(Eluna* /*E*/, lua_State* L, Creature* creature) + int AttackStart(lua_State* L, Creature* creature) { Unit* target = Eluna::CHECKOBJ(L, 2); @@ -1206,7 +1206,7 @@ namespace LuaCreature /** * Save the [Creature] in the database. */ - int SaveToDB(Eluna* /*E*/, lua_State* /*L*/, Creature* creature) + int SaveToDB(lua_State* /*L*/, Creature* creature) { creature->SaveToDB(); return 0; @@ -1217,7 +1217,7 @@ namespace LuaCreature * * This should be called every update cycle for the Creature's AI. */ - int SelectVictim(Eluna* /*E*/, lua_State* L, Creature* creature) + int SelectVictim(lua_State* L, Creature* creature) { #ifndef TRINITY Eluna::Push(L, creature->SelectHostileTarget()); @@ -1233,7 +1233,7 @@ namespace LuaCreature * @param uint32 entry : the Creature ID to transform into * @param uint32 dataGUIDLow = 0 : use this Creature's model and equipment instead of the defaults */ - int UpdateEntry(Eluna* /*E*/, lua_State* L, Creature* creature) + int UpdateEntry(lua_State* L, Creature* creature) { uint32 entry = Eluna::CHECKVAL(L, 2); uint32 dataGuidLow = Eluna::CHECKVAL(L, 3, 0); @@ -1250,7 +1250,7 @@ namespace LuaCreature /** * Resets [Creature]'s loot mode to default */ - int ResetLootMode(Eluna* /*E*/, lua_State* /*L*/, Creature* creature) // TODO: Implement LootMode features + int ResetLootMode(lua_State* /*L*/, Creature* creature) // TODO: Implement LootMode features { creature->ResetLootMode(); return 0; @@ -1261,7 +1261,7 @@ namespace LuaCreature * * @param uint16 lootMode */ - int RemoveLootMode(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement LootMode features + int RemoveLootMode(lua_State* L, Creature* creature) // TODO: Implement LootMode features { uint16 lootMode = Eluna::CHECKVAL(L, 2); @@ -1274,7 +1274,7 @@ namespace LuaCreature * * @param uint16 lootMode */ - int AddLootMode(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement LootMode features + int AddLootMode(lua_State* L, Creature* creature) // TODO: Implement LootMode features { uint16 lootMode = Eluna::CHECKVAL(L, 2); diff --git a/ElunaQueryMethods.h b/ElunaQueryMethods.h index 07e8b33..4f2ea38 100644 --- a/ElunaQueryMethods.h +++ b/ElunaQueryMethods.h @@ -40,7 +40,7 @@ namespace LuaQuery * @param uint32 column * @return bool isNull */ - int IsNull(Eluna* /*E*/, lua_State* L, ElunaQuery* result) + int IsNull(lua_State* L, ElunaQuery* result) { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); @@ -58,7 +58,7 @@ namespace LuaQuery * * @return uint32 columnCount */ - int GetColumnCount(Eluna* /*E*/, lua_State* L, ElunaQuery* result) + int GetColumnCount(lua_State* L, ElunaQuery* result) { Eluna::Push(L, RESULT->GetFieldCount()); return 1; @@ -69,7 +69,7 @@ namespace LuaQuery * * @return uint32 rowCount */ - int GetRowCount(Eluna* /*E*/, lua_State* L, ElunaQuery* result) + int GetRowCount(lua_State* L, ElunaQuery* result) { if (RESULT->GetRowCount() > (uint32)-1) Eluna::Push(L, (uint32)-1); @@ -84,7 +84,7 @@ namespace LuaQuery * @param uint32 column * @return bool data */ - int GetBool(Eluna* /*E*/, lua_State* L, ElunaQuery* result) + int GetBool(lua_State* L, ElunaQuery* result) { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); @@ -98,7 +98,7 @@ namespace LuaQuery * @param uint32 column * @return uint8 data */ - int GetUInt8(Eluna* /*E*/, lua_State* L, ElunaQuery* result) + int GetUInt8(lua_State* L, ElunaQuery* result) { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); @@ -112,7 +112,7 @@ namespace LuaQuery * @param uint32 column * @return uint16 data */ - int GetUInt16(Eluna* /*E*/, lua_State* L, ElunaQuery* result) + int GetUInt16(lua_State* L, ElunaQuery* result) { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); @@ -126,7 +126,7 @@ namespace LuaQuery * @param uint32 column * @return uint32 data */ - int GetUInt32(Eluna* /*E*/, lua_State* L, ElunaQuery* result) + int GetUInt32(lua_State* L, ElunaQuery* result) { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); @@ -140,7 +140,7 @@ namespace LuaQuery * @param uint32 column * @return uint64 data */ - int GetUInt64(Eluna* /*E*/, lua_State* L, ElunaQuery* result) + int GetUInt64(lua_State* L, ElunaQuery* result) { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); @@ -154,7 +154,7 @@ namespace LuaQuery * @param uint32 column * @return int8 data */ - int GetInt8(Eluna* /*E*/, lua_State* L, ElunaQuery* result) + int GetInt8(lua_State* L, ElunaQuery* result) { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); @@ -168,7 +168,7 @@ namespace LuaQuery * @param uint32 column * @return int16 data */ - int GetInt16(Eluna* /*E*/, lua_State* L, ElunaQuery* result) + int GetInt16(lua_State* L, ElunaQuery* result) { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); @@ -182,7 +182,7 @@ namespace LuaQuery * @param uint32 column * @return int32 data */ - int GetInt32(Eluna* /*E*/, lua_State* L, ElunaQuery* result) + int GetInt32(lua_State* L, ElunaQuery* result) { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); @@ -196,7 +196,7 @@ namespace LuaQuery * @param uint32 column * @return int64 data */ - int GetInt64(Eluna* /*E*/, lua_State* L, ElunaQuery* result) + int GetInt64(lua_State* L, ElunaQuery* result) { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); @@ -210,7 +210,7 @@ namespace LuaQuery * @param uint32 column * @return float data */ - int GetFloat(Eluna* /*E*/, lua_State* L, ElunaQuery* result) + int GetFloat(lua_State* L, ElunaQuery* result) { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); @@ -224,7 +224,7 @@ namespace LuaQuery * @param uint32 column * @return double data */ - int GetDouble(Eluna* /*E*/, lua_State* L, ElunaQuery* result) + int GetDouble(lua_State* L, ElunaQuery* result) { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); @@ -238,7 +238,7 @@ namespace LuaQuery * @param uint32 column * @return string data */ - int GetString(Eluna* /*E*/, lua_State* L, ElunaQuery* result) + int GetString(lua_State* L, ElunaQuery* result) { uint32 col = Eluna::CHECKVAL(L, 2); CheckFields(L, result); @@ -260,7 +260,7 @@ namespace LuaQuery * * @return bool hadNextRow */ - int NextRow(Eluna* /*E*/, lua_State* L, ElunaQuery* result) + int NextRow(lua_State* L, ElunaQuery* result) { Eluna::Push(L, RESULT->NextRow()); return 1; @@ -283,7 +283,7 @@ namespace LuaQuery * * @return table rowData : table filled with row columns and data where `T[column] = data` */ - int GetRow(Eluna* /*E*/, lua_State* L, ElunaQuery* result) + int GetRow(lua_State* L, ElunaQuery* result) { lua_newtable(L); int tbl = lua_gettop(L); diff --git a/ElunaTemplate.h b/ElunaTemplate.h index ce821ee..b96a042 100644 --- a/ElunaTemplate.h +++ b/ElunaTemplate.h @@ -20,42 +20,33 @@ extern "C" class ElunaGlobal { public: - struct ElunaRegister - { - const char* name; - int(*mfunc)(Eluna*, lua_State*); - }; - static int thunk(lua_State* L) { - ElunaRegister* l = static_cast(lua_touserdata(L, lua_upvalueindex(1))); - Eluna* E = static_cast(lua_touserdata(L, lua_upvalueindex(2))); - int args = lua_gettop(L); - int expected = l->mfunc(E, L); - args = lua_gettop(L) - args; + luaL_Reg* l = static_cast(lua_touserdata(L, lua_upvalueindex(1))); + int top = lua_gettop(L); + int expected = l->func(L); + int args = lua_gettop(L) - top; if (args < 0 || args > expected) { ELUNA_LOG_ERROR("[Eluna]: %s returned unexpected amount of arguments %i out of %i. Report to devs", l->name, args, expected); ASSERT(false); } - for (; args < expected; ++args) - lua_pushnil(L); + lua_settop(L, top + expected); return expected; } - static void SetMethods(Eluna* E, ElunaRegister* methodTable) + static void SetMethods(Eluna* E, luaL_Reg* methodTable) { ASSERT(E); ASSERT(methodTable); lua_pushglobaltable(E->L); - for (; methodTable && methodTable->name && methodTable->mfunc; ++methodTable) + for (; methodTable && methodTable->name && methodTable->func; ++methodTable) { lua_pushstring(E->L, methodTable->name); lua_pushlightuserdata(E->L, (void*)methodTable); - lua_pushlightuserdata(E->L, (void*)E); - lua_pushcclosure(E->L, thunk, 2); + lua_pushcclosure(E->L, thunk, 1); lua_settable(E->L, -3); } @@ -118,7 +109,7 @@ template struct ElunaRegister { const char* name; - int(*mfunc)(Eluna*, lua_State*, T*); + int(*mfunc)(lua_State*, T*); }; template @@ -247,8 +238,7 @@ public: { lua_pushstring(E->L, methodTable->name); lua_pushlightuserdata(E->L, (void*)methodTable); - lua_pushlightuserdata(E->L, (void*)E); - lua_pushcclosure(E->L, CallMethod, 2); + lua_pushcclosure(E->L, CallMethod, 1); lua_settable(E->L, -3); } @@ -356,19 +346,16 @@ public: if (!obj) return 0; ElunaRegister* l = static_cast*>(lua_touserdata(L, lua_upvalueindex(1))); - Eluna* E = static_cast(lua_touserdata(L, lua_upvalueindex(2))); int top = lua_gettop(L); - int expected = l->mfunc(E, L, obj); + int expected = l->mfunc(L, obj); int args = lua_gettop(L) - top; if (args < 0 || args > expected) { ELUNA_LOG_ERROR("[Eluna]: %s returned unexpected amount of arguments %i out of %i. Report to devs", l->name, args, expected); ASSERT(false); } - if (args == expected) - return expected; - lua_settop(L, top); - return 0; + lua_settop(L, top + expected); + return expected; } // Metamethods ("virtual") diff --git a/GameObjectMethods.h b/GameObjectMethods.h index 6031f35..939a78d 100644 --- a/GameObjectMethods.h +++ b/GameObjectMethods.h @@ -18,7 +18,7 @@ namespace LuaGameObject * @param uint32 questId : quest entry Id to check * @return bool hasQuest */ - int HasQuest(Eluna* /*E*/, lua_State* L, GameObject* go) + int HasQuest(lua_State* L, GameObject* go) { uint32 questId = Eluna::CHECKVAL(L, 2); @@ -35,7 +35,7 @@ namespace LuaGameObject * * @return bool isSpawned */ - int IsSpawned(Eluna* /*E*/, lua_State* L, GameObject* go) + int IsSpawned(lua_State* L, GameObject* go) { Eluna::Push(L, go->isSpawned()); return 1; @@ -46,7 +46,7 @@ namespace LuaGameObject * * @return bool isTransport */ - int IsTransport(Eluna* /*E*/, lua_State* L, GameObject* go) + int IsTransport(lua_State* L, GameObject* go) { Eluna::Push(L, go->IsTransport()); return 1; @@ -57,13 +57,13 @@ namespace LuaGameObject * * @return bool isActive */ - int IsActive(Eluna* /*E*/, lua_State* L, GameObject* go) + int IsActive(lua_State* L, GameObject* go) { Eluna::Push(L, go->isActiveObject()); return 1; } - /*int IsDestructible(Eluna* E, lua_State* L, GameObject* go) // TODO: Implementation core side + /*int IsDestructible(lua_State* L, GameObject* go) // TODO: Implementation core side { Eluna::Push(L, go->IsDestructibleBuilding()); return 1; @@ -74,7 +74,7 @@ namespace LuaGameObject * * @return uint32 displayId */ - int GetDisplayId(Eluna* /*E*/, lua_State* L, GameObject* go) + int GetDisplayId(lua_State* L, GameObject* go) { Eluna::Push(L, go->GetDisplayId()); return 1; @@ -95,7 +95,7 @@ namespace LuaGameObject * * @return [GOState] goState */ - int GetGoState(Eluna* /*E*/, lua_State* L, GameObject* go) + int GetGoState(lua_State* L, GameObject* go) { Eluna::Push(L, go->GetGoState()); return 1; @@ -117,7 +117,7 @@ namespace LuaGameObject * * @return [LootState] lootState */ - int GetLootState(Eluna* /*E*/, lua_State* L, GameObject* go) + int GetLootState(lua_State* L, GameObject* go) { Eluna::Push(L, go->getLootState()); return 1; @@ -128,7 +128,7 @@ namespace LuaGameObject * * @return [Player] player */ - int GetLootRecipient(Eluna* /*E*/, lua_State* L, GameObject* go) + int GetLootRecipient(lua_State* L, GameObject* go) { Eluna::Push(L, go->GetLootRecipient()); return 1; @@ -139,7 +139,7 @@ namespace LuaGameObject * * @return [Group] group */ - int GetLootRecipientGroup(Eluna* /*E*/, lua_State* L, GameObject* go) + int GetLootRecipientGroup(lua_State* L, GameObject* go) { #ifdef TRINITY Eluna::Push(L, go->GetLootRecipientGroup()); @@ -154,7 +154,7 @@ namespace LuaGameObject * * @return uint32 dbguid */ - int GetDBTableGUIDLow(Eluna* /*E*/, lua_State* L, GameObject* go) + int GetDBTableGUIDLow(lua_State* L, GameObject* go) { #ifdef TRINITY Eluna::Push(L, go->GetSpawnId()); @@ -179,7 +179,7 @@ namespace LuaGameObject * * @param [GOState] state : all available go states can be seen above */ - int SetGoState(Eluna* /*E*/, lua_State* L, GameObject* go) + int SetGoState(lua_State* L, GameObject* go) { uint32 state = Eluna::CHECKVAL(L, 2, 0); @@ -209,7 +209,7 @@ namespace LuaGameObject * * @param [LootState] state : all available loot states can be seen above */ - int SetLootState(Eluna* /*E*/, lua_State* L, GameObject* go) + int SetLootState(lua_State* L, GameObject* go) { uint32 state = Eluna::CHECKVAL(L, 2, 0); @@ -229,7 +229,7 @@ namespace LuaGameObject * Saves [GameObject] to the database * */ - int SaveToDB(Eluna* /*E*/, lua_State* /*L*/, GameObject* go) + int SaveToDB(lua_State* /*L*/, GameObject* go) { go->SaveToDB(); return 0; @@ -242,7 +242,7 @@ namespace LuaGameObject * * @param bool deleteFromDB : if true, it will delete the [GameObject] from the database */ - int RemoveFromWorld(Eluna* /*E*/, lua_State* L, GameObject* go) + int RemoveFromWorld(lua_State* L, GameObject* go) { bool deldb = Eluna::CHECKVAL(L, 2, false); @@ -276,7 +276,7 @@ namespace LuaGameObject * * @param uint32 delay = 0 : cooldown time in seconds to restore the [GameObject] back to normal. 0 for infinite duration */ - int UseDoorOrButton(Eluna* /*E*/, lua_State* L, GameObject* go) + int UseDoorOrButton(lua_State* L, GameObject* go) { uint32 delay = Eluna::CHECKVAL(L, 2, 0); @@ -289,7 +289,7 @@ namespace LuaGameObject * * The gameobject may be automatically respawned by the core */ - int Despawn(Eluna* /*E*/, lua_State* L, GameObject* go) + int Despawn(lua_State* L, GameObject* go) { go->SetLootState(GO_JUST_DEACTIVATED); return 0; @@ -298,7 +298,7 @@ namespace LuaGameObject /** * Respawns a [GameObject] */ - int Respawn(Eluna* /*E*/, lua_State* L, GameObject* go) + int Respawn(lua_State* L, GameObject* go) { go->Respawn(); return 0; @@ -311,7 +311,7 @@ namespace LuaGameObject * * @param int32 delay = 0 : cooldown time in seconds to respawn or despawn the object. 0 means never */ - int SetRespawnTime(Eluna* /*E*/, lua_State* L, GameObject* go) + int SetRespawnTime(lua_State* L, GameObject* go) { int32 respawn = Eluna::CHECKVAL(L, 2); diff --git a/GlobalMethods.h b/GlobalMethods.h index c2e2e6d..d828efd 100644 --- a/GlobalMethods.h +++ b/GlobalMethods.h @@ -21,7 +21,7 @@ namespace LuaGlobalFunctions * * @return string engineName */ - int GetLuaEngine(Eluna* /*E*/, lua_State* L) + int GetLuaEngine(lua_State* L) { Eluna::Push(L, "ElunaEngine"); return 1; @@ -34,7 +34,7 @@ namespace LuaGlobalFunctions * * @return string coreName */ - int GetCoreName(Eluna* /*E*/, lua_State* L) + int GetCoreName(lua_State* L) { Eluna::Push(L, CORE_NAME); return 1; @@ -49,7 +49,7 @@ namespace LuaGlobalFunctions * * @return string version */ - int GetCoreVersion(Eluna* /*E*/, lua_State* L) + int GetCoreVersion(lua_State* L) { Eluna::Push(L, CORE_VERSION); return 1; @@ -62,7 +62,7 @@ namespace LuaGlobalFunctions * * @return int32 expansion */ - int GetCoreExpansion(Eluna* /*E*/, lua_State* L) + int GetCoreExpansion(lua_State* L) { #ifdef CLASSIC Eluna::Push(L, 0); @@ -82,7 +82,7 @@ namespace LuaGlobalFunctions * @param uint32 questId : [Quest] entry ID * @return [Quest] quest */ - int GetQuest(Eluna* /*E*/, lua_State* L) + int GetQuest(lua_State* L) { uint32 questId = Eluna::CHECKVAL(L, 1); @@ -96,7 +96,7 @@ namespace LuaGlobalFunctions * @param uint64 guid : guid of the [Player], you can get it with [Object:GetGUID] * @return [Player] player */ - int GetPlayerByGUID(Eluna* /*E*/, lua_State* L) + int GetPlayerByGUID(lua_State* L) { uint64 guid = Eluna::CHECKVAL(L, 1); Eluna::Push(L, eObjectAccessor()FindPlayer(ObjectGuid(guid))); @@ -109,7 +109,7 @@ namespace LuaGlobalFunctions * @param string name : name of the [Player] * @return [Player] player */ - int GetPlayerByName(Eluna* /*E*/, lua_State* L) + int GetPlayerByName(lua_State* L) { const char* name = Eluna::CHECKVAL(L, 1); Eluna::Push(L, eObjectAccessor()FindPlayerByName(name)); @@ -121,7 +121,7 @@ namespace LuaGlobalFunctions * * @return uint32 time */ - int GetGameTime(Eluna* /*E*/, lua_State* L) + int GetGameTime(lua_State* L) { #ifdef TRINITY Eluna::Push(L, GameTime::GetGameTime()); @@ -147,7 +147,7 @@ namespace LuaGlobalFunctions * @param bool onlyGM = false : optional check if GM only * @return table worldPlayers */ - int GetPlayersInWorld(Eluna* /*E*/, lua_State* L) + int GetPlayersInWorld(lua_State* L) { uint32 team = Eluna::CHECKVAL(L, 1, TEAM_NEUTRAL); bool onlyGM = Eluna::CHECKVAL(L, 2, false); @@ -207,7 +207,7 @@ namespace LuaGlobalFunctions * @param [TeamId] team : optional check team of the [Player], Alliance, Horde or Neutral (All) * @return table mapPlayers */ - int GetPlayersInMap(Eluna* /*E*/, lua_State* L) + int GetPlayersInMap(lua_State* L) { uint32 mapID = Eluna::CHECKVAL(L, 1); uint32 instanceID = Eluna::CHECKVAL(L, 2, 0); @@ -250,7 +250,7 @@ namespace LuaGlobalFunctions * @param string name * @return [Guild] guild : the Guild, or `nil` if it doesn't exist */ - int GetGuildByName(Eluna* /*E*/, lua_State* L) + int GetGuildByName(lua_State* L) { const char* name = Eluna::CHECKVAL(L, 1); Eluna::Push(L, eGuildMgr->GetGuildByName(name)); @@ -264,7 +264,7 @@ namespace LuaGlobalFunctions * @param uint32 instanceId = 0 : required if the map is an instance, otherwise don't pass anything * @return [Map] map : the Map, or `nil` if it doesn't exist */ - int GetMapById(Eluna* /*E*/, lua_State* L) + int GetMapById(lua_State* L) { uint32 mapid = Eluna::CHECKVAL(L, 1); uint32 instance = Eluna::CHECKVAL(L, 2, 0); @@ -279,7 +279,7 @@ namespace LuaGlobalFunctions * @param uint64 guid : the guid of a [Guild] leader * @return [Guild] guild, or `nil` if it doesn't exist */ - int GetGuildByLeaderGUID(Eluna* /*E*/, lua_State* L) + int GetGuildByLeaderGUID(lua_State* L) { uint64 guid = Eluna::CHECKVAL(L, 1); @@ -292,7 +292,7 @@ namespace LuaGlobalFunctions * * @return uint32 count */ - int GetPlayerCount(Eluna* /*E*/, lua_State* L) + int GetPlayerCount(lua_State* L) { Eluna::Push(L, eWorld->GetActiveSessionCount()); return 1; @@ -308,7 +308,7 @@ namespace LuaGlobalFunctions * @param uint32 lowguid : low GUID of the [Player] * @return uint64 guid */ - int GetPlayerGUID(Eluna* /*E*/, lua_State* L) + int GetPlayerGUID(lua_State* L) { uint32 lowguid = Eluna::CHECKVAL(L, 1); Eluna::Push(L, MAKE_NEW_GUID(lowguid, 0, HIGHGUID_PLAYER)); @@ -324,7 +324,7 @@ namespace LuaGlobalFunctions * @param uint32 lowguid : low GUID of the [Item] * @return uint64 guid */ - int GetItemGUID(Eluna* /*E*/, lua_State* L) + int GetItemGUID(lua_State* L) { uint32 lowguid = Eluna::CHECKVAL(L, 1); Eluna::Push(L, MAKE_NEW_GUID(lowguid, 0, HIGHGUID_ITEM)); @@ -342,7 +342,7 @@ namespace LuaGlobalFunctions * @param uint32 entry : entry ID of the [GameObject] * @return uint64 guid */ - int GetObjectGUID(Eluna* /*E*/, lua_State* L) + int GetObjectGUID(lua_State* L) { uint32 lowguid = Eluna::CHECKVAL(L, 1); uint32 entry = Eluna::CHECKVAL(L, 2); @@ -361,7 +361,7 @@ namespace LuaGlobalFunctions * @param uint32 entry : entry ID of the [Creature] * @return uint64 guid */ - int GetUnitGUID(Eluna* /*E*/, lua_State* L) + int GetUnitGUID(lua_State* L) { uint32 lowguid = Eluna::CHECKVAL(L, 1); uint32 entry = Eluna::CHECKVAL(L, 2); @@ -388,7 +388,7 @@ namespace LuaGlobalFunctions * @param uint64 guid : GUID of an [Object] * @return uint32 lowguid : low GUID of the [Object] */ - int GetGUIDLow(Eluna* /*E*/, lua_State* L) + int GetGUIDLow(lua_State* L) { uint64 guid = Eluna::CHECKVAL(L, 1); @@ -416,7 +416,7 @@ namespace LuaGlobalFunctions * @param [LocaleConstant] locale = DEFAULT_LOCALE : locale to return the [Item] name in * @return string itemLink */ - int GetItemLink(Eluna* /*E*/, lua_State* L) + int GetItemLink(lua_State* L) { uint32 entry = Eluna::CHECKVAL(L, 1); uint8 locale = Eluna::CHECKVAL(L, 2, DEFAULT_LOCALE); @@ -453,7 +453,7 @@ namespace LuaGlobalFunctions * @param uint64 guid : GUID of an [Object] * @return int32 typeId : type ID of the [Object] */ - int GetGUIDType(Eluna* /*E*/, lua_State* L) + int GetGUIDType(lua_State* L) { uint64 guid = Eluna::CHECKVAL(L, 1); Eluna::Push(L, static_cast(GUID_HIPART(guid))); @@ -468,7 +468,7 @@ namespace LuaGlobalFunctions * @param uint64 guid : GUID of an [Creature] or [GameObject] * @return uint32 entry : entry ID, or `0` if `guid` is not a [Creature] or [GameObject] */ - int GetGUIDEntry(Eluna* /*E*/, lua_State* L) + int GetGUIDEntry(lua_State* L) { uint64 guid = Eluna::CHECKVAL(L, 1); Eluna::Push(L, GUID_ENPART(guid)); @@ -495,7 +495,7 @@ namespace LuaGlobalFunctions * @param [LocaleConstant] locale = DEFAULT_LOCALE : locale to return the name in * @return string areaOrZoneName */ - int GetAreaName(Eluna* /*E*/, lua_State* L) + int GetAreaName(lua_State* L) { uint32 areaOrZoneId = Eluna::CHECKVAL(L, 1); uint8 locale = Eluna::CHECKVAL(L, 2, DEFAULT_LOCALE); @@ -514,7 +514,7 @@ namespace LuaGlobalFunctions return 1; } - static int RegisterEntryHelper(Eluna* E, lua_State* L, int regtype) + static int RegisterEntryHelper(lua_State* L, int regtype) { uint32 id = Eluna::CHECKVAL(L, 1); uint32 ev = Eluna::CHECKVAL(L, 2); @@ -524,13 +524,13 @@ namespace LuaGlobalFunctions lua_pushvalue(L, 3); int functionRef = luaL_ref(L, LUA_REGISTRYINDEX); if (functionRef >= 0) - return E->Register(L, regtype, id, 0, 0, ev, functionRef, shots); + return Eluna::GetEluna(L)->Register(L, regtype, id, 0, 0, ev, functionRef, shots); else luaL_argerror(L, 3, "unable to make a ref to function"); return 0; } - static int RegisterEventHelper(Eluna* E, lua_State* L, int regtype) + static int RegisterEventHelper(lua_State* L, int regtype) { uint32 ev = Eluna::CHECKVAL(L, 1); luaL_checktype(L, 2, LUA_TFUNCTION); @@ -539,13 +539,13 @@ namespace LuaGlobalFunctions lua_pushvalue(L, 2); int functionRef = luaL_ref(L, LUA_REGISTRYINDEX); if (functionRef >= 0) - return E->Register(L, regtype, 0, 0, 0, ev, functionRef, shots); + return Eluna::GetEluna(L)->Register(L, regtype, 0, 0, 0, ev, functionRef, shots); else luaL_argerror(L, 2, "unable to make a ref to function"); return 0; } - static int RegisterUniqueHelper(Eluna* E, lua_State* L, int regtype) + static int RegisterUniqueHelper(lua_State* L, int regtype) { uint64 guid = Eluna::CHECKVAL(L, 1); uint32 instanceId = Eluna::CHECKVAL(L, 2); @@ -556,7 +556,7 @@ namespace LuaGlobalFunctions lua_pushvalue(L, 4); int functionRef = luaL_ref(L, LUA_REGISTRYINDEX); if (functionRef >= 0) - return E->Register(L, regtype, 0, guid, instanceId, ev, functionRef, shots); + return Eluna::GetEluna(L)->Register(L, regtype, 0, guid, instanceId, ev, functionRef, shots); else luaL_argerror(L, 4, "unable to make a ref to function"); return 0; @@ -629,9 +629,9 @@ namespace LuaGlobalFunctions * * @return function cancel : a function that cancels the binding when called */ - int RegisterServerEvent(Eluna* E, lua_State* L) + int RegisterServerEvent(lua_State* L) { - return RegisterEventHelper(E, L, Hooks::REGTYPE_SERVER); + return RegisterEventHelper(L, Hooks::REGTYPE_SERVER); } /** @@ -698,9 +698,9 @@ namespace LuaGlobalFunctions * * @return function cancel : a function that cancels the binding when called */ - int RegisterPlayerEvent(Eluna* E, lua_State* L) + int RegisterPlayerEvent(lua_State* L) { - return RegisterEventHelper(E, L, Hooks::REGTYPE_PLAYER); + return RegisterEventHelper(L, Hooks::REGTYPE_PLAYER); } /** @@ -735,9 +735,9 @@ namespace LuaGlobalFunctions * * @return function cancel : a function that cancels the binding when called */ - int RegisterGuildEvent(Eluna* E, lua_State* L) + int RegisterGuildEvent(lua_State* L) { - return RegisterEventHelper(E, L, Hooks::REGTYPE_GUILD); + return RegisterEventHelper(L, Hooks::REGTYPE_GUILD); } /** @@ -767,9 +767,9 @@ namespace LuaGlobalFunctions * * @return function cancel : a function that cancels the binding when called */ - int RegisterGroupEvent(Eluna* E, lua_State* L) + int RegisterGroupEvent(lua_State* L) { - return RegisterEventHelper(E, L, Hooks::REGTYPE_GROUP); + return RegisterEventHelper(L, Hooks::REGTYPE_GROUP); } /** @@ -795,9 +795,9 @@ namespace LuaGlobalFunctions * * @return function cancel : a function that cancels the binding when called */ - int RegisterBGEvent(Eluna* E, lua_State* L) + int RegisterBGEvent(lua_State* L) { - return RegisterEventHelper(E, L, Hooks::REGTYPE_BG); + return RegisterEventHelper(L, Hooks::REGTYPE_BG); } /** @@ -824,9 +824,9 @@ namespace LuaGlobalFunctions * * @return function cancel : a function that cancels the binding when called */ - int RegisterPacketEvent(Eluna* E, lua_State* L) + int RegisterPacketEvent(lua_State* L) { - return RegisterEntryHelper(E, L, Hooks::REGTYPE_PACKET); + return RegisterEntryHelper(L, Hooks::REGTYPE_PACKET); } /** @@ -851,9 +851,9 @@ namespace LuaGlobalFunctions * * @return function cancel : a function that cancels the binding when called */ - int RegisterCreatureGossipEvent(Eluna* E, lua_State* L) + int RegisterCreatureGossipEvent(lua_State* L) { - return RegisterEntryHelper(E, L, Hooks::REGTYPE_CREATURE_GOSSIP); + return RegisterEntryHelper(L, Hooks::REGTYPE_CREATURE_GOSSIP); } /** @@ -878,9 +878,9 @@ namespace LuaGlobalFunctions * * @return function cancel : a function that cancels the binding when called */ - int RegisterGameObjectGossipEvent(Eluna* E, lua_State* L) + int RegisterGameObjectGossipEvent(lua_State* L) { - return RegisterEntryHelper(E, L, Hooks::REGTYPE_GAMEOBJECT_GOSSIP); + return RegisterEntryHelper(L, Hooks::REGTYPE_GAMEOBJECT_GOSSIP); } /** @@ -908,9 +908,9 @@ namespace LuaGlobalFunctions * * @return function cancel : a function that cancels the binding when called */ - int RegisterItemEvent(Eluna* E, lua_State* L) + int RegisterItemEvent(lua_State* L) { - return RegisterEntryHelper(E, L, Hooks::REGTYPE_ITEM); + return RegisterEntryHelper(L, Hooks::REGTYPE_ITEM); } /** @@ -935,9 +935,9 @@ namespace LuaGlobalFunctions * * @return function cancel : a function that cancels the binding when called */ - int RegisterItemGossipEvent(Eluna* E, lua_State* L) + int RegisterItemGossipEvent(lua_State* L) { - return RegisterEntryHelper(E, L, Hooks::REGTYPE_ITEM_GOSSIP); + return RegisterEntryHelper(L, Hooks::REGTYPE_ITEM_GOSSIP); } /** @@ -962,9 +962,9 @@ namespace LuaGlobalFunctions * @param function function : function to register * @param uint32 shots = 0 : the number of times the function will be called, 0 means "always call this function" */ - int RegisterMapEvent(Eluna* E, lua_State* L) + int RegisterMapEvent(lua_State* L) { - return RegisterEntryHelper(E, L, Hooks::REGTYPE_MAP); + return RegisterEntryHelper(L, Hooks::REGTYPE_MAP); } /** @@ -989,9 +989,9 @@ namespace LuaGlobalFunctions * @param function function : function to register * @param uint32 shots = 0 : the number of times the function will be called, 0 means "always call this function" */ - int RegisterInstanceEvent(Eluna* E, lua_State* L) + int RegisterInstanceEvent(lua_State* L) { - return RegisterEntryHelper(E, L, Hooks::REGTYPE_INSTANCE); + return RegisterEntryHelper(L, Hooks::REGTYPE_INSTANCE); } /** @@ -1018,9 +1018,9 @@ namespace LuaGlobalFunctions * * @return function cancel : a function that cancels the binding when called */ - int RegisterPlayerGossipEvent(Eluna* E, lua_State* L) + int RegisterPlayerGossipEvent(lua_State* L) { - return RegisterEntryHelper(E, L, Hooks::REGTYPE_PLAYER_GOSSIP); + return RegisterEntryHelper(L, Hooks::REGTYPE_PLAYER_GOSSIP); } /** @@ -1080,9 +1080,9 @@ namespace LuaGlobalFunctions * * @return function cancel : a function that cancels the binding when called */ - int RegisterCreatureEvent(Eluna* E, lua_State* L) + int RegisterCreatureEvent(lua_State* L) { - return RegisterEntryHelper(E, L, Hooks::REGTYPE_CREATURE); + return RegisterEntryHelper(L, Hooks::REGTYPE_CREATURE); } /** @@ -1143,9 +1143,9 @@ namespace LuaGlobalFunctions * * @return function cancel : a function that cancels the binding when called */ - int RegisterUniqueCreatureEvent(Eluna* E, lua_State* L) + int RegisterUniqueCreatureEvent(lua_State* L) { - return RegisterUniqueHelper(E, L, Hooks::REGTYPE_CREATURE); + return RegisterUniqueHelper(L, Hooks::REGTYPE_CREATURE); } /** @@ -1181,15 +1181,15 @@ namespace LuaGlobalFunctions * * @return function cancel : a function that cancels the binding when called */ - int RegisterGameObjectEvent(Eluna* E, lua_State* L) + int RegisterGameObjectEvent(lua_State* L) { - return RegisterEntryHelper(E, L, Hooks::REGTYPE_GAMEOBJECT); + return RegisterEntryHelper(L, Hooks::REGTYPE_GAMEOBJECT); } /** * Reloads the Lua engine. */ - int ReloadEluna(Eluna* /*E*/, lua_State* /*L*/) + int ReloadEluna(lua_State* /*L*/) { Eluna::ReloadEluna(); return 0; @@ -1200,7 +1200,7 @@ namespace LuaGlobalFunctions * * @param string message : message to send */ - int SendWorldMessage(Eluna* /*E*/, lua_State* L) + int SendWorldMessage(lua_State* L) { const char* message = Eluna::CHECKVAL(L, 1); eWorld->SendServerMessage(SERVER_MSG_STRING, message); @@ -1216,7 +1216,7 @@ namespace LuaGlobalFunctions * @param string sql : query to execute * @return [ElunaQuery] results */ - int WorldDBQuery(Eluna* /*E*/, lua_State* L) + int WorldDBQuery(lua_State* L) { const char* query = Eluna::CHECKVAL(L, 1); @@ -1247,7 +1247,7 @@ namespace LuaGlobalFunctions * * @param string sql : query to execute */ - int WorldDBExecute(Eluna* /*E*/, lua_State* L) + int WorldDBExecute(lua_State* L) { const char* query = Eluna::CHECKVAL(L, 1); WorldDatabase.Execute(query); @@ -1263,7 +1263,7 @@ namespace LuaGlobalFunctions * @param string sql : query to execute * @return [ElunaQuery] results */ - int CharDBQuery(Eluna* /*E*/, lua_State* L) + int CharDBQuery(lua_State* L) { const char* query = Eluna::CHECKVAL(L, 1); @@ -1294,7 +1294,7 @@ namespace LuaGlobalFunctions * * @param string sql : query to execute */ - int CharDBExecute(Eluna* /*E*/, lua_State* L) + int CharDBExecute(lua_State* L) { const char* query = Eluna::CHECKVAL(L, 1); CharacterDatabase.Execute(query); @@ -1310,7 +1310,7 @@ namespace LuaGlobalFunctions * @param string sql : query to execute * @return [ElunaQuery] results */ - int AuthDBQuery(Eluna* /*E*/, lua_State* L) + int AuthDBQuery(lua_State* L) { const char* query = Eluna::CHECKVAL(L, 1); @@ -1341,7 +1341,7 @@ namespace LuaGlobalFunctions * * @param string sql : query to execute */ - int AuthDBExecute(Eluna* /*E*/, lua_State* L) + int AuthDBExecute(lua_State* L) { const char* query = Eluna::CHECKVAL(L, 1); LoginDatabase.Execute(query); @@ -1360,7 +1360,7 @@ namespace LuaGlobalFunctions * @param uint32 repeats : how many times for the event to repeat, 0 is infinite * @return int eventId : unique ID for the timed event used to cancel it or nil */ - int CreateLuaEvent(Eluna* E, lua_State* L) + int CreateLuaEvent(lua_State* L) { luaL_checktype(L, 1, LUA_TFUNCTION); uint32 delay = Eluna::CHECKVAL(L, 2); @@ -1370,7 +1370,7 @@ namespace LuaGlobalFunctions int functionRef = luaL_ref(L, LUA_REGISTRYINDEX); if (functionRef != LUA_REFNIL && functionRef != LUA_NOREF) { - E->eventMgr->globalProcessor->AddEvent(functionRef, delay, repeats); + Eluna::GetEluna(L)->eventMgr->globalProcessor->AddEvent(functionRef, delay, repeats); Eluna::Push(L, functionRef); } return 1; @@ -1382,16 +1382,16 @@ namespace LuaGlobalFunctions * @param int eventId : event Id to remove * @param bool all_Events = false : remove from all events, not just global */ - int RemoveEventById(Eluna* E, lua_State* L) + int RemoveEventById(lua_State* L) { int eventId = Eluna::CHECKVAL(L, 1); bool all_Events = Eluna::CHECKVAL(L, 1, false); // not thread safe if (all_Events) - E->eventMgr->SetState(eventId, LUAEVENT_STATE_ABORT); + Eluna::GetEluna(L)->eventMgr->SetState(eventId, LUAEVENT_STATE_ABORT); else - E->eventMgr->globalProcessor->SetState(eventId, LUAEVENT_STATE_ABORT); + Eluna::GetEluna(L)->eventMgr->globalProcessor->SetState(eventId, LUAEVENT_STATE_ABORT); return 0; } @@ -1400,15 +1400,15 @@ namespace LuaGlobalFunctions * * @param bool all_Events = false : remove all events, not just global */ - int RemoveEvents(Eluna* E, lua_State* L) + int RemoveEvents(lua_State* L) { bool all_Events = Eluna::CHECKVAL(L, 1, false); // not thread safe if (all_Events) - E->eventMgr->SetStates(LUAEVENT_STATE_ABORT); + Eluna::GetEluna(L)->eventMgr->SetStates(LUAEVENT_STATE_ABORT); else - E->eventMgr->globalProcessor->SetStates(LUAEVENT_STATE_ABORT); + Eluna::GetEluna(L)->eventMgr->globalProcessor->SetStates(LUAEVENT_STATE_ABORT); return 0; } @@ -1428,7 +1428,7 @@ namespace LuaGlobalFunctions * @param uint32 phase = 1 : phase to put the [Creature] or [GameObject] in * @return [WorldObject] worldObject : returns [Creature] or [GameObject] */ - int PerformIngameSpawn(Eluna* /*E*/, lua_State* L) + int PerformIngameSpawn(lua_State* L) { int spawntype = Eluna::CHECKVAL(L, 1); uint32 entry = Eluna::CHECKVAL(L, 2); @@ -1762,7 +1762,7 @@ namespace LuaGlobalFunctions * @param uint32 size : the size of the packet * @return [WorldPacket] packet */ - int CreatePacket(Eluna* /*E*/, lua_State* L) + int CreatePacket(lua_State* L) { uint32 opcode = Eluna::CHECKVAL(L, 1); size_t size = Eluna::CHECKVAL(L, 2); @@ -1782,7 +1782,7 @@ namespace LuaGlobalFunctions * @param uint32 incrtime : combined with maxcount, incrtime tells how often (in seconds) the vendor list is refreshed and the limited [Item] copies are restocked * @param uint32 extendedcost : unique cost of an [Item], such as conquest points for example */ - int AddVendorItem(Eluna* /*E*/, lua_State* L) + int AddVendorItem(lua_State* L) { uint32 entry = Eluna::CHECKVAL(L, 1); uint32 item = Eluna::CHECKVAL(L, 2); @@ -1818,7 +1818,7 @@ namespace LuaGlobalFunctions * @param uint32 entry : [Creature] entry Id * @param uint32 item : [Item] entry Id */ - int VendorRemoveItem(Eluna* /*E*/, lua_State* L) + int VendorRemoveItem(lua_State* L) { uint32 entry = Eluna::CHECKVAL(L, 1); uint32 item = Eluna::CHECKVAL(L, 2); @@ -1838,7 +1838,7 @@ namespace LuaGlobalFunctions * * @param uint32 entry : [Creature] entry Id */ - int VendorRemoveAllItems(Eluna* /*E*/, lua_State* L) + int VendorRemoveAllItems(lua_State* L) { uint32 entry = Eluna::CHECKVAL(L, 1); @@ -1861,7 +1861,7 @@ namespace LuaGlobalFunctions * * @param [Player] player : [Player] to kick */ - int Kick(Eluna* /*E*/, lua_State* L) + int Kick(lua_State* L) { Player* player = Eluna::CHECKOBJ(L, 1); player->GetSession()->KickPlayer(); @@ -1884,7 +1884,7 @@ namespace LuaGlobalFunctions * @param string reason = "" : ban reason, this is optional * @param string whoBanned = "" : the [Player]'s name that banned the account, character or IP, this is optional */ - int Ban(Eluna* /*E*/, lua_State* L) + int Ban(lua_State* L) { int banMode = Eluna::CHECKVAL(L, 1); std::string nameOrIP = Eluna::CHECKVAL(L, 2); @@ -1922,7 +1922,7 @@ namespace LuaGlobalFunctions /** * Saves all [Player]s. */ - int SaveAllPlayers(Eluna* /*E*/, lua_State* /*L*/) + int SaveAllPlayers(lua_State* /*L*/) { eObjectAccessor()SaveAllPlayers(); return 0; @@ -1956,7 +1956,7 @@ namespace LuaGlobalFunctions * @param uint32 entry = 0 : entry of an [Item] to send with mail * @param uint32 amount = 0 : amount of the [Item] to send with mail */ - int SendMail(Eluna* /*E*/, lua_State* L) + int SendMail(lua_State* L) { int i = 0; std::string subject = Eluna::CHECKVAL(L, ++i); @@ -2036,7 +2036,7 @@ namespace LuaGlobalFunctions * @param uint32 b * @return uint32 result */ - int bit_and(Eluna* /*E*/, lua_State* L) + int bit_and(lua_State* L) { uint32 a = Eluna::CHECKVAL(L, 1); uint32 b = Eluna::CHECKVAL(L, 2); @@ -2051,7 +2051,7 @@ namespace LuaGlobalFunctions * @param uint32 b * @return uint32 result */ - int bit_or(Eluna* /*E*/, lua_State* L) + int bit_or(lua_State* L) { uint32 a = Eluna::CHECKVAL(L, 1); uint32 b = Eluna::CHECKVAL(L, 2); @@ -2066,7 +2066,7 @@ namespace LuaGlobalFunctions * @param uint32 b * @return uint32 result */ - int bit_lshift(Eluna* /*E*/, lua_State* L) + int bit_lshift(lua_State* L) { uint32 a = Eluna::CHECKVAL(L, 1); uint32 b = Eluna::CHECKVAL(L, 2); @@ -2081,7 +2081,7 @@ namespace LuaGlobalFunctions * @param uint32 b * @return uint32 result */ - int bit_rshift(Eluna* /*E*/, lua_State* L) + int bit_rshift(lua_State* L) { uint32 a = Eluna::CHECKVAL(L, 1); uint32 b = Eluna::CHECKVAL(L, 2); @@ -2096,7 +2096,7 @@ namespace LuaGlobalFunctions * @param uint32 b * @return uint32 result */ - int bit_xor(Eluna* /*E*/, lua_State* L) + int bit_xor(lua_State* L) { uint32 a = Eluna::CHECKVAL(L, 1); uint32 b = Eluna::CHECKVAL(L, 2); @@ -2110,7 +2110,7 @@ namespace LuaGlobalFunctions * @param uint32 a * @return uint32 result */ - int bit_not(Eluna* /*E*/, lua_State* L) + int bit_not(lua_State* L) { uint32 a = Eluna::CHECKVAL(L, 1); Eluna::Push(L, ~a); @@ -2139,7 +2139,7 @@ namespace LuaGlobalFunctions * @param uint32 pathId = 0 : path Id of the taxi path * @return uint32 actualPathId */ - int AddTaxiPath(Eluna* /*E*/, lua_State* L) + int AddTaxiPath(lua_State* L) { luaL_checktype(L, 1, LUA_TTABLE); uint32 mountA = Eluna::CHECKVAL(L, 2); @@ -2295,7 +2295,7 @@ namespace LuaGlobalFunctions * @param uint8 slot : the slot the [Item] is in within the bag, you can get this with [Item:GetSlot] * @return bool isInventoryPos */ - int IsInventoryPos(Eluna* /*E*/, lua_State* L) + int IsInventoryPos(lua_State* L) { uint8 bag = Eluna::CHECKVAL(L, 1); uint8 slot = Eluna::CHECKVAL(L, 2); @@ -2313,7 +2313,7 @@ namespace LuaGlobalFunctions * @param uint8 slot : the slot the [Item] is in within the bag, you can get this with [Item:GetSlot] * @return bool isEquipmentPosition */ - int IsEquipmentPos(Eluna* /*E*/, lua_State* L) + int IsEquipmentPos(lua_State* L) { uint8 bag = Eluna::CHECKVAL(L, 1); uint8 slot = Eluna::CHECKVAL(L, 2); @@ -2331,7 +2331,7 @@ namespace LuaGlobalFunctions * @param uint8 slot : the slot the [Item] is in within the bag, you can get this with [Item:GetSlot] * @return bool isBankPosition */ - int IsBankPos(Eluna* /*E*/, lua_State* L) + int IsBankPos(lua_State* L) { uint8 bag = Eluna::CHECKVAL(L, 1); uint8 slot = Eluna::CHECKVAL(L, 2); @@ -2349,7 +2349,7 @@ namespace LuaGlobalFunctions * @param uint8 slot : the slot the [Item] is in within the bag, you can get this with [Item:GetSlot] * @return bool isBagPosition */ - int IsBagPos(Eluna* /*E*/, lua_State* L) + int IsBagPos(lua_State* L) { uint8 bag = Eluna::CHECKVAL(L, 1); uint8 slot = Eluna::CHECKVAL(L, 2); @@ -2363,7 +2363,7 @@ namespace LuaGlobalFunctions * * @return uint32 currTime : the current time, in milliseconds */ - int GetCurrTime(Eluna* /*E*/, lua_State* L) + int GetCurrTime(lua_State* L) { Eluna::Push(L, ElunaUtil::GetCurrTime()); return 1; @@ -2375,7 +2375,7 @@ namespace LuaGlobalFunctions * @param uint32 oldTime : an old timestamp, in milliseconds * @return uint32 timeDiff : the difference, in milliseconds */ - int GetTimeDiff(Eluna* /*E*/, lua_State* L) + int GetTimeDiff(lua_State* L) { uint32 oldtimems = Eluna::CHECKVAL(L, 1); @@ -2400,7 +2400,7 @@ namespace LuaGlobalFunctions * * @param ... */ - int PrintInfo(Eluna* /*E*/, lua_State* L) + int PrintInfo(lua_State* L) { ELUNA_LOG_INFO("%s", GetStackAsString(L).c_str()); return 0; @@ -2411,7 +2411,7 @@ namespace LuaGlobalFunctions * * @param ... */ - int PrintError(Eluna* /*E*/, lua_State* L) + int PrintError(lua_State* L) { ELUNA_LOG_ERROR("%s", GetStackAsString(L).c_str()); return 0; @@ -2422,7 +2422,7 @@ namespace LuaGlobalFunctions * * @param ... */ - int PrintDebug(Eluna* /*E*/, lua_State* L) + int PrintDebug(lua_State* L) { ELUNA_LOG_DEBUG("%s", GetStackAsString(L).c_str()); return 0; @@ -2442,7 +2442,7 @@ namespace LuaGlobalFunctions * @param string n_str * @return int64 value */ - int CreateLongLong(Eluna* /*E*/, lua_State* L) + int CreateLongLong(lua_State* L) { long long init = 0; if (lua_isstring(L, 1)) @@ -2474,7 +2474,7 @@ namespace LuaGlobalFunctions * @param string n_str * @return uint64 value */ - int CreateULongLong(Eluna* /*E*/, lua_State* L) + int CreateULongLong(lua_State* L) { unsigned long long init = 0; if (lua_isstring(L, 1)) @@ -2503,18 +2503,18 @@ namespace LuaGlobalFunctions * @proto (event_type) * @param uint32 event_type : the event whose handlers will be cleared, see [Global:RegisterBGEvent] */ - int ClearBattleGroundEvents(Eluna* E, lua_State* L) + int ClearBattleGroundEvents(lua_State* L) { typedef EventKey Key; if (lua_isnoneornil(L, 1)) { - E->BGEventBindings->Clear(); + Eluna::GetEluna(L)->BGEventBindings->Clear(); } else { uint32 event_type = Eluna::CHECKVAL(L, 1); - E->BGEventBindings->Clear(Key((Hooks::BGEvents)event_type)); + Eluna::GetEluna(L)->BGEventBindings->Clear(Key((Hooks::BGEvents)event_type)); } return 0; } @@ -2534,7 +2534,7 @@ namespace LuaGlobalFunctions * @param uint32 entry : the ID of one or more [Creature]s whose handlers will be cleared * @param uint32 event_type : the event whose handlers will be cleared, see [Global:RegisterCreatureEvent] */ - int ClearCreatureEvents(Eluna* E, lua_State* L) + int ClearCreatureEvents(lua_State* L) { typedef EntryKey Key; @@ -2542,6 +2542,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); + Eluna* E = Eluna::GetEluna(L); for (uint32 i = 1; i < Hooks::CREATURE_EVENT_COUNT; ++i) E->CreatureEventBindings->Clear(Key((Hooks::CreatureEvents)i, entry)); } @@ -2549,7 +2550,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); uint32 event_type = Eluna::CHECKVAL(L, 2); - E->CreatureEventBindings->Clear(Key((Hooks::CreatureEvents)event_type, entry)); + Eluna::GetEluna(L)->CreatureEventBindings->Clear(Key((Hooks::CreatureEvents)event_type, entry)); } return 0; } @@ -2570,7 +2571,7 @@ namespace LuaGlobalFunctions * @param uint32 instance_id : the instance ID of a single [Creature] whose handlers will be cleared * @param uint32 event_type : the event whose handlers will be cleared, see [Global:RegisterCreatureEvent] */ - int ClearUniqueCreatureEvents(Eluna* E, lua_State* L) + int ClearUniqueCreatureEvents(lua_State* L) { typedef UniqueObjectKey Key; @@ -2579,6 +2580,7 @@ namespace LuaGlobalFunctions uint64 guid = Eluna::CHECKVAL(L, 1); uint32 instanceId = Eluna::CHECKVAL(L, 2); + Eluna* E = Eluna::GetEluna(L); for (uint32 i = 1; i < Hooks::CREATURE_EVENT_COUNT; ++i) E->CreatureUniqueBindings->Clear(Key((Hooks::CreatureEvents)i, guid, instanceId)); } @@ -2587,7 +2589,7 @@ namespace LuaGlobalFunctions uint64 guid = Eluna::CHECKVAL(L, 1); uint32 instanceId = Eluna::CHECKVAL(L, 2); uint32 event_type = Eluna::CHECKVAL(L, 3); - E->CreatureUniqueBindings->Clear(Key((Hooks::CreatureEvents)event_type, guid, instanceId)); + Eluna::GetEluna(L)->CreatureUniqueBindings->Clear(Key((Hooks::CreatureEvents)event_type, guid, instanceId)); } return 0; } @@ -2607,7 +2609,7 @@ namespace LuaGlobalFunctions * @param uint32 entry : the ID of a [Creature] whose handlers will be cleared * @param uint32 event_type : the event whose handlers will be cleared, see [Global:RegisterCreatureGossipEvent] */ - int ClearCreatureGossipEvents(Eluna* E, lua_State* L) + int ClearCreatureGossipEvents(lua_State* L) { typedef EntryKey Key; @@ -2615,6 +2617,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); + Eluna* E = Eluna::GetEluna(L); for (uint32 i = 1; i < Hooks::GOSSIP_EVENT_COUNT; ++i) E->CreatureGossipBindings->Clear(Key((Hooks::GossipEvents)i, entry)); } @@ -2622,7 +2625,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); uint32 event_type = Eluna::CHECKVAL(L, 2); - E->CreatureGossipBindings->Clear(Key((Hooks::GossipEvents)event_type, entry)); + Eluna::GetEluna(L)->CreatureGossipBindings->Clear(Key((Hooks::GossipEvents)event_type, entry)); } return 0; } @@ -2642,7 +2645,7 @@ namespace LuaGlobalFunctions * @param uint32 entry : the ID of a [GameObject] whose handlers will be cleared * @param uint32 event_type : the event whose handlers will be cleared, see [Global:RegisterGameObjectEvent] */ - int ClearGameObjectEvents(Eluna* E, lua_State* L) + int ClearGameObjectEvents(lua_State* L) { typedef EntryKey Key; @@ -2650,6 +2653,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); + Eluna* E = Eluna::GetEluna(L); for (uint32 i = 1; i < Hooks::GAMEOBJECT_EVENT_COUNT; ++i) E->GameObjectEventBindings->Clear(Key((Hooks::GameObjectEvents)i, entry)); } @@ -2657,7 +2661,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); uint32 event_type = Eluna::CHECKVAL(L, 2); - E->GameObjectEventBindings->Clear(Key((Hooks::GameObjectEvents)event_type, entry)); + Eluna::GetEluna(L)->GameObjectEventBindings->Clear(Key((Hooks::GameObjectEvents)event_type, entry)); } return 0; } @@ -2677,7 +2681,7 @@ namespace LuaGlobalFunctions * @param uint32 entry : the ID of a [GameObject] whose handlers will be cleared * @param uint32 event_type : the event whose handlers will be cleared, see [Global:RegisterGameObjectGossipEvent] */ - int ClearGameObjectGossipEvents(Eluna* E, lua_State* L) + int ClearGameObjectGossipEvents(lua_State* L) { typedef EntryKey Key; @@ -2685,6 +2689,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); + Eluna* E = Eluna::GetEluna(L); for (uint32 i = 1; i < Hooks::GOSSIP_EVENT_COUNT; ++i) E->GameObjectGossipBindings->Clear(Key((Hooks::GossipEvents)i, entry)); } @@ -2692,7 +2697,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); uint32 event_type = Eluna::CHECKVAL(L, 2); - E->GameObjectGossipBindings->Clear(Key((Hooks::GossipEvents)event_type, entry)); + Eluna::GetEluna(L)->GameObjectGossipBindings->Clear(Key((Hooks::GossipEvents)event_type, entry)); } return 0; } @@ -2708,18 +2713,18 @@ namespace LuaGlobalFunctions * @proto (event_type) * @param uint32 event_type : the event whose handlers will be cleared, see [Global:RegisterGroupEvent] */ - int ClearGroupEvents(Eluna* E, lua_State* L) + int ClearGroupEvents(lua_State* L) { typedef EventKey Key; if (lua_isnoneornil(L, 1)) { - E->GroupEventBindings->Clear(); + Eluna::GetEluna(L)->GroupEventBindings->Clear(); } else { uint32 event_type = Eluna::CHECKVAL(L, 1); - E->GroupEventBindings->Clear(Key((Hooks::GroupEvents)event_type)); + Eluna::GetEluna(L)->GroupEventBindings->Clear(Key((Hooks::GroupEvents)event_type)); } return 0; } @@ -2735,18 +2740,18 @@ namespace LuaGlobalFunctions * @proto (event_type) * @param uint32 event_type : the event whose handlers will be cleared, see [Global:RegisterGuildEvent] */ - int ClearGuildEvents(Eluna* E, lua_State* L) + int ClearGuildEvents(lua_State* L) { typedef EventKey Key; if (lua_isnoneornil(L, 1)) { - E->GuildEventBindings->Clear(); + Eluna::GetEluna(L)->GuildEventBindings->Clear(); } else { uint32 event_type = Eluna::CHECKVAL(L, 1); - E->GuildEventBindings->Clear(Key((Hooks::GuildEvents)event_type)); + Eluna::GetEluna(L)->GuildEventBindings->Clear(Key((Hooks::GuildEvents)event_type)); } return 0; } @@ -2766,7 +2771,7 @@ namespace LuaGlobalFunctions * @param uint32 entry : the ID of an [Item] whose handlers will be cleared * @param uint32 event_type : the event whose handlers will be cleared, see [Global:RegisterItemEvent] */ - int ClearItemEvents(Eluna* E, lua_State* L) + int ClearItemEvents(lua_State* L) { typedef EntryKey Key; @@ -2774,6 +2779,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); + Eluna* E = Eluna::GetEluna(L); for (uint32 i = 1; i < Hooks::ITEM_EVENT_COUNT; ++i) E->ItemEventBindings->Clear(Key((Hooks::ItemEvents)i, entry)); } @@ -2781,7 +2787,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); uint32 event_type = Eluna::CHECKVAL(L, 2); - E->ItemEventBindings->Clear(Key((Hooks::ItemEvents)event_type, entry)); + Eluna::GetEluna(L)->ItemEventBindings->Clear(Key((Hooks::ItemEvents)event_type, entry)); } return 0; } @@ -2801,7 +2807,7 @@ namespace LuaGlobalFunctions * @param uint32 entry : the ID of an [Item] whose handlers will be cleared * @param uint32 event_type : the event whose handlers will be cleared, see [Global:RegisterItemGossipEvent] */ - int ClearItemGossipEvents(Eluna* E, lua_State* L) + int ClearItemGossipEvents(lua_State* L) { typedef EntryKey Key; @@ -2809,6 +2815,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); + Eluna* E = Eluna::GetEluna(L); for (uint32 i = 1; i < Hooks::GOSSIP_EVENT_COUNT; ++i) E->ItemGossipBindings->Clear(Key((Hooks::GossipEvents)i, entry)); } @@ -2816,7 +2823,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); uint32 event_type = Eluna::CHECKVAL(L, 2); - E->ItemGossipBindings->Clear(Key((Hooks::GossipEvents)event_type, entry)); + Eluna::GetEluna(L)->ItemGossipBindings->Clear(Key((Hooks::GossipEvents)event_type, entry)); } return 0; } @@ -2833,7 +2840,7 @@ namespace LuaGlobalFunctions * @param uint32 opcode : the type of [WorldPacket] whose handlers will be cleared * @param uint32 event_type : the event whose handlers will be cleared, see [Global:RegisterPacketEvent] */ - int ClearPacketEvents(Eluna* E, lua_State* L) + int ClearPacketEvents(lua_State* L) { typedef EntryKey Key; @@ -2841,6 +2848,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); + Eluna* E = Eluna::GetEluna(L); for (uint32 i = 1; i < Hooks::PACKET_EVENT_COUNT; ++i) E->PacketEventBindings->Clear(Key((Hooks::PacketEvents)i, entry)); } @@ -2848,7 +2856,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); uint32 event_type = Eluna::CHECKVAL(L, 2); - E->PacketEventBindings->Clear(Key((Hooks::PacketEvents)event_type, entry)); + Eluna::GetEluna(L)->PacketEventBindings->Clear(Key((Hooks::PacketEvents)event_type, entry)); } return 0; } @@ -2864,18 +2872,18 @@ namespace LuaGlobalFunctions * @proto (event_type) * @param uint32 event_type : the event whose handlers will be cleared, see [Global:RegisterPlayerEvent] */ - int ClearPlayerEvents(Eluna* E, lua_State* L) + int ClearPlayerEvents(lua_State* L) { typedef EventKey Key; if (lua_isnoneornil(L, 1)) { - E->PlayerEventBindings->Clear(); + Eluna::GetEluna(L)->PlayerEventBindings->Clear(); } else { uint32 event_type = Eluna::CHECKVAL(L, 1); - E->PlayerEventBindings->Clear(Key((Hooks::PlayerEvents)event_type)); + Eluna::GetEluna(L)->PlayerEventBindings->Clear(Key((Hooks::PlayerEvents)event_type)); } return 0; } @@ -2892,7 +2900,7 @@ namespace LuaGlobalFunctions * @param uint32 entry : the low GUID of a [Player] whose handlers will be cleared * @param uint32 event_type : the event whose handlers will be cleared, see [Global:RegisterPlayerGossipEvent] */ - int ClearPlayerGossipEvents(Eluna* E, lua_State* L) + int ClearPlayerGossipEvents(lua_State* L) { typedef EntryKey Key; @@ -2900,6 +2908,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); + Eluna* E = Eluna::GetEluna(L); for (uint32 i = 1; i < Hooks::GOSSIP_EVENT_COUNT; ++i) E->PlayerGossipBindings->Clear(Key((Hooks::GossipEvents)i, entry)); } @@ -2907,7 +2916,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); uint32 event_type = Eluna::CHECKVAL(L, 2); - E->PlayerGossipBindings->Clear(Key((Hooks::GossipEvents)event_type, entry)); + Eluna::GetEluna(L)->PlayerGossipBindings->Clear(Key((Hooks::GossipEvents)event_type, entry)); } return 0; } @@ -2923,18 +2932,18 @@ namespace LuaGlobalFunctions * @proto (event_type) * @param uint32 event_type : the event whose handlers will be cleared, see [Global:RegisterServerEvent] */ - int ClearServerEvents(Eluna* E, lua_State* L) + int ClearServerEvents(lua_State* L) { typedef EventKey Key; if (lua_isnoneornil(L, 1)) { - E->ServerEventBindings->Clear(); + Eluna::GetEluna(L)->ServerEventBindings->Clear(); } else { uint32 event_type = Eluna::CHECKVAL(L, 1); - E->ServerEventBindings->Clear(Key((Hooks::ServerEvents)event_type)); + Eluna::GetEluna(L)->ServerEventBindings->Clear(Key((Hooks::ServerEvents)event_type)); } return 0; } @@ -2951,7 +2960,7 @@ namespace LuaGlobalFunctions * @param uint32 map_id : the ID of a [Map] * @param uint32 event_type : the event whose handlers will be cleared, see [Global:RegisterPlayerGossipEvent] */ - int ClearMapEvents(Eluna* E, lua_State* L) + int ClearMapEvents(lua_State* L) { typedef EntryKey Key; @@ -2959,6 +2968,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); + Eluna* E = Eluna::GetEluna(L); for (uint32 i = 1; i < Hooks::INSTANCE_EVENT_COUNT; ++i) E->MapEventBindings->Clear(Key((Hooks::InstanceEvents)i, entry)); } @@ -2966,7 +2976,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); uint32 event_type = Eluna::CHECKVAL(L, 2); - E->MapEventBindings->Clear(Key((Hooks::InstanceEvents)event_type, entry)); + Eluna::GetEluna(L)->MapEventBindings->Clear(Key((Hooks::InstanceEvents)event_type, entry)); } return 0; @@ -2984,7 +2994,7 @@ namespace LuaGlobalFunctions * @param uint32 entry : the ID of an instance of a [Map] * @param uint32 event_type : the event whose handlers will be cleared, see [Global:RegisterInstanceEvent] */ - int ClearInstanceEvents(Eluna* E, lua_State* L) + int ClearInstanceEvents(lua_State* L) { typedef EntryKey Key; @@ -2992,6 +3002,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); + Eluna* E = Eluna::GetEluna(L); for (uint32 i = 1; i < Hooks::INSTANCE_EVENT_COUNT; ++i) E->InstanceEventBindings->Clear(Key((Hooks::InstanceEvents)i, entry)); } @@ -2999,7 +3010,7 @@ namespace LuaGlobalFunctions { uint32 entry = Eluna::CHECKVAL(L, 1); uint32 event_type = Eluna::CHECKVAL(L, 2); - E->InstanceEventBindings->Clear(Key((Hooks::InstanceEvents)event_type, entry)); + Eluna::GetEluna(L)->InstanceEventBindings->Clear(Key((Hooks::InstanceEvents)event_type, entry)); } return 0; diff --git a/GroupMethods.h b/GroupMethods.h index b436690..3f76a73 100644 --- a/GroupMethods.h +++ b/GroupMethods.h @@ -18,7 +18,7 @@ namespace LuaGroup * @param uint64 guid : guid of a possible leader * @return bool isLeader */ - int IsLeader(Eluna* /*E*/, lua_State* L, Group* group) + int IsLeader(lua_State* L, Group* group) { uint64 guid = Eluna::CHECKVAL(L, 2); Eluna::Push(L, group->IsLeader(ObjectGuid(guid))); @@ -30,7 +30,7 @@ namespace LuaGroup * * @return bool isFull */ - int IsFull(Eluna* /*E*/, lua_State* L, Group* group) + int IsFull(lua_State* L, Group* group) { Eluna::Push(L, group->IsFull()); return 1; @@ -41,7 +41,7 @@ namespace LuaGroup * * @return bool isRaid */ - int IsRaidGroup(Eluna* /*E*/, lua_State* L, Group* group) + int IsRaidGroup(lua_State* L, Group* group) { Eluna::Push(L, group->isRaidGroup()); return 1; @@ -52,7 +52,7 @@ namespace LuaGroup * * @return bool isBG */ - int IsBGGroup(Eluna* /*E*/, lua_State* L, Group* group) + int IsBGGroup(lua_State* L, Group* group) { Eluna::Push(L, group->isBGGroup()); return 1; @@ -64,7 +64,7 @@ namespace LuaGroup * @param uint64 guid : guid of a player * @return bool isMember */ - int IsMember(Eluna* /*E*/, lua_State* L, Group* group) + int IsMember(lua_State* L, Group* group) { uint64 guid = Eluna::CHECKVAL(L, 2); Eluna::Push(L, group->IsMember(ObjectGuid(guid))); @@ -77,7 +77,7 @@ namespace LuaGroup * @param uint64 guid : guid of a player * @return bool isAssistant */ - int IsAssistant(Eluna* /*E*/, lua_State* L, Group* group) + int IsAssistant(lua_State* L, Group* group) { uint64 guid = Eluna::CHECKVAL(L, 2); Eluna::Push(L, group->IsAssistant(ObjectGuid(guid))); @@ -91,7 +91,7 @@ namespace LuaGroup * @param [Player] player2 : second [Player] to check * @return bool sameSubGroup */ - int SameSubGroup(Eluna* /*E*/, lua_State* L, Group* group) + int SameSubGroup(lua_State* L, Group* group) { Player* player1 = Eluna::CHECKOBJ(L, 2); Player* player2 = Eluna::CHECKOBJ(L, 3); @@ -105,7 +105,7 @@ namespace LuaGroup * @param uint8 subGroup : subGroup ID to check * @return bool hasFreeSlot */ - int HasFreeSlotSubGroup(Eluna* /*E*/, lua_State* L, Group* group) + int HasFreeSlotSubGroup(lua_State* L, Group* group) { uint8 subGroup = Eluna::CHECKVAL(L, 2); @@ -125,7 +125,7 @@ namespace LuaGroup * @param [Player] player : [Player] to add to the group * @return bool added : true if member was added */ - int AddMember(Eluna* /*E*/, lua_State* L, Group* group) + int AddMember(lua_State* L, Group* group) { Player* player = Eluna::CHECKOBJ(L, 2); @@ -150,13 +150,13 @@ namespace LuaGroup return 1; } - /*int IsLFGGroup(Eluna* E, 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(Eluna* E, lua_State* L, Group* group) // TODO: Implementation + /*int IsBFGroup(lua_State* L, Group* group) // TODO: Implementation { Eluna::Push(L, group->isBFGroup()); return 1; @@ -167,7 +167,7 @@ namespace LuaGroup * * @return table groupPlayers : table of [Player]s */ - int GetMembers(Eluna* /*E*/, lua_State* L, Group* group) + int GetMembers(lua_State* L, Group* group) { lua_newtable(L); int tbl = lua_gettop(L); @@ -199,7 +199,7 @@ namespace LuaGroup * * @return uint64 leaderGUID */ - int GetLeaderGUID(Eluna* /*E*/, lua_State* L, Group* group) + int GetLeaderGUID(lua_State* L, Group* group) { #ifndef TRINITY Eluna::Push(L, group->GetLeaderGuid()); @@ -214,7 +214,7 @@ namespace LuaGroup * * @return uint64 groupGUID */ - int GetGUID(Eluna* /*E*/, lua_State* L, Group* group) + int GetGUID(lua_State* L, Group* group) { #ifdef CLASSIC Eluna::Push(L, group->GetId()); @@ -230,7 +230,7 @@ namespace LuaGroup * @param string name : the [Player]'s name * @return uint64 memberGUID */ - int GetMemberGUID(Eluna* /*E*/, lua_State* L, Group* group) + int GetMemberGUID(lua_State* L, Group* group) { const char* name = Eluna::CHECKVAL(L, 2); #ifndef TRINITY @@ -246,7 +246,7 @@ namespace LuaGroup * * @return uint32 memberCount */ - int GetMembersCount(Eluna* /*E*/, lua_State* L, Group* group) + int GetMembersCount(lua_State* L, Group* group) { Eluna::Push(L, group->GetMembersCount()); return 1; @@ -258,7 +258,7 @@ namespace LuaGroup * @param uint64 guid : guid of the player * @return uint8 subGroupID : a valid subgroup ID or MAX_RAID_SUBGROUPS+1 */ - int GetMemberGroup(Eluna* /*E*/, lua_State* L, Group* group) + int GetMemberGroup(lua_State* L, Group* group) { uint64 guid = Eluna::CHECKVAL(L, 2); Eluna::Push(L, group->GetMemberGroup(ObjectGuid(guid))); @@ -270,7 +270,7 @@ namespace LuaGroup * * @param uint64 guid : guid of the new leader */ - int SetLeader(Eluna* /*E*/, lua_State* L, Group* group) + int SetLeader(lua_State* L, Group* group) { uint64 guid = Eluna::CHECKVAL(L, 2); group->ChangeLeader(ObjectGuid(guid)); @@ -285,7 +285,7 @@ namespace LuaGroup * @param bool ignorePlayersInBg : ignores [Player]s in a battleground * @param uint64 ignore : ignore a [Player] by their GUID */ - int SendPacket(Eluna* /*E*/, lua_State* L, Group* group) + int SendPacket(lua_State* L, Group* group) { WorldPacket* data = Eluna::CHECKOBJ(L, 2); bool ignorePlayersInBg = Eluna::CHECKVAL(L, 3); @@ -316,7 +316,7 @@ namespace LuaGroup * @param [RemoveMethod] method : method used to remove the player * @return bool removed */ - int RemoveMember(Eluna* /*E*/, lua_State* L, Group* group) + int RemoveMember(lua_State* L, Group* group) { uint64 guid = Eluna::CHECKVAL(L, 2); uint32 method = Eluna::CHECKVAL(L, 3, 0); @@ -333,7 +333,7 @@ namespace LuaGroup * Disbands this [Group] * */ - int Disband(Eluna* /*E*/, lua_State* /*L*/, Group* group) + int Disband(lua_State* /*L*/, Group* group) { group->Disband(); return 0; @@ -343,7 +343,7 @@ namespace LuaGroup * Converts this [Group] to a raid [Group] * */ - int ConvertToRaid(Eluna* /*E*/, lua_State* /*L*/, Group* group) + int ConvertToRaid(lua_State* /*L*/, Group* group) { group->ConvertToRaid(); return 0; @@ -355,7 +355,7 @@ namespace LuaGroup * @param uint64 guid : guid of the player to move * @param uint8 groupID : the subGroup's ID */ - int SetMembersGroup(Eluna* /*E*/, lua_State* L, Group* group) + int SetMembersGroup(lua_State* L, Group* group) { uint64 guid = Eluna::CHECKVAL(L, 2); uint8 subGroup = Eluna::CHECKVAL(L, 3); @@ -380,7 +380,7 @@ namespace LuaGroup * @param uint64 target : GUID of the icon target, 0 is to clear the icon * @param uint64 setter : GUID of the icon setter */ - int SetTargetIcon(Eluna* /*E*/, lua_State* L, Group* group) + int SetTargetIcon(lua_State* L, Group* group) { uint8 icon = Eluna::CHECKVAL(L, 2); uint64 target = Eluna::CHECKVAL(L, 3); @@ -397,7 +397,7 @@ namespace LuaGroup return 0; } - /*int ConvertToLFG(Eluna* E, lua_State* L, Group* group) // TODO: Implementation + /*int ConvertToLFG(lua_State* L, Group* group) // TODO: Implementation { group->ConvertToLFG(); return 0; diff --git a/GuildMethods.h b/GuildMethods.h index 23732e4..6e76422 100644 --- a/GuildMethods.h +++ b/GuildMethods.h @@ -19,7 +19,7 @@ namespace LuaGuild * * @return table guildPlayers : table of [Player]s */ - int GetMembers(Eluna* /*E*/, lua_State* L, Guild* guild) + int GetMembers(lua_State* L, Guild* guild) { lua_newtable(L); int tbl = lua_gettop(L); @@ -60,7 +60,7 @@ namespace LuaGuild * * @return uint32 memberCount */ - int GetMemberCount(Eluna* /*E*/, lua_State* L, Guild* guild) + int GetMemberCount(lua_State* L, Guild* guild) { #ifdef TRINITY Eluna::Push(L, guild->GetMemberCount()); @@ -75,7 +75,7 @@ namespace LuaGuild * * @return [Player] leader */ - int GetLeader(Eluna* /*E*/, lua_State* L, Guild* guild) + int GetLeader(lua_State* L, Guild* guild) { #ifndef TRINITY Eluna::Push(L, eObjectAccessor()FindPlayer(guild->GetLeaderGuid())); @@ -90,7 +90,7 @@ namespace LuaGuild * * @return uint64 leaderGUID */ - int GetLeaderGUID(Eluna* /*E*/, lua_State* L, Guild* guild) + int GetLeaderGUID(lua_State* L, Guild* guild) { #ifndef TRINITY Eluna::Push(L, guild->GetLeaderGuid()); @@ -105,7 +105,7 @@ namespace LuaGuild * * @return uint32 entryId */ - int GetId(Eluna* /*E*/, lua_State* L, Guild* guild) + int GetId(lua_State* L, Guild* guild) { Eluna::Push(L, guild->GetId()); return 1; @@ -116,7 +116,7 @@ namespace LuaGuild * * @return string guildName */ - int GetName(Eluna* /*E*/, lua_State* L, Guild* guild) + int GetName(lua_State* L, Guild* guild) { Eluna::Push(L, guild->GetName()); return 1; @@ -127,7 +127,7 @@ namespace LuaGuild * * @return string guildMOTD */ - int GetMOTD(Eluna* /*E*/, lua_State* L, Guild* guild) + int GetMOTD(lua_State* L, Guild* guild) { Eluna::Push(L, guild->GetMOTD()); return 1; @@ -138,7 +138,7 @@ namespace LuaGuild * * @return string guildInfo */ - int GetInfo(Eluna* /*E*/, lua_State* L, Guild* guild) + int GetInfo(lua_State* L, Guild* guild) { #ifndef TRINITY Eluna::Push(L, guild->GetGINFO()); @@ -154,7 +154,7 @@ namespace LuaGuild * * @param [Player] leader : the [Player] leader to change */ - int SetLeader(Eluna* /*E*/, lua_State* L, Guild* guild) + int SetLeader(lua_State* L, Guild* guild) { Player* player = Eluna::CHECKOBJ(L, 2); @@ -174,7 +174,7 @@ namespace LuaGuild * @param uint8 tabId : the ID of the tab specified * @param string info : the information to be set to the bank tab */ - int SetBankTabText(Eluna* /*E*/, lua_State* L, Guild* guild) + int SetBankTabText(lua_State* L, Guild* guild) { uint8 tabId = Eluna::CHECKVAL(L, 2); const char* text = Eluna::CHECKVAL(L, 3); @@ -193,7 +193,7 @@ namespace LuaGuild * * @param [WorldPacket] packet : the [WorldPacket] to be sent to the [Player]s */ - int SendPacket(Eluna* /*E*/, lua_State* L, Guild* guild) + int SendPacket(lua_State* L, Guild* guild) { WorldPacket* data = Eluna::CHECKOBJ(L, 2); @@ -212,7 +212,7 @@ namespace LuaGuild * @param [WorldPacket] packet : the [WorldPacket] to be sent to the [Player]s * @param uint8 rankId : the rank ID */ - int SendPacketToRanked(Eluna* /*E*/, lua_State* L, Guild* guild) + int SendPacketToRanked(lua_State* L, Guild* guild) { WorldPacket* data = Eluna::CHECKOBJ(L, 2); uint8 ranked = Eluna::CHECKVAL(L, 3); @@ -228,7 +228,7 @@ namespace LuaGuild /** * Disbands the [Guild] */ - int Disband(Eluna* /*E*/, lua_State* /*L*/, Guild* guild) + int Disband(lua_State* /*L*/, Guild* guild) { guild->Disband(); return 0; @@ -242,7 +242,7 @@ namespace LuaGuild * @param [Player] player : the [Player] to be added to the guild * @param uint8 rankId : the rank ID */ - int AddMember(Eluna* /*E*/, lua_State* L, Guild* guild) + int AddMember(lua_State* L, Guild* guild) { Player* player = Eluna::CHECKOBJ(L, 2); uint8 rankId = Eluna::CHECKVAL(L, 3, GUILD_RANK_NONE); @@ -262,7 +262,7 @@ namespace LuaGuild * @param [Player] player : the [Player] to be removed from the guild * @param bool isDisbanding : default 'false', should only be set to 'true' if the guild is triggered to disband */ - int DeleteMember(Eluna* /*E*/, lua_State* L, Guild* guild) + int DeleteMember(lua_State* L, Guild* guild) { Player* player = Eluna::CHECKOBJ(L, 2); bool isDisbanding = Eluna::CHECKVAL(L, 3, false); @@ -282,7 +282,7 @@ namespace LuaGuild * @param [Player] player : the [Player] to be promoted/demoted * @param uint8 rankId : the rank ID */ - int SetMemberRank(Eluna* /*E*/, lua_State* L, Guild* guild) + int SetMemberRank(lua_State* L, Guild* guild) { Player* player = Eluna::CHECKOBJ(L, 2); uint8 newRank = Eluna::CHECKVAL(L, 3); @@ -304,7 +304,7 @@ namespace LuaGuild * @param [Player] player * @param uint32 money */ - int WithdrawBankMoney(Eluna* /*E*/, lua_State* L, Guild* guild) + int WithdrawBankMoney(lua_State* L, Guild* guild) { Player* player = Eluna::CHECKOBJ(L, 2); uint32 money = Eluna::CHECKVAL(L, 3); @@ -325,7 +325,7 @@ namespace LuaGuild * @param [Player] player * @param uint32 money */ - int DepositBankMoney(Eluna* /*E*/, lua_State* L, Guild* guild) + int DepositBankMoney(lua_State* L, Guild* guild) { Player* player = Eluna::CHECKOBJ(L, 2); uint32 money = Eluna::CHECKVAL(L, 3); diff --git a/ItemMethods.h b/ItemMethods.h index 14e244e..4e5b2d6 100644 --- a/ItemMethods.h +++ b/ItemMethods.h @@ -17,7 +17,7 @@ namespace LuaItem * * @return bool isSoulBound */ - int IsSoulBound(Eluna* /*E*/, lua_State* L, Item* item) + int IsSoulBound(lua_State* L, Item* item) { Eluna::Push(L, item->IsSoulBound()); return 1; @@ -29,7 +29,7 @@ namespace LuaItem * * @return bool isAccountBound */ - int IsBoundAccountWide(Eluna* /*E*/, lua_State* L, Item* item) + int IsBoundAccountWide(lua_State* L, Item* item) { Eluna::Push(L, item->IsBoundAccountWide()); return 1; @@ -41,7 +41,7 @@ namespace LuaItem * * @return bool isBoundByEnchant */ - int IsBoundByEnchant(Eluna* /*E*/, lua_State* L, Item* item) + int IsBoundByEnchant(lua_State* L, Item* item) { Eluna::Push(L, item->IsBoundByEnchant()); return 1; @@ -53,7 +53,7 @@ namespace LuaItem * @param [Player] player : the [Player] object to check the item against * @return bool isNotBound */ - int IsNotBoundToPlayer(Eluna* /*E*/, lua_State* L, Item* item) + int IsNotBoundToPlayer(lua_State* L, Item* item) { Player* player = Eluna::CHECKOBJ(L, 2); @@ -66,7 +66,7 @@ namespace LuaItem * * @return bool isLocked */ - int IsLocked(Eluna* /*E*/, lua_State* L, Item* item) + int IsLocked(lua_State* L, Item* item) { Eluna::Push(L, item->IsLocked()); return 1; @@ -77,7 +77,7 @@ namespace LuaItem * * @return bool isBag */ - int IsBag(Eluna* /*E*/, lua_State* L, Item* item) + int IsBag(lua_State* L, Item* item) { Eluna::Push(L, item->IsBag()); return 1; @@ -89,7 +89,7 @@ namespace LuaItem * * @return bool isCurrencyToken */ - int IsCurrencyToken(Eluna* /*E*/, lua_State* L, Item* item) + int IsCurrencyToken(lua_State* L, Item* item) { Eluna::Push(L, item->IsCurrencyToken()); return 1; @@ -101,7 +101,7 @@ namespace LuaItem * * @return bool isNotEmptyBag */ - int IsNotEmptyBag(Eluna* /*E*/, lua_State* L, Item* item) + int IsNotEmptyBag(lua_State* L, Item* item) { Eluna::Push(L, item->IsNotEmptyBag()); return 1; @@ -112,7 +112,7 @@ namespace LuaItem * * @return bool isBroken */ - int IsBroken(Eluna* /*E*/, lua_State* L, Item* item) + int IsBroken(lua_State* L, Item* item) { Eluna::Push(L, item->IsBroken()); return 1; @@ -123,7 +123,7 @@ namespace LuaItem * * @return bool isTradeable */ - int CanBeTraded(Eluna* /*E*/, lua_State* L, Item* item) + int CanBeTraded(lua_State* L, Item* item) { #if (defined(TBC) || defined(CLASSIC)) Eluna::Push(L, item->CanBeTraded()); @@ -139,7 +139,7 @@ namespace LuaItem * * @return bool isInTrade */ - int IsInTrade(Eluna* /*E*/, lua_State* L, Item* item) + int IsInTrade(lua_State* L, Item* item) { Eluna::Push(L, item->IsInTrade()); return 1; @@ -150,7 +150,7 @@ namespace LuaItem * * @return bool isInBag */ - int IsInBag(Eluna* /*E*/, lua_State* L, Item* item) + int IsInBag(lua_State* L, Item* item) { Eluna::Push(L, item->IsInBag()); return 1; @@ -161,7 +161,7 @@ namespace LuaItem * * @return bool isEquipped */ - int IsEquipped(Eluna* /*E*/, lua_State* L, Item* item) + int IsEquipped(lua_State* L, Item* item) { Eluna::Push(L, item->IsEquipped()); return 1; @@ -173,7 +173,7 @@ namespace LuaItem * @param uint32 questId : the [Quest] id to be checked * @return bool hasQuest */ - int HasQuest(Eluna* /*E*/, lua_State* L, Item* item) + int HasQuest(lua_State* L, Item* item) { uint32 quest = Eluna::CHECKVAL(L, 2); #ifndef TRINITY @@ -189,7 +189,7 @@ namespace LuaItem * * @return bool isPotion */ - int IsPotion(Eluna* /*E*/, lua_State* L, Item* item) + int IsPotion(lua_State* L, Item* item) { Eluna::Push(L, item->IsPotion()); return 1; @@ -201,7 +201,7 @@ namespace LuaItem * * @return bool isWeaponVellum */ - int IsWeaponVellum(Eluna* /*E*/, lua_State* L, Item* item) + int IsWeaponVellum(lua_State* L, Item* item) { Eluna::Push(L, item->IsWeaponVellum()); return 1; @@ -212,7 +212,7 @@ namespace LuaItem * * @return bool isArmorVellum */ - int IsArmorVellum(Eluna* /*E*/, lua_State* L, Item* item) + int IsArmorVellum(lua_State* L, Item* item) { Eluna::Push(L, item->IsArmorVellum()); return 1; @@ -224,13 +224,13 @@ namespace LuaItem * * @return bool isConjuredConsumable */ - int IsConjuredConsumable(Eluna* /*E*/, lua_State* L, Item* item) + int IsConjuredConsumable(lua_State* L, Item* item) { Eluna::Push(L, item->IsConjuredConsumable()); return 1; } - /*int IsRefundExpired(Eluna* E, lua_State* L, Item* item)// TODO: Implement core support + /*int IsRefundExpired(lua_State* L, Item* item)// TODO: Implement core support { Eluna::Push(L, item->IsRefundExpired()); return 1; @@ -257,7 +257,7 @@ namespace LuaItem * @param [LocaleConstant] locale = DEFAULT_LOCALE : locale to return the [Item]'s name in * @return string itemLink */ - int GetItemLink(Eluna* /*E*/, lua_State* L, Item* item) + int GetItemLink(lua_State* L, Item* item) { uint8 locale = Eluna::CHECKVAL(L, 2, DEFAULT_LOCALE); if (locale >= TOTAL_LOCALES) @@ -313,7 +313,7 @@ namespace LuaItem return 1; } - int GetOwnerGUID(Eluna* /*E*/, lua_State* L, Item* item) + int GetOwnerGUID(lua_State* L, Item* item) { #ifndef TRINITY Eluna::Push(L, item->GetOwnerGuid()); @@ -328,7 +328,7 @@ namespace LuaItem * * @return [Player] player : the [Player] who owns the [Item] */ - int GetOwner(Eluna* /*E*/, lua_State* L, Item* item) + int GetOwner(lua_State* L, Item* item) { Eluna::Push(L, item->GetOwner()); return 1; @@ -339,7 +339,7 @@ namespace LuaItem * * @return uint32 count */ - int GetCount(Eluna* /*E*/, lua_State* L, Item* item) + int GetCount(lua_State* L, Item* item) { Eluna::Push(L, item->GetCount()); return 1; @@ -350,7 +350,7 @@ namespace LuaItem * * @return uint32 maxCount */ - int GetMaxStackCount(Eluna* /*E*/, lua_State* L, Item* item) + int GetMaxStackCount(lua_State* L, Item* item) { Eluna::Push(L, item->GetMaxStackCount()); return 1; @@ -361,7 +361,7 @@ namespace LuaItem * * @return uint8 slot */ - int GetSlot(Eluna* /*E*/, lua_State* L, Item* item) + int GetSlot(lua_State* L, Item* item) { Eluna::Push(L, item->GetSlot()); return 1; @@ -372,7 +372,7 @@ namespace LuaItem * * @return uint8 bagSlot */ - int GetBagSlot(Eluna* /*E*/, lua_State* L, Item* item) + int GetBagSlot(lua_State* L, Item* item) { Eluna::Push(L, item->GetBagSlot()); return 1; @@ -384,7 +384,7 @@ namespace LuaItem * @param [EnchantmentSlot] enchantSlot : the enchant slot specified * @return uint32 enchantId : the id of the enchant slot specified */ - int GetEnchantmentId(Eluna* /*E*/, lua_State* L, Item* item) + int GetEnchantmentId(lua_State* L, Item* item) { uint32 enchant_slot = Eluna::CHECKVAL(L, 2); @@ -401,7 +401,7 @@ namespace LuaItem * @param uint32 spellIndex : the spell index specified * @return uint32 spellId : the id of the spell */ - int GetSpellId(Eluna* /*E*/, lua_State* L, Item* item) + int GetSpellId(lua_State* L, Item* item) { uint32 index = Eluna::CHECKVAL(L, 2); if (index >= MAX_ITEM_PROTO_SPELLS) @@ -417,7 +417,7 @@ namespace LuaItem * @param uint32 spellIndex : the spell index specified * @return uint32 spellTrigger : the spell trigger of the specified index */ - int GetSpellTrigger(Eluna* /*E*/, lua_State* L, Item* item) + int GetSpellTrigger(lua_State* L, Item* item) { uint32 index = Eluna::CHECKVAL(L, 2); if (index >= MAX_ITEM_PROTO_SPELLS) @@ -432,7 +432,7 @@ namespace LuaItem * * @return uint32 class */ - int GetClass(Eluna* /*E*/, lua_State* L, Item* item) + int GetClass(lua_State* L, Item* item) { Eluna::Push(L, item->GetTemplate()->Class); return 1; @@ -443,7 +443,7 @@ namespace LuaItem * * @return uint32 subClass */ - int GetSubClass(Eluna* /*E*/, lua_State* L, Item* item) + int GetSubClass(lua_State* L, Item* item) { Eluna::Push(L, item->GetTemplate()->SubClass); return 1; @@ -454,7 +454,7 @@ namespace LuaItem * * @return string name */ - int GetName(Eluna* /*E*/, lua_State* L, Item* item) + int GetName(lua_State* L, Item* item) { Eluna::Push(L, item->GetTemplate()->Name1); return 1; @@ -465,7 +465,7 @@ namespace LuaItem * * @return uint32 displayId */ - int GetDisplayId(Eluna* /*E*/, lua_State* L, Item* item) + int GetDisplayId(lua_State* L, Item* item) { Eluna::Push(L, item->GetTemplate()->DisplayInfoID); return 1; @@ -476,7 +476,7 @@ namespace LuaItem * * @return uint32 quality */ - int GetQuality(Eluna* /*E*/, lua_State* L, Item* item) + int GetQuality(lua_State* L, Item* item) { Eluna::Push(L, item->GetTemplate()->Quality); return 1; @@ -487,7 +487,7 @@ namespace LuaItem * * @return uint32 count */ - int GetBuyCount(Eluna* /*E*/, lua_State* L, Item* item) + int GetBuyCount(lua_State* L, Item* item) { Eluna::Push(L, item->GetTemplate()->BuyCount); return 1; @@ -498,7 +498,7 @@ namespace LuaItem * * @return uint32 price */ - int GetBuyPrice(Eluna* /*E*/, lua_State* L, Item* item) + int GetBuyPrice(lua_State* L, Item* item) { Eluna::Push(L, item->GetTemplate()->BuyPrice); return 1; @@ -509,7 +509,7 @@ namespace LuaItem * * @return uint32 price */ - int GetSellPrice(Eluna* /*E*/, lua_State* L, Item* item) + int GetSellPrice(lua_State* L, Item* item) { Eluna::Push(L, item->GetTemplate()->SellPrice); return 1; @@ -520,7 +520,7 @@ namespace LuaItem * * @return uint32 inventoryType */ - int GetInventoryType(Eluna* /*E*/, lua_State* L, Item* item) + int GetInventoryType(lua_State* L, Item* item) { Eluna::Push(L, item->GetTemplate()->InventoryType); return 1; @@ -531,7 +531,7 @@ namespace LuaItem * * @return uint32 allowableClass */ - int GetAllowableClass(Eluna* /*E*/, lua_State* L, Item* item) + int GetAllowableClass(lua_State* L, Item* item) { Eluna::Push(L, item->GetTemplate()->AllowableClass); return 1; @@ -542,7 +542,7 @@ namespace LuaItem * * @return uint32 allowableRace */ - int GetAllowableRace(Eluna* /*E*/, lua_State* L, Item* item) + int GetAllowableRace(lua_State* L, Item* item) { Eluna::Push(L, item->GetTemplate()->AllowableRace); return 1; @@ -553,7 +553,7 @@ namespace LuaItem * * @return uint32 itemLevel */ - int GetItemLevel(Eluna* /*E*/, lua_State* L, Item* item) + int GetItemLevel(lua_State* L, Item* item) { Eluna::Push(L, item->GetTemplate()->ItemLevel); return 1; @@ -564,14 +564,14 @@ namespace LuaItem * * @return uint32 requiredLevel */ - int GetRequiredLevel(Eluna* /*E*/, lua_State* L, Item* item) + int GetRequiredLevel(lua_State* L, Item* item) { Eluna::Push(L, item->GetTemplate()->RequiredLevel); return 1; } #ifdef WOTLK - int GetStatsCount(Eluna* /*E*/, lua_State* L, Item* item) + int GetStatsCount(lua_State* L, Item* item) { Eluna::Push(L, item->GetTemplate()->StatsCount); return 1; @@ -583,14 +583,14 @@ namespace LuaItem * * @return uint32 randomPropertyId */ - int GetRandomProperty(Eluna* /*E*/, lua_State* L, Item* item) + int GetRandomProperty(lua_State* L, Item* item) { Eluna::Push(L, item->GetTemplate()->RandomProperty); return 1; } #ifndef CLASSIC - int GetRandomSuffix(Eluna* /*E*/, lua_State* L, Item* item) + int GetRandomSuffix(lua_State* L, Item* item) { Eluna::Push(L, item->GetTemplate()->RandomSuffix); return 1; @@ -602,7 +602,7 @@ namespace LuaItem * * @return uint32 itemSetId */ - int GetItemSet(Eluna* /*E*/, lua_State* L, Item* item) + int GetItemSet(lua_State* L, Item* item) { Eluna::Push(L, item->GetTemplate()->ItemSet); return 1; @@ -613,7 +613,7 @@ namespace LuaItem * * @return uint32 bagSize */ - int GetBagSize(Eluna* /*E*/, lua_State* L, Item* item) + int GetBagSize(lua_State* L, Item* item) { if (Bag* bag = item->ToBag()) Eluna::Push(L, bag->GetBagSize()); @@ -627,7 +627,7 @@ namespace LuaItem * * @param [Player] player : the [Player] specified */ - int SetOwner(Eluna* /*E*/, lua_State* L, Item* item) + int SetOwner(lua_State* L, Item* item) { Player* player = Eluna::CHECKOBJ(L, 2); #ifndef TRINITY @@ -643,7 +643,7 @@ namespace LuaItem * * @param bool setBinding */ - int SetBinding(Eluna* /*E*/, lua_State* L, Item* item) + int SetBinding(lua_State* L, Item* item) { bool soulbound = Eluna::CHECKVAL(L, 2); @@ -656,7 +656,7 @@ namespace LuaItem * * @param uint32 count */ - int SetCount(Eluna* /*E*/, lua_State* L, Item* item) + int SetCount(lua_State* L, Item* item) { uint32 count = Eluna::CHECKVAL(L, 2); item->SetCount(count); @@ -670,7 +670,7 @@ namespace LuaItem * @param uint32 enchantSlot : the slot for the enchant to be applied to * @return bool enchantmentSuccess : if enchantment is successfully set to specified slot, returns 'true', otherwise 'false' */ - int SetEnchantment(Eluna* /*E*/, lua_State* L, Item* item) + int SetEnchantment(lua_State* L, Item* item) { Player* owner = item->GetOwner(); if (!owner) @@ -704,7 +704,7 @@ namespace LuaItem * @param uint32 enchantSlot : the slot for the enchant to be removed from * @return bool enchantmentRemoved : if enchantment is successfully removed from specified slot, returns 'true', otherwise 'false' */ - int ClearEnchantment(Eluna* /*E*/, lua_State* L, Item* item) + int ClearEnchantment(lua_State* L, Item* item) { Player* owner = item->GetOwner(); if (!owner) @@ -732,7 +732,7 @@ namespace LuaItem /** * Saves the [Item] to the database */ - int SaveToDB(Eluna* /*E*/, lua_State* /*L*/, Item* item) + int SaveToDB(lua_State* /*L*/, Item* item) { #ifndef TRINITY item->SaveToDB(); diff --git a/LuaEngine.cpp b/LuaEngine.cpp index 97dd49e..25a42b9 100644 --- a/LuaEngine.cpp +++ b/LuaEngine.cpp @@ -232,6 +232,10 @@ void Eluna::OpenLua() } L = luaL_newstate(); + + lua_pushlightuserdata(L, this); + lua_setfield(L, LUA_REGISTRYINDEX, ELUNA_STATE_PTR); + CreateBindStores(); // open base lua libraries diff --git a/LuaEngine.h b/LuaEngine.h index 0b4264d..29424b5 100644 --- a/LuaEngine.h +++ b/LuaEngine.h @@ -112,6 +112,7 @@ struct LuaScript }; #define ELUNA_OBJECT_STORE "Eluna Object Store" +#define ELUNA_STATE_PTR "Eluna State Ptr" #define LOCK_ELUNA Eluna::Guard __guard(Eluna::GetLock()) #ifndef TRINITY @@ -154,8 +155,8 @@ private: ~Eluna(); // Prevent copy - Eluna(Eluna const&); - Eluna& operator=(const Eluna&); + Eluna(Eluna const&) = delete; + Eluna& operator=(const Eluna&) = delete; void OpenLua(); void CloseLua(); @@ -247,6 +248,17 @@ public: static void ReloadEluna() { LOCK_ELUNA; reload = true; } static LockType& GetLock() { return lock; }; static bool IsInitialized() { return initialized; } + // Never returns nullptr + static Eluna* GetEluna(lua_State* L) + { + lua_pushstring(L, ELUNA_STATE_PTR); + lua_rawget(L, LUA_REGISTRYINDEX); + ASSERT(lua_islightuserdata(L, -1)); + Eluna* E = static_cast(lua_touserdata(L, -1)); + lua_pop(L, 1); + ASSERT(E); + return E; + } // Static pushes, can be used by anything, including methods. static void Push(lua_State* luastate); // nil diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index 3e12fb7..075bbaa 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -37,7 +37,7 @@ extern "C" #include "VehicleMethods.h" #include "BattleGroundMethods.h" -ElunaGlobal::ElunaRegister GlobalMethods[] = +luaL_Reg GlobalMethods[] = { // Hooks { "RegisterPacketEvent", &LuaGlobalFunctions::RegisterPacketEvent }, diff --git a/MapMethods.h b/MapMethods.h index 3749e09..1894f9f 100644 --- a/MapMethods.h +++ b/MapMethods.h @@ -23,7 +23,7 @@ namespace LuaMap * * @return bool isArena */ - int IsArena(Eluna* /*E*/, lua_State* L, Map* map) + int IsArena(lua_State* L, Map* map) { Eluna::Push(L, map->IsBattleArena()); return 1; @@ -35,7 +35,7 @@ namespace LuaMap * * @return bool isBattleGround */ - int IsBattleground(Eluna* /*E*/, lua_State* L, Map* map) + int IsBattleground(lua_State* L, Map* map) { #ifndef TRINITY Eluna::Push(L, map->IsBattleGround()); @@ -50,7 +50,7 @@ namespace LuaMap * * @return bool isDungeon */ - int IsDungeon(Eluna* /*E*/, lua_State* L, Map* map) + int IsDungeon(lua_State* L, Map* map) { Eluna::Push(L, map->IsDungeon()); return 1; @@ -61,7 +61,7 @@ namespace LuaMap * * @return bool isEmpty */ - int IsEmpty(Eluna* /*E*/, lua_State* L, Map* map) + int IsEmpty(lua_State* L, Map* map) { Eluna::Push(L, map->isEmpty()); return 1; @@ -73,7 +73,7 @@ namespace LuaMap * * @return bool isHeroic */ - int IsHeroic(Eluna* /*E*/, lua_State* L, Map* map) + int IsHeroic(lua_State* L, Map* map) { Eluna::Push(L, map->IsHeroic()); return 1; @@ -85,7 +85,7 @@ namespace LuaMap * * @return bool isRaid */ - int IsRaid(Eluna* /*E*/, lua_State* L, Map* map) + int IsRaid(lua_State* L, Map* map) { Eluna::Push(L, map->IsRaid()); return 1; @@ -96,7 +96,7 @@ namespace LuaMap * * @return string mapName */ - int GetName(Eluna* /*E*/, lua_State* L, Map* map) + int GetName(lua_State* L, Map* map) { Eluna::Push(L, map->GetMapName()); return 1; @@ -111,7 +111,7 @@ namespace LuaMap * @param float y * @return float z */ - int GetHeight(Eluna* /*E*/, lua_State* L, Map* map) + int GetHeight(lua_State* L, Map* map) { float x = Eluna::CHECKVAL(L, 2); float y = Eluna::CHECKVAL(L, 3); @@ -133,7 +133,7 @@ namespace LuaMap * * @return int32 difficulty */ - int GetDifficulty(Eluna* /*E*/, lua_State* L, Map* map) + int GetDifficulty(lua_State* L, Map* map) { #ifndef CLASSIC Eluna::Push(L, map->GetDifficulty()); @@ -148,7 +148,7 @@ namespace LuaMap * * @return uint32 instanceId */ - int GetInstanceId(Eluna* /*E*/, lua_State* L, Map* map) + int GetInstanceId(lua_State* L, Map* map) { Eluna::Push(L, map->GetInstanceId()); return 1; @@ -159,7 +159,7 @@ namespace LuaMap * * @return uint32 playerCount */ - int GetPlayerCount(Eluna* /*E*/, lua_State* L, Map* map) + int GetPlayerCount(lua_State* L, Map* map) { Eluna::Push(L, map->GetPlayersCountExceptGMs()); return 1; @@ -170,7 +170,7 @@ namespace LuaMap * * @return uint32 mapId */ - int GetMapId(Eluna* /*E*/, lua_State* L, Map* map) + int GetMapId(lua_State* L, Map* map) { Eluna::Push(L, map->GetId()); return 1; @@ -184,7 +184,7 @@ namespace LuaMap * @param float z * @return uint32 areaId */ - int GetAreaId(Eluna* /*E*/, lua_State* L, Map* map) + int GetAreaId(lua_State* L, Map* map) { float x = Eluna::CHECKVAL(L, 2); float y = Eluna::CHECKVAL(L, 3); @@ -203,7 +203,7 @@ namespace LuaMap * * @param uint64 guid */ - int GetWorldObject(Eluna* /*E*/, lua_State* L, Map* map) + int GetWorldObject(lua_State* L, Map* map) { uint64 guid = Eluna::CHECKVAL(L, 2); @@ -257,7 +257,7 @@ namespace LuaMap * @param [WeatherType] type : the [WeatherType], see above available weather types * @param float grade : the intensity/grade of the [Weather], ranges from 0 to 1 */ - int SetWeather(Eluna* /*E*/, lua_State* L, Map* map) + int SetWeather(lua_State* L, Map* map) { uint32 zoneId = Eluna::CHECKVAL(L, 2); uint32 weatherType = Eluna::CHECKVAL(L, 3); @@ -284,7 +284,7 @@ namespace LuaMap * * @return table instance_data : instance data table, or `nil` */ - int GetInstanceData(Eluna* E, lua_State* L, Map* map) + int GetInstanceData(lua_State* L, Map* map) { #ifdef TRINITY ElunaInstanceAI* iAI = NULL; @@ -295,7 +295,7 @@ namespace LuaMap #endif if (iAI) - sEluna->PushInstanceData(L, iAI, false); + Eluna::GetEluna(L)->PushInstanceData(L, iAI, false); else Eluna::Push(L); // nil @@ -305,7 +305,7 @@ namespace LuaMap /** * Saves the [Map]'s instance data to the database. */ - int SaveInstanceData(Eluna* E, lua_State* L, Map* map) + int SaveInstanceData(lua_State* L, Map* map) { #ifdef TRINITY ElunaInstanceAI* iAI = NULL; diff --git a/ObjectMethods.h b/ObjectMethods.h index fbe5ff2..7bd98bb 100644 --- a/ObjectMethods.h +++ b/ObjectMethods.h @@ -31,7 +31,7 @@ namespace LuaObject * @param uint32 flag : the flag to check for in the flags data * @return bool hasFlag */ - int HasFlag(Eluna* /*E*/, lua_State* L, Object* obj) + int HasFlag(lua_State* L, Object* obj) { uint16 index = Eluna::CHECKVAL(L, 2); uint32 flag = Eluna::CHECKVAL(L, 3); @@ -45,7 +45,7 @@ namespace LuaObject * * @return bool inWorld */ - int IsInWorld(Eluna* /*E*/, lua_State* L, Object* obj) + int IsInWorld(lua_State* L, Object* obj) { Eluna::Push(L, obj->IsInWorld()); return 1; @@ -57,7 +57,7 @@ namespace LuaObject * @param uint16 index * @return int32 value */ - int GetInt32Value(Eluna* /*E*/, lua_State* L, Object* obj) + int GetInt32Value(lua_State* L, Object* obj) { uint16 index = Eluna::CHECKVAL(L, 2); Eluna::Push(L, obj->GetInt32Value(index)); @@ -70,7 +70,7 @@ namespace LuaObject * @param uint16 index * @return uint32 value */ - int GetUInt32Value(Eluna* /*E*/, lua_State* L, Object* obj) + int GetUInt32Value(lua_State* L, Object* obj) { uint16 index = Eluna::CHECKVAL(L, 2); Eluna::Push(L, obj->GetUInt32Value(index)); @@ -83,7 +83,7 @@ namespace LuaObject * @param uint16 index * @return float value */ - int GetFloatValue(Eluna* /*E*/, lua_State* L, Object* obj) + int GetFloatValue(lua_State* L, Object* obj) { uint16 index = Eluna::CHECKVAL(L, 2); Eluna::Push(L, obj->GetFloatValue(index)); @@ -99,7 +99,7 @@ namespace LuaObject * @param uint8 offset : should be 0, 1, 2, or 3 * @return uint8 value */ - int GetByteValue(Eluna* /*E*/, lua_State* L, Object* obj) + int GetByteValue(lua_State* L, Object* obj) { uint16 index = Eluna::CHECKVAL(L, 2); uint8 offset = Eluna::CHECKVAL(L, 3); @@ -116,7 +116,7 @@ namespace LuaObject * @param uint8 offset : should be 0 or 1 * @return uint16 value */ - int GetUInt16Value(Eluna* /*E*/, lua_State* L, Object* obj) + int GetUInt16Value(lua_State* L, Object* obj) { uint16 index = Eluna::CHECKVAL(L, 2); uint8 offset = Eluna::CHECKVAL(L, 3); @@ -131,7 +131,7 @@ namespace LuaObject * * @return float scale */ - int GetScale(Eluna* /*E*/, lua_State* L, Object* obj) + int GetScale(lua_State* L, Object* obj) { Eluna::Push(L, obj->GetObjectScale()); return 1; @@ -144,7 +144,7 @@ namespace LuaObject * * @return uint32 entry */ - int GetEntry(Eluna* /*E*/, lua_State* L, Object* obj) + int GetEntry(lua_State* L, Object* obj) { Eluna::Push(L, obj->GetEntry()); return 1; @@ -162,7 +162,7 @@ namespace LuaObject * * @return uint64 guid */ - int GetGUID(Eluna* /*E*/, lua_State* L, Object* obj) + int GetGUID(lua_State* L, Object* obj) { Eluna::Push(L, obj->GET_GUID()); return 1; @@ -180,7 +180,7 @@ namespace LuaObject * * @return uint32 guidLow */ - int GetGUIDLow(Eluna* /*E*/, lua_State* L, Object* obj) + int GetGUIDLow(lua_State* L, Object* obj) { #ifdef TRINITY Eluna::Push(L, obj->GetGUID().GetCounter()); @@ -207,7 +207,7 @@ namespace LuaObject * * @return uint8 typeID */ - int GetTypeId(Eluna* /*E*/, lua_State* L, Object* obj) + int GetTypeId(lua_State* L, Object* obj) { Eluna::Push(L, obj->GetTypeId()); return 1; @@ -219,7 +219,7 @@ namespace LuaObject * @param uint16 index * @return uint64 value */ - int GetUInt64Value(Eluna* /*E*/, lua_State* L, Object* obj) + int GetUInt64Value(lua_State* L, Object* obj) { uint16 index = Eluna::CHECKVAL(L, 2); obj->GetUInt64Value(index); @@ -236,7 +236,7 @@ namespace LuaObject * @param uint16 index * @param uint32 value */ - int SetFlag(Eluna* /*E*/, lua_State* L, Object* obj) + int SetFlag(lua_State* L, Object* obj) { uint16 index = Eluna::CHECKVAL(L, 2); uint32 flag = Eluna::CHECKVAL(L, 3); @@ -251,7 +251,7 @@ namespace LuaObject * @param uint16 index * @param int32 value */ - int SetInt32Value(Eluna* /*E*/, lua_State* L, Object* obj) + int SetInt32Value(lua_State* L, Object* obj) { uint16 index = Eluna::CHECKVAL(L, 2); int32 value = Eluna::CHECKVAL(L, 3); @@ -265,7 +265,7 @@ namespace LuaObject * @param uint16 index * @param uint32 value */ - int SetUInt32Value(Eluna* /*E*/, lua_State* L, Object* obj) + int SetUInt32Value(lua_State* L, Object* obj) { uint16 index = Eluna::CHECKVAL(L, 2); uint32 value = Eluna::CHECKVAL(L, 3); @@ -279,7 +279,7 @@ namespace LuaObject * @param uint16 index * @param uint32 value */ - int UpdateUInt32Value(Eluna* /*E*/, lua_State* L, Object* obj) + int UpdateUInt32Value(lua_State* L, Object* obj) { uint16 index = Eluna::CHECKVAL(L, 2); uint32 value = Eluna::CHECKVAL(L, 3); @@ -293,7 +293,7 @@ namespace LuaObject * @param uint16 index * @param float value */ - int SetFloatValue(Eluna* /*E*/, lua_State* L, Object* obj) + int SetFloatValue(lua_State* L, Object* obj) { uint16 index = Eluna::CHECKVAL(L, 2); float value = Eluna::CHECKVAL(L, 3); @@ -309,7 +309,7 @@ namespace LuaObject * @param uint8 offset : should be 0, 1, 2, or 3 * @param uint8 value */ - int SetByteValue(Eluna* /*E*/, lua_State* L, Object* obj) + int SetByteValue(lua_State* L, Object* obj) { uint16 index = Eluna::CHECKVAL(L, 2); uint8 offset = Eluna::CHECKVAL(L, 3); @@ -325,7 +325,7 @@ namespace LuaObject * @param uint8 offset : should be 0 or 1 * @param uint16 value */ - int SetUInt16Value(Eluna* /*E*/, lua_State* L, Object* obj) + int SetUInt16Value(lua_State* L, Object* obj) { uint16 index = Eluna::CHECKVAL(L, 2); uint8 offset = Eluna::CHECKVAL(L, 3); @@ -341,7 +341,7 @@ namespace LuaObject * @param uint8 offset : should be 0 or 1 * @param int16 value */ - int SetInt16Value(Eluna* /*E*/, lua_State* L, Object* obj) + int SetInt16Value(lua_State* L, Object* obj) { uint16 index = Eluna::CHECKVAL(L, 2); uint8 offset = Eluna::CHECKVAL(L, 3); @@ -355,7 +355,7 @@ namespace LuaObject * * @param float scale */ - int SetScale(Eluna* /*E*/, lua_State* L, Object* obj) + int SetScale(lua_State* L, Object* obj) { float size = Eluna::CHECKVAL(L, 2); @@ -369,7 +369,7 @@ namespace LuaObject * @param uint16 index * @param uint64 value */ - int SetUInt64Value(Eluna* /*E*/, lua_State* L, Object* obj) + int SetUInt64Value(lua_State* L, Object* obj) { uint16 index = Eluna::CHECKVAL(L, 2); uint64 value = Eluna::CHECKVAL(L, 3); @@ -383,7 +383,7 @@ namespace LuaObject * @param uint16 index * @param uint32 flag */ - int RemoveFlag(Eluna* /*E*/, lua_State* L, Object* obj) + int RemoveFlag(lua_State* L, Object* obj) { uint16 index = Eluna::CHECKVAL(L, 2); uint32 flag = Eluna::CHECKVAL(L, 3); @@ -399,7 +399,7 @@ namespace LuaObject * * @return [Corpse] corpse : the [Object] as a [Corpse], or `nil` */ - int ToCorpse(Eluna* /*E*/, lua_State* L, Object* obj) + int ToCorpse(lua_State* L, Object* obj) { Eluna::Push(L, obj->ToCorpse()); return 1; @@ -412,7 +412,7 @@ namespace LuaObject * * @return [GameObject] gameObject : the [Object] as a [GameObject], or `nil` */ - int ToGameObject(Eluna* /*E*/, lua_State* L, Object* obj) + int ToGameObject(lua_State* L, Object* obj) { Eluna::Push(L, obj->ToGameObject()); return 1; @@ -425,7 +425,7 @@ namespace LuaObject * * @return [Unit] unit : the [Object] as a [Unit], or `nil` */ - int ToUnit(Eluna* /*E*/, lua_State* L, Object* obj) + int ToUnit(lua_State* L, Object* obj) { Eluna::Push(L, obj->ToUnit()); return 1; @@ -438,7 +438,7 @@ namespace LuaObject * * @return [Creature] creature : the [Object] as a [Creature], or `nil` */ - int ToCreature(Eluna* /*E*/, lua_State* L, Object* obj) + int ToCreature(lua_State* L, Object* obj) { Eluna::Push(L, obj->ToCreature()); return 1; @@ -451,7 +451,7 @@ namespace LuaObject * * @return [Player] player : the [Object] as a [Player], or `nil` */ - int ToPlayer(Eluna* /*E*/, lua_State* L, Object* obj) + int ToPlayer(lua_State* L, Object* obj) { Eluna::Push(L, obj->ToPlayer()); return 1; diff --git a/PlayerMethods.h b/PlayerMethods.h index 7736f10..cd1866f 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -18,7 +18,7 @@ namespace LuaPlayer * * @return bool canTitanGrip */ - int CanTitanGrip(Eluna* /*E*/, lua_State* L, Player* player) + int CanTitanGrip(lua_State* L, Player* player) { Eluna::Push(L, player->CanTitanGrip()); return 1; @@ -31,7 +31,7 @@ namespace LuaPlayer * @param uint8 spec : specified talent tree * @return bool hasTalent */ - int HasTalent(Eluna* /*E*/, lua_State* L, Player* player) + int HasTalent(lua_State* L, Player* player) { uint32 talentId = Eluna::CHECKVAL(L, 2); uint8 spec = Eluna::CHECKVAL(L, 3); @@ -47,7 +47,7 @@ namespace LuaPlayer * @param uint32 achievementId * @return bool hasAchieved */ - int HasAchieved(Eluna* /*E*/, lua_State* L, Player* player) + int HasAchieved(lua_State* L, Player* player) { uint32 achievementId = Eluna::CHECKVAL(L, 2); #ifndef TRINITY @@ -65,7 +65,7 @@ namespace LuaPlayer * @param uint32 questId * @return bool hasQuest */ - int HasQuest(Eluna* /*E*/, lua_State* L, Player* player) + int HasQuest(lua_State* L, Player* player) { uint32 quest = Eluna::CHECKVAL(L, 2); @@ -79,7 +79,7 @@ namespace LuaPlayer * @param uint32 skill * @return bool hasSkill */ - int HasSkill(Eluna* /*E*/, lua_State* L, Player* player) + int HasSkill(lua_State* L, Player* player) { uint32 skill = Eluna::CHECKVAL(L, 2); @@ -93,7 +93,7 @@ namespace LuaPlayer * @param uint32 spellId * @return bool hasSpell */ - int HasSpell(Eluna* /*E*/, lua_State* L, Player* player) + int HasSpell(lua_State* L, Player* player) { uint32 id = Eluna::CHECKVAL(L, 2); @@ -107,7 +107,7 @@ namespace LuaPlayer * @param uint32 flag * @return bool hasLoginFlag */ - int HasAtLoginFlag(Eluna* /*E*/, lua_State* L, Player* player) + int HasAtLoginFlag(lua_State* L, Player* player) { uint32 flag = Eluna::CHECKVAL(L, 2); @@ -121,7 +121,7 @@ namespace LuaPlayer * @param int32 entry : entry of a [GameObject] * @return bool hasQuest */ - int HasQuestForGO(Eluna* /*E*/, lua_State* L, Player* player) + int HasQuestForGO(lua_State* L, Player* player) { int32 entry = Eluna::CHECKVAL(L, 2); @@ -136,7 +136,7 @@ namespace LuaPlayer * @param uint32 titleId * @return bool hasTitle */ - int HasTitle(Eluna* /*E*/, lua_State* L, Player* player) + int HasTitle(lua_State* L, Player* player) { uint32 id = Eluna::CHECKVAL(L, 2); CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id); @@ -154,7 +154,7 @@ namespace LuaPlayer * @param bool check_bank = false : determines if the item can be in player bank * @return bool hasItem */ - int HasItem(Eluna* /*E*/, lua_State* L, Player* player) + int HasItem(lua_State* L, Player* player) { uint32 itemId = Eluna::CHECKVAL(L, 2); uint32 count = Eluna::CHECKVAL(L, 3, 1); @@ -169,7 +169,7 @@ namespace LuaPlayer * @param uint32 entry : entry of the item * @return bool hasQuest */ - int HasQuestForItem(Eluna* /*E*/, lua_State* L, Player* player) + int HasQuestForItem(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); @@ -186,7 +186,7 @@ namespace LuaPlayer * @param uint32 entry : entry of the item * @return bool canUse */ - int CanUseItem(Eluna* /*E*/, lua_State* L, Player* player) + int CanUseItem(lua_State* L, Player* player) { Item* item = Eluna::CHECKOBJ(L, 2, false); if (item) @@ -209,7 +209,7 @@ namespace LuaPlayer * @param uint32 spellId * @return bool hasSpellCooldown */ - int HasSpellCooldown(Eluna* /*E*/, lua_State* L, Player* player) + int HasSpellCooldown(lua_State* L, Player* player) { uint32 spellId = Eluna::CHECKVAL(L, 2); @@ -227,7 +227,7 @@ namespace LuaPlayer * @param uint32 entryId * @return bool hasSpellCooldown */ - int CanShareQuest(Eluna* /*E*/, lua_State* L, Player* player) + int CanShareQuest(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); @@ -240,7 +240,7 @@ namespace LuaPlayer * * @return bool canSpeak */ - int CanSpeak(Eluna* /*E*/, lua_State* L, Player* player) + int CanSpeak(lua_State* L, Player* player) { Eluna::Push(L, player->CanSpeak()); return 1; @@ -251,7 +251,7 @@ namespace LuaPlayer * * @return bool canUninviteFromGroup */ - int CanUninviteFromGroup(Eluna* /*E*/, lua_State* L, Player* player) + int CanUninviteFromGroup(lua_State* L, Player* player) { Eluna::Push(L, player->CanUninviteFromGroup() == ERR_PARTY_RESULT_OK); return 1; @@ -263,7 +263,7 @@ namespace LuaPlayer * * @return bool canFly */ - int CanFly(Eluna* /*E*/, lua_State* L, Player* player) + int CanFly(lua_State* L, Player* player) { Eluna::Push(L, player->CanFly()); return 1; @@ -277,7 +277,7 @@ namespace LuaPlayer * @param bool honorable = true : if victims are honorable * @return uint32 kills */ - int GetHonorStoredKills(Eluna* /*E*/, lua_State* L, Player* player) + int GetHonorStoredKills(lua_State* L, Player* player) { bool honorable = Eluna::CHECKVAL(L, 2, true); @@ -290,7 +290,7 @@ namespace LuaPlayer * * @return float rankPoints */ - int GetRankPoints(Eluna* /*E*/, lua_State* L, Player* player) + int GetRankPoints(lua_State* L, Player* player) { Eluna::Push(L, player->GetRankPoints()); return 1; @@ -301,7 +301,7 @@ namespace LuaPlayer * * @return int32 standingPos */ - int GetHonorLastWeekStandingPos(Eluna* /*E*/, lua_State* L, Player* player) + int GetHonorLastWeekStandingPos(lua_State* L, Player* player) { Eluna::Push(L, player->GetHonorLastWeekStandingPos()); return 1; @@ -313,7 +313,7 @@ namespace LuaPlayer * * @return bool isInWater */ - int IsInWater(Eluna* /*E*/, lua_State* L, Player* player) + int IsInWater(lua_State* L, Player* player) { Eluna::Push(L, player->IsInWater()); return 1; @@ -324,7 +324,7 @@ namespace LuaPlayer * * @return bool isMoving */ - int IsMoving(Eluna* /*E*/, lua_State* L, Player* player) // enable for unit when mangos support it + int IsMoving(lua_State* L, Player* player) // enable for unit when mangos support it { Eluna::Push(L, player->isMoving()); return 1; @@ -334,7 +334,7 @@ namespace LuaPlayer /** * Updates the [Player]s weekly honor status */ - int UpdateHonor(Eluna* /*E*/, lua_State* L, Player* player) + int UpdateHonor(lua_State* L, Player* player) { player->UpdateHonor(); return 0; @@ -343,7 +343,7 @@ namespace LuaPlayer /** * Resets the [Player]s weekly honor status */ - int ResetHonor(Eluna* /*E*/, lua_State* L, Player* player) + int ResetHonor(lua_State* L, Player* player) { player->ResetHonor(); return 0; @@ -352,7 +352,7 @@ namespace LuaPlayer /** * Clears all of [Player]s weekly honor status */ - int ClearHonorInfo(Eluna* /*E*/, lua_State* L, Player* player) + int ClearHonorInfo(lua_State* L, Player* player) { player->ClearHonorInfo(); return 0; @@ -365,7 +365,7 @@ namespace LuaPlayer * * @return bool isFlying */ - int IsFlying(Eluna* /*E*/, lua_State* L, Player* player) // enable for unit when mangos support it + int IsFlying(lua_State* L, Player* player) // enable for unit when mangos support it { Eluna::Push(L, player->IsFlying()); return 1; @@ -377,7 +377,7 @@ namespace LuaPlayer * * @return bool isInGroup */ - int IsInGroup(Eluna* /*E*/, lua_State* L, Player* player) + int IsInGroup(lua_State* L, Player* player) { Eluna::Push(L, (player->GetGroup() != NULL)); return 1; @@ -388,7 +388,7 @@ namespace LuaPlayer * * @return bool isInGuild */ - int IsInGuild(Eluna* /*E*/, lua_State* L, Player* player) + int IsInGuild(lua_State* L, Player* player) { Eluna::Push(L, (player->GetGuildId() != 0)); return 1; @@ -401,7 +401,7 @@ namespace LuaPlayer * * @return bool isGM */ - int IsGM(Eluna* /*E*/, lua_State* L, Player* player) + int IsGM(lua_State* L, Player* player) { #ifndef TRINITY Eluna::Push(L, player->isGameMaster()); @@ -418,7 +418,7 @@ namespace LuaPlayer * @param uint32 type * @return bool isInArenaTeam */ - int IsInArenaTeam(Eluna* /*E*/, lua_State* L, Player* player) + int IsInArenaTeam(lua_State* L, Player* player) { uint32 type = Eluna::CHECKVAL(L, 2); if (type < MAX_ARENA_SLOT && player->GetArenaTeamId(type)) @@ -435,7 +435,7 @@ namespace LuaPlayer * @param uint32 entry * @return bool canComplete */ - int CanCompleteQuest(Eluna* /*E*/, lua_State* L, Player* player) + int CanCompleteQuest(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); @@ -448,7 +448,7 @@ namespace LuaPlayer * * @return bool isHorde */ - int IsHorde(Eluna* /*E*/, lua_State* L, Player* player) + int IsHorde(lua_State* L, Player* player) { Eluna::Push(L, (player->GetTeam() == HORDE)); return 1; @@ -459,7 +459,7 @@ namespace LuaPlayer * * @return bool isAlliance */ - int IsAlliance(Eluna* /*E*/, lua_State* L, Player* player) + int IsAlliance(lua_State* L, Player* player) { Eluna::Push(L, (player->GetTeam() == ALLIANCE)); return 1; @@ -470,7 +470,7 @@ namespace LuaPlayer * * @return bool isDND */ - int IsDND(Eluna* /*E*/, lua_State* L, Player* player) + int IsDND(lua_State* L, Player* player) { Eluna::Push(L, player->isDND()); return 1; @@ -481,7 +481,7 @@ namespace LuaPlayer * * @return bool isAFK */ - int IsAFK(Eluna* /*E*/, lua_State* L, Player* player) + int IsAFK(lua_State* L, Player* player) { Eluna::Push(L, player->isAFK()); return 1; @@ -492,13 +492,13 @@ namespace LuaPlayer * * @return bool isFalling */ - int IsFalling(Eluna* /*E*/, lua_State* L, Player* player) + int IsFalling(lua_State* L, Player* player) { Eluna::Push(L, player->IsFalling()); return 1; } - int IsGroupVisibleFor(Eluna* /*E*/, lua_State* L, Player* player) + int IsGroupVisibleFor(lua_State* L, Player* player) { Player* target = Eluna::CHECKOBJ(L, 2); Eluna::Push(L, player->IsGroupVisibleFor(target)); @@ -511,7 +511,7 @@ namespace LuaPlayer * @param [Player] player * @return bool isInSameRaidWith */ - int IsInSameRaidWith(Eluna* /*E*/, lua_State* L, Player* player) + int IsInSameRaidWith(lua_State* L, Player* player) { Player* target = Eluna::CHECKOBJ(L, 2); Eluna::Push(L, player->IsInSameRaidWith(target)); @@ -524,7 +524,7 @@ namespace LuaPlayer * @param [Player] player * @return bool isInSameGroupWith */ - int IsInSameGroupWith(Eluna* /*E*/, lua_State* L, Player* player) + int IsInSameGroupWith(lua_State* L, Player* player) { Player* target = Eluna::CHECKOBJ(L, 2); Eluna::Push(L, player->IsInSameGroupWith(target)); @@ -537,7 +537,7 @@ namespace LuaPlayer * @param [Unit] unit * @return bool isHonorOrXPTarget */ - int IsHonorOrXPTarget(Eluna* /*E*/, lua_State* L, Player* player) + int IsHonorOrXPTarget(lua_State* L, Player* player) { Unit* victim = Eluna::CHECKOBJ(L, 2); @@ -551,7 +551,7 @@ namespace LuaPlayer * @param [Player] player * @return bool isVisibleForPlayer */ - int IsVisibleForPlayer(Eluna* /*E*/, lua_State* L, Player* player) + int IsVisibleForPlayer(lua_State* L, Player* player) { Player* target = Eluna::CHECKOBJ(L, 2); @@ -559,7 +559,7 @@ namespace LuaPlayer return 1; } - int IsGMVisible(Eluna* /*E*/, lua_State* L, Player* player) + int IsGMVisible(lua_State* L, Player* player) { Eluna::Push(L, player->isGMVisible()); return 1; @@ -570,7 +570,7 @@ namespace LuaPlayer * * @return bool isTaxiCheater */ - int IsTaxiCheater(Eluna* /*E*/, lua_State* L, Player* player) + int IsTaxiCheater(lua_State* L, Player* player) { #ifdef MANGOS Eluna::Push(L, player->IsTaxiCheater()); @@ -580,7 +580,7 @@ namespace LuaPlayer return 1; } - int IsGMChat(Eluna* /*E*/, lua_State* L, Player* player) + int IsGMChat(lua_State* L, Player* player) { Eluna::Push(L, player->isGMChat()); return 1; @@ -591,7 +591,7 @@ namespace LuaPlayer * * @return bool isAcceptingWhispers */ - int IsAcceptingWhispers(Eluna* /*E*/, lua_State* L, Player* player) + int IsAcceptingWhispers(lua_State* L, Player* player) { Eluna::Push(L, player->isAcceptWhispers()); return 1; @@ -602,7 +602,7 @@ namespace LuaPlayer * * @return bool isRested */ - int IsRested(Eluna* /*E*/, lua_State* L, Player* player) + int IsRested(lua_State* L, Player* player) { Eluna::Push(L, player->GetRestBonus() > 0.0f); return 1; @@ -613,7 +613,7 @@ namespace LuaPlayer * * @return bool inBattlegroundQueue */ - int InBattlegroundQueue(Eluna* /*E*/, lua_State* L, Player* player) + int InBattlegroundQueue(lua_State* L, Player* player) { #ifndef TRINITY Eluna::Push(L, player->InBattleGroundQueue()); @@ -629,7 +629,7 @@ namespace LuaPlayer * * @return bool inArena */ - int InArena(Eluna* /*E*/, lua_State* L, Player* player) + int InArena(lua_State* L, Player* player) { Eluna::Push(L, player->InArena()); return 1; @@ -641,7 +641,7 @@ namespace LuaPlayer * * @return bool inBattleGround */ - int InBattleground(Eluna* /*E*/, lua_State* L, Player* player) + int InBattleground(lua_State* L, Player* player) { #ifndef TRINITY Eluna::Push(L, player->InBattleGround()); @@ -656,7 +656,7 @@ namespace LuaPlayer * * @return bool canBlock */ - int CanBlock(Eluna* /*E*/, lua_State* L, Player* player) + int CanBlock(lua_State* L, Player* player) { Eluna::Push(L, player->CanBlock()); return 1; @@ -667,13 +667,13 @@ namespace LuaPlayer * * @return bool canParry */ - int CanParry(Eluna* /*E*/, lua_State* L, Player* player) + int CanParry(lua_State* L, Player* player) { Eluna::Push(L, player->CanParry()); return 1; } - /*int HasReceivedQuestReward(Eluna* E, lua_State* L, Player* player) + /*int HasReceivedQuestReward(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); @@ -681,37 +681,37 @@ namespace LuaPlayer return 1; }*/ - /*int IsOutdoorPvPActive(Eluna* E, lua_State* L, Player* player) + /*int IsOutdoorPvPActive(lua_State* L, Player* player) { Eluna::Push(L, player->IsOutdoorPvPActive()); return 1; }*/ - /*int IsImmuneToEnvironmentalDamage(Eluna* E, lua_State* L, Player* player) + /*int IsImmuneToEnvironmentalDamage(lua_State* L, Player* player) { Eluna::Push(L, player->IsImmuneToEnvironmentalDamage()); return 1; }*/ - /*int InRandomLfgDungeon(Eluna* E, lua_State* L, Player* player) + /*int InRandomLfgDungeon(lua_State* L, Player* player) { Eluna::Push(L, player->inRandomLfgDungeon()); return 1; }*/ - /*int IsUsingLfg(Eluna* E, lua_State* L, Player* player) + /*int IsUsingLfg(lua_State* L, Player* player) { Eluna::Push(L, player->isUsingLfg()); return 1; }*/ - /*int IsNeverVisible(Eluna* E, lua_State* L, Player* player) + /*int IsNeverVisible(lua_State* L, Player* player) { Eluna::Push(L, player->IsNeverVisible()); return 1; }*/ - /*int CanFlyInZone(Eluna* E, lua_State* L, Player* player) + /*int CanFlyInZone(lua_State* L, Player* player) { uint32 mapid = Eluna::CHECKVAL(L, 2); uint32 zone = Eluna::CHECKVAL(L, 2); @@ -720,13 +720,13 @@ namespace LuaPlayer return 1; }*/ - /*int HasPendingBind(Eluna* E, lua_State* L, Player* player) + /*int HasPendingBind(lua_State* L, Player* player) { Eluna::Push(L, player->PendingHasPendingBind()); return 1; }*/ - /*int IsARecruiter(Eluna* E, lua_State* L, Player* player) + /*int IsARecruiter(lua_State* L, Player* player) { Eluna::Push(L, player->GetSession()->IsARecruiter() || (player->GetSession()->GetRecruiterId() != 0)); return 1; @@ -738,7 +738,7 @@ namespace LuaPlayer * * @return uint8 specCount */ - int GetSpecsCount(Eluna* /*E*/, lua_State* L, Player* player) + int GetSpecsCount(lua_State* L, Player* player) { Eluna::Push(L, player->GetSpecsCount()); return 1; @@ -749,7 +749,7 @@ namespace LuaPlayer * * @return uint32 specId */ - int GetActiveSpec(Eluna* /*E*/, lua_State* L, Player* player) + int GetActiveSpec(lua_State* L, Player* player) { Eluna::Push(L, player->GetActiveSpec()); return 1; @@ -762,7 +762,7 @@ namespace LuaPlayer * * @return uint32 phasemask */ - int GetPhaseMaskForSpawn(Eluna* /*E*/, lua_State* L, Player* player) + int GetPhaseMaskForSpawn(lua_State* L, Player* player) { Eluna::Push(L, player->GetPhaseMaskForSpawn()); return 1; @@ -776,7 +776,7 @@ namespace LuaPlayer * * @return uint32 arenaPoints */ - int GetArenaPoints(Eluna* /*E*/, lua_State* L, Player* player) + int GetArenaPoints(lua_State* L, Player* player) { Eluna::Push(L, player->GetArenaPoints()); return 1; @@ -787,7 +787,7 @@ namespace LuaPlayer * * @return uint32 honorPoints */ - int GetHonorPoints(Eluna* /*E*/, lua_State* L, Player* player) + int GetHonorPoints(lua_State* L, Player* player) { Eluna::Push(L, player->GetHonorPoints()); return 1; @@ -799,7 +799,7 @@ namespace LuaPlayer * * @return uint32 blockValue */ - int GetShieldBlockValue(Eluna* /*E*/, lua_State* L, Player* player) + int GetShieldBlockValue(lua_State* L, Player* player) { Eluna::Push(L, player->GetShieldBlockValue()); return 1; @@ -812,7 +812,7 @@ namespace LuaPlayer * @param uint32 spellId * @return uint32 spellCooldownDelay */ - int GetSpellCooldownDelay(Eluna* /*E*/, lua_State* L, Player* player) + int GetSpellCooldownDelay(lua_State* L, Player* player) { uint32 spellId = Eluna::CHECKVAL(L, 2); @@ -832,7 +832,7 @@ namespace LuaPlayer * * @return uint32 latency */ - int GetLatency(Eluna* /*E*/, lua_State* L, Player* player) + int GetLatency(lua_State* L, Player* player) { Eluna::Push(L, player->GetSession()->GetLatency()); return 1; @@ -844,7 +844,7 @@ namespace LuaPlayer * * @return uint32 championingFaction */ - int GetChampioningFaction(Eluna* /*E*/, lua_State* L, Player* player) + int GetChampioningFaction(lua_State* L, Player* player) { Eluna::Push(L, player->GetChampioningFaction()); return 1; @@ -856,7 +856,7 @@ namespace LuaPlayer * * @return uint8 subGroup */ - int GetOriginalSubGroup(Eluna* /*E*/, lua_State* L, Player* player) + int GetOriginalSubGroup(lua_State* L, Player* player) { Eluna::Push(L, player->GetOriginalSubGroup()); return 1; @@ -867,7 +867,7 @@ namespace LuaPlayer * * @return [Group] group */ - int GetOriginalGroup(Eluna* /*E*/, lua_State* L, Player* player) + int GetOriginalGroup(lua_State* L, Player* player) { Eluna::Push(L, player->GetOriginalGroup()); return 1; @@ -879,7 +879,7 @@ namespace LuaPlayer * @param float radius * @return [Player] player */ - int GetNextRandomRaidMember(Eluna* /*E*/, lua_State* L, Player* player) + int GetNextRandomRaidMember(lua_State* L, Player* player) { float radius = Eluna::CHECKVAL(L, 2); @@ -892,7 +892,7 @@ namespace LuaPlayer * * @return uint8 subGroup */ - int GetSubGroup(Eluna* /*E*/, lua_State* L, Player* player) + int GetSubGroup(lua_State* L, Player* player) { Eluna::Push(L, player->GetSubGroup()); return 1; @@ -903,7 +903,7 @@ namespace LuaPlayer * * @return [Group] group */ - int GetGroupInvite(Eluna* /*E*/, lua_State* L, Player* player) + int GetGroupInvite(lua_State* L, Player* player) { Eluna::Push(L, player->GetGroupInvite()); return 1; @@ -915,7 +915,7 @@ namespace LuaPlayer * @param uint32 xp * @return uint32 xpBonus */ - int GetXPRestBonus(Eluna* /*E*/, lua_State* L, Player* player) + int GetXPRestBonus(lua_State* L, Player* player) { uint32 xp = Eluna::CHECKVAL(L, 2); @@ -928,7 +928,7 @@ namespace LuaPlayer * * @return [BattleGroundTypeId] typeId */ - int GetBattlegroundTypeId(Eluna* /*E*/, lua_State* L, Player* player) + int GetBattlegroundTypeId(lua_State* L, Player* player) { #ifndef TRINITY Eluna::Push(L, player->GetBattleGroundTypeId()); @@ -943,7 +943,7 @@ namespace LuaPlayer * * @return uint32 battleGroundId */ - int GetBattlegroundId(Eluna* /*E*/, lua_State* L, Player* player) + int GetBattlegroundId(lua_State* L, Player* player) { #ifndef TRINITY Eluna::Push(L, player->GetBattleGroundId()); @@ -959,7 +959,7 @@ namespace LuaPlayer * @param uint32 faction * @return [ReputationRank] rank */ - int GetReputationRank(Eluna* /*E*/, lua_State* L, Player* player) + int GetReputationRank(lua_State* L, Player* player) { uint32 faction = Eluna::CHECKVAL(L, 2); @@ -972,7 +972,7 @@ namespace LuaPlayer * * @return uint16 drunkValue */ - int GetDrunkValue(Eluna* /*E*/, lua_State* L, Player* player) + int GetDrunkValue(lua_State* L, Player* player) { Eluna::Push(L, player->GetDrunkValue()); return 1; @@ -984,7 +984,7 @@ namespace LuaPlayer * @param uint32 skill * @param int16 bonusVal */ - int GetSkillTempBonusValue(Eluna* /*E*/, lua_State* L, Player* player) + int GetSkillTempBonusValue(lua_State* L, Player* player) { uint32 skill = Eluna::CHECKVAL(L, 2); @@ -998,7 +998,7 @@ namespace LuaPlayer * @param uint32 skill * @param int16 bonusVal */ - int GetSkillPermBonusValue(Eluna* /*E*/, lua_State* L, Player* player) + int GetSkillPermBonusValue(lua_State* L, Player* player) { uint32 skill = Eluna::CHECKVAL(L, 2); @@ -1012,7 +1012,7 @@ namespace LuaPlayer * @param uint32 skill * @return uint16 pureVal */ - int GetPureSkillValue(Eluna* /*E*/, lua_State* L, Player* player) + int GetPureSkillValue(lua_State* L, Player* player) { uint32 skill = Eluna::CHECKVAL(L, 2); @@ -1026,7 +1026,7 @@ namespace LuaPlayer * @param uint32 skill * @return uint16 baseVal */ - int GetBaseSkillValue(Eluna* /*E*/, lua_State* L, Player* player) + int GetBaseSkillValue(lua_State* L, Player* player) { uint32 skill = Eluna::CHECKVAL(L, 2); @@ -1040,7 +1040,7 @@ namespace LuaPlayer * @param uint32 skill * @return uint16 val */ - int GetSkillValue(Eluna* /*E*/, lua_State* L, Player* player) + int GetSkillValue(lua_State* L, Player* player) { uint32 skill = Eluna::CHECKVAL(L, 2); @@ -1054,7 +1054,7 @@ namespace LuaPlayer * @param uint32 skill * @return uint16 pureVal */ - int GetPureMaxSkillValue(Eluna* /*E*/, lua_State* L, Player* player) + int GetPureMaxSkillValue(lua_State* L, Player* player) { uint32 skill = Eluna::CHECKVAL(L, 2); @@ -1068,7 +1068,7 @@ namespace LuaPlayer * @param uint32 skill * @return uint16 val */ - int GetMaxSkillValue(Eluna* /*E*/, lua_State* L, Player* player) + int GetMaxSkillValue(lua_State* L, Player* player) { uint32 skill = Eluna::CHECKVAL(L, 2); @@ -1081,7 +1081,7 @@ namespace LuaPlayer * * @return float bonus */ - int GetManaBonusFromIntellect(Eluna* /*E*/, lua_State* L, Player* player) + int GetManaBonusFromIntellect(lua_State* L, Player* player) { Eluna::Push(L, player->GetManaBonusFromIntellect()); return 1; @@ -1092,7 +1092,7 @@ namespace LuaPlayer * * @return float bonus */ - int GetHealthBonusFromStamina(Eluna* /*E*/, lua_State* L, Player* player) + int GetHealthBonusFromStamina(lua_State* L, Player* player) { Eluna::Push(L, player->GetHealthBonusFromStamina()); return 1; @@ -1104,7 +1104,7 @@ namespace LuaPlayer * @param bool isRaid = true : argument is TrinityCore only * @return int32 difficulty */ - int GetDifficulty(Eluna* /*E*/, lua_State* L, Player* player) + int GetDifficulty(lua_State* L, Player* player) { #ifdef TBC Eluna::Push(L, player->GetDifficulty()); @@ -1122,7 +1122,7 @@ namespace LuaPlayer * * @return uint32 guildRank */ - int GetGuildRank(Eluna* /*E*/, lua_State* L, Player* player) // TODO: Move to Guild Methods + int GetGuildRank(lua_State* L, Player* player) // TODO: Move to Guild Methods { Eluna::Push(L, player->GetRank()); return 1; @@ -1133,7 +1133,7 @@ namespace LuaPlayer * * @return uint32 freeTalentPointAmt */ - int GetFreeTalentPoints(Eluna* /*E*/, lua_State* L, Player* player) + int GetFreeTalentPoints(lua_State* L, Player* player) { Eluna::Push(L, player->GetFreeTalentPoints()); return 1; @@ -1144,7 +1144,7 @@ namespace LuaPlayer * * @return string guildName */ - int GetGuildName(Eluna* /*E*/, lua_State* L, Player* player) + int GetGuildName(lua_State* L, Player* player) { if (!player->GetGuildId()) return 1; @@ -1158,7 +1158,7 @@ namespace LuaPlayer * @param uint32 faction * @return int32 reputationAmt */ - int GetReputation(Eluna* /*E*/, lua_State* L, Player* player) + int GetReputation(lua_State* L, Player* player) { uint32 faction = Eluna::CHECKVAL(L, 2); @@ -1171,7 +1171,7 @@ namespace LuaPlayer * * @return [Unit] target */ - int GetComboTarget(Eluna* /*E*/, lua_State* L, Player* player) + int GetComboTarget(lua_State* L, Player* player) { #ifndef TRINITY Eluna::Push(L, player->GetMap()->GetUnit(player->GetComboTargetGuid())); @@ -1186,7 +1186,7 @@ namespace LuaPlayer * * @return uint8 comboPoints */ - int GetComboPoints(Eluna* /*E*/, lua_State* L, Player* player) + int GetComboPoints(lua_State* L, Player* player) { Eluna::Push(L, player->GetComboPoints()); return 1; @@ -1197,7 +1197,7 @@ namespace LuaPlayer * * @return uint32 inGameTime */ - int GetInGameTime(Eluna* /*E*/, lua_State* L, Player* player) + int GetInGameTime(lua_State* L, Player* player) { Eluna::Push(L, player->GetInGameTime()); return 1; @@ -1209,7 +1209,7 @@ namespace LuaPlayer * @param uint32 questId * @return [QuestStatus] questStatus */ - int GetQuestStatus(Eluna* /*E*/, lua_State* L, Player* player) + int GetQuestStatus(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); @@ -1223,7 +1223,7 @@ namespace LuaPlayer * @param uint32 questId * @return bool questRewardStatus */ - int GetQuestRewardStatus(Eluna* /*E*/, lua_State* L, Player* player) + int GetQuestRewardStatus(lua_State* L, Player* player) { uint32 questId = Eluna::CHECKVAL(L, 2); @@ -1238,7 +1238,7 @@ namespace LuaPlayer * @param int32 entry : entry of required [Creature] * @return uint16 count */ - int GetReqKillOrCastCurrentCount(Eluna* /*E*/, lua_State* L, Player* player) + int GetReqKillOrCastCurrentCount(lua_State* L, Player* player) { uint32 questId = Eluna::CHECKVAL(L, 2); int32 entry = Eluna::CHECKVAL(L, 3); @@ -1253,7 +1253,7 @@ namespace LuaPlayer * @param uint32 questId * @return [QuestStatus] questRewardStatus */ - int GetQuestLevel(Eluna* /*E*/, lua_State* L, Player* player) + int GetQuestLevel(lua_State* L, Player* player) { Quest* quest = Eluna::CHECKOBJ(L, 2); @@ -1271,7 +1271,7 @@ namespace LuaPlayer * @param uint8 slot * @return [Item] item */ - int GetEquippedItemBySlot(Eluna* /*E*/, lua_State* L, Player* player) + int GetEquippedItemBySlot(lua_State* L, Player* player) { uint8 slot = Eluna::CHECKVAL(L, 2); if (slot >= EQUIPMENT_SLOT_END) @@ -1287,7 +1287,7 @@ namespace LuaPlayer * * @return float restBonus */ - int GetRestBonus(Eluna* /*E*/, lua_State* L, Player* player) + int GetRestBonus(lua_State* L, Player* player) { Eluna::Push(L, player->GetRestBonus()); return 1; @@ -1298,7 +1298,7 @@ namespace LuaPlayer * * @return uint8 tag */ - int GetChatTag(Eluna* /*E*/, lua_State* L, Player* player) + int GetChatTag(lua_State* L, Player* player) { Eluna::Push(L, player->GetChatTag()); return 1; @@ -1329,7 +1329,7 @@ namespace LuaPlayer * @param uint8 slot : the slot the [Item] is in within the bag, you can get this with [Item:GetSlot] * @return [Item] item : [Item] or nil */ - int GetItemByPos(Eluna* /*E*/, lua_State* L, Player* player) + int GetItemByPos(lua_State* L, Player* player) { uint8 bag = Eluna::CHECKVAL(L, 2); uint8 slot = Eluna::CHECKVAL(L, 3); @@ -1346,7 +1346,7 @@ namespace LuaPlayer * @param uint64 guid : an item guid * @return [Item] item */ - int GetItemByGUID(Eluna* /*E*/, lua_State* L, Player* player) + int GetItemByGUID(lua_State* L, Player* player) { uint64 guid = Eluna::CHECKVAL(L, 2); @@ -1362,7 +1362,7 @@ namespace LuaPlayer * @param uint32 entryId * @return [Item] item */ - int GetItemByEntry(Eluna* /*E*/, lua_State* L, Player* player) + int GetItemByEntry(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); @@ -1375,7 +1375,7 @@ namespace LuaPlayer * * @return uint32 textId : key to npc_text database table */ - int GetGossipTextId(Eluna* /*E*/, lua_State* L, Player* player) + int GetGossipTextId(lua_State* L, Player* player) { WorldObject* obj = Eluna::CHECKOBJ(L, 2); Eluna::Push(L, player->GetGossipTextId(obj)); @@ -1387,7 +1387,7 @@ namespace LuaPlayer * * @return [Unit] unit */ - int GetSelection(Eluna* /*E*/, lua_State* L, Player* player) + int GetSelection(lua_State* L, Player* player) { #ifndef TRINITY Eluna::Push(L, player->GetMap()->GetUnit(player->GetSelectionGuid())); @@ -1402,7 +1402,7 @@ namespace LuaPlayer * * @return [AccountTypes] gmRank */ - int GetGMRank(Eluna* /*E*/, lua_State* L, Player* player) + int GetGMRank(lua_State* L, Player* player) { Eluna::Push(L, player->GetSession()->GetSecurity()); return 1; @@ -1413,7 +1413,7 @@ namespace LuaPlayer * * @return uint32 coinage */ - int GetCoinage(Eluna* /*E*/, lua_State* L, Player* player) + int GetCoinage(lua_State* L, Player* player) { Eluna::Push(L, player->GetMoney()); return 1; @@ -1424,7 +1424,7 @@ namespace LuaPlayer * * @return uint32 guildId */ - int GetGuildId(Eluna* /*E*/, lua_State* L, Player* player) + int GetGuildId(lua_State* L, Player* player) { Eluna::Push(L, player->GetGuildId()); return 1; @@ -1435,7 +1435,7 @@ namespace LuaPlayer * * @return [TeamId] teamId */ - int GetTeam(Eluna* /*E*/, lua_State* L, Player* player) + int GetTeam(lua_State* L, Player* player) { Eluna::Push(L, player->GetTeamId()); return 1; @@ -1448,7 +1448,7 @@ namespace LuaPlayer * @param bool checkinBank = false : also counts the items in player's bank if true * @return uint32 itemamount */ - int GetItemCount(Eluna* /*E*/, lua_State* L, Player* player) + int GetItemCount(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); bool checkinBank = Eluna::CHECKVAL(L, 3, false); @@ -1461,7 +1461,7 @@ namespace LuaPlayer * * @return uint32 lifeTimeKils */ - int GetLifetimeKills(Eluna* /*E*/, lua_State* L, Player* player) + int GetLifetimeKills(lua_State* L, Player* player) { Eluna::Push(L, player->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS)); return 1; @@ -1472,7 +1472,7 @@ namespace LuaPlayer * * @return string ip */ - int GetPlayerIP(Eluna* /*E*/, lua_State* L, Player* player) + int GetPlayerIP(lua_State* L, Player* player) { Eluna::Push(L, player->GetSession()->GetRemoteAddress()); return 1; @@ -1483,7 +1483,7 @@ namespace LuaPlayer * * @return uint32 currLevelPlayTime */ - int GetLevelPlayedTime(Eluna* /*E*/, lua_State* L, Player* player) + int GetLevelPlayedTime(lua_State* L, Player* player) { Eluna::Push(L, player->GetLevelPlayedTime()); return 1; @@ -1494,7 +1494,7 @@ namespace LuaPlayer * * @return uint32 totalPlayTime */ - int GetTotalPlayedTime(Eluna* /*E*/, lua_State* L, Player* player) + int GetTotalPlayedTime(lua_State* L, Player* player) { Eluna::Push(L, player->GetTotalPlayedTime()); return 1; @@ -1505,7 +1505,7 @@ namespace LuaPlayer * * @return [Guild] guild */ - int GetGuild(Eluna* /*E*/, lua_State* L, Player* player) + int GetGuild(lua_State* L, Player* player) { Eluna::Push(L, eGuildMgr->GetGuildById(player->GetGuildId())); return 1; @@ -1516,7 +1516,7 @@ namespace LuaPlayer * * @return [Group] group */ - int GetGroup(Eluna* /*E*/, lua_State* L, Player* player) + int GetGroup(lua_State* L, Player* player) { Eluna::Push(L, player->GetGroup()); return 1; @@ -1527,7 +1527,7 @@ namespace LuaPlayer * * @return uint32 accountId */ - int GetAccountId(Eluna* /*E*/, lua_State* L, Player* player) + int GetAccountId(lua_State* L, Player* player) { Eluna::Push(L, player->GetSession()->GetAccountId()); return 1; @@ -1538,7 +1538,7 @@ namespace LuaPlayer * * @return string accountName */ - int GetAccountName(Eluna* /*E*/, lua_State* L, Player* player) + int GetAccountName(lua_State* L, Player* player) { std::string accName; if (eAccountMgr->GetName(player->GetSession()->GetAccountId(), accName)) @@ -1551,7 +1551,7 @@ namespace LuaPlayer * * @return [Corpse] corpse */ - int GetCorpse(Eluna* /*E*/, lua_State* L, Player* player) + int GetCorpse(lua_State* L, Player* player) { Eluna::Push(L, player->GetCorpse()); return 1; @@ -1562,7 +1562,7 @@ namespace LuaPlayer * * @return int localeIndex */ - int GetDbLocaleIndex(Eluna* /*E*/, lua_State* L, Player* player) + int GetDbLocaleIndex(lua_State* L, Player* player) { Eluna::Push(L, player->GetSession()->GetSessionDbLocaleIndex()); return 1; @@ -1573,31 +1573,31 @@ namespace LuaPlayer * * @return [LocaleConstant] locale */ - int GetDbcLocale(Eluna* /*E*/, lua_State* L, Player* player) + int GetDbcLocale(lua_State* L, Player* player) { Eluna::Push(L, player->GetSession()->GetSessionDbcLocale()); return 1; } - /*int GetRecruiterId(Eluna* E, lua_State* L, Player* player) + /*int GetRecruiterId(lua_State* L, Player* player) { Eluna::Push(L, player->GetSession()->GetRecruiterId()); return 1; }*/ - /*int GetSelectedPlayer(Eluna* E, lua_State* L, Player* player) + /*int GetSelectedPlayer(lua_State* L, Player* player) { Eluna::Push(L, player->GetSelectedPlayer()); return 1; }*/ - /*int GetSelectedUnit(Eluna* E, lua_State* L, Player* player) + /*int GetSelectedUnit(lua_State* L, Player* player) { Eluna::Push(L, player->GetSelectedUnit()); return 1; }*/ - /*int GetNearbyGameObject(Eluna* E, lua_State* L, Player* player) + /*int GetNearbyGameObject(lua_State* L, Player* player) { Eluna::Push(L, ChatHandler(player->GetSession()).GetNearbyGameObject()); return 1; @@ -1608,7 +1608,7 @@ namespace LuaPlayer * * @param bool apply = true : lock if true and unlock if false */ - int SetPlayerLock(Eluna* /*E*/, lua_State* L, Player* player) + int SetPlayerLock(lua_State* L, Player* player) { bool apply = Eluna::CHECKVAL(L, 2, true); @@ -1630,7 +1630,7 @@ namespace LuaPlayer * * @param uint32 flag */ - int SetAtLoginFlag(Eluna* /*E*/, lua_State* L, Player* player) + int SetAtLoginFlag(lua_State* L, Player* player) { uint32 flag = Eluna::CHECKVAL(L, 2); @@ -1643,7 +1643,7 @@ namespace LuaPlayer * * @param uint32 sheatheState */ - int SetSheath(Eluna* /*E*/, lua_State* L, Player* player) + int SetSheath(lua_State* L, Player* player) { uint32 sheathed = Eluna::CHECKVAL(L, 2); if (sheathed >= MAX_SHEATH_STATE) @@ -1658,7 +1658,7 @@ namespace LuaPlayer * * @param uint8 drunkValue */ - int SetDrunkValue(Eluna* /*E*/, lua_State* L, Player* player) + int SetDrunkValue(lua_State* L, Player* player) { uint8 newDrunkValue = Eluna::CHECKVAL(L, 2); @@ -1671,7 +1671,7 @@ namespace LuaPlayer * * @param uint8 raceId */ - int SetFactionForRace(Eluna* /*E*/, lua_State* L, Player* player) + int SetFactionForRace(lua_State* L, Player* player) { uint8 race = Eluna::CHECKVAL(L, 2); @@ -1687,7 +1687,7 @@ namespace LuaPlayer * @param uint16 currVal * @param uint16 maxVal */ - int SetSkill(Eluna* /*E*/, lua_State* L, Player* player) + int SetSkill(lua_State* L, Player* player) { uint16 id = Eluna::CHECKVAL(L, 2); uint16 step = Eluna::CHECKVAL(L, 3); @@ -1703,7 +1703,7 @@ namespace LuaPlayer * * @param uint8 rank */ - int SetGuildRank(Eluna* /*E*/, lua_State* L, Player* player) // TODO: Move to Guild Methods + int SetGuildRank(lua_State* L, Player* player) // TODO: Move to Guild Methods { uint8 rank = Eluna::CHECKVAL(L, 2); @@ -1719,7 +1719,7 @@ namespace LuaPlayer * * @param uint32 talentPointAmt */ - int SetFreeTalentPoints(Eluna* /*E*/, lua_State* L, Player* player) + int SetFreeTalentPoints(lua_State* L, Player* player) { uint32 points = Eluna::CHECKVAL(L, 2); @@ -1736,7 +1736,7 @@ namespace LuaPlayer * @param uint32 factionId * @param int32 reputationValue */ - int SetReputation(Eluna* /*E*/, lua_State* L, Player* player) + int SetReputation(lua_State* L, Player* player) { uint32 faction = Eluna::CHECKVAL(L, 2); int32 value = Eluna::CHECKVAL(L, 3); @@ -1752,7 +1752,7 @@ namespace LuaPlayer * @param uint32 entry : entry of a quest * @param uint32 status */ - int SetQuestStatus(Eluna* /*E*/, lua_State* L, Player* player) + int SetQuestStatus(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); uint32 status = Eluna::CHECKVAL(L, 3); @@ -1768,7 +1768,7 @@ namespace LuaPlayer * * @param float restBonus */ - int SetRestBonus(Eluna* /*E*/, lua_State* L, Player* player) + int SetRestBonus(lua_State* L, Player* player) { float bonus = Eluna::CHECKVAL(L, 2); @@ -1781,7 +1781,7 @@ namespace LuaPlayer * * @param bool acceptWhispers = true */ - int SetAcceptWhispers(Eluna* /*E*/, lua_State* L, Player* player) + int SetAcceptWhispers(lua_State* L, Player* player) { bool on = Eluna::CHECKVAL(L, 2, true); @@ -1794,7 +1794,7 @@ namespace LuaPlayer * * @param bool on = true */ - int SetPvPDeath(Eluna* /*E*/, lua_State* L, Player* player) + int SetPvPDeath(lua_State* L, Player* player) { bool on = Eluna::CHECKVAL(L, 2, true); @@ -1807,7 +1807,7 @@ namespace LuaPlayer * * @param bool gmVisible = true */ - int SetGMVisible(Eluna* /*E*/, lua_State* L, Player* player) + int SetGMVisible(lua_State* L, Player* player) { bool on = Eluna::CHECKVAL(L, 2, true); @@ -1820,7 +1820,7 @@ namespace LuaPlayer * * @param bool taxiCheat = true */ - int SetTaxiCheat(Eluna* /*E*/, lua_State* L, Player* player) + int SetTaxiCheat(lua_State* L, Player* player) { bool on = Eluna::CHECKVAL(L, 2, true); @@ -1833,7 +1833,7 @@ namespace LuaPlayer * * @param bool on = true */ - int SetGMChat(Eluna* /*E*/, lua_State* L, Player* player) + int SetGMChat(lua_State* L, Player* player) { bool on = Eluna::CHECKVAL(L, 2, true); @@ -1846,7 +1846,7 @@ namespace LuaPlayer * * @param bool setGmMode = true */ - int SetGameMaster(Eluna* /*E*/, lua_State* L, Player* player) + int SetGameMaster(lua_State* L, Player* player) { bool on = Eluna::CHECKVAL(L, 2, true); @@ -1862,7 +1862,7 @@ namespace LuaPlayer * * @param [Gender] gender */ - int SetGender(Eluna* /*E*/, lua_State* L, Player* player) + int SetGender(lua_State* L, Player* player) { uint32 _gender = Eluna::CHECKVAL(L, 2); @@ -1892,7 +1892,7 @@ namespace LuaPlayer * * @param uint32 arenaPoints */ - int SetArenaPoints(Eluna* /*E*/, lua_State* L, Player* player) + int SetArenaPoints(lua_State* L, Player* player) { uint32 arenaP = Eluna::CHECKVAL(L, 2); player->SetArenaPoints(arenaP); @@ -1904,7 +1904,7 @@ namespace LuaPlayer * * @param uint32 honorPoints */ - int SetHonorPoints(Eluna* /*E*/, lua_State* L, Player* player) + int SetHonorPoints(lua_State* L, Player* player) { uint32 honorP = Eluna::CHECKVAL(L, 2); player->SetHonorPoints(honorP); @@ -1920,7 +1920,7 @@ namespace LuaPlayer * @param uint32 kills * @param bool honorable = true : if victims were honorable */ - int SetHonorStoredKills(Eluna* /*E*/, lua_State* L, Player* player) + int SetHonorStoredKills(lua_State* L, Player* player) { uint32 kills = Eluna::CHECKVAL(L, 2); bool honorable = Eluna::CHECKVAL(L, 3, true); @@ -1934,7 +1934,7 @@ namespace LuaPlayer * * @param float rankPoints */ - int SetRankPoints(Eluna* /*E*/, lua_State* L, Player* player) + int SetRankPoints(lua_State* L, Player* player) { float rankPoints = Eluna::CHECKVAL(L, 2); @@ -1947,7 +1947,7 @@ namespace LuaPlayer * * @param int32 standingPos */ - int SetHonorLastWeekStandingPos(Eluna* /*E*/, lua_State* L, Player* player) + int SetHonorLastWeekStandingPos(lua_State* L, Player* player) { int32 standingPos = Eluna::CHECKVAL(L, 2); @@ -1961,7 +1961,7 @@ namespace LuaPlayer * * @param uint32 honorableKills */ - int SetLifetimeKills(Eluna* /*E*/, lua_State* L, Player* player) + int SetLifetimeKills(lua_State* L, Player* player) { uint32 val = Eluna::CHECKVAL(L, 2); player->SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, val); @@ -1973,7 +1973,7 @@ namespace LuaPlayer * * @param uint32 copperAmt */ - int SetCoinage(Eluna* /*E*/, lua_State* L, Player* player) + int SetCoinage(lua_State* L, Player* player) { uint32 amt = Eluna::CHECKVAL(L, 2); player->SetMoney(amt); @@ -1989,7 +1989,7 @@ namespace LuaPlayer * @param uint32 mapId : Map ID * @param uint32 areaId : Area ID */ - int SetBindPoint(Eluna* /*E*/, lua_State* L, Player* player) + int SetBindPoint(lua_State* L, Player* player) { float x = Eluna::CHECKVAL(L, 2); float y = Eluna::CHECKVAL(L, 3); @@ -2012,7 +2012,7 @@ namespace LuaPlayer * * @param uint32 titleId */ - int SetKnownTitle(Eluna* /*E*/, lua_State* L, Player* player) + int SetKnownTitle(lua_State* L, Player* player) { uint32 id = Eluna::CHECKVAL(L, 2); CharTitlesEntry const* t = sCharTitlesStore.LookupEntry(id); @@ -2028,7 +2028,7 @@ namespace LuaPlayer * * @param bool applyFFA = true */ - int SetFFA(Eluna* /*E*/, lua_State* L, Player* player) + int SetFFA(lua_State* L, Player* player) { bool apply = Eluna::CHECKVAL(L, 2, true); @@ -2037,7 +2037,7 @@ namespace LuaPlayer } #endif - /*int SetMovement(Eluna* E, lua_State* L, Player* player) + /*int SetMovement(lua_State* L, Player* player) { int32 pType = Eluna::CHECKVAL(L, 2); @@ -2049,7 +2049,7 @@ namespace LuaPlayer /** * Resets the [Player]s pets talent points */ - int ResetPetTalents(Eluna* /*E*/, lua_State* /*L*/, Player* player) + int ResetPetTalents(lua_State* /*L*/, Player* player) { #ifndef TRINITY Pet* pet = player->GetPet(); @@ -2066,7 +2066,7 @@ namespace LuaPlayer /** * Reset the [Player]s completed achievements */ - int ResetAchievements(Eluna* /*E*/, lua_State* /*L*/, Player* player) + int ResetAchievements(lua_State* /*L*/, Player* player) { #ifndef TRINITY player->GetAchievementMgr().Reset(); @@ -2082,7 +2082,7 @@ namespace LuaPlayer * * @param uint64 guid = playerguid : guid of the mailbox window sender */ - int SendShowMailBox(Eluna* /*E*/, lua_State* L, Player* player) + int SendShowMailBox(lua_State* L, Player* player) { uint64 guid = Eluna::CHECKVAL(L, 2, player->GET_GUID()); @@ -2103,7 +2103,7 @@ namespace LuaPlayer * * @param int32 amount */ - int ModifyArenaPoints(Eluna* /*E*/, lua_State* L, Player* player) + int ModifyArenaPoints(lua_State* L, Player* player) { int32 amount = Eluna::CHECKVAL(L, 2); @@ -2116,7 +2116,7 @@ namespace LuaPlayer * * @param int32 amount */ - int ModifyHonorPoints(Eluna* /*E*/, lua_State* L, Player* player) + int ModifyHonorPoints(lua_State* L, Player* player) { int32 amount = Eluna::CHECKVAL(L, 2); @@ -2129,7 +2129,7 @@ namespace LuaPlayer /** * Saves the [Player] to the database */ - int SaveToDB(Eluna* /*E*/, lua_State* /*L*/, Player* player) + int SaveToDB(lua_State* /*L*/, Player* player) { player->SaveToDB(); return 0; @@ -2140,7 +2140,7 @@ namespace LuaPlayer * * @param [Unit] summoner */ - int SummonPlayer(Eluna* /*E*/, lua_State* L, Player* player) + int SummonPlayer(lua_State* L, Player* player) { Unit* summoner = Eluna::CHECKOBJ(L, 2); @@ -2169,7 +2169,7 @@ namespace LuaPlayer * * @param uint32 muteTime */ - int Mute(Eluna* /*E*/, lua_State* L, Player* player) + int Mute(lua_State* L, Player* player) { uint32 muteseconds = Eluna::CHECKVAL(L, 2); /*const char* reason = luaL_checkstring(E, 2);*/ // Mangos does not have a reason field in database. @@ -2185,7 +2185,7 @@ namespace LuaPlayer /** * Creates the [Player]'s corpse */ - int CreateCorpse(Eluna* /*E*/, lua_State* /*L*/, Player* player) + int CreateCorpse(lua_State* /*L*/, Player* player) { player->CreateCorpse(); return 0; @@ -2196,7 +2196,7 @@ namespace LuaPlayer * * @param uint32 entry : quest entry */ - int RewardQuest(Eluna* /*E*/, lua_State* L, Player* player) + int RewardQuest(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); @@ -2215,7 +2215,7 @@ namespace LuaPlayer * * @param [Unit] sender */ - int SendAuctionMenu(Eluna* /*E*/, lua_State* L, Player* player) + int SendAuctionMenu(lua_State* L, Player* player) { Unit* unit = Eluna::CHECKOBJ(L, 2); @@ -2248,7 +2248,7 @@ namespace LuaPlayer * * @param [Creature] sender */ - int SendTaxiMenu(Eluna* /*E*/, lua_State* L, Player* player) + int SendTaxiMenu(lua_State* L, Player* player) { Creature* creature = Eluna::CHECKOBJ(L, 2); @@ -2259,7 +2259,7 @@ namespace LuaPlayer /** * Sends a spirit resurrection request to the [Player] */ - int SendSpiritResurrect(Eluna* /*E*/, lua_State* /*L*/, Player* player) + int SendSpiritResurrect(lua_State* /*L*/, Player* player) { player->GetSession()->SendSpiritResurrect(); return 0; @@ -2270,7 +2270,7 @@ namespace LuaPlayer * * @param [WorldObject] sender */ - int SendTabardVendorActivate(Eluna* /*E*/, lua_State* L, Player* player) + int SendTabardVendorActivate(lua_State* L, Player* player) { WorldObject* obj = Eluna::CHECKOBJ(L, 2); @@ -2283,7 +2283,7 @@ namespace LuaPlayer * * @param [WorldObject] sender */ - int SendShowBank(Eluna* /*E*/, lua_State* L, Player* player) + int SendShowBank(lua_State* L, Player* player) { WorldObject* obj = Eluna::CHECKOBJ(L, 2); @@ -2296,7 +2296,7 @@ namespace LuaPlayer * * @param [WorldObject] sender */ - int SendListInventory(Eluna* /*E*/, lua_State* L, Player* player) + int SendListInventory(lua_State* L, Player* player) { WorldObject* obj = Eluna::CHECKOBJ(L, 2); @@ -2309,7 +2309,7 @@ namespace LuaPlayer * * @param [WorldObject] sender */ - int SendTrainerList(Eluna* /*E*/, lua_State* L, Player* player) + int SendTrainerList(lua_State* L, Player* player) { WorldObject* obj = Eluna::CHECKOBJ(L, 2); @@ -2322,7 +2322,7 @@ namespace LuaPlayer * * @param [Player] invitee */ - int SendGuildInvite(Eluna* /*E*/, lua_State* L, Player* player) + int SendGuildInvite(lua_State* L, Player* player) { Player* plr = Eluna::CHECKOBJ(L, 2); @@ -2340,7 +2340,7 @@ namespace LuaPlayer * * @param bool saveToDb = true */ - int LogoutPlayer(Eluna* /*E*/, lua_State* L, Player* player) + int LogoutPlayer(lua_State* L, Player* player) { bool save = Eluna::CHECKVAL(L, 2, true); @@ -2351,7 +2351,7 @@ namespace LuaPlayer /** * Forcefully removes the [Player] from a [BattleGround] raid group */ - int RemoveFromBattlegroundRaid(Eluna* /*E*/, lua_State* /*L*/, Player* player) + int RemoveFromBattlegroundRaid(lua_State* /*L*/, Player* player) { #ifndef TRINITY player->RemoveFromBattleGroundRaid(); @@ -2369,7 +2369,7 @@ namespace LuaPlayer * @param uint32 map = true * @param uint32 difficulty = 0 */ - int UnbindInstance(Eluna* /*E*/, lua_State* L, Player* player) + int UnbindInstance(lua_State* L, Player* player) { uint32 map = Eluna::CHECKVAL(L, 2); #ifndef CLASSIC @@ -2386,7 +2386,7 @@ namespace LuaPlayer /** * Unbinds the [Player] from his instances except the one he currently is in. */ - int UnbindAllInstances(Eluna* /*E*/, lua_State* /*L*/, Player* player) + int UnbindAllInstances(lua_State* /*L*/, Player* player) { #ifdef CLASSIC Player::BoundInstancesMap& binds = player->GetBoundInstances(); @@ -2418,7 +2418,7 @@ namespace LuaPlayer * * @param bool teleToEntry = true */ - int LeaveBattleground(Eluna* /*E*/, lua_State* L, Player* player) + int LeaveBattleground(lua_State* L, Player* player) { bool teleToEntryPoint = Eluna::CHECKVAL(L, 2, true); @@ -2435,7 +2435,7 @@ namespace LuaPlayer * @param bool guildBank = false * @return uint32 totalCost */ - int DurabilityRepair(Eluna* /*E*/, lua_State* L, Player* player) + int DurabilityRepair(lua_State* L, Player* player) { uint16 position = Eluna::CHECKVAL(L, 2); bool cost = Eluna::CHECKVAL(L, 3, true); @@ -2458,7 +2458,7 @@ namespace LuaPlayer * @param bool guidBank = false * @return uint32 totalCost */ - int DurabilityRepairAll(Eluna* /*E*/, lua_State* L, Player* player) + int DurabilityRepairAll(lua_State* L, Player* player) { bool cost = Eluna::CHECKVAL(L, 2, true); float discountMod = Eluna::CHECKVAL(L, 3, 1.0f); @@ -2477,7 +2477,7 @@ namespace LuaPlayer * * @param int32 slot */ - int DurabilityPointLossForEquipSlot(Eluna* /*E*/, lua_State* L, Player* player) + int DurabilityPointLossForEquipSlot(lua_State* L, Player* player) { int32 slot = Eluna::CHECKVAL(L, 2); @@ -2494,7 +2494,7 @@ namespace LuaPlayer * @param int32 points * @param bool inventory = true */ - int DurabilityPointsLossAll(Eluna* /*E*/, lua_State* L, Player* player) + int DurabilityPointsLossAll(lua_State* L, Player* player) { int32 points = Eluna::CHECKVAL(L, 2); bool inventory = Eluna::CHECKVAL(L, 3, true); @@ -2509,7 +2509,7 @@ namespace LuaPlayer * @param [Item] item * @param int32 points */ - int DurabilityPointsLoss(Eluna* /*E*/, lua_State* L, Player* player) + int DurabilityPointsLoss(lua_State* L, Player* player) { Item* item = Eluna::CHECKOBJ(L, 2); int32 points = Eluna::CHECKVAL(L, 3); @@ -2524,7 +2524,7 @@ namespace LuaPlayer * @param [Item] item * @param double percent */ - int DurabilityLoss(Eluna* /*E*/, lua_State* L, Player* player) + int DurabilityLoss(lua_State* L, Player* player) { Item* item = Eluna::CHECKOBJ(L, 2); double percent = Eluna::CHECKVAL(L, 3); @@ -2539,7 +2539,7 @@ namespace LuaPlayer * @param double percent * @param bool inventory = true */ - int DurabilityLossAll(Eluna* /*E*/, lua_State* L, Player* player) + int DurabilityLossAll(lua_State* L, Player* player) { double percent = Eluna::CHECKVAL(L, 2); bool inventory = Eluna::CHECKVAL(L, 3, true); @@ -2551,7 +2551,7 @@ namespace LuaPlayer /** * Kills the [Player] */ - int KillPlayer(Eluna* /*E*/, lua_State* /*L*/, Player* player) + int KillPlayer(lua_State* /*L*/, Player* player) { player->KillPlayer(); return 0; @@ -2560,7 +2560,7 @@ namespace LuaPlayer /** * Forces the [Player] to leave a [Group] */ - int RemoveFromGroup(Eluna* /*E*/, lua_State* /*L*/, Player* player) + int RemoveFromGroup(lua_State* /*L*/, Player* player) { if (!player->GetGroup()) return 0; @@ -2574,7 +2574,7 @@ namespace LuaPlayer * * @return uint32 resetCost */ - int ResetTalentsCost(Eluna* /*E*/, lua_State* L, Player* player) + int ResetTalentsCost(lua_State* L, Player* player) { #ifdef CATA Eluna::Push(L, player->GetNextResetTalentsCost()); @@ -2593,7 +2593,7 @@ namespace LuaPlayer * * @param bool noCost = true */ - int ResetTalents(Eluna* /*E*/, lua_State* L, Player* player) + int ResetTalents(lua_State* L, Player* player) { bool no_cost = Eluna::CHECKVAL(L, 2, true); @@ -2619,7 +2619,7 @@ namespace LuaPlayer * @param bool disabled = false * @param bool learnLowRank = true */ - int RemoveSpell(Eluna* /*E*/, lua_State* L, Player* player) + int RemoveSpell(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); bool disabled = Eluna::CHECKVAL(L, 3, false); @@ -2636,7 +2636,7 @@ namespace LuaPlayer /** * Clears the [Player]s combo points */ - int ClearComboPoints(Eluna* /*E*/, lua_State* /*L*/, Player* player) + int ClearComboPoints(lua_State* /*L*/, Player* player) { player->ClearComboPoints(); return 0; @@ -2648,7 +2648,7 @@ namespace LuaPlayer * @param [Unit] target * @param int8 count */ - int AddComboPoints(Eluna* /*E*/, lua_State* L, Player* player) + int AddComboPoints(lua_State* L, Player* player) { Unit* target = Eluna::CHECKOBJ(L, 2); int8 count = Eluna::CHECKVAL(L, 3); @@ -2663,7 +2663,7 @@ namespace LuaPlayer * @param uint32 entry : entry of a [Creature] * @param [Creature] creature */ - int TalkedToCreature(Eluna* /*E*/, lua_State* L, Player* player) + int TalkedToCreature(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); Creature* creature = Eluna::CHECKOBJ(L, 3); @@ -2677,7 +2677,7 @@ namespace LuaPlayer * * @param uint32 entry : entry of a [Creature] */ - int KilledMonsterCredit(Eluna* /*E*/, lua_State* L, Player* player) + int KilledMonsterCredit(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); @@ -2691,7 +2691,7 @@ namespace LuaPlayer * @param uint32 quest : entry of a quest * @param [WorldObject] obj */ - int GroupEventHappens(Eluna* /*E*/, lua_State* L, Player* player) + int GroupEventHappens(lua_State* L, Player* player) { uint32 questId = Eluna::CHECKVAL(L, 2); WorldObject* obj = Eluna::CHECKOBJ(L, 3); @@ -2705,7 +2705,7 @@ namespace LuaPlayer * * @param uint32 quest : entry of a [Quest] */ - int AreaExploredOrEventHappens(Eluna* /*E*/, lua_State* L, Player* player) + int AreaExploredOrEventHappens(lua_State* L, Player* player) { uint32 questId = Eluna::CHECKVAL(L, 2); @@ -2718,7 +2718,7 @@ namespace LuaPlayer * * @param uint32 entry : entry of a [Quest] */ - int FailQuest(Eluna* /*E*/, lua_State* L, Player* player) + int FailQuest(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); @@ -2731,7 +2731,7 @@ namespace LuaPlayer * * @param uint32 entry : quest entry */ - int IncompleteQuest(Eluna* /*E*/, lua_State* L, Player* player) + int IncompleteQuest(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); @@ -2746,7 +2746,7 @@ namespace LuaPlayer * * @param uint32 entry : quest entry */ - int CompleteQuest(Eluna* /*E*/, lua_State* L, Player* player) + int CompleteQuest(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); @@ -2870,7 +2870,7 @@ namespace LuaPlayer * * @param uint32 entry : quest entry */ - int AddQuest(Eluna* /*E*/, lua_State* L, Player* player) + int AddQuest(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); @@ -2920,7 +2920,7 @@ namespace LuaPlayer * * @param uint32 entry : quest entry */ - int RemoveQuest(Eluna* /*E*/, lua_State* L, Player* player) + int RemoveQuest(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); @@ -2971,7 +2971,7 @@ namespace LuaPlayer * @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) + int Whisper(lua_State* L, Player* player) { std::string text = Eluna::CHECKVAL(L, 2); uint32 lang = Eluna::CHECKVAL(L, 3); @@ -2993,7 +2993,7 @@ namespace LuaPlayer * * @param string emoteText */ - int TextEmote(Eluna* /*E*/, lua_State* L, Player* player) + int TextEmote(lua_State* L, Player* player) { std::string text = Eluna::CHECKVAL(L, 2); @@ -3007,7 +3007,7 @@ namespace LuaPlayer * @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) + int Yell(lua_State* L, Player* player) { std::string text = Eluna::CHECKVAL(L, 2); uint32 lang = Eluna::CHECKVAL(L, 3); @@ -3025,7 +3025,7 @@ namespace LuaPlayer * @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) + int Say(lua_State* L, Player* player) { std::string text = Eluna::CHECKVAL(L, 2); uint32 lang = Eluna::CHECKVAL(L, 3); @@ -3043,7 +3043,7 @@ namespace LuaPlayer * @param uint32 xp : experience to give * @param [Unit] victim = nil */ - int GiveXP(Eluna* /*E*/, lua_State* L, Player* player) + int GiveXP(lua_State* L, Player* player) { uint32 xp = Eluna::CHECKVAL(L, 2); Unit* victim = Eluna::CHECKOBJ(L, 3, false); @@ -3055,7 +3055,7 @@ namespace LuaPlayer /** * Toggle the [Player]s 'Do Not Disturb' flag */ - int ToggleDND(Eluna* /*E*/, lua_State* /*L*/, Player* player) + int ToggleDND(lua_State* /*L*/, Player* player) { player->ToggleDND(); return 0; @@ -3064,7 +3064,7 @@ namespace LuaPlayer /** * Toggle the [Player]s 'Away From Keyboard' flag */ - int ToggleAFK(Eluna* /*E*/, lua_State* /*L*/, Player* player) + int ToggleAFK(lua_State* /*L*/, Player* player) { player->ToggleAFK(); return 0; @@ -3111,7 +3111,7 @@ namespace LuaPlayer * @param uint32 slot : equipment slot to equip the item to The slot can be [EquipmentSlots] or [InventorySlots] * @return [Item] equippedItem : item or nil if equipping failed */ - int EquipItem(Eluna* /*E*/, lua_State* L, Player* player) + int EquipItem(lua_State* L, Player* player) { uint16 dest = 0; Item* item = Eluna::CHECKOBJ(L, 2, false); @@ -3161,7 +3161,7 @@ namespace LuaPlayer * @param uint32 slot : equipment slot to test * @return bool canEquip */ - int CanEquipItem(Eluna* /*E*/, lua_State* L, Player* player) + int CanEquipItem(lua_State* L, Player* player) { Item* item = Eluna::CHECKOBJ(L, 2, false); uint32 slot = Eluna::CHECKVAL(L, 3); @@ -3202,7 +3202,7 @@ namespace LuaPlayer * * @param uint32 titleId */ - int UnsetKnownTitle(Eluna* /*E*/, lua_State* L, Player* player) + int UnsetKnownTitle(lua_State* L, Player* player) { uint32 id = Eluna::CHECKVAL(L, 2); CharTitlesEntry const* t = sCharTitlesStore.LookupEntry(id); @@ -3215,7 +3215,7 @@ namespace LuaPlayer /** * Advances all of the [Player]s skills to the maximum amount available */ - int AdvanceSkillsToMax(Eluna* /*E*/, lua_State* /*L*/, Player* player) + int AdvanceSkillsToMax(lua_State* /*L*/, Player* player) { player->UpdateSkillsToMaxSkillsForLevel(); return 0; @@ -3226,7 +3226,7 @@ namespace LuaPlayer * * @param uint32 skillStep */ - int AdvanceAllSkills(Eluna* /*E*/, lua_State* L, Player* player) + int AdvanceAllSkills(lua_State* L, Player* player) { uint32 step = Eluna::CHECKVAL(L, 2); @@ -3254,7 +3254,7 @@ namespace LuaPlayer * @param uint32 skillId * @param uint32 skillStep */ - int AdvanceSkill(Eluna* /*E*/, lua_State* L, Player* player) + int AdvanceSkill(lua_State* L, Player* player) { uint32 _skillId = Eluna::CHECKVAL(L, 2); uint32 _step = Eluna::CHECKVAL(L, 3); @@ -3275,7 +3275,7 @@ namespace LuaPlayer * @param float zCoord * @param float orientation */ - int Teleport(Eluna* /*E*/, lua_State* L, Player* player) + int Teleport(lua_State* L, Player* player) { uint32 mapId = Eluna::CHECKVAL(L, 2); float x = Eluna::CHECKVAL(L, 3); @@ -3295,7 +3295,7 @@ namespace LuaPlayer return 1; } - int AddLifetimeKills(Eluna* /*E*/, lua_State* L, Player* player) + int AddLifetimeKills(lua_State* L, Player* player) { uint32 val = Eluna::CHECKVAL(L, 2); uint32 currentKills = player->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS); @@ -3310,7 +3310,7 @@ namespace LuaPlayer * @param uint32 itemCount = 1 : amount of the item to add * @return [Item] item : the item that was added or nil */ - int AddItem(Eluna* /*E*/, lua_State* L, Player* player) + int AddItem(lua_State* L, Player* player) { uint32 itemId = Eluna::CHECKVAL(L, 2); uint32 itemCount = Eluna::CHECKVAL(L, 3, 1); @@ -3344,7 +3344,7 @@ namespace LuaPlayer * @param uint32 entry : entry of the item to remove * @param uint32 itemCount = 1 : amount of the item to remove */ - int RemoveItem(Eluna* /*E*/, lua_State* L, Player* player) + int RemoveItem(lua_State* L, Player* player) { Item* item = Eluna::CHECKOBJ(L, 2, false); uint32 itemCount = Eluna::CHECKVAL(L, 3); @@ -3368,7 +3368,7 @@ namespace LuaPlayer * * @param uint32 val : kills to remove */ - int RemoveLifetimeKills(Eluna* /*E*/, lua_State* L, Player* player) + int RemoveLifetimeKills(lua_State* L, Player* player) { uint32 val = Eluna::CHECKVAL(L, 2); uint32 currentKills = player->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS); @@ -3384,7 +3384,7 @@ namespace LuaPlayer * @param uint32 spellId * @param bool update = true */ - int ResetSpellCooldown(Eluna* /*E*/, lua_State* L, Player* player) + int ResetSpellCooldown(lua_State* L, Player* player) { uint32 spellId = Eluna::CHECKVAL(L, 2); bool update = Eluna::CHECKVAL(L, 3, true); @@ -3402,7 +3402,7 @@ namespace LuaPlayer * @param uint32 category * @param bool update = true */ - int ResetTypeCooldowns(Eluna* /*E*/, lua_State* L, Player* player) + int ResetTypeCooldowns(lua_State* L, Player* player) { uint32 category = Eluna::CHECKVAL(L, 2); bool update = Eluna::CHECKVAL(L, 3, true); @@ -3422,7 +3422,7 @@ namespace LuaPlayer /** * Resets all of the [Player]'s cooldowns */ - int ResetAllCooldowns(Eluna* /*E*/, lua_State* /*L*/, Player* player) + int ResetAllCooldowns(lua_State* /*L*/, Player* player) { #ifdef TRINITY player->GetSpellHistory()->ResetAllCooldowns(); @@ -3438,7 +3438,7 @@ namespace LuaPlayer * @param uint32 spellId : entry of a spell * @param [Unit] target */ - int SendClearCooldowns(Eluna* /*E*/, lua_State* L, Player* player) + int SendClearCooldowns(lua_State* L, Player* player) { uint32 spellId = Eluna::CHECKVAL(L, 2); Unit* target = Eluna::CHECKOBJ(L, 3); @@ -3456,7 +3456,7 @@ namespace LuaPlayer * * @param string message */ - int SendBroadcastMessage(Eluna* /*E*/, lua_State* L, Player* player) + int SendBroadcastMessage(lua_State* L, Player* player) { const char* message = Eluna::CHECKVAL(L, 2); if (std::string(message).length() > 0) @@ -3469,7 +3469,7 @@ namespace LuaPlayer * * @param string message */ - int SendAreaTriggerMessage(Eluna* /*E*/, lua_State* L, Player* player) + int SendAreaTriggerMessage(lua_State* L, Player* player) { std::string msg = Eluna::CHECKVAL(L, 2); if (msg.length() > 0) @@ -3482,7 +3482,7 @@ namespace LuaPlayer * * @param string message */ - int SendNotification(Eluna* /*E*/, lua_State* L, Player* player) + int SendNotification(lua_State* L, Player* player) { std::string msg = Eluna::CHECKVAL(L, 2); if (msg.length() > 0) @@ -3496,7 +3496,7 @@ namespace LuaPlayer * @param [WorldPacket] packet * @param bool selfOnly = true */ - int SendPacket(Eluna* /*E*/, lua_State* L, Player* player) + int SendPacket(lua_State* L, Player* player) { WorldPacket* data = Eluna::CHECKOBJ(L, 2); bool selfOnly = Eluna::CHECKVAL(L, 3, true); @@ -3524,7 +3524,7 @@ namespace LuaPlayer * @param string fullMsg * */ - int SendAddonMessage(Eluna* /*E*/, lua_State* L, Player* player) + int SendAddonMessage(lua_State* L, Player* player) { std::string prefix = Eluna::CHECKVAL(L, 2); std::string message = Eluna::CHECKVAL(L, 3); @@ -3555,7 +3555,7 @@ namespace LuaPlayer /** * Kicks the [Player] from the server */ - int KickPlayer(Eluna* /*E*/, lua_State* /*L*/, Player* player) + int KickPlayer(lua_State* /*L*/, Player* player) { player->GetSession()->KickPlayer(); return 0; @@ -3566,7 +3566,7 @@ namespace LuaPlayer * * @param int32 copperAmt : negative to remove, positive to add */ - int ModifyMoney(Eluna* /*E*/, lua_State* L, Player* player) + int ModifyMoney(lua_State* L, Player* player) { int32 amt = Eluna::CHECKVAL(L, 2); @@ -3579,7 +3579,7 @@ namespace LuaPlayer * * @param uint32 spellId */ - int LearnSpell(Eluna* /*E*/, lua_State* L, Player* player) + int LearnSpell(lua_State* L, Player* player) { uint32 id = Eluna::CHECKVAL(L, 2); @@ -3597,7 +3597,7 @@ namespace LuaPlayer * @param uint32 talent_id * @param uint32 talentRank */ - int LearnTalent(Eluna* /*E*/, lua_State* L, Player* player) + int LearnTalent(lua_State* L, Player* player) { uint32 id = Eluna::CHECKVAL(L, 2); uint32 rank = Eluna::CHECKVAL(L, 3); @@ -3612,7 +3612,7 @@ namespace LuaPlayer * @param float healthPercent = 100.0f * @param bool ressSickness = false */ - int ResurrectPlayer(Eluna* /*E*/, lua_State* L, Player* player) + int ResurrectPlayer(lua_State* L, Player* player) { float percent = Eluna::CHECKVAL(L, 2, 100.0f); bool sickness = Eluna::CHECKVAL(L, 3, false); @@ -3639,7 +3639,7 @@ namespace LuaPlayer * @param string popup = nil : if non empty string, a popup with given text shown on click * @param uint32 money = 0 : required money in copper */ - int GossipMenuAddItem(Eluna* /*E*/, lua_State* L, Player* player) + int GossipMenuAddItem(lua_State* L, Player* player) { uint32 _icon = Eluna::CHECKVAL(L, 2); const char* msg = Eluna::CHECKVAL(L, 3); @@ -3665,7 +3665,7 @@ namespace LuaPlayer * * See also: [Player:GossipMenuAddItem], [Player:GossipAddQuests], [Player:GossipSendMenu], [Player:GossipClearMenu] */ - int GossipComplete(Eluna* /*E*/, lua_State* /*L*/, Player* player) + int GossipComplete(lua_State* /*L*/, Player* player) { #ifndef TRINITY player->PlayerTalkClass->CloseGossip(); @@ -3689,7 +3689,7 @@ namespace LuaPlayer * @param [Object] sender : object acting as the source of the sent gossip menu * @param uint32 menu_id : if sender is a [Player] then menu_id is mandatory */ - int GossipSendMenu(Eluna* /*E*/, lua_State* L, Player* player) + int GossipSendMenu(lua_State* L, Player* player) { uint32 npc_text = Eluna::CHECKVAL(L, 2); Object* sender = Eluna::CHECKOBJ(L, 3); @@ -3710,7 +3710,7 @@ namespace LuaPlayer * Note: This is needed when you show a gossip menu without using gossip hello or select hooks which do this automatically. * Usually this is needed when using [Player] is the sender of a Gossip Menu. */ - int GossipClearMenu(Eluna* /*E*/, lua_State* /*L*/, Player* player) + int GossipClearMenu(lua_State* /*L*/, Player* player) { player->PlayerTalkClass->ClearMenus(); return 0; @@ -3721,7 +3721,7 @@ namespace LuaPlayer * * @param uint32 pathId : pathId from DBC or [Global:AddTaxiPath] */ - int StartTaxi(Eluna* /*E*/, lua_State* L, Player* player) + int StartTaxi(lua_State* L, Player* player) { uint32 pathId = Eluna::CHECKVAL(L, 2); @@ -3739,7 +3739,7 @@ namespace LuaPlayer * @param uint32 data * @param string iconText */ - int GossipSendPOI(Eluna* /*E*/, lua_State* L, Player* player) + int GossipSendPOI(lua_State* L, Player* player) { float x = Eluna::CHECKVAL(L, 2); float y = Eluna::CHECKVAL(L, 3); @@ -3768,7 +3768,7 @@ namespace LuaPlayer * * @param [WorldObject] source : a questgiver with quests */ - int GossipAddQuests(Eluna* /*E*/, lua_State* L, Player* player) + int GossipAddQuests(lua_State* L, Player* player) { WorldObject* source = Eluna::CHECKOBJ(L, 2); @@ -3791,7 +3791,7 @@ namespace LuaPlayer * @param uint32 questId : entry of a quest * @param bool activateAccept = true : auto finish the quest */ - int SendQuestTemplate(Eluna* /*E*/, lua_State* L, Player* player) + int SendQuestTemplate(lua_State* L, Player* player) { uint32 questId = Eluna::CHECKVAL(L, 2); bool activateAccept = Eluna::CHECKVAL(L, 3, true); @@ -3807,7 +3807,7 @@ namespace LuaPlayer /** * Converts [Player]'s corpse to bones */ - int SpawnBones(Eluna* /*E*/, lua_State* /*L*/, Player* player) + int SpawnBones(lua_State* /*L*/, Player* player) { player->SpawnCorpseBones(); return 0; @@ -3818,7 +3818,7 @@ namespace LuaPlayer * * @param [Player] looter */ - int RemovedInsignia(Eluna* /*E*/, lua_State* L, Player* player) + int RemovedInsignia(lua_State* L, Player* player) { Player* looter = Eluna::CHECKOBJ(L, 2); player->RemovedInsignia(looter); @@ -3831,7 +3831,7 @@ namespace LuaPlayer * @param [Player] invited : player to invite to group * @return bool success : true if the player was invited to a group */ - int GroupInvite(Eluna* /*E*/, lua_State* L, Player* player) + int GroupInvite(lua_State* L, Player* player) { Player* invited = Eluna::CHECKOBJ(L, 2); @@ -3895,7 +3895,7 @@ namespace LuaPlayer * @param [Player] invited : player to add to group * @return [Group] createdGroup : the created group or nil */ - int GroupCreate(Eluna* /*E*/, lua_State* L, Player* player) + int GroupCreate(lua_State* L, Player* player) { Player* invited = Eluna::CHECKOBJ(L, 2); @@ -3946,7 +3946,7 @@ namespace LuaPlayer * * @param uint32 CinematicSequenceId : entry of a cinematic */ - int SendCinematicStart(Eluna* /*E*/, lua_State* L, Player* player) + int SendCinematicStart(lua_State* L, Player* player) { uint32 CinematicSequenceId = Eluna::CHECKVAL(L, 2); @@ -3960,7 +3960,7 @@ namespace LuaPlayer * * @param uint32 MovieId : entry of a movie */ - int SendMovieStart(Eluna* /*E*/, lua_State* L, Player* player) + int SendMovieStart(lua_State* L, Player* player) { uint32 MovieId = Eluna::CHECKVAL(L, 2); @@ -3969,13 +3969,13 @@ namespace LuaPlayer } #endif - /*int BindToInstance(Eluna* E, lua_State* L, Player* player) + /*int BindToInstance(lua_State* L, Player* player) { player->BindToInstance(); return 0; }*/ - /*int AddTalent(Eluna* E, lua_State* L, Player* player) + /*int AddTalent(lua_State* L, Player* player) { uint32 spellId = Eluna::CHECKVAL(L, 2); uint8 spec = Eluna::CHECKVAL(L, 3); @@ -3987,7 +3987,7 @@ namespace LuaPlayer return 1; }*/ - /*int GainSpellComboPoints(Eluna* E, lua_State* L, Player* player) + /*int GainSpellComboPoints(lua_State* L, Player* player) { int8 count = Eluna::CHECKVAL(L, 2); @@ -3995,7 +3995,7 @@ namespace LuaPlayer return 0; }*/ - /*int KillGOCredit(Eluna* E, lua_State* L, Player* player) + /*int KillGOCredit(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); uint64 guid = Eluna::CHECKVAL(L, 3); @@ -4003,13 +4003,13 @@ namespace LuaPlayer return 0; }*/ - /*int KilledPlayerCredit(Eluna* E, lua_State* L, Player* player) + /*int KilledPlayerCredit(lua_State* L, Player* player) { player->KilledPlayerCredit(); return 0; }*/ - /*int RemoveRewardedQuest(Eluna* E, lua_State* L, Player* player) + /*int RemoveRewardedQuest(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); @@ -4017,7 +4017,7 @@ namespace LuaPlayer return 0; }*/ - /*int RemoveActiveQuest(Eluna* E, lua_State* L, Player* player) + /*int RemoveActiveQuest(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); @@ -4025,7 +4025,7 @@ namespace LuaPlayer return 0; }*/ - /*int SummonPet(Eluna* E, lua_State* L, Player* player) + /*int SummonPet(lua_State* L, Player* player) { uint32 entry = Eluna::CHECKVAL(L, 2); float x = Eluna::CHECKVAL(L, 3); @@ -4042,7 +4042,7 @@ namespace LuaPlayer return 0; }*/ - /*int RemovePet(Eluna* E, lua_State* L, Player* player) + /*int RemovePet(lua_State* L, Player* player) { int mode = Eluna::CHECKVAL(L, 2, PET_SAVE_AS_DELETED); bool returnreagent = Eluna::CHECKVAL(L, 2, false); diff --git a/QuestMethods.h b/QuestMethods.h index 724b141..4427622 100644 --- a/QuestMethods.h +++ b/QuestMethods.h @@ -49,7 +49,7 @@ namespace LuaQuest * @param [QuestFlags] flag : all available flags can be seen above * @return bool hasFlag */ - int HasFlag(Eluna* /*E*/, lua_State* L, Quest* quest) + int HasFlag(lua_State* L, Quest* quest) { uint32 flag = Eluna::CHECKVAL(L, 2); #ifndef TRINITY @@ -66,7 +66,7 @@ namespace LuaQuest * * @return bool isDaily */ - int IsDaily(Eluna* /*E*/, lua_State* L, Quest* quest) + int IsDaily(lua_State* L, Quest* quest) { Eluna::Push(L, quest->IsDaily()); return 1; @@ -78,7 +78,7 @@ namespace LuaQuest * * @return bool isRepeatable */ - int IsRepeatable(Eluna* /*E*/, lua_State* L, Quest* quest) + int IsRepeatable(lua_State* L, Quest* quest) { Eluna::Push(L, quest->IsRepeatable()); return 1; @@ -89,7 +89,7 @@ namespace LuaQuest * * @return uint32 entryId */ - int GetId(Eluna* /*E*/, lua_State* L, Quest* quest) + int GetId(lua_State* L, Quest* quest) { Eluna::Push(L, quest->GetQuestId()); return 1; @@ -100,7 +100,7 @@ namespace LuaQuest * * @return uint32 level */ - int GetLevel(Eluna* /*E*/, lua_State* L, Quest* quest) + int GetLevel(lua_State* L, Quest* quest) { Eluna::Push(L, quest->GetQuestLevel()); return 1; @@ -111,7 +111,7 @@ namespace LuaQuest * * @return uint32 minLevel */ - int GetMinLevel(Eluna* /*E*/, lua_State* L, Quest* quest) + int GetMinLevel(lua_State* L, Quest* quest) { Eluna::Push(L, quest->GetMinLevel()); return 1; @@ -122,7 +122,7 @@ namespace LuaQuest * * @return int32 entryId */ - int GetNextQuestId(Eluna* /*E*/, lua_State* L, Quest* quest) + int GetNextQuestId(lua_State* L, Quest* quest) { Eluna::Push(L, quest->GetNextQuestId()); return 1; @@ -133,7 +133,7 @@ namespace LuaQuest * * @return int32 entryId */ - int GetPrevQuestId(Eluna* /*E*/, lua_State* L, Quest* quest) + int GetPrevQuestId(lua_State* L, Quest* quest) { Eluna::Push(L, quest->GetPrevQuestId()); return 1; @@ -144,7 +144,7 @@ namespace LuaQuest * * @return int32 entryId */ - int GetNextQuestInChain(Eluna* /*E*/, lua_State* L, Quest* quest) + int GetNextQuestInChain(lua_State* L, Quest* quest) { Eluna::Push(L, quest->GetNextQuestInChain()); return 1; @@ -155,7 +155,7 @@ namespace LuaQuest * * @return [QuestFlags] flags */ - int GetFlags(Eluna* /*E*/, lua_State* L, Quest* quest) + int GetFlags(lua_State* L, Quest* quest) { #ifndef TRINITY Eluna::Push(L, quest->GetQuestFlags()); @@ -172,13 +172,13 @@ namespace LuaQuest * * @return uint32 type */ - int GetType(Eluna* /*E*/, lua_State* L, Quest* quest) + int GetType(lua_State* L, Quest* quest) { Eluna::Push(L, quest->GetType()); return 1; } - /*int GetMaxLevel(Eluna* E, lua_State* L, Quest* quest) + /*int GetMaxLevel(lua_State* L, Quest* quest) { Eluna::Push(L, quest->GetMaxLevel()); return 1; diff --git a/SpellMethods.h b/SpellMethods.h index 4740bac..a52fc60 100644 --- a/SpellMethods.h +++ b/SpellMethods.h @@ -19,7 +19,7 @@ namespace LuaSpell * * @return bool isAutoRepeating */ - int IsAutoRepeat(Eluna* /*E*/, lua_State* L, Spell* spell) + int IsAutoRepeat(lua_State* L, Spell* spell) { Eluna::Push(L, spell->IsAutoRepeat()); return 1; @@ -30,7 +30,7 @@ namespace LuaSpell * * @return [Unit] caster */ - int GetCaster(Eluna* /*E*/, lua_State* L, Spell* spell) + int GetCaster(lua_State* L, Spell* spell) { Eluna::Push(L, spell->GetCaster()); return 1; @@ -41,7 +41,7 @@ namespace LuaSpell * * @return int32 castTime */ - int GetCastTime(Eluna* /*E*/, lua_State* L, Spell* spell) + int GetCastTime(lua_State* L, Spell* spell) { Eluna::Push(L, spell->GetCastTime()); return 1; @@ -52,7 +52,7 @@ namespace LuaSpell * * @return uint32 entryId */ - int GetEntry(Eluna* /*E*/, lua_State* L, Spell* spell) + int GetEntry(lua_State* L, Spell* spell) { Eluna::Push(L, spell->m_spellInfo->Id); return 1; @@ -63,7 +63,7 @@ namespace LuaSpell * * @return uint32 powerCost */ - int GetPowerCost(Eluna* /*E*/, lua_State* L, Spell* spell) + int GetPowerCost(lua_State* L, Spell* spell) { Eluna::Push(L, spell->GetPowerCost()); return 1; @@ -74,7 +74,7 @@ namespace LuaSpell * * @return int32 duration */ - int GetDuration(Eluna* /*E*/, lua_State* L, Spell* spell) + int GetDuration(lua_State* L, Spell* spell) { #ifndef TRINITY Eluna::Push(L, GetSpellDuration(spell->m_spellInfo)); @@ -91,7 +91,7 @@ namespace LuaSpell * @return float y : y coordinate of the [Spell] * @return float z : z coordinate of the [Spell] */ - int GetTargetDest(Eluna* /*E*/, lua_State* L, Spell* spell) + int GetTargetDest(lua_State* L, Spell* spell) { #ifndef TRINITY if (!(spell->m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)) @@ -122,7 +122,7 @@ namespace LuaSpell * * @return [Object] target */ - int GetTarget(Eluna* /*E*/, lua_State* L, Spell* spell) + int GetTarget(lua_State* L, Spell* spell) { #ifndef TRINITY if (GameObject* target = spell->m_targets.getGOTarget()) @@ -153,7 +153,7 @@ namespace LuaSpell * * @param bool repeat : set variable to 'true' for spell to automatically repeat */ - int SetAutoRepeat(Eluna* /*E*/, lua_State* L, Spell* spell) + int SetAutoRepeat(lua_State* L, Spell* spell) { bool repeat = Eluna::CHECKVAL(L, 2); spell->SetAutoRepeat(repeat); @@ -165,7 +165,7 @@ namespace LuaSpell * * @param bool skipCheck = false : skips initial checks to see if the [Spell] can be casted or not, this is optional */ - int Cast(Eluna* /*E*/, lua_State* L, Spell* spell) + int Cast(lua_State* L, Spell* spell) { bool skipCheck = Eluna::CHECKVAL(L, 2, false); spell->cast(skipCheck); @@ -175,7 +175,7 @@ namespace LuaSpell /** * Cancels the [Spell]. */ - int Cancel(Eluna* /*E*/, lua_State* /*L*/, Spell* spell) + int Cancel(lua_State* /*L*/, Spell* spell) { spell->cancel(); return 0; @@ -184,7 +184,7 @@ namespace LuaSpell /** * Finishes the [Spell]. */ - int Finish(Eluna* /*E*/, lua_State* /*L*/, Spell* spell) + int Finish(lua_State* /*L*/, Spell* spell) { spell->finish(); return 0; diff --git a/UnitMethods.h b/UnitMethods.h index b3545f6..b3bee5b 100644 --- a/UnitMethods.h +++ b/UnitMethods.h @@ -19,7 +19,7 @@ namespace LuaUnit * @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) + int Attack(lua_State* L, Unit* unit) { Unit* who = Eluna::CHECKOBJ(L, 2); bool meleeAttack = Eluna::CHECKVAL(L, 3, false); @@ -33,7 +33,7 @@ namespace LuaUnit * * @return bool isAttacking : if the [Unit] wasn't attacking already */ - int AttackStop(Eluna* /*E*/, lua_State* L, Unit* unit) + int AttackStop(lua_State* L, Unit* unit) { Eluna::Push(L, unit->AttackStop()); return 1; @@ -44,7 +44,7 @@ namespace LuaUnit * * @return bool isStanding */ - int IsStandState(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsStandState(lua_State* L, Unit* unit) { Eluna::Push(L, unit->IsStandState()); return 1; @@ -55,7 +55,7 @@ namespace LuaUnit * * @return bool isMounted */ - int IsMounted(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsMounted(lua_State* L, Unit* unit) { Eluna::Push(L, unit->IsMounted()); return 1; @@ -66,7 +66,7 @@ namespace LuaUnit * * @return bool isRooted */ - int IsRooted(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsRooted(lua_State* L, Unit* unit) { #ifdef TRINITY Eluna::Push(L, unit->isInRoots() || unit->HasUnitMovementFlag(MOVEMENTFLAG_ROOT)); @@ -85,7 +85,7 @@ namespace LuaUnit * * @return bool hasFullHealth */ - int IsFullHealth(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsFullHealth(lua_State* L, Unit* unit) { Eluna::Push(L, unit->IsFullHealth()); return 1; @@ -98,7 +98,7 @@ namespace LuaUnit * @param float radius * @return bool withinDist */ - int IsWithinDistInMap(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsWithinDistInMap(lua_State* L, Unit* unit) { WorldObject* obj = Eluna::CHECKOBJ(L, 2); float radius = Eluna::CHECKVAL(L, 3); @@ -114,7 +114,7 @@ namespace LuaUnit * @param float radius * @return bool isAccessible */ - int IsInAccessiblePlaceFor(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsInAccessiblePlaceFor(lua_State* L, Unit* unit) { Creature* creature = Eluna::CHECKOBJ(L, 2); @@ -131,7 +131,7 @@ namespace LuaUnit * * @return bool isAuctioneer */ - int IsAuctioneer(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsAuctioneer(lua_State* L, Unit* unit) { #ifndef TRINITY Eluna::Push(L, unit->isAuctioner()); @@ -146,7 +146,7 @@ namespace LuaUnit * * @return bool isGuildMaster */ - int IsGuildMaster(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsGuildMaster(lua_State* L, Unit* unit) { #ifdef CMANGOS Eluna::Push(L, unit->isGuildMaster()); @@ -161,7 +161,7 @@ namespace LuaUnit * * @return bool isInnkeeper */ - int IsInnkeeper(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsInnkeeper(lua_State* L, Unit* unit) { #ifdef CMANGOS Eluna::Push(L, unit->isInnkeeper()); @@ -176,7 +176,7 @@ namespace LuaUnit * * @return bool isTrainer */ - int IsTrainer(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsTrainer(lua_State* L, Unit* unit) { #ifdef CMANGOS Eluna::Push(L, unit->isTrainer()); @@ -191,7 +191,7 @@ namespace LuaUnit * * @return bool hasGossip */ - int IsGossip(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsGossip(lua_State* L, Unit* unit) { #ifdef CMANGOS Eluna::Push(L, unit->isGossip()); @@ -206,7 +206,7 @@ namespace LuaUnit * * @return bool isTaxi */ - int IsTaxi(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsTaxi(lua_State* L, Unit* unit) { #ifdef CMANGOS Eluna::Push(L, unit->isTaxi()); @@ -221,7 +221,7 @@ namespace LuaUnit * * @return bool isSpiritHealer */ - int IsSpiritHealer(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsSpiritHealer(lua_State* L, Unit* unit) { #ifdef CMANGOS Eluna::Push(L, unit->isSpiritHealer()); @@ -236,7 +236,7 @@ namespace LuaUnit * * @return bool isSpiritGuide */ - int IsSpiritGuide(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsSpiritGuide(lua_State* L, Unit* unit) { #ifdef CMANGOS Eluna::Push(L, unit->isSpiritGuide()); @@ -251,7 +251,7 @@ namespace LuaUnit * * @return bool isTabardDesigner */ - int IsTabardDesigner(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsTabardDesigner(lua_State* L, Unit* unit) { #ifdef CMANGOS Eluna::Push(L, unit->isTabardDesigner()); @@ -266,7 +266,7 @@ namespace LuaUnit * * @return bool isTabardDesigner */ - int IsServiceProvider(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsServiceProvider(lua_State* L, Unit* unit) { #ifdef CMANGOS Eluna::Push(L, unit->isServiceProvider()); @@ -281,7 +281,7 @@ namespace LuaUnit * * @return bool isSpiritService */ - int IsSpiritService(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsSpiritService(lua_State* L, Unit* unit) { #ifdef CMANGOS Eluna::Push(L, unit->isSpiritService()); @@ -296,7 +296,7 @@ namespace LuaUnit * * @return bool isAlive */ - int IsAlive(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsAlive(lua_State* L, Unit* unit) { #ifdef CMANGOS Eluna::Push(L, unit->isAlive()); @@ -311,7 +311,7 @@ namespace LuaUnit * * @return bool isDead */ - int IsDead(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsDead(lua_State* L, Unit* unit) { #ifdef MANGOS Eluna::Push(L, unit->IsDead()); @@ -326,7 +326,7 @@ namespace LuaUnit * * @return bool isDying */ - int IsDying(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsDying(lua_State* L, Unit* unit) { #ifdef MANGOS Eluna::Push(L, unit->IsDying()); @@ -341,7 +341,7 @@ namespace LuaUnit * * @return bool isBanker */ - int IsBanker(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsBanker(lua_State* L, Unit* unit) { #ifdef CMANGOS Eluna::Push(L, unit->isBanker()); @@ -356,7 +356,7 @@ namespace LuaUnit * * @return bool isVendor */ - int IsVendor(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsVendor(lua_State* L, Unit* unit) { #ifdef CMANGOS Eluna::Push(L, unit->isVendor()); @@ -371,7 +371,7 @@ namespace LuaUnit * * @return bool isBattleMaster */ - int IsBattleMaster(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsBattleMaster(lua_State* L, Unit* unit) { #ifdef CMANGOS Eluna::Push(L, unit->isBattleMaster()); @@ -386,7 +386,7 @@ namespace LuaUnit * * @return bool isCharmed */ - int IsCharmed(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsCharmed(lua_State* L, Unit* unit) { #ifdef CMANGOS Eluna::Push(L, unit->isCharmed()); @@ -401,7 +401,7 @@ namespace LuaUnit * * @return bool isArmorer */ - int IsArmorer(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsArmorer(lua_State* L, Unit* unit) { #ifdef CMANGOS Eluna::Push(L, unit->isArmorer()); @@ -416,7 +416,7 @@ namespace LuaUnit * * @return bool isAttackingPlayer */ - int IsAttackingPlayer(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsAttackingPlayer(lua_State* L, Unit* unit) { Eluna::Push(L, unit->isAttackingPlayer()); return 1; @@ -427,7 +427,7 @@ namespace LuaUnit * * @return bool isPvP */ - int IsPvPFlagged(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsPvPFlagged(lua_State* L, Unit* unit) { Eluna::Push(L, unit->IsPvP()); return 1; @@ -439,7 +439,7 @@ namespace LuaUnit * * @return bool isOnVehicle */ - int IsOnVehicle(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsOnVehicle(lua_State* L, Unit* unit) { #ifndef TRINITY Eluna::Push(L, unit->IsBoarded()); @@ -455,7 +455,7 @@ namespace LuaUnit * * @return bool inCombat */ - int IsInCombat(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsInCombat(lua_State* L, Unit* unit) { #ifdef CMANGOS Eluna::Push(L, unit->isInCombat()); @@ -470,7 +470,7 @@ namespace LuaUnit * * @return bool underWater */ - int IsUnderWater(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsUnderWater(lua_State* L, Unit* unit) { Eluna::Push(L, unit->IsUnderWater()); return 1; @@ -481,7 +481,7 @@ namespace LuaUnit * * @return bool inWater */ - int IsInWater(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsInWater(lua_State* L, Unit* unit) { Eluna::Push(L, unit->IsInWater()); return 1; @@ -492,7 +492,7 @@ namespace LuaUnit * * @return bool notMoving */ - int IsStopped(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsStopped(lua_State* L, Unit* unit) { Eluna::Push(L, unit->IsStopped()); return 1; @@ -503,7 +503,7 @@ namespace LuaUnit * * @return bool questGiver */ - int IsQuestGiver(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsQuestGiver(lua_State* L, Unit* unit) { #ifdef CMANGOS Eluna::Push(L, unit->isQuestGiver()); @@ -519,7 +519,7 @@ namespace LuaUnit * @param int32 healthpct : percentage in integer from * @return bool isBelow */ - int HealthBelowPct(Eluna* /*E*/, lua_State* L, Unit* unit) + int HealthBelowPct(lua_State* L, Unit* unit) { Eluna::Push(L, unit->HealthBelowPct(Eluna::CHECKVAL(L, 2))); return 1; @@ -531,7 +531,7 @@ namespace LuaUnit * @param int32 healthpct : percentage in integer from * @return bool isAbove */ - int HealthAbovePct(Eluna* /*E*/, lua_State* L, Unit* unit) + int HealthAbovePct(lua_State* L, Unit* unit) { Eluna::Push(L, unit->HealthAbovePct(Eluna::CHECKVAL(L, 2))); return 1; @@ -543,7 +543,7 @@ namespace LuaUnit * @param uint32 spell : entry of the aura spell * @return bool hasAura */ - int HasAura(Eluna* /*E*/, lua_State* L, Unit* unit) + int HasAura(lua_State* L, Unit* unit) { uint32 spell = Eluna::CHECKVAL(L, 2); @@ -556,7 +556,7 @@ namespace LuaUnit * * @return bool isCasting */ - int IsCasting(Eluna* /*E*/, lua_State* L, Unit* unit) + int IsCasting(lua_State* L, Unit* unit) { #ifdef TRINITY Eluna::Push(L, unit->HasUnitState(UNIT_STATE_CASTING)); @@ -572,7 +572,7 @@ namespace LuaUnit * @param [UnitState] state : an unit state * @return bool hasState */ - int HasUnitState(Eluna* /*E*/, lua_State* L, Unit* unit) + int HasUnitState(lua_State* L, Unit* unit) { uint32 state = Eluna::CHECKVAL(L, 2); #ifndef TRINITY @@ -583,19 +583,19 @@ namespace LuaUnit return 1; } - /*int IsVisible(Eluna* E, lua_State* L, Unit* unit) + /*int IsVisible(lua_State* L, Unit* unit) { Eluna::Push(L, unit->IsVisible()); return 1; }*/ - /*int IsMoving(Eluna* E, lua_State* L, Unit* unit) + /*int IsMoving(lua_State* L, Unit* unit) { Eluna::Push(L, unit->isMoving()); return 1; }*/ - /*int IsFlying(Eluna* E, lua_State* L, Unit* unit) + /*int IsFlying(lua_State* L, Unit* unit) { Eluna::Push(L, unit->IsFlying()); return 1; @@ -606,7 +606,7 @@ namespace LuaUnit * * @return [Unit] owner */ - int GetOwner(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetOwner(lua_State* L, Unit* unit) { Eluna::Push(L, unit->GetOwner()); return 1; @@ -617,7 +617,7 @@ namespace LuaUnit * * @return uint64 ownerGUID */ - int GetOwnerGUID(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetOwnerGUID(lua_State* L, Unit* unit) { #ifndef TRINITY Eluna::Push(L, unit->GetOwnerGuid()); @@ -632,7 +632,7 @@ namespace LuaUnit * * @return uint32 mountId : displayId of the mount */ - int GetMountId(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetMountId(lua_State* L, Unit* unit) { Eluna::Push(L, unit->GetMountID()); return 1; @@ -643,7 +643,7 @@ namespace LuaUnit * * @return uint64 creatorGUID */ - int GetCreatorGUID(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetCreatorGUID(lua_State* L, Unit* unit) { #ifndef TRINITY Eluna::Push(L, unit->GetCreatorGuid()); @@ -658,7 +658,7 @@ namespace LuaUnit * * @return uint64 charmerGUID */ - int GetCharmerGUID(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetCharmerGUID(lua_State* L, Unit* unit) { #ifndef TRINITY Eluna::Push(L, unit->GetCharmerGuid()); @@ -673,7 +673,7 @@ namespace LuaUnit * * @return uint64 charmedGUID */ - int GetCharmGUID(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetCharmGUID(lua_State* L, Unit* unit) { #ifndef TRINITY Eluna::Push(L, unit->GetCharmGuid()); @@ -688,7 +688,7 @@ namespace LuaUnit * * @return uint64 petGUID */ - int GetPetGUID(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetPetGUID(lua_State* L, Unit* unit) { #ifndef TRINITY Eluna::Push(L, unit->GetPetGuid()); @@ -703,7 +703,7 @@ namespace LuaUnit * * @return uint64 controllerGUID */ - int GetControllerGUID(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetControllerGUID(lua_State* L, Unit* unit) { #ifndef TRINITY Eluna::Push(L, unit->GetCharmerOrOwnerGuid()); @@ -718,7 +718,7 @@ namespace LuaUnit * * @return uint64 controllerGUID */ - int GetControllerGUIDS(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetControllerGUIDS(lua_State* L, Unit* unit) { #ifndef TRINITY Eluna::Push(L, unit->GetCharmerOrOwnerOrOwnGuid()); @@ -734,7 +734,7 @@ namespace LuaUnit * @param uint32 statType * @return float stat */ - int GetStat(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetStat(lua_State* L, Unit* unit) { uint32 stat = Eluna::CHECKVAL(L, 2); @@ -751,7 +751,7 @@ namespace LuaUnit * @param uint32 spellSchool * @return uint32 spellPower */ - int GetBaseSpellPower(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetBaseSpellPower(lua_State* L, Unit* unit) { uint32 spellschool = Eluna::CHECKVAL(L, 2); @@ -767,7 +767,7 @@ namespace LuaUnit * * @return [Unit] victim */ - int GetVictim(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetVictim(lua_State* L, Unit* unit) { #ifndef TRINITY Eluna::Push(L, unit->getVictim()); @@ -793,7 +793,7 @@ namespace LuaUnit * @param [CurrentSpellTypes] spellType * @return [Spell] castedSpell */ - int GetCurrentSpell(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetCurrentSpell(lua_State* L, Unit* unit) { uint32 type = Eluna::CHECKVAL(L, 2); if (type >= CURRENT_MAX_SPELL) @@ -808,7 +808,7 @@ namespace LuaUnit * * @return uint8 standState */ - int GetStandState(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetStandState(lua_State* L, Unit* unit) { #ifdef TRINITY Eluna::Push(L, unit->GetStandState()); @@ -823,7 +823,7 @@ namespace LuaUnit * * @return uint32 displayId */ - int GetDisplayId(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetDisplayId(lua_State* L, Unit* unit) { Eluna::Push(L, unit->GetDisplayId()); return 1; @@ -834,7 +834,7 @@ namespace LuaUnit * * @return uint32 displayId */ - int GetNativeDisplayId(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetNativeDisplayId(lua_State* L, Unit* unit) { Eluna::Push(L, unit->GetNativeDisplayId()); return 1; @@ -845,7 +845,7 @@ namespace LuaUnit * * @return uint8 level */ - int GetLevel(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetLevel(lua_State* L, Unit* unit) { Eluna::Push(L, unit->getLevel()); return 1; @@ -856,13 +856,13 @@ namespace LuaUnit * * @return uint32 healthAmount */ - int GetHealth(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetHealth(lua_State* L, Unit* unit) { Eluna::Push(L, unit->GetHealth()); return 1; } - Powers PowerSelectorHelper(Eluna* /*E*/, lua_State* L, Unit* unit, int powerType = -1) + Powers PowerSelectorHelper(lua_State* L, Unit* unit, int powerType = -1) { #ifdef TRINITY if (powerType == -1) @@ -898,10 +898,10 @@ namespace LuaUnit * @param int type = -1 : a valid power type from [Powers] or -1 for the [Unit]'s current power type * @return uint32 powerAmount */ - int GetPower(Eluna* E, lua_State* L, Unit* unit) + int GetPower(lua_State* L, Unit* unit) { int type = Eluna::CHECKVAL(L, 2, -1); - Powers power = PowerSelectorHelper(E, L, unit, type); + Powers power = PowerSelectorHelper(L, unit, type); Eluna::Push(L, unit->GetPower(power)); return 1; @@ -927,10 +927,10 @@ namespace LuaUnit * @param int type = -1 : a valid power type from [Powers] or -1 for the [Unit]'s current power type * @return uint32 maxPowerAmount */ - int GetMaxPower(Eluna* E, lua_State* L, Unit* unit) + int GetMaxPower(lua_State* L, Unit* unit) { int type = Eluna::CHECKVAL(L, 2, -1); - Powers power = PowerSelectorHelper(E, L, unit, type); + Powers power = PowerSelectorHelper(L, unit, type); Eluna::Push(L, unit->GetMaxPower(power)); return 1; @@ -956,10 +956,10 @@ namespace LuaUnit * @param int type = -1 : a valid power type from [Powers] or -1 for the [Unit]'s current power type * @return float powerPct */ - int GetPowerPct(Eluna* E, lua_State* L, Unit* unit) + int GetPowerPct(lua_State* L, Unit* unit) { int type = Eluna::CHECKVAL(L, 2, -1); - Powers power = PowerSelectorHelper(E, L, unit, type); + Powers power = PowerSelectorHelper(L, unit, type); #if (!defined(TRINITY) && defined(WOTLK)) float percent = ((float)unit->GetPower(power) / (float)unit->GetMaxPower(power)) * 100.0f; @@ -989,7 +989,7 @@ namespace LuaUnit * * @return [Powers] powerType */ - int GetPowerType(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetPowerType(lua_State* L, Unit* unit) { #ifdef TRINITY Eluna::Push(L, unit->getPowerType()); @@ -1004,7 +1004,7 @@ namespace LuaUnit * * @return uint32 maxHealth */ - int GetMaxHealth(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetMaxHealth(lua_State* L, Unit* unit) { Eluna::Push(L, unit->GetMaxHealth()); return 1; @@ -1015,7 +1015,7 @@ namespace LuaUnit * * @return float healthPct */ - int GetHealthPct(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetHealthPct(lua_State* L, Unit* unit) { #ifndef TRINITY Eluna::Push(L, unit->GetHealthPercent()); @@ -1030,7 +1030,7 @@ namespace LuaUnit * * @return uint8 gender : 0 for male, 1 for female and 2 for none */ - int GetGender(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetGender(lua_State* L, Unit* unit) { Eluna::Push(L, unit->getGender()); return 1; @@ -1041,7 +1041,7 @@ namespace LuaUnit * * @return [Races] race */ - int GetRace(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetRace(lua_State* L, Unit* unit) { Eluna::Push(L, unit->getRace()); return 1; @@ -1052,7 +1052,7 @@ namespace LuaUnit * * @return [Classes] class */ - int GetClass(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetClass(lua_State* L, Unit* unit) { Eluna::Push(L, unit->getClass()); return 1; @@ -1063,7 +1063,7 @@ namespace LuaUnit * * @return uint32 creatureType */ - int GetCreatureType(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetCreatureType(lua_State* L, Unit* unit) { Eluna::Push(L, unit->GetCreatureType()); return 1; @@ -1090,7 +1090,7 @@ namespace LuaUnit * @param [LocaleConstant] locale = DEFAULT_LOCALE * @return string className : class name or nil */ - int GetClassAsString(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetClassAsString(lua_State* L, Unit* unit) { uint8 locale = Eluna::CHECKVAL(L, 2, DEFAULT_LOCALE); if (locale >= TOTAL_LOCALES) @@ -1125,7 +1125,7 @@ namespace LuaUnit * @param [LocaleConstant] locale = DEFAULT_LOCALE : locale to return the race name in * @return string raceName : race name or nil */ - int GetRaceAsString(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetRaceAsString(lua_State* L, Unit* unit) { uint8 locale = Eluna::CHECKVAL(L, 2, DEFAULT_LOCALE); if (locale >= TOTAL_LOCALES) @@ -1144,7 +1144,7 @@ namespace LuaUnit * * @return uint32 faction */ - int GetFaction(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetFaction(lua_State* L, Unit* unit) { Eluna::Push(L, unit->getFaction()); return 1; @@ -1156,7 +1156,7 @@ namespace LuaUnit * @param uint32 spellID : entry of the aura spell * @return [Aura] aura : aura object or nil */ - int GetAura(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetAura(lua_State* L, Unit* unit) { uint32 spellID = Eluna::CHECKVAL(L, 2); #ifndef TRINITY @@ -1172,7 +1172,7 @@ namespace LuaUnit * * @return uint32 combatTimer */ - int GetCombatTime(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetCombatTime(lua_State* L, Unit* unit) { Eluna::Push(L, unit->GetCombatTimer()); return 1; @@ -1184,7 +1184,7 @@ namespace LuaUnit * @param float range = 533.333 : search radius * @return table friendyUnits : table filled with friendly units */ - int GetFriendlyUnitsInRange(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetFriendlyUnitsInRange(lua_State* L, Unit* unit) { float range = Eluna::CHECKVAL(L, 2, SIZE_OF_GRIDS); @@ -1222,7 +1222,7 @@ namespace LuaUnit * @param float range = 533.333 : search radius * @return table unfriendyUnits : table filled with unfriendly units */ - int GetUnfriendlyUnitsInRange(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetUnfriendlyUnitsInRange(lua_State* L, Unit* unit) { float range = Eluna::CHECKVAL(L, 2, SIZE_OF_GRIDS); @@ -1260,7 +1260,7 @@ namespace LuaUnit * * @return [Vehicle] vehicle */ - int GetVehicleKit(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetVehicleKit(lua_State* L, Unit* unit) { #ifndef TRINITY Eluna::Push(L, unit->GetVehicleInfo()); @@ -1271,7 +1271,7 @@ namespace LuaUnit } /* - int GetVehicle(Eluna* E, lua_State* L, Unit* unit) + int GetVehicle(lua_State* L, Unit* unit) { Eluna::Push(L, unit->GetVehicle()); return 1; @@ -1283,7 +1283,7 @@ namespace LuaUnit * * @return uint64 critterGuid */ - int GetCritterGUID(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetCritterGUID(lua_State* L, Unit* unit) { #ifndef TRINITY Eluna::Push(L, unit->GetCritterGuid()); @@ -1315,7 +1315,7 @@ namespace LuaUnit * @param [UnitMoveType] type * @return float speed */ - int GetSpeed(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetSpeed(lua_State* L, Unit* unit) { uint32 type = Eluna::CHECKVAL(L, 2); if (type >= MAX_MOVE_TYPE) @@ -1361,7 +1361,7 @@ namespace LuaUnit * * @return [MovementGeneratorType] movementType */ - int GetMovementType(Eluna* /*E*/, lua_State* L, Unit* unit) + int GetMovementType(lua_State* L, Unit* unit) { Eluna::Push(L, unit->GetMotionMaster()->GetCurrentMovementGeneratorType()); return 1; @@ -1372,7 +1372,7 @@ namespace LuaUnit * * @param uint64 guid : new owner guid */ - int SetOwnerGUID(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetOwnerGUID(lua_State* L, Unit* unit) { uint64 guid = Eluna::CHECKVAL(L, 2); @@ -1389,7 +1389,7 @@ namespace LuaUnit * * @param bool apply = true : true if set on, false if off */ - int SetPvP(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetPvP(lua_State* L, Unit* unit) { bool apply = Eluna::CHECKVAL(L, 2, true); @@ -1409,7 +1409,7 @@ namespace LuaUnit * * @param [SheathState] sheathState : valid SheathState */ - int SetSheath(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetSheath(lua_State* L, Unit* unit) { uint32 sheathed = Eluna::CHECKVAL(L, 2); if (sheathed >= MAX_SHEATH_STATE) @@ -1424,7 +1424,7 @@ namespace LuaUnit * * @param string name : new name */ - int SetName(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetName(lua_State* L, Unit* unit) { const char* name = Eluna::CHECKVAL(L, 2); if (std::string(name).length() > 0) @@ -1455,7 +1455,7 @@ namespace LuaUnit * @param float rate * @param bool forced = false */ - int SetSpeed(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetSpeed(lua_State* L, Unit* unit) { uint32 type = Eluna::CHECKVAL(L, 2); float rate = Eluna::CHECKVAL(L, 3); @@ -1475,7 +1475,7 @@ namespace LuaUnit * * @param uint32 faction : new faction ID */ - int SetFaction(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetFaction(lua_State* L, Unit* unit) { uint32 factionId = Eluna::CHECKVAL(L, 2); unit->setFaction(factionId); @@ -1487,7 +1487,7 @@ namespace LuaUnit * * @param uint8 level : new level */ - int SetLevel(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetLevel(lua_State* L, Unit* unit) { uint8 newlevel = Eluna::CHECKVAL(L, 2); @@ -1514,7 +1514,7 @@ namespace LuaUnit * * @param uint32 health : new health */ - int SetHealth(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetHealth(lua_State* L, Unit* unit) { uint32 amt = Eluna::CHECKVAL(L, 2); unit->SetHealth(amt); @@ -1526,7 +1526,7 @@ namespace LuaUnit * * @param uint32 maxHealth : new max health */ - int SetMaxHealth(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetMaxHealth(lua_State* L, Unit* unit) { uint32 amt = Eluna::CHECKVAL(L, 2); unit->SetMaxHealth(amt); @@ -1553,11 +1553,11 @@ namespace LuaUnit * @param int type = -1 : a valid power type from [Powers] or -1 for the [Unit]'s current power type * @param uint32 power : new power amount */ - int SetPower(Eluna* E, lua_State* L, Unit* unit) + int SetPower(lua_State* L, Unit* unit) { int type = Eluna::CHECKVAL(L, 2, -1); uint32 amt = Eluna::CHECKVAL(L, 3); - Powers power = PowerSelectorHelper(E, L, unit, type); + Powers power = PowerSelectorHelper(L, unit, type); unit->SetPower(power, amt); return 0; @@ -1583,11 +1583,11 @@ namespace LuaUnit * @param int type = -1 : a valid power type from [Powers] or -1 for the [Unit]'s current power type * @param uint32 maxPower : new max power amount */ - int SetMaxPower(Eluna* E, lua_State* L, Unit* unit) + int SetMaxPower(lua_State* L, Unit* unit) { int type = Eluna::CHECKVAL(L, 2, -1); uint32 amt = Eluna::CHECKVAL(L, 3); - Powers power = PowerSelectorHelper(E, L, unit, type); + Powers power = PowerSelectorHelper(L, unit, type); unit->SetMaxPower(power, amt); return 0; @@ -1612,7 +1612,7 @@ namespace LuaUnit * * @param [Powers] type : a valid power type */ - int SetPowerType(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetPowerType(lua_State* L, Unit* unit) { uint32 type = Eluna::CHECKVAL(L, 2); if (type >= int(MAX_POWERS)) @@ -1631,7 +1631,7 @@ namespace LuaUnit * * @param uint32 displayId */ - int SetDisplayId(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetDisplayId(lua_State* L, Unit* unit) { uint32 model = Eluna::CHECKVAL(L, 2); unit->SetDisplayId(model); @@ -1643,7 +1643,7 @@ namespace LuaUnit * * @param uint32 displayId */ - int SetNativeDisplayId(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetNativeDisplayId(lua_State* L, Unit* unit) { uint32 model = Eluna::CHECKVAL(L, 2); unit->SetNativeDisplayId(model); @@ -1655,7 +1655,7 @@ namespace LuaUnit * * @param uint32 orientation */ - int SetFacing(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetFacing(lua_State* L, Unit* unit) { float o = Eluna::CHECKVAL(L, 2); unit->SetFacingTo(o); @@ -1667,7 +1667,7 @@ namespace LuaUnit * * @param [WorldObject] target */ - int SetFacingToObject(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetFacingToObject(lua_State* L, Unit* unit) { WorldObject* obj = Eluna::CHECKOBJ(L, 2); unit->SetFacingToObject(obj); @@ -1679,7 +1679,7 @@ namespace LuaUnit * * @param uint64 guid */ - int SetCreatorGUID(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetCreatorGUID(lua_State* L, Unit* unit) { uint64 guid = Eluna::CHECKVAL(L, 2); #ifndef TRINITY @@ -1695,7 +1695,7 @@ namespace LuaUnit * * @param uint64 guid */ - int SetCharmerGUID(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetCharmerGUID(lua_State* L, Unit* unit) { uint64 guid = Eluna::CHECKVAL(L, 2); #ifndef TRINITY @@ -1711,7 +1711,7 @@ namespace LuaUnit * * @param uint64 guid */ - int SetPetGUID(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetPetGUID(lua_State* L, Unit* unit) { uint64 guid = Eluna::CHECKVAL(L, 2); #ifndef TRINITY @@ -1727,7 +1727,7 @@ namespace LuaUnit * * @param bool enable = true */ - int SetWaterWalk(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetWaterWalk(lua_State* L, Unit* unit) { bool enable = Eluna::CHECKVAL(L, 2, true); #ifndef TRINITY @@ -1743,7 +1743,7 @@ namespace LuaUnit * * @param uint8 state : stand state */ - int SetStandState(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetStandState(lua_State* L, Unit* unit) { uint8 state = Eluna::CHECKVAL(L, 2); unit->SetStandState(state); @@ -1756,7 +1756,7 @@ namespace LuaUnit * * @param bool apply = true */ - int SetFFA(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetFFA(lua_State* L, Unit* unit) { bool apply = Eluna::CHECKVAL(L, 2, true); @@ -1784,7 +1784,7 @@ namespace LuaUnit * * @param bool apply = true */ - int SetSanctuary(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetSanctuary(lua_State* L, Unit* unit) { bool apply = Eluna::CHECKVAL(L, 2, true); @@ -1800,7 +1800,7 @@ namespace LuaUnit return 0; } - int SetCritterGUID(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetCritterGUID(lua_State* L, Unit* unit) { uint64 guid = Eluna::CHECKVAL(L, 2); #ifndef TRINITY @@ -1812,7 +1812,7 @@ namespace LuaUnit } #endif - /*int SetStunned(Eluna* E, lua_State* L, Unit* unit) + /*int SetStunned(lua_State* L, Unit* unit) { bool apply = Eluna::CHECKVAL(L, 2, true); unit->SetControlled(apply, UNIT_STATE_STUNNED); @@ -1824,7 +1824,7 @@ namespace LuaUnit * * @param bool apply = true */ - int SetRooted(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetRooted(lua_State* L, Unit* unit) { bool apply = Eluna::CHECKVAL(L, 2, true); #ifndef TRINITY @@ -1840,7 +1840,7 @@ namespace LuaUnit * * @param bool apply = true */ - int SetConfused(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetConfused(lua_State* L, Unit* unit) { bool apply = Eluna::CHECKVAL(L, 2, true); #ifndef TRINITY @@ -1856,7 +1856,7 @@ namespace LuaUnit * * @param bool apply = true */ - int SetFeared(Eluna* /*E*/, lua_State* L, Unit* unit) + int SetFeared(lua_State* L, Unit* unit) { bool apply = Eluna::CHECKVAL(L, 2, true); #ifndef TRINITY @@ -1867,14 +1867,14 @@ namespace LuaUnit return 0; } - /*int SetCanFly(Eluna* E, lua_State* L, Unit* unit) + /*int SetCanFly(lua_State* L, Unit* unit) { bool apply = Eluna::CHECKVAL(L, 2, true); unit->SetCanFly(apply); return 0; }*/ - /*int SetVisible(Eluna* E, lua_State* L, Unit* unit) + /*int SetVisible(lua_State* L, Unit* unit) { bool x = Eluna::CHECKVAL(L, 2, true); unit->SetVisible(x); @@ -1884,7 +1884,7 @@ namespace LuaUnit /** * Clears the [Unit]'s threat list. */ - int ClearThreatList(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) + int ClearThreatList(lua_State* /*L*/, Unit* unit) { #ifdef MANGOS unit->GetThreatManager().clearReferences(); @@ -1899,7 +1899,7 @@ namespace LuaUnit * * @param uint32 displayId */ - int Mount(Eluna* /*E*/, lua_State* L, Unit* unit) + int Mount(lua_State* L, Unit* unit) { uint32 displayId = Eluna::CHECKVAL(L, 2); @@ -1910,7 +1910,7 @@ namespace LuaUnit /** * Dismounts the [Unit]. */ - int Dismount(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) + int Dismount(lua_State* /*L*/, Unit* unit) { if (unit->IsMounted()) { @@ -1931,7 +1931,7 @@ namespace LuaUnit * * @param uint32 emoteId */ - int Emote(Eluna* /*E*/, lua_State* L, Unit* unit) + int Emote(lua_State* L, Unit* unit) { unit->HandleEmoteCommand(Eluna::CHECKVAL(L, 2)); return 0; @@ -1942,7 +1942,7 @@ namespace LuaUnit * * @param uint32 emoteId */ - int EmoteState(Eluna* /*E*/, lua_State* L, Unit* unit) + int EmoteState(lua_State* L, Unit* unit) { uint32 emoteId = Eluna::CHECKVAL(L, 2); @@ -1955,7 +1955,7 @@ namespace LuaUnit * * @return int32 percentage */ - int CountPctFromCurHealth(Eluna* /*E*/, lua_State* L, Unit* unit) + int CountPctFromCurHealth(lua_State* L, Unit* unit) { Eluna::Push(L, unit->CountPctFromCurHealth(Eluna::CHECKVAL(L, 2))); return 1; @@ -1966,7 +1966,7 @@ namespace LuaUnit * * @return int32 percentage */ - int CountPctFromMaxHealth(Eluna* /*E*/, lua_State* L, Unit* unit) + int CountPctFromMaxHealth(lua_State* L, Unit* unit) { Eluna::Push(L, unit->CountPctFromMaxHealth(Eluna::CHECKVAL(L, 2))); return 1; @@ -1980,7 +1980,7 @@ namespace LuaUnit * @param string msg * @param [Player] target */ - int SendChatMessageToPlayer(Eluna* /*E*/, lua_State* L, Unit* unit) + int SendChatMessageToPlayer(lua_State* L, Unit* unit) { uint8 type = Eluna::CHECKVAL(L, 2); uint32 lang = Eluna::CHECKVAL(L, 3); @@ -2016,7 +2016,7 @@ namespace LuaUnit /** * Stops the [Unit]'s movement */ - int MoveStop(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) + int MoveStop(lua_State* /*L*/, Unit* unit) { unit->StopMoving(); return 0; @@ -2027,7 +2027,7 @@ namespace LuaUnit * * @param bool reset = true : cleans movement */ - int MoveExpire(Eluna* /*E*/, lua_State* L, Unit* unit) + int MoveExpire(lua_State* L, Unit* unit) { bool reset = Eluna::CHECKVAL(L, 2, true); unit->GetMotionMaster()->MovementExpired(reset); @@ -2039,7 +2039,7 @@ namespace LuaUnit * * @param bool reset = true : clean movement */ - int MoveClear(Eluna* /*E*/, lua_State* L, Unit* unit) + int MoveClear(lua_State* L, Unit* unit) { bool reset = Eluna::CHECKVAL(L, 2, true); unit->GetMotionMaster()->Clear(reset); @@ -2049,7 +2049,7 @@ namespace LuaUnit /** * The [Unit] will be idle */ - int MoveIdle(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) + int MoveIdle(lua_State* /*L*/, Unit* unit) { unit->GetMotionMaster()->MoveIdle(); return 0; @@ -2060,7 +2060,7 @@ namespace LuaUnit * * @param float radius : limit on how far the [Unit] will move at random */ - int MoveRandom(Eluna* /*E*/, lua_State* L, Unit* unit) + int MoveRandom(lua_State* L, Unit* unit) { float radius = Eluna::CHECKVAL(L, 2); float x, y, z; @@ -2076,7 +2076,7 @@ namespace LuaUnit /** * The [Unit] will move to its set home location */ - int MoveHome(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) + int MoveHome(lua_State* /*L*/, Unit* unit) { unit->GetMotionMaster()->MoveTargetedHome(); return 0; @@ -2089,7 +2089,7 @@ namespace LuaUnit * @param float dist = 0 : distance to start following * @param float angle = 0 */ - int MoveFollow(Eluna* /*E*/, lua_State* L, Unit* unit) + int MoveFollow(lua_State* L, Unit* unit) { Unit* target = Eluna::CHECKOBJ(L, 2); float dist = Eluna::CHECKVAL(L, 3, 0.0f); @@ -2105,7 +2105,7 @@ namespace LuaUnit * @param float dist = 0 : distance start chasing * @param float angle = 0 */ - int MoveChase(Eluna* /*E*/, lua_State* L, Unit* unit) + int MoveChase(lua_State* L, Unit* unit) { Unit* target = Eluna::CHECKOBJ(L, 2); float dist = Eluna::CHECKVAL(L, 3, 0.0f); @@ -2117,7 +2117,7 @@ namespace LuaUnit /** * The [Unit] will move confused */ - int MoveConfused(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) + int MoveConfused(lua_State* /*L*/, Unit* unit) { unit->GetMotionMaster()->MoveConfused(); return 0; @@ -2129,7 +2129,7 @@ namespace LuaUnit * @param [Unit] target * @param uint32 time = 0 : flee delay */ - int MoveFleeing(Eluna* /*E*/, lua_State* L, Unit* unit) + int MoveFleeing(lua_State* L, Unit* unit) { Unit* target = Eluna::CHECKOBJ(L, 2); uint32 time = Eluna::CHECKVAL(L, 3, 0); @@ -2146,7 +2146,7 @@ namespace LuaUnit * @param float z * @param bool genPath = true : if true, generates path */ - int MoveTo(Eluna* /*E*/, lua_State* L, Unit* unit) + int MoveTo(lua_State* L, Unit* unit) { uint32 id = Eluna::CHECKVAL(L, 2); float x = Eluna::CHECKVAL(L, 3); @@ -2168,7 +2168,7 @@ namespace LuaUnit * @param float maxHeight : maximum height * @param uint32 id = 0 : unique movement Id */ - int MoveJump(Eluna* /*E*/, lua_State* L, Unit* unit) + int MoveJump(lua_State* L, Unit* unit) { float x = Eluna::CHECKVAL(L, 2); float y = Eluna::CHECKVAL(L, 3); @@ -2195,7 +2195,7 @@ namespace LuaUnit * @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) + int SendUnitWhisper(lua_State* L, Unit* unit) { const char* msg = Eluna::CHECKVAL(L, 2); uint32 lang = Eluna::CHECKVAL(L, 3); @@ -2217,7 +2217,7 @@ namespace LuaUnit * @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) + int SendUnitEmote(lua_State* L, Unit* unit) { const char* msg = Eluna::CHECKVAL(L, 2); Unit* receiver = Eluna::CHECKOBJ(L, 3, false); @@ -2237,7 +2237,7 @@ namespace LuaUnit * @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) + int SendUnitSay(lua_State* L, Unit* unit) { const char* msg = Eluna::CHECKVAL(L, 2); uint32 language = Eluna::CHECKVAL(L, 3); @@ -2256,7 +2256,7 @@ namespace LuaUnit * @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) + int SendUnitYell(lua_State* L, Unit* unit) { const char* msg = Eluna::CHECKVAL(L, 2); uint32 language = Eluna::CHECKVAL(L, 3); @@ -2272,7 +2272,7 @@ namespace LuaUnit /** * Unmorphs the [Unit] setting it's display ID back to the native display ID. */ - int DeMorph(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) + int DeMorph(lua_State* /*L*/, Unit* unit) { unit->DeMorph(); return 0; @@ -2285,7 +2285,7 @@ namespace LuaUnit * @param uint32 spell : entry of a spell * @param bool triggered = false : if true the spell is instant and has no cost */ - int CastSpell(Eluna* /*E*/, lua_State* L, Unit* unit) + int CastSpell(lua_State* L, Unit* unit) { Unit* target = Eluna::CHECKOBJ(L, 2, NULL); uint32 spell = Eluna::CHECKVAL(L, 3); @@ -2319,7 +2319,7 @@ namespace LuaUnit * @param [Item] castItem = nil * @param uint64 originalCaster = 0 */ - int CastCustomSpell(Eluna* /*E*/, lua_State* L, Unit* unit) + int CastCustomSpell(lua_State* L, Unit* unit) { Unit* target = Eluna::CHECKOBJ(L, 2, NULL); uint32 spell = Eluna::CHECKVAL(L, 3); @@ -2346,7 +2346,7 @@ namespace LuaUnit * @param uint32 spell : entry of a spell * @param bool triggered = false : if true the spell is instant and has no cost */ - int CastSpellAoF(Eluna* /*E*/, lua_State* L, Unit* unit) + int CastSpellAoF(lua_State* L, Unit* unit) { float _x = Eluna::CHECKVAL(L, 2); float _y = Eluna::CHECKVAL(L, 3); @@ -2364,7 +2364,7 @@ namespace LuaUnit /** * Clears the [Unit]'s combat */ - int ClearInCombat(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) + int ClearInCombat(lua_State* /*L*/, Unit* unit) { unit->ClearInCombat(); return 0; @@ -2375,7 +2375,7 @@ namespace LuaUnit * * @param uint32 spell = 0 : entry of a spell */ - int StopSpellCast(Eluna* /*E*/, lua_State* L, Unit* unit) + int StopSpellCast(lua_State* L, Unit* unit) { uint32 spellId = Eluna::CHECKVAL(L, 2, 0); unit->CastStop(spellId); @@ -2390,7 +2390,7 @@ namespace LuaUnit * @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 InterruptSpell(lua_State* L, Unit* unit) { int spellType = Eluna::CHECKVAL(L, 2); bool delayed = Eluna::CHECKVAL(L, 3, true); @@ -2423,7 +2423,7 @@ namespace LuaUnit * @param [Unit] target : aura will be applied on the target * @return [Aura] aura */ - int AddAura(Eluna* /*E*/, lua_State* L, Unit* unit) + int AddAura(lua_State* L, Unit* unit) { uint32 spellId = Eluna::CHECKVAL(L, 2); Unit* target = Eluna::CHECKOBJ(L, 3); @@ -2466,7 +2466,7 @@ namespace LuaUnit * * @param uint32 spell : entry of a spell */ - int RemoveAura(Eluna* /*E*/, lua_State* L, Unit* unit) + int RemoveAura(lua_State* L, Unit* unit) { uint32 spellId = Eluna::CHECKVAL(L, 2); unit->RemoveAurasDueToSpell(spellId); @@ -2478,7 +2478,7 @@ namespace LuaUnit * * Note: talents and racials are also auras, use with caution */ - int RemoveAllAuras(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) + int RemoveAllAuras(lua_State* /*L*/, Unit* unit) { unit->RemoveAllAuras(); return 0; @@ -2489,7 +2489,7 @@ namespace LuaUnit * * @param [UnitState] state */ - int AddUnitState(Eluna* /*E*/, lua_State* L, Unit* unit) + int AddUnitState(lua_State* L, Unit* unit) { uint32 state = Eluna::CHECKVAL(L, 2); @@ -2506,7 +2506,7 @@ namespace LuaUnit * * @param [UnitState] state */ - int ClearUnitState(Eluna* /*E*/, lua_State* L, Unit* unit) + int ClearUnitState(lua_State* L, Unit* unit) { uint32 state = Eluna::CHECKVAL(L, 2); @@ -2526,7 +2526,7 @@ namespace LuaUnit * @param float z * @param float o : orientation */ - int NearTeleport(Eluna* /*E*/, lua_State* L, Unit* unit) + int NearTeleport(lua_State* L, Unit* unit) { float x = Eluna::CHECKVAL(L, 2); float y = Eluna::CHECKVAL(L, 3); @@ -2560,7 +2560,7 @@ namespace LuaUnit * @param [SpellSchools] school = MAX_SPELL_SCHOOL : school the damage is done in or MAX_SPELL_SCHOOL for direct damage * @param uint32 spell = 0 : spell that inflicts the damage */ - int DealDamage(Eluna* /*E*/, lua_State* L, Unit* unit) + int DealDamage(lua_State* L, Unit* unit) { Unit* target = Eluna::CHECKOBJ(L, 2); uint32 damage = Eluna::CHECKVAL(L, 3); @@ -2661,7 +2661,7 @@ namespace LuaUnit * @param uint32 amount : amount to heal * @param bool critical = false : if true, heal is logged as critical */ - int DealHeal(Eluna* /*E*/, lua_State* L, Unit* unit) + int DealHeal(lua_State* L, Unit* unit) { Unit* target = Eluna::CHECKOBJ(L, 2); uint32 spell = Eluna::CHECKVAL(L, 3); @@ -2692,7 +2692,7 @@ namespace LuaUnit * @param [Unit] target : [Unit] to kill * @param bool durLoss = true : when true, the target's items suffer durability loss */ - int Kill(Eluna* /*E*/, lua_State* L, Unit* unit) + int Kill(lua_State* L, Unit* unit) { Unit* target = Eluna::CHECKOBJ(L, 2); bool durLoss = Eluna::CHECKVAL(L, 3, true); @@ -2727,7 +2727,7 @@ namespace LuaUnit * @param [SpellSchoolMask] schoolMask = 0 : [SpellSchoolMask] of the threat causer * @param uint32 spell = 0 : spell entry used for threat */ - int AddThreat(Eluna* /*E*/, lua_State* L, Unit* unit) + int AddThreat(lua_State* L, Unit* unit) { Unit* victim = Eluna::CHECKOBJ(L, 2); float threat = Eluna::CHECKVAL(L, 3, true); @@ -2752,31 +2752,31 @@ namespace LuaUnit return 0; } - /*int RestoreDisplayId(Eluna* E, lua_State* L, Unit* unit) + /*int RestoreDisplayId(lua_State* L, Unit* unit) { unit->RestoreDisplayId(); return 0; }*/ - /*int RestoreFaction(Eluna* E, lua_State* L, Unit* unit) + /*int RestoreFaction(lua_State* L, Unit* unit) { unit->RestoreFaction(); return 0; }*/ - /*int RemoveBindSightAuras(Eluna* E, lua_State* L, Unit* unit) + /*int RemoveBindSightAuras(lua_State* L, Unit* unit) { unit->RemoveBindSightAuras(); return 0; }*/ - /*int RemoveCharmAuras(Eluna* E, lua_State* L, Unit* unit) + /*int RemoveCharmAuras(lua_State* L, Unit* unit) { unit->RemoveCharmAuras(); return 0; }*/ - /*int DisableMelee(Eluna* E, lua_State* L, Unit* unit) + /*int DisableMelee(lua_State* L, Unit* unit) { bool apply = Eluna::CHECKVAL(L, 2, true); @@ -2787,7 +2787,7 @@ namespace LuaUnit return 0; }*/ - /*int SummonGuardian(Eluna* E, lua_State* L, Unit* unit) + /*int SummonGuardian(lua_State* L, Unit* unit) { uint32 entry = Eluna::CHECKVAL(L, 2); float x = Eluna::CHECKVAL(L, 3); diff --git a/VehicleMethods.h b/VehicleMethods.h index 4b7acf9..ce54c32 100644 --- a/VehicleMethods.h +++ b/VehicleMethods.h @@ -20,7 +20,7 @@ namespace LuaVehicle * @param [Unit] passenger * @return bool isOnBoard */ - int IsOnBoard(Eluna* /*E*/, lua_State* L, Vehicle* vehicle) + int IsOnBoard(lua_State* L, Vehicle* vehicle) { Unit* passenger = Eluna::CHECKOBJ(L, 2); #ifndef TRINITY @@ -36,7 +36,7 @@ namespace LuaVehicle * * @return [Unit] owner */ - int GetOwner(Eluna* /*E*/, lua_State* L, Vehicle* vehicle) + int GetOwner(lua_State* L, Vehicle* vehicle) { #ifndef TRINITY Eluna::Push(L, vehicle->GetOwner()); @@ -51,7 +51,7 @@ namespace LuaVehicle * * @return uint32 entry */ - int GetEntry(Eluna* /*E*/, lua_State* L, Vehicle* vehicle) + int GetEntry(lua_State* L, Vehicle* vehicle) { #ifndef TRINITY Eluna::Push(L, vehicle->GetVehicleEntry()->m_ID); @@ -67,7 +67,7 @@ namespace LuaVehicle * @param int8 seat * @return [Unit] passenger */ - int GetPassenger(Eluna* /*E*/, lua_State* L, Vehicle* vehicle) + int GetPassenger(lua_State* L, Vehicle* vehicle) { int8 seatId = Eluna::CHECKVAL(L, 2); Eluna::Push(L, vehicle->GetPassenger(seatId)); @@ -80,7 +80,7 @@ namespace LuaVehicle * @param [Unit] passenger * @param int8 seat */ - int AddPassenger(Eluna* /*E*/, lua_State* L, Vehicle* vehicle) + int AddPassenger(lua_State* L, Vehicle* vehicle) { Unit* passenger = Eluna::CHECKOBJ(L, 2); int8 seatId = Eluna::CHECKVAL(L, 3); @@ -98,7 +98,7 @@ namespace LuaVehicle * * @param [Unit] passenger */ - int RemovePassenger(Eluna* /*E*/, lua_State* L, Vehicle* vehicle) + int RemovePassenger(lua_State* L, Vehicle* vehicle) { Unit* passenger = Eluna::CHECKOBJ(L, 2); #ifndef TRINITY diff --git a/WorldObjectMethods.h b/WorldObjectMethods.h index 78ee720..01a4fbc 100644 --- a/WorldObjectMethods.h +++ b/WorldObjectMethods.h @@ -17,7 +17,7 @@ namespace LuaWorldObject * * @return string name */ - int GetName(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetName(lua_State* L, WorldObject* obj) { Eluna::Push(L, obj->GetName()); return 1; @@ -28,7 +28,7 @@ namespace LuaWorldObject * * @return [Map] mapObject */ - int GetMap(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetMap(lua_State* L, WorldObject* obj) { Eluna::Push(L, obj->GetMap()); return 1; @@ -40,7 +40,7 @@ namespace LuaWorldObject * * @return uint32 phase */ - int GetPhaseMask(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetPhaseMask(lua_State* L, WorldObject* obj) { Eluna::Push(L, obj->GetPhaseMask()); return 1; @@ -52,7 +52,7 @@ namespace LuaWorldObject * @param uint32 phaseMask * @param bool update = true : update visibility to nearby objects */ - int SetPhaseMask(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int SetPhaseMask(lua_State* L, WorldObject* obj) { uint32 phaseMask = Eluna::CHECKVAL(L, 2); bool update = Eluna::CHECKVAL(L, 3, true); @@ -66,7 +66,7 @@ namespace LuaWorldObject * * @return uint32 instanceId */ - int GetInstanceId(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetInstanceId(lua_State* L, WorldObject* obj) { Eluna::Push(L, obj->GetInstanceId()); return 1; @@ -77,7 +77,7 @@ namespace LuaWorldObject * * @return uint32 areaId */ - int GetAreaId(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetAreaId(lua_State* L, WorldObject* obj) { Eluna::Push(L, obj->GetAreaId()); return 1; @@ -88,7 +88,7 @@ namespace LuaWorldObject * * @return uint32 zoneId */ - int GetZoneId(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetZoneId(lua_State* L, WorldObject* obj) { Eluna::Push(L, obj->GetZoneId()); return 1; @@ -99,7 +99,7 @@ namespace LuaWorldObject * * @return uint32 mapId */ - int GetMapId(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetMapId(lua_State* L, WorldObject* obj) { Eluna::Push(L, obj->GetMapId()); return 1; @@ -110,7 +110,7 @@ namespace LuaWorldObject * * @return float x */ - int GetX(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetX(lua_State* L, WorldObject* obj) { Eluna::Push(L, obj->GetPositionX()); return 1; @@ -121,7 +121,7 @@ namespace LuaWorldObject * * @return float y */ - int GetY(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetY(lua_State* L, WorldObject* obj) { Eluna::Push(L, obj->GetPositionY()); return 1; @@ -132,7 +132,7 @@ namespace LuaWorldObject * * @return float z */ - int GetZ(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetZ(lua_State* L, WorldObject* obj) { Eluna::Push(L, obj->GetPositionZ()); return 1; @@ -143,7 +143,7 @@ namespace LuaWorldObject * * @return float orientation / facing */ - int GetO(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetO(lua_State* L, WorldObject* obj) { Eluna::Push(L, obj->GetOrientation()); return 1; @@ -157,7 +157,7 @@ namespace LuaWorldObject * @return float z : z coordinate (height) of the [WorldObject] * @return float o : facing / orientation of the [WorldObject] */ - int GetLocation(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetLocation(lua_State* L, WorldObject* obj) { Eluna::Push(L, obj->GetPositionX()); Eluna::Push(L, obj->GetPositionY()); @@ -175,7 +175,7 @@ namespace LuaWorldObject * * @return [Player] nearestPlayer */ - int GetNearestPlayer(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetNearestPlayer(lua_State* L, WorldObject* obj) { float range = Eluna::CHECKVAL(L, 2, SIZE_OF_GRIDS); uint32 hostile = Eluna::CHECKVAL(L, 3, 0); @@ -204,7 +204,7 @@ namespace LuaWorldObject * * @return [GameObject] nearestGameObject */ - int GetNearestGameObject(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetNearestGameObject(lua_State* L, WorldObject* obj) { float range = Eluna::CHECKVAL(L, 2, SIZE_OF_GRIDS); uint32 entry = Eluna::CHECKVAL(L, 3, 0); @@ -234,7 +234,7 @@ namespace LuaWorldObject * * @return [Creature] nearestCreature */ - int GetNearestCreature(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetNearestCreature(lua_State* L, WorldObject* obj) { float range = Eluna::CHECKVAL(L, 2, SIZE_OF_GRIDS); uint32 entry = Eluna::CHECKVAL(L, 3, 0); @@ -264,7 +264,7 @@ namespace LuaWorldObject * * @return table playersInRange : table of [Player]s */ - int GetPlayersInRange(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetPlayersInRange(lua_State* L, WorldObject* obj) { float range = Eluna::CHECKVAL(L, 2, SIZE_OF_GRIDS); uint32 hostile = Eluna::CHECKVAL(L, 3, 0); @@ -305,7 +305,7 @@ namespace LuaWorldObject * * @return table creaturesInRange : table of [Creature]s */ - int GetCreaturesInRange(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetCreaturesInRange(lua_State* L, WorldObject* obj) { float range = Eluna::CHECKVAL(L, 2, SIZE_OF_GRIDS); uint32 entry = Eluna::CHECKVAL(L, 3, 0); @@ -346,7 +346,7 @@ namespace LuaWorldObject * * @return table gameObjectsInRange : table of [GameObject]s */ - int GetGameObjectsInRange(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetGameObjectsInRange(lua_State* L, WorldObject* obj) { float range = Eluna::CHECKVAL(L, 2, SIZE_OF_GRIDS); uint32 entry = Eluna::CHECKVAL(L, 3, 0); @@ -389,7 +389,7 @@ namespace LuaWorldObject * * @return [WorldObject] worldObject */ - int GetNearObject(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetNearObject(lua_State* L, WorldObject* obj) { float range = Eluna::CHECKVAL(L, 2, SIZE_OF_GRIDS); uint16 type = Eluna::CHECKVAL(L, 3, 0); // TypeMask @@ -426,7 +426,7 @@ namespace LuaWorldObject * * @return table worldObjectList : table of [WorldObject]s */ - int GetNearObjects(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetNearObjects(lua_State* L, WorldObject* obj) { float range = Eluna::CHECKVAL(L, 2, SIZE_OF_GRIDS); uint16 type = Eluna::CHECKVAL(L, 3, 0); // TypeMask @@ -477,7 +477,7 @@ namespace LuaWorldObject * * @return float dist : the distance in yards */ - int GetDistance(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetDistance(lua_State* L, WorldObject* obj) { WorldObject* target = Eluna::CHECKOBJ(L, 2, false); if (target && target->IsInWorld()) @@ -507,7 +507,7 @@ namespace LuaWorldObject * * @return float dist : the distance in yards */ - int GetExactDistance(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetExactDistance(lua_State* L, WorldObject* obj) { float x, y, z; obj->GetPosition(x, y, z); @@ -545,7 +545,7 @@ namespace LuaWorldObject * * @return float dist : the distance in yards */ - int GetDistance2d(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetDistance2d(lua_State* L, WorldObject* obj) { WorldObject* target = Eluna::CHECKOBJ(L, 2, false); if (target && target->IsInWorld()) @@ -573,7 +573,7 @@ namespace LuaWorldObject * * @return float dist : the distance in yards */ - int GetExactDistance2d(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetExactDistance2d(lua_State* L, WorldObject* obj) { float x, y, z; obj->GetPosition(x, y, z); @@ -605,7 +605,7 @@ namespace LuaWorldObject * @return float y * @return float z */ - int GetRelativePoint(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetRelativePoint(lua_State* L, WorldObject* obj) { float dist = Eluna::CHECKVAL(L, 2); float rad = Eluna::CHECKVAL(L, 3); @@ -633,7 +633,7 @@ namespace LuaWorldObject * * @return float angle : angle in radians in range 0..2*pi */ - int GetAngle(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int GetAngle(lua_State* L, WorldObject* obj) { WorldObject* target = Eluna::CHECKOBJ(L, 2, false); @@ -653,7 +653,7 @@ namespace LuaWorldObject * * @param [WorldPacket] packet */ - int SendPacket(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int SendPacket(lua_State* L, WorldObject* obj) { WorldPacket* data = Eluna::CHECKOBJ(L, 2); #ifdef CMANGOS @@ -675,7 +675,7 @@ namespace LuaWorldObject * @param uint32 respawnDelay = 30 : respawn time in seconds * @return [GameObject] gameObject */ - int SummonGameObject(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int SummonGameObject(lua_State* L, WorldObject* obj) { uint32 entry = Eluna::CHECKVAL(L, 2); float x = Eluna::CHECKVAL(L, 3); @@ -718,7 +718,7 @@ namespace LuaWorldObject * @param uint32 despawnTimer = 0 : despawn time in milliseconds * @return [Creature] spawnedCreature */ - int SpawnCreature(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int SpawnCreature(lua_State* L, WorldObject* obj) { uint32 entry = Eluna::CHECKVAL(L, 2); float x = Eluna::CHECKVAL(L, 3); @@ -787,7 +787,7 @@ namespace LuaWorldObject * @param uint32 repeats : how many times for the event to repeat, 0 is infinite * @return int eventId : unique ID for the timed event used to cancel it or nil */ - int RegisterEvent(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int RegisterEvent(lua_State* L, WorldObject* obj) { luaL_checktype(L, 2, LUA_TFUNCTION); uint32 delay = Eluna::CHECKVAL(L, 3); @@ -808,7 +808,7 @@ namespace LuaWorldObject * * @param int eventId : event Id to remove */ - int RemoveEventById(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int RemoveEventById(lua_State* L, WorldObject* obj) { int eventId = Eluna::CHECKVAL(L, 2); obj->elunaEvents->SetState(eventId, LUAEVENT_STATE_ABORT); @@ -819,7 +819,7 @@ namespace LuaWorldObject * Removes all timed events from a [WorldObject] * */ - int RemoveEvents(Eluna* /*E*/, lua_State* /*L*/, WorldObject* obj) + int RemoveEvents(lua_State* /*L*/, WorldObject* obj) { obj->elunaEvents->SetStates(LUAEVENT_STATE_ABORT); return 0; @@ -837,7 +837,7 @@ namespace LuaWorldObject * @param float z * @return bool isInLoS */ - int IsWithinLoS(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int IsWithinLoS(lua_State* L, WorldObject* obj) { WorldObject* target = Eluna::CHECKOBJ(L, 2, false); @@ -865,7 +865,7 @@ namespace LuaWorldObject * @param uint32 music : entry of a music * @param [Player] player = nil : [Player] to play the music to */ - int PlayMusic(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int PlayMusic(lua_State* L, WorldObject* obj) { uint32 musicid = Eluna::CHECKVAL(L, 2); Player* player = Eluna::CHECKOBJ(L, 3, false); @@ -897,7 +897,7 @@ namespace LuaWorldObject * @param uint32 sound : entry of a sound * @param [Player] player = nil : [Player] to play the sound to */ - int PlayDirectSound(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int PlayDirectSound(lua_State* L, WorldObject* obj) { uint32 soundId = Eluna::CHECKVAL(L, 2); Player* player = Eluna::CHECKOBJ(L, 3, false); @@ -923,7 +923,7 @@ namespace LuaWorldObject * @param uint32 sound : entry of a sound * @param [Player] player = nil : [Player] to play the sound to */ - int PlayDistanceSound(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int PlayDistanceSound(lua_State* L, WorldObject* obj) { uint32 soundId = Eluna::CHECKVAL(L, 2); Player* player = Eluna::CHECKOBJ(L, 3, false); diff --git a/WorldPacketMethods.h b/WorldPacketMethods.h index 35666b1..afabcdd 100644 --- a/WorldPacketMethods.h +++ b/WorldPacketMethods.h @@ -25,7 +25,7 @@ namespace LuaPacket * * @return uint16 opcode */ - int GetOpcode(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int GetOpcode(lua_State* L, WorldPacket* packet) { Eluna::Push(L, packet->GetOpcode()); return 1; @@ -36,7 +36,7 @@ namespace LuaPacket * * @return uint32 size */ - int GetSize(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int GetSize(lua_State* L, WorldPacket* packet) { Eluna::Push(L, packet->size()); return 1; @@ -47,7 +47,7 @@ namespace LuaPacket * * @param [Opcodes] opcode : see Opcodes.h for all known opcodes */ - int SetOpcode(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int SetOpcode(lua_State* L, WorldPacket* packet) { uint32 opcode = Eluna::CHECKVAL(L, 2); if (opcode >= NUM_MSG_TYPES) @@ -61,7 +61,7 @@ namespace LuaPacket * * @return int8 value */ - int ReadByte(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int ReadByte(lua_State* L, WorldPacket* packet) { int8 _byte; (*packet) >> _byte; @@ -74,7 +74,7 @@ namespace LuaPacket * * @return uint8 value */ - int ReadUByte(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int ReadUByte(lua_State* L, WorldPacket* packet) { uint8 _ubyte; (*packet) >> _ubyte; @@ -87,7 +87,7 @@ namespace LuaPacket * * @return int16 value */ - int ReadShort(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int ReadShort(lua_State* L, WorldPacket* packet) { int16 _short; (*packet) >> _short; @@ -100,7 +100,7 @@ namespace LuaPacket * * @return uint16 value */ - int ReadUShort(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int ReadUShort(lua_State* L, WorldPacket* packet) { uint16 _ushort; (*packet) >> _ushort; @@ -113,7 +113,7 @@ namespace LuaPacket * * @return int32 value */ - int ReadLong(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int ReadLong(lua_State* L, WorldPacket* packet) { int32 _long; (*packet) >> _long; @@ -126,7 +126,7 @@ namespace LuaPacket * * @return uint32 value */ - int ReadULong(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int ReadULong(lua_State* L, WorldPacket* packet) { uint32 _ulong; (*packet) >> _ulong; @@ -139,7 +139,7 @@ namespace LuaPacket * * @return float value */ - int ReadFloat(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int ReadFloat(lua_State* L, WorldPacket* packet) { float _val; (*packet) >> _val; @@ -152,7 +152,7 @@ namespace LuaPacket * * @return double value */ - int ReadDouble(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int ReadDouble(lua_State* L, WorldPacket* packet) { double _val; (*packet) >> _val; @@ -165,7 +165,7 @@ namespace LuaPacket * * @return uint64 value : value returned as string */ - int ReadGUID(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int ReadGUID(lua_State* L, WorldPacket* packet) { uint64 guid; (*packet) >> guid; @@ -178,7 +178,7 @@ namespace LuaPacket * * @return string value */ - int ReadString(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int ReadString(lua_State* L, WorldPacket* packet) { std::string _val; (*packet) >> _val; @@ -191,7 +191,7 @@ namespace LuaPacket * * @param uint64 value : the value to be written to the [WorldPacket] */ - int WriteGUID(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int WriteGUID(lua_State* L, WorldPacket* packet) { uint64 guid = Eluna::CHECKVAL(L, 2); (*packet) << guid; @@ -203,7 +203,7 @@ namespace LuaPacket * * @param string value : the string to be written to the [WorldPacket] */ - int WriteString(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int WriteString(lua_State* L, WorldPacket* packet) { std::string _val = Eluna::CHECKVAL(L, 2); (*packet) << _val; @@ -215,7 +215,7 @@ namespace LuaPacket * * @param int8 value : the int8 value to be written to the [WorldPacket] */ - int WriteByte(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int WriteByte(lua_State* L, WorldPacket* packet) { int8 byte = Eluna::CHECKVAL(L, 2); (*packet) << byte; @@ -227,7 +227,7 @@ namespace LuaPacket * * @param uint8 value : the uint8 value to be written to the [WorldPacket] */ - int WriteUByte(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int WriteUByte(lua_State* L, WorldPacket* packet) { uint8 byte = Eluna::CHECKVAL(L, 2); (*packet) << byte; @@ -239,7 +239,7 @@ namespace LuaPacket * * @param int16 value : the int16 value to be written to the [WorldPacket] */ - int WriteShort(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int WriteShort(lua_State* L, WorldPacket* packet) { int16 _short = Eluna::CHECKVAL(L, 2); (*packet) << _short; @@ -251,7 +251,7 @@ namespace LuaPacket * * @param uint16 value : the uint16 value to be written to the [WorldPacket] */ - int WriteUShort(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int WriteUShort(lua_State* L, WorldPacket* packet) { uint16 _ushort = Eluna::CHECKVAL(L, 2); (*packet) << _ushort; @@ -263,7 +263,7 @@ namespace LuaPacket * * @param int32 value : the int32 value to be written to the [WorldPacket] */ - int WriteLong(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int WriteLong(lua_State* L, WorldPacket* packet) { int32 _long = Eluna::CHECKVAL(L, 2); (*packet) << _long; @@ -275,7 +275,7 @@ namespace LuaPacket * * @param uint32 value : the uint32 value to be written to the [WorldPacket] */ - int WriteULong(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int WriteULong(lua_State* L, WorldPacket* packet) { uint32 _ulong = Eluna::CHECKVAL(L, 2); (*packet) << _ulong; @@ -287,7 +287,7 @@ namespace LuaPacket * * @param float value : the float value to be written to the [WorldPacket] */ - int WriteFloat(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int WriteFloat(lua_State* L, WorldPacket* packet) { float _val = Eluna::CHECKVAL(L, 2); (*packet) << _val; @@ -299,7 +299,7 @@ namespace LuaPacket * * @param double value : the double value to be written to the [WorldPacket] */ - int WriteDouble(Eluna* /*E*/, lua_State* L, WorldPacket* packet) + int WriteDouble(lua_State* L, WorldPacket* packet) { double _val = Eluna::CHECKVAL(L, 2); (*packet) << _val;