Fix calling Eluna functions from coroutines.

Fixes #126.
This commit is contained in:
Patman64
2014-12-15 00:33:46 -05:00
parent 3f08b37fd0
commit 967a8045eb
21 changed files with 2548 additions and 2548 deletions

View File

@@ -24,9 +24,9 @@ namespace LuaAura
*
* @return [Unit] caster
*/
int GetCaster(Eluna* E, Aura* aura)
int GetCaster(Eluna* /*E*/, lua_State* L, Aura* aura)
{
Eluna::Push(E->L, aura->GetCaster());
Eluna::Push(L, aura->GetCaster());
return 1;
}
@@ -35,12 +35,12 @@ namespace LuaAura
*
* @return string caster_guid : the GUID of the Unit as a decimal string
*/
int GetCasterGUID(Eluna* E, Aura* aura)
int GetCasterGUID(Eluna* /*E*/, lua_State* L, Aura* aura)
{
#ifndef TRINITY
Eluna::Push(E->L, aura->GetCasterGuid());
Eluna::Push(L, aura->GetCasterGuid());
#else
Eluna::Push(E->L, aura->GetCasterGUID());
Eluna::Push(L, aura->GetCasterGUID());
#endif
return 1;
}
@@ -50,9 +50,9 @@ namespace LuaAura
*
* @return uint32 caster_level
*/
int GetCasterLevel(Eluna* E, Aura* aura)
int GetCasterLevel(Eluna* /*E*/, lua_State* L, Aura* aura)
{
Eluna::Push(E->L, aura->GetCaster()->getLevel());
Eluna::Push(L, aura->GetCaster()->getLevel());
return 1;
}
@@ -61,12 +61,12 @@ namespace LuaAura
*
* @return int32 duration : amount of time left in milliseconds
*/
int GetDuration(Eluna* E, Aura* aura)
int GetDuration(Eluna* /*E*/, lua_State* L, Aura* aura)
{
#ifndef TRINITY
Eluna::Push(E->L, aura->GetAuraDuration());
Eluna::Push(L, aura->GetAuraDuration());
#else
Eluna::Push(E->L, aura->GetDuration());
Eluna::Push(L, aura->GetDuration());
#endif
return 1;
}
@@ -76,9 +76,9 @@ namespace LuaAura
*
* @return uint32 aura_id
*/
int GetAuraId(Eluna* E, Aura* aura)
int GetAuraId(Eluna* /*E*/, lua_State* L, Aura* aura)
{
Eluna::Push(E->L, aura->GetId());
Eluna::Push(L, aura->GetId());
return 1;
}
@@ -90,12 +90,12 @@ namespace LuaAura
*
* @return int32 max_duration : the maximum duration of the Aura, in milliseconds
*/
int GetMaxDuration(Eluna* E, Aura* aura)
int GetMaxDuration(Eluna* /*E*/, lua_State* L, Aura* aura)
{
#ifndef TRINITY
Eluna::Push(E->L, aura->GetAuraMaxDuration());
Eluna::Push(L, aura->GetAuraMaxDuration());
#else
Eluna::Push(E->L, aura->GetMaxDuration());
Eluna::Push(L, aura->GetMaxDuration());
#endif
return 1;
}
@@ -107,9 +107,9 @@ namespace LuaAura
*
* @return uint32 stack_amount
*/
int GetStackAmount(Eluna* E, Aura* aura)
int GetStackAmount(Eluna* /*E*/, lua_State* L, Aura* aura)
{
Eluna::Push(E->L, aura->GetStackAmount());
Eluna::Push(L, aura->GetStackAmount());
return 1;
}
@@ -118,12 +118,12 @@ namespace LuaAura
*
* @return [Unit] owner
*/
int GetOwner(Eluna* E, Aura* aura)
int GetOwner(Eluna* /*E*/, lua_State* L, Aura* aura)
{
#ifndef TRINITY
Eluna::Push(E->L, aura->GetTarget());
Eluna::Push(L, aura->GetTarget());
#else
Eluna::Push(E->L, aura->GetOwner());
Eluna::Push(L, aura->GetOwner());
#endif
return 1;
}
@@ -133,9 +133,9 @@ namespace LuaAura
*
* @param int32 duration : the new duration of the Aura, in milliseconds
*/
int SetDuration(Eluna* E, Aura* aura)
int SetDuration(Eluna* /*E*/, lua_State* L, Aura* aura)
{
int32 duration = Eluna::CHECKVAL<int32>(E->L, 2);
int32 duration = Eluna::CHECKVAL<int32>(L, 2);
#ifndef TRINITY
aura->GetHolder()->SetAuraDuration(duration);
#if (defined(TBC) || defined(CLASSIC))
@@ -157,9 +157,9 @@ namespace LuaAura
*
* @param int32 duration : the new maximum duration of the Aura, in milliseconds
*/
int SetMaxDuration(Eluna* E, Aura* aura)
int SetMaxDuration(Eluna* /*E*/, lua_State* L, Aura* aura)
{
int32 duration = Eluna::CHECKVAL<int32>(E->L, 2);
int32 duration = Eluna::CHECKVAL<int32>(L, 2);
#ifndef TRINITY
aura->GetHolder()->SetAuraMaxDuration(duration);
#if (defined(TBC) || defined(CLASSIC))
@@ -181,9 +181,9 @@ namespace LuaAura
*
* @param uint32 amount
*/
int SetStackAmount(Eluna* E, Aura* aura)
int SetStackAmount(Eluna* /*E*/, lua_State* L, Aura* aura)
{
uint8 amount = Eluna::CHECKVAL<uint8>(E->L, 2);
uint8 amount = Eluna::CHECKVAL<uint8>(L, 2);
#ifndef TRINITY
aura->GetHolder()->SetStackAmount(amount);
#else
@@ -195,14 +195,14 @@ namespace LuaAura
/**
* Remove this [Aura] from the [Unit] it is applied to.
*/
int Remove(Eluna* E, Aura* aura)
int Remove(Eluna* /*E*/, lua_State* L, Aura* aura)
{
#ifndef TRINITY
aura->GetTarget()->RemoveSpellAuraHolder(aura->GetHolder(), AURA_REMOVE_BY_CANCEL);
#else
aura->Remove();
#endif
Eluna::CHECKOBJ<ElunaObject>(E->L, 1)->Invalidate();
Eluna::CHECKOBJ<ElunaObject>(L, 1)->Invalidate();
return 0;
}
};

View File

@@ -14,9 +14,9 @@ namespace LuaBattleGround
*
* @return string name
*/
int GetName(Eluna* E, BattleGround* bg)
int GetName(Eluna* /*E*/, lua_State* L, BattleGround* bg)
{
Eluna::Push(E->L, bg->GetName());
Eluna::Push(L, bg->GetName());
return 1;
}
@@ -26,11 +26,11 @@ namespace LuaBattleGround
* @param uint32 team : team ID
* @return uint32 count
*/
int GetAlivePlayersCountByTeam(Eluna* E, BattleGround* bg)
int GetAlivePlayersCountByTeam(Eluna* /*E*/, lua_State* L, BattleGround* bg)
{
uint32 team = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 team = Eluna::CHECKVAL<uint32>(L, 2);
Eluna::Push(E->L, bg->GetAlivePlayersCountByTeam((Team)team));
Eluna::Push(L, bg->GetAlivePlayersCountByTeam((Team)team));
return 1;
}
@@ -39,9 +39,9 @@ namespace LuaBattleGround
*
* @return [Map] map
*/
int GetMap(Eluna* E, BattleGround* bg)
int GetMap(Eluna* /*E*/, lua_State* L, BattleGround* bg)
{
Eluna::Push(E->L, bg->GetBgMap());
Eluna::Push(L, bg->GetBgMap());
return 1;
}
@@ -51,11 +51,11 @@ namespace LuaBattleGround
* @param uint32 kills : amount of kills
* @return uint32 bonusHonor
*/
int GetBonusHonorFromKillCount(Eluna* E, BattleGround* bg)
int GetBonusHonorFromKillCount(Eluna* /*E*/, lua_State* L, BattleGround* bg)
{
uint32 kills = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 kills = Eluna::CHECKVAL<uint32>(L, 2);
Eluna::Push(E->L, bg->GetBonusHonorFromKill(kills));
Eluna::Push(L, bg->GetBonusHonorFromKill(kills));
return 1;
}
@@ -64,9 +64,9 @@ namespace LuaBattleGround
*
* @return BattleGroundBracketId bracketId
*/
int GetBracketId(Eluna* E, BattleGround* bg)
int GetBracketId(Eluna* /*E*/, lua_State* L, BattleGround* bg)
{
Eluna::Push(E->L, bg->GetBracketId());
Eluna::Push(L, bg->GetBracketId());
return 1;
}
@@ -75,12 +75,12 @@ namespace LuaBattleGround
*
* @return uint32 endTime
*/
int GetEndTime(Eluna* E, BattleGround* bg)
int GetEndTime(Eluna* /*E*/, lua_State* L, BattleGround* bg)
{
#ifdef CATA
Eluna::Push(E->L, bg->GetRemainingTime());
Eluna::Push(L, bg->GetRemainingTime());
#else
Eluna::Push(E->L, bg->GetEndTime());
Eluna::Push(L, bg->GetEndTime());
#endif
return 1;
}
@@ -91,11 +91,11 @@ namespace LuaBattleGround
* @param uint32 team : team ID
* @return uint32 freeSlots
*/
int GetFreeSlotsForTeam(Eluna* E, BattleGround* bg)
int GetFreeSlotsForTeam(Eluna* /*E*/, lua_State* L, BattleGround* bg)
{
uint32 team = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 team = Eluna::CHECKVAL<uint32>(L, 2);
Eluna::Push(E->L, bg->GetFreeSlotsForTeam((Team)team));
Eluna::Push(L, bg->GetFreeSlotsForTeam((Team)team));
return 1;
}
@@ -104,9 +104,9 @@ namespace LuaBattleGround
*
* @return uint32 instanceId
*/
int GetInstanceId(Eluna* E, BattleGround* bg)
int GetInstanceId(Eluna* /*E*/, lua_State* L, BattleGround* bg)
{
Eluna::Push(E->L, bg->GetInstanceID());
Eluna::Push(L, bg->GetInstanceID());
return 1;
}
@@ -115,9 +115,9 @@ namespace LuaBattleGround
*
* @return uint32 mapId
*/
int GetMapId(Eluna* E, BattleGround* bg)
int GetMapId(Eluna* /*E*/, lua_State* L, BattleGround* bg)
{
Eluna::Push(E->L, bg->GetMapId());
Eluna::Push(L, bg->GetMapId());
return 1;
}
@@ -126,9 +126,9 @@ namespace LuaBattleGround
*
* @return BattleGroundTypeId typeId
*/
int GetTypeId(Eluna* E, BattleGround* bg)
int GetTypeId(Eluna* /*E*/, lua_State* L, BattleGround* bg)
{
Eluna::Push(E->L, bg->GetTypeID());
Eluna::Push(L, bg->GetTypeID());
return 1;
}
@@ -137,9 +137,9 @@ namespace LuaBattleGround
*
* @return uint32 maxLevel
*/
int GetMaxLevel(Eluna* E, BattleGround* bg)
int GetMaxLevel(Eluna* /*E*/, lua_State* L, BattleGround* bg)
{
Eluna::Push(E->L, bg->GetMaxLevel());
Eluna::Push(L, bg->GetMaxLevel());
return 1;
}
@@ -148,9 +148,9 @@ namespace LuaBattleGround
*
* @return uint32 minLevel
*/
int GetMinLevel(Eluna* E, BattleGround* bg)
int GetMinLevel(Eluna* /*E*/, lua_State* L, BattleGround* bg)
{
Eluna::Push(E->L, bg->GetMinLevel());
Eluna::Push(L, bg->GetMinLevel());
return 1;
}
@@ -159,9 +159,9 @@ namespace LuaBattleGround
*
* @return uint32 maxPlayerCount
*/
int GetMaxPlayers(Eluna* E, BattleGround* bg)
int GetMaxPlayers(Eluna* /*E*/, lua_State* L, BattleGround* bg)
{
Eluna::Push(E->L, bg->GetMaxPlayers());
Eluna::Push(L, bg->GetMaxPlayers());
return 1;
}
@@ -170,9 +170,9 @@ namespace LuaBattleGround
*
* @return uint32 minPlayerCount
*/
int GetMinPlayers(Eluna* E, BattleGround* bg)
int GetMinPlayers(Eluna* /*E*/, lua_State* L, BattleGround* bg)
{
Eluna::Push(E->L, bg->GetMinPlayers());
Eluna::Push(L, bg->GetMinPlayers());
return 1;
}
@@ -181,9 +181,9 @@ namespace LuaBattleGround
*
* @return uint32 maxTeamPlayerCount
*/
int GetMaxPlayersPerTeam(Eluna* E, BattleGround* bg)
int GetMaxPlayersPerTeam(Eluna* /*E*/, lua_State* L, BattleGround* bg)
{
Eluna::Push(E->L, bg->GetMaxPlayersPerTeam());
Eluna::Push(L, bg->GetMaxPlayersPerTeam());
return 1;
}
@@ -192,9 +192,9 @@ namespace LuaBattleGround
*
* @return uint32 minTeamPlayerCount
*/
int GetMinPlayersPerTeam(Eluna* E, BattleGround* bg)
int GetMinPlayersPerTeam(Eluna* /*E*/, lua_State* L, BattleGround* bg)
{
Eluna::Push(E->L, bg->GetMinPlayersPerTeam());
Eluna::Push(L, bg->GetMinPlayersPerTeam());
return 1;
}
@@ -203,9 +203,9 @@ namespace LuaBattleGround
*
* @return Team team
*/
int GetWinner(Eluna* E, BattleGround* bg)
int GetWinner(Eluna* /*E*/, lua_State* L, BattleGround* bg)
{
Eluna::Push(E->L, bg->GetWinner());
Eluna::Push(L, bg->GetWinner());
return 1;
}
@@ -214,9 +214,9 @@ namespace LuaBattleGround
*
* @return BattleGroundStatus status
*/
int GetStatus(Eluna* E, BattleGround* bg)
int GetStatus(Eluna* /*E*/, lua_State* L, BattleGround* bg)
{
Eluna::Push(E->L, bg->GetStatus());
Eluna::Push(L, bg->GetStatus());
return 1;
}
};

View File

@@ -14,12 +14,12 @@ namespace LuaCorpse
*
* @return uint64 ownerGUID
*/
int GetOwnerGUID(Eluna* E, Corpse* corpse)
int GetOwnerGUID(Eluna* /*E*/, lua_State* L, Corpse* corpse)
{
#ifndef TRINITY
Eluna::Push(E->L, corpse->GetOwnerGuid());
Eluna::Push(L, corpse->GetOwnerGuid());
#else
Eluna::Push(E->L, corpse->GetOwnerGUID());
Eluna::Push(L, corpse->GetOwnerGUID());
#endif
return 1;
}
@@ -29,9 +29,9 @@ namespace LuaCorpse
*
* @return uint32 ghostTime
*/
int GetGhostTime(Eluna* E, Corpse* corpse)
int GetGhostTime(Eluna* /*E*/, lua_State* L, Corpse* corpse)
{
Eluna::Push(E->L, uint32(corpse->GetGhostTime()));
Eluna::Push(L, uint32(corpse->GetGhostTime()));
return 1;
}
@@ -49,9 +49,9 @@ namespace LuaCorpse
*
* @return [CorpseType] corpseType
*/
int GetType(Eluna* E, Corpse* corpse)
int GetType(Eluna* /*E*/, lua_State* L, Corpse* corpse)
{
Eluna::Push(E->L, corpse->GetType());
Eluna::Push(L, corpse->GetType());
return 1;
}
@@ -59,7 +59,7 @@ namespace LuaCorpse
* Resets the [Corpse] ghost time.
*
*/
int ResetGhostTime(Eluna* /*E*/, Corpse* corpse)
int ResetGhostTime(Eluna* /*E*/, lua_State* L, Corpse* corpse)
{
corpse->ResetGhostTime();
return 0;
@@ -69,7 +69,7 @@ namespace LuaCorpse
* Saves the [Corpse] to the database.
*
*/
int SaveToDB(Eluna* /*E*/, Corpse* corpse)
int SaveToDB(Eluna* /*E*/, lua_State* L, Corpse* corpse)
{
corpse->SaveToDB();
return 0;
@@ -79,7 +79,7 @@ namespace LuaCorpse
* Deletes the [Corpse] from the world.
*
*/
int DeleteBonesFromWorld(Eluna* /*E*/, Corpse* corpse)
int DeleteBonesFromWorld(Eluna* /*E*/, lua_State* L, Corpse* corpse)
{
corpse->DeleteBonesFromWorld();
return 0;

View File

@@ -22,9 +22,9 @@ namespace LuaCreature
*
* @return bool reputationDisabled
*/
int IsReputationGainDisabled(Eluna* E, Creature* creature)
int IsReputationGainDisabled(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->IsReputationGainDisabled());
Eluna::Push(L, creature->IsReputationGainDisabled());
return 1;
}
@@ -34,12 +34,12 @@ namespace LuaCreature
*
* @return bool regeneratesHealth
*/
int CanRegenerateHealth(Eluna* E, Creature* creature)
int CanRegenerateHealth(Eluna* /*E*/, lua_State* L, Creature* creature)
{
#ifndef TRINITY
Eluna::Push(E->L, creature->IsRegeneratingHealth());
Eluna::Push(L, creature->IsRegeneratingHealth());
#else
Eluna::Push(E->L, creature->isRegeneratingHealth());
Eluna::Push(L, creature->isRegeneratingHealth());
#endif
return 1;
}
@@ -51,14 +51,14 @@ namespace LuaCreature
* @param uint32 questID : the ID of a [Quest]
* @return bool completesQuest
*/
int CanCompleteQuest(Eluna* E, Creature* creature)
int CanCompleteQuest(Eluna* /*E*/, lua_State* L, Creature* creature)
{
uint32 quest_id = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 quest_id = Eluna::CHECKVAL<uint32>(L, 2);
#ifndef TRINITY
Eluna::Push(E->L, creature->HasInvolvedQuest(quest_id));
Eluna::Push(L, creature->HasInvolvedQuest(quest_id));
#else
Eluna::Push(E->L, creature->hasInvolvedQuest(quest_id));
Eluna::Push(L, creature->hasInvolvedQuest(quest_id));
#endif
return 1;
}
@@ -70,14 +70,14 @@ 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, Creature* creature)
int IsTargetableForAttack(Eluna* /*E*/, lua_State* L, Creature* creature)
{
bool mustBeDead = Eluna::CHECKVAL<bool>(E->L, 2, false);
bool mustBeDead = Eluna::CHECKVAL<bool>(L, 2, false);
#ifdef MANGOS
Eluna::Push(E->L, creature->IsTargetableForAttack(mustBeDead));
Eluna::Push(L, creature->IsTargetableForAttack(mustBeDead));
#else
Eluna::Push(E->L, creature->isTargetableForAttack(mustBeDead));
Eluna::Push(L, creature->isTargetableForAttack(mustBeDead));
#endif
return 1;
}
@@ -91,13 +91,13 @@ 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, Creature* creature)
int CanAssistTo(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Unit* u = Eluna::CHECKOBJ<Unit>(E->L, 2);
Unit* enemy = Eluna::CHECKOBJ<Unit>(E->L, 3);
bool checkfaction = Eluna::CHECKVAL<bool>(E->L, 4, true);
Unit* u = Eluna::CHECKOBJ<Unit>(L, 2);
Unit* enemy = Eluna::CHECKOBJ<Unit>(L, 3);
bool checkfaction = Eluna::CHECKVAL<bool>(L, 4, true);
Eluna::Push(E->L, creature->CanAssistTo(u, enemy, checkfaction));
Eluna::Push(L, creature->CanAssistTo(u, enemy, checkfaction));
return 1;
}
@@ -107,9 +107,9 @@ namespace LuaCreature
*
* @return bool searchedForAssistance
*/
int HasSearchedAssistance(Eluna* E, Creature* creature)
int HasSearchedAssistance(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->HasSearchedAssistance());
Eluna::Push(L, creature->HasSearchedAssistance());
return 1;
}
@@ -119,14 +119,14 @@ namespace LuaCreature
*
* @return bool tapped
*/
int IsTappedBy(Eluna* E, Creature* creature)
int IsTappedBy(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Player* player = Eluna::CHECKOBJ<Player>(E->L, 2);
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
#ifdef MANGOS
Eluna::Push(E->L, creature->IsTappedBy(player));
Eluna::Push(L, creature->IsTappedBy(player));
#else
Eluna::Push(E->L, creature->isTappedBy(player));
Eluna::Push(L, creature->isTappedBy(player));
#endif
return 1;
}
@@ -137,12 +137,12 @@ namespace LuaCreature
*
* @return bool hasLootRecipient
*/
int HasLootRecipient(Eluna* E, Creature* creature)
int HasLootRecipient(Eluna* /*E*/, lua_State* L, Creature* creature)
{
#ifndef TRINITY
Eluna::Push(E->L, creature->HasLootRecipient());
Eluna::Push(L, creature->HasLootRecipient());
#else
Eluna::Push(E->L, creature->hasLootRecipient());
Eluna::Push(L, creature->hasLootRecipient());
#endif
return 1;
}
@@ -153,13 +153,13 @@ namespace LuaCreature
*
* @return bool canAggro
*/
int CanAggro(Eluna* E, Creature* creature)
int CanAggro(Eluna* /*E*/, lua_State* L, Creature* creature)
{
#ifdef TRINITY
Eluna::Push(E->L, !creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC));
Eluna::Push(L, !creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC));
#else
// Eluna::Push(E->L, creature->CanInitiateAttack());
Eluna::Push(E->L, !creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE));
// Eluna::Push(L, creature->CanInitiateAttack());
Eluna::Push(L, !creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE));
#endif
return 1;
}
@@ -170,9 +170,9 @@ namespace LuaCreature
*
* @return bool canSwim
*/
int CanSwim(Eluna* E, Creature* creature)
int CanSwim(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->CanSwim());
Eluna::Push(L, creature->CanSwim());
return 1;
}
@@ -182,9 +182,9 @@ namespace LuaCreature
*
* @return bool canWalk
*/
int CanWalk(Eluna* E, Creature* creature)
int CanWalk(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->CanWalk());
Eluna::Push(L, creature->CanWalk());
return 1;
}
@@ -194,9 +194,9 @@ namespace LuaCreature
*
* @return bool inEvadeMode
*/
int IsInEvadeMode(Eluna* E, Creature* creature)
int IsInEvadeMode(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->IsInEvadeMode());
Eluna::Push(L, creature->IsInEvadeMode());
return 1;
}
@@ -206,12 +206,12 @@ namespace LuaCreature
*
* @return bool isElite
*/
int IsElite(Eluna* E, Creature* creature)
int IsElite(Eluna* /*E*/, lua_State* L, Creature* creature)
{
#ifndef TRINITY
Eluna::Push(E->L, creature->IsElite());
Eluna::Push(L, creature->IsElite());
#else
Eluna::Push(E->L, creature->isElite());
Eluna::Push(L, creature->isElite());
#endif
return 1;
}
@@ -222,9 +222,9 @@ namespace LuaCreature
*
* @return bool isGuard
*/
int IsGuard(Eluna* E, Creature* creature)
int IsGuard(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->IsGuard());
Eluna::Push(L, creature->IsGuard());
return 1;
}
@@ -234,9 +234,9 @@ namespace LuaCreature
*
* @return bool isCivilian
*/
int IsCivilian(Eluna* E, Creature* creature)
int IsCivilian(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->IsCivilian());
Eluna::Push(L, creature->IsCivilian());
return 1;
}
@@ -246,9 +246,9 @@ namespace LuaCreature
*
* @return bool isLeader
*/
int IsRacialLeader(Eluna* E, Creature* creature)
int IsRacialLeader(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->IsRacialLeader());
Eluna::Push(L, creature->IsRacialLeader());
return 1;
}
@@ -258,12 +258,12 @@ namespace LuaCreature
*
* @return bool isWorldBoss
*/
int IsWorldBoss(Eluna* E, Creature* creature)
int IsWorldBoss(Eluna* /*E*/, lua_State* L, Creature* creature)
{
#ifndef TRINITY
Eluna::Push(E->L, creature->IsWorldBoss());
Eluna::Push(L, creature->IsWorldBoss());
#else
Eluna::Push(E->L, creature->isWorldBoss());
Eluna::Push(L, creature->isWorldBoss());
#endif
return 1;
}
@@ -275,11 +275,11 @@ namespace LuaCreature
* @param uint32 spellId : the ID of a [Spell]
* @return bool hasCooldown
*/
int HasCategoryCooldown(Eluna* E, Creature* creature)
int HasCategoryCooldown(Eluna* /*E*/, lua_State* L, Creature* creature)
{
uint32 spell = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 spell = Eluna::CHECKVAL<uint32>(L, 2);
Eluna::Push(E->L, creature->HasCategoryCooldown(spell));
Eluna::Push(L, creature->HasCategoryCooldown(spell));
return 1;
}
@@ -290,11 +290,11 @@ namespace LuaCreature
* @param uint32 spellId : the ID of a [Spell]
* @return bool hasSpell
*/
int HasSpell(Eluna* E, Creature* creature)
int HasSpell(Eluna* /*E*/, lua_State* L, Creature* creature)
{
uint32 id = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 id = Eluna::CHECKVAL<uint32>(L, 2);
Eluna::Push(E->L, creature->HasSpell(id));
Eluna::Push(L, creature->HasSpell(id));
return 1;
}
@@ -305,14 +305,14 @@ namespace LuaCreature
* @param uint32 questId : the ID of a [Quest]
* @return bool hasQuest
*/
int HasQuest(Eluna* E, Creature* creature)
int HasQuest(Eluna* /*E*/, lua_State* L, Creature* creature)
{
uint32 questId = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 questId = Eluna::CHECKVAL<uint32>(L, 2);
#ifndef TRINITY
Eluna::Push(E->L, creature->HasQuest(questId));
Eluna::Push(L, creature->HasQuest(questId));
#else
Eluna::Push(E->L, creature->hasQuest(questId));
Eluna::Push(L, creature->hasQuest(questId));
#endif
return 1;
}
@@ -324,11 +324,11 @@ namespace LuaCreature
* @param uint32 spellId : the ID of a [Spell]
* @return bool hasCooldown
*/
int HasSpellCooldown(Eluna* E, Creature* creature)
int HasSpellCooldown(Eluna* /*E*/, lua_State* L, Creature* creature)
{
uint32 spellId = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 spellId = Eluna::CHECKVAL<uint32>(L, 2);
Eluna::Push(E->L, creature->HasSpellCooldown(spellId));
Eluna::Push(L, creature->HasSpellCooldown(spellId));
return 1;
}
@@ -338,9 +338,9 @@ namespace LuaCreature
*
* @return bool canFly
*/
int CanFly(Eluna* E, Creature* creature)
int CanFly(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->CanFly());
Eluna::Push(L, creature->CanFly());
return 1;
}
@@ -351,32 +351,32 @@ namespace LuaCreature
*
* @return bool canFly
*/
int IsTrigger(Eluna* E, Creature* creature)
int IsTrigger(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->IsTrigger());
Eluna::Push(L, creature->IsTrigger());
return 1;
}
int IsDamageEnoughForLootingAndReward(Eluna* E, Creature* creature)
int IsDamageEnoughForLootingAndReward(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->IsDamageEnoughForLootingAndReward());
Eluna::Push(L, creature->IsDamageEnoughForLootingAndReward());
return 1;
}
int CanStartAttack(Eluna* E, Creature* creature) // TODO: Implement core side
int CanStartAttack(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement core side
{
Unit* target = Eluna::CHECKOBJ<Unit>(E->L, 2);
bool force = Eluna::CHECKVAL<bool>(E->L, 3, true);
Unit* target = Eluna::CHECKOBJ<Unit>(L, 2);
bool force = Eluna::CHECKVAL<bool>(L, 3, true);
Eluna::Push(E->L, creature->CanStartAttack(target, force));
Eluna::Push(L, creature->CanStartAttack(target, force));
return 1;
}
int HasLootMode(Eluna* E, Creature* creature) // TODO: Implement LootMode features
int HasLootMode(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement LootMode features
{
uint16 lootMode = Eluna::CHECKVAL<uint16>(E->L, 2);
uint16 lootMode = Eluna::CHECKVAL<uint16>(L, 2);
Eluna::Push(E->L, creature->HasLootMode(lootMode));
Eluna::Push(L, creature->HasLootMode(lootMode));
return 1;
}
#endif
@@ -391,9 +391,9 @@ namespace LuaCreature
*
* @return uint32 respawnDelay : the respawn delay, in seconds
*/
int GetRespawnDelay(Eluna* E, Creature* creature)
int GetRespawnDelay(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->GetRespawnDelay());
Eluna::Push(L, creature->GetRespawnDelay());
return 1;
}
@@ -403,9 +403,9 @@ namespace LuaCreature
*
* @return float wanderRadius
*/
int GetWanderRadius(Eluna* E, Creature* creature)
int GetWanderRadius(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->GetRespawnRadius());
Eluna::Push(L, creature->GetRespawnRadius());
return 1;
}
@@ -415,9 +415,9 @@ namespace LuaCreature
*
* @return uint32 pathId
*/
int GetWaypointPath(Eluna* E, Creature* creature)
int GetWaypointPath(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->GetWaypointPath());
Eluna::Push(L, creature->GetWaypointPath());
return 1;
}
#endif
@@ -427,12 +427,12 @@ namespace LuaCreature
*
* @return uint32 wpId
*/
int GetCurrentWaypointId(Eluna* E, Creature* creature)
int GetCurrentWaypointId(Eluna* /*E*/, lua_State* L, Creature* creature)
{
#ifdef TRINITY
Eluna::Push(E->L, creature->GetCurrentWaypointID());
Eluna::Push(L, creature->GetCurrentWaypointID());
#else
Eluna::Push(E->L, creature->GetMotionMaster()->getLastReachedWaypoint());
Eluna::Push(L, creature->GetMotionMaster()->getLastReachedWaypoint());
#endif
return 1;
}
@@ -442,9 +442,9 @@ namespace LuaCreature
*
* @return MovementGeneratorType defaultMovementType
*/
int GetDefaultMovementType(Eluna* E, Creature* creature)
int GetDefaultMovementType(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->GetDefaultMovementType());
Eluna::Push(L, creature->GetDefaultMovementType());
return 1;
}
@@ -454,16 +454,16 @@ namespace LuaCreature
* @param Unit target
* @return float aggroRange
*/
int GetAggroRange(Eluna* E, Creature* creature)
int GetAggroRange(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Unit* target = Eluna::CHECKOBJ<Unit>(E->L, 2);
Unit* target = Eluna::CHECKOBJ<Unit>(L, 2);
#ifndef TRINITY
float AttackDist = creature->GetAttackDistance(target);
float ThreatRadius = sWorld.getConfig(CONFIG_FLOAT_THREAT_RADIUS);
Eluna::Push(E->L, ThreatRadius > AttackDist ? ThreatRadius : AttackDist);
Eluna::Push(L, ThreatRadius > AttackDist ? ThreatRadius : AttackDist);
#else
Eluna::Push(E->L, creature->GetAggroRange(target));
Eluna::Push(L, creature->GetAggroRange(target));
#endif
return 1;
}
@@ -477,11 +477,11 @@ namespace LuaCreature
* @param Unit target
* @return float attackDistance
*/
int GetAttackDistance(Eluna* E, Creature* creature)
int GetAttackDistance(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Unit* target = Eluna::CHECKOBJ<Unit>(E->L, 2);
Unit* target = Eluna::CHECKOBJ<Unit>(L, 2);
Eluna::Push(E->L, creature->GetAttackDistance(target));
Eluna::Push(L, creature->GetAttackDistance(target));
return 1;
}
@@ -490,12 +490,12 @@ namespace LuaCreature
*
* @return Group lootRecipientGroup : the group or `nil`
*/
int GetLootRecipientGroup(Eluna* E, Creature* creature)
int GetLootRecipientGroup(Eluna* /*E*/, lua_State* L, Creature* creature)
{
#ifndef TRINITY
Eluna::Push(E->L, creature->GetGroupLootRecipient());
Eluna::Push(L, creature->GetGroupLootRecipient());
#else
Eluna::Push(E->L, creature->GetLootRecipientGroup());
Eluna::Push(L, creature->GetLootRecipientGroup());
#endif
return 1;
}
@@ -505,9 +505,9 @@ namespace LuaCreature
*
* @return Player lootRecipient : the player or `nil`
*/
int GetLootRecipient(Eluna* E, Creature* creature)
int GetLootRecipient(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->GetLootRecipient());
Eluna::Push(L, creature->GetLootRecipient());
return 1;
}
@@ -520,9 +520,9 @@ namespace LuaCreature
*
* @return string scriptName
*/
int GetScriptName(Eluna* E, Creature* creature)
int GetScriptName(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->GetScriptName());
Eluna::Push(L, creature->GetScriptName());
return 1;
}
@@ -535,9 +535,9 @@ namespace LuaCreature
*
* @return string AIName
*/
int GetAIName(Eluna* E, Creature* creature)
int GetAIName(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->GetAIName());
Eluna::Push(L, creature->GetAIName());
return 1;
}
@@ -549,9 +549,9 @@ namespace LuaCreature
*
* @return uint32 scriptID
*/
int GetScriptId(Eluna* E, Creature* creature)
int GetScriptId(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->GetScriptId());
Eluna::Push(L, creature->GetScriptId());
return 1;
}
@@ -561,11 +561,11 @@ namespace LuaCreature
* @param uint32 spellID
* @return uint32 cooldown : the cooldown, in milliseconds
*/
int GetCreatureSpellCooldownDelay(Eluna* E, Creature* creature)
int GetCreatureSpellCooldownDelay(Eluna* /*E*/, lua_State* L, Creature* creature)
{
uint32 spell = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 spell = Eluna::CHECKVAL<uint32>(L, 2);
Eluna::Push(E->L, creature->GetCreatureSpellCooldownDelay(spell));
Eluna::Push(L, creature->GetCreatureSpellCooldownDelay(spell));
return 1;
}
@@ -574,9 +574,9 @@ namespace LuaCreature
*
* @return uint32 corpseDelay : the delay, in seconds
*/
int GetCorpseDelay(Eluna* E, Creature* creature)
int GetCorpseDelay(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->GetCorpseDelay());
Eluna::Push(L, creature->GetCorpseDelay());
return 1;
}
@@ -589,7 +589,7 @@ namespace LuaCreature
* @return float z
* @return float o
*/
int GetHomePosition(Eluna* E, Creature* creature)
int GetHomePosition(Eluna* /*E*/, lua_State* L, Creature* creature)
{
float x, y, z, o;
#ifndef TRINITY
@@ -598,10 +598,10 @@ namespace LuaCreature
creature->GetHomePosition(x, y, z, o);
#endif
Eluna::Push(E->L, x);
Eluna::Push(E->L, y);
Eluna::Push(E->L, z);
Eluna::Push(E->L, o);
Eluna::Push(L, x);
Eluna::Push(L, y);
Eluna::Push(L, z);
Eluna::Push(L, o);
return 4;
}
@@ -614,12 +614,12 @@ namespace LuaCreature
* @param float z
* @param float o
*/
int SetHomePosition(Eluna* E, Creature* creature)
int SetHomePosition(Eluna* /*E*/, lua_State* L, Creature* creature)
{
float x = Eluna::CHECKVAL<float>(E->L, 2);
float y = Eluna::CHECKVAL<float>(E->L, 3);
float z = Eluna::CHECKVAL<float>(E->L, 4);
float o = Eluna::CHECKVAL<float>(E->L, 5);
float x = Eluna::CHECKVAL<float>(L, 2);
float y = Eluna::CHECKVAL<float>(L, 3);
float z = Eluna::CHECKVAL<float>(L, 4);
float o = Eluna::CHECKVAL<float>(L, 5);
#ifndef TRINITY
creature->SetRespawnCoord(x, y, z, o);
@@ -658,13 +658,13 @@ 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, Creature* creature)
int GetAITarget(Eluna* /*E*/, lua_State* L, Creature* creature)
{
uint32 targetType = Eluna::CHECKVAL<uint32>(E->L, 2);
bool playerOnly = Eluna::CHECKVAL<bool>(E->L, 3, false);
uint32 position = Eluna::CHECKVAL<uint32>(E->L, 4, 0);
float dist = Eluna::CHECKVAL<float>(E->L, 5, 0.0f);
int32 aura = Eluna::CHECKVAL<int32>(E->L, 6, 0);
uint32 targetType = Eluna::CHECKVAL<uint32>(L, 2);
bool playerOnly = Eluna::CHECKVAL<bool>(L, 3, false);
uint32 position = Eluna::CHECKVAL<uint32>(L, 4, 0);
float dist = Eluna::CHECKVAL<float>(L, 5, 0.0f);
int32 aura = Eluna::CHECKVAL<int32>(L, 6, 0);
#ifdef MANGOS
ThreatList const& threatlist = creature->GetThreatManager().getThreatList();
@@ -711,7 +711,7 @@ namespace LuaCreature
std::list<Unit*>::const_iterator itr = targetList.begin();
if (position)
std::advance(itr, position);
Eluna::Push(E->L, *itr);
Eluna::Push(L, *itr);
}
break;
case SELECT_TARGET_FARTHEST:
@@ -720,7 +720,7 @@ namespace LuaCreature
std::list<Unit*>::reverse_iterator ritr = targetList.rbegin();
if (position)
std::advance(ritr, position);
Eluna::Push(E->L, *ritr);
Eluna::Push(L, *ritr);
}
break;
case SELECT_TARGET_RANDOM:
@@ -730,11 +730,11 @@ namespace LuaCreature
std::advance(itr, urand(0, position));
else
std::advance(itr, urand(0, targetList.size() - 1));
Eluna::Push(E->L, *itr);
Eluna::Push(L, *itr);
}
break;
default:
luaL_argerror(E->L, 2, "SelectAggroTarget expected");
luaL_argerror(L, 2, "SelectAggroTarget expected");
break;
}
@@ -746,10 +746,10 @@ namespace LuaCreature
*
* @return table targets
*/
int GetAITargets(Eluna* E, Creature* creature)
int GetAITargets(Eluna* /*E*/, lua_State* L, Creature* creature)
{
lua_newtable(E->L);
int tbl = lua_gettop(E->L);
lua_newtable(L);
int tbl = lua_gettop(L);
uint32 i = 0;
#ifdef MANGOS
@@ -765,12 +765,12 @@ namespace LuaCreature
if (!target)
continue;
++i;
Eluna::Push(E->L, i);
Eluna::Push(E->L, target);
lua_settable(E->L, tbl);
Eluna::Push(L, i);
Eluna::Push(L, target);
lua_settable(L, tbl);
}
lua_settop(E->L, tbl);
lua_settop(L, tbl);
return 1;
}
@@ -779,12 +779,12 @@ namespace LuaCreature
*
* @return int targetsCount
*/
int GetAITargetsCount(Eluna* E, Creature* creature)
int GetAITargetsCount(Eluna* /*E*/, lua_State* L, Creature* creature)
{
#ifdef MANGOS
Eluna::Push(E->L, creature->GetThreatManager().getThreatList().size());
Eluna::Push(L, creature->GetThreatManager().getThreatList().size());
#else
Eluna::Push(E->L, creature->getThreatManager().getThreatList().size());
Eluna::Push(L, creature->getThreatManager().getThreatList().size());
#endif
return 1;
}
@@ -797,9 +797,9 @@ namespace LuaCreature
*
* @return NPCFlags npcFlags
*/
int GetNPCFlags(Eluna* E, Creature* creature)
int GetNPCFlags(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->GetUInt32Value(UNIT_NPC_FLAGS));
Eluna::Push(L, creature->GetUInt32Value(UNIT_NPC_FLAGS));
return 1;
}
@@ -809,17 +809,17 @@ namespace LuaCreature
*
* @return uint32 shieldBlockValue
*/
int GetShieldBlockValue(Eluna* E, Creature* creature)
int GetShieldBlockValue(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Eluna::Push(E->L, creature->GetShieldBlockValue());
Eluna::Push(L, creature->GetShieldBlockValue());
return 1;
}
#endif
#ifdef TRINITY
int GetLootMode(Eluna* E, Creature* creature) // TODO: Implement LootMode features
int GetLootMode(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement LootMode features
{
Eluna::Push(E->L, creature->GetLootMode());
Eluna::Push(L, creature->GetLootMode());
return 1;
}
#endif
@@ -831,9 +831,9 @@ namespace LuaCreature
*
* @param NPCFlags flags
*/
int SetNPCFlags(Eluna* E, Creature* creature)
int SetNPCFlags(Eluna* /*E*/, lua_State* L, Creature* creature)
{
uint32 flags = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 flags = Eluna::CHECKVAL<uint32>(L, 2);
creature->SetUInt32Value(UNIT_NPC_FLAGS, flags);
return 0;
@@ -845,9 +845,9 @@ namespace LuaCreature
*
* @param bool enable = true
*/
int SetDisableGravity(Eluna* E, Creature* creature)
int SetDisableGravity(Eluna* /*E*/, lua_State* L, Creature* creature)
{
bool enable = Eluna::CHECKVAL<bool>(E->L, 2, true);
bool enable = Eluna::CHECKVAL<bool>(L, 2, true);
#ifdef TRINITY
creature->SetDisableGravity(!enable);
@@ -858,9 +858,9 @@ namespace LuaCreature
}
#ifdef TRINITY
int SetLootMode(Eluna* E, Creature* creature) // TODO: Implement LootMode features
int SetLootMode(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement LootMode features
{
uint16 lootMode = Eluna::CHECKVAL<uint16>(E->L, 2);
uint16 lootMode = Eluna::CHECKVAL<uint16>(L, 2);
creature->SetLootMode(lootMode);
return 0;
@@ -872,9 +872,9 @@ namespace LuaCreature
*
* @param DeathState deathState
*/
int SetDeathState(Eluna* E, Creature* creature)
int SetDeathState(Eluna* /*E*/, lua_State* L, Creature* creature)
{
int32 state = Eluna::CHECKVAL<int32>(E->L, 2);
int32 state = Eluna::CHECKVAL<int32>(L, 2);
#ifndef TRINITY
creature->SetDeathState((DeathState)state);
@@ -889,9 +889,9 @@ namespace LuaCreature
*
* @param bool enable = true : `true` to enable walking, `false` for running
*/
int SetWalk(Eluna* E, Creature* creature) // TODO: Move same to Player ?
int SetWalk(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Move same to Player ?
{
bool enable = Eluna::CHECKVAL<bool>(E->L, 2, true);
bool enable = Eluna::CHECKVAL<bool>(L, 2, true);
creature->SetWalk(enable);
return 0;
@@ -904,11 +904,11 @@ namespace LuaCreature
* @param uint32 off_hand : off hand [Item]'s entry
* @param uint32 ranged : ranged [Item]'s entry
*/
int SetEquipmentSlots(Eluna* E, Creature* creature)
int SetEquipmentSlots(Eluna* /*E*/, lua_State* L, Creature* creature)
{
uint32 main_hand = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 off_hand = Eluna::CHECKVAL<uint32>(E->L, 3);
uint32 ranged = Eluna::CHECKVAL<uint32>(E->L, 4);
uint32 main_hand = Eluna::CHECKVAL<uint32>(L, 2);
uint32 off_hand = Eluna::CHECKVAL<uint32>(L, 3);
uint32 ranged = Eluna::CHECKVAL<uint32>(L, 4);
#ifdef TRINITY
creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, main_hand);
@@ -927,9 +927,9 @@ namespace LuaCreature
*
* @param bool allow = true : `true` to allow aggro, `false` to disable aggro
*/
int SetAggroEnabled(Eluna* E, Creature* creature)
int SetAggroEnabled(Eluna* /*E*/, lua_State* L, Creature* creature)
{
bool allow = Eluna::CHECKVAL<bool>(E->L, 2, true);
bool allow = Eluna::CHECKVAL<bool>(L, 2, true);
#ifdef TRINITY
if (allow)
@@ -951,9 +951,9 @@ namespace LuaCreature
*
* @param bool disable = true : `true` to disable reputation, `false` to enable
*/
int SetDisableReputationGain(Eluna* E, Creature* creature)
int SetDisableReputationGain(Eluna* /*E*/, lua_State* L, Creature* creature)
{
bool disable = Eluna::CHECKVAL<bool>(E->L, 2, true);
bool disable = Eluna::CHECKVAL<bool>(L, 2, true);
creature->SetDisableReputationGain(disable);
return 0;
@@ -965,7 +965,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*/, Creature* creature)
int SetInCombatWithZone(Eluna* /*E*/, lua_State* /*L*/, Creature* creature)
{
creature->SetInCombatWithZone();
return 0;
@@ -976,9 +976,9 @@ namespace LuaCreature
*
* @param float distance
*/
int SetWanderRadius(Eluna* E, Creature* creature)
int SetWanderRadius(Eluna* /*E*/, lua_State* L, Creature* creature)
{
float dist = Eluna::CHECKVAL<float>(E->L, 2);
float dist = Eluna::CHECKVAL<float>(L, 2);
creature->SetRespawnRadius(dist);
return 0;
@@ -989,9 +989,9 @@ namespace LuaCreature
*
* @param uint32 delay : the delay, in seconds
*/
int SetRespawnDelay(Eluna* E, Creature* creature)
int SetRespawnDelay(Eluna* /*E*/, lua_State* L, Creature* creature)
{
uint32 delay = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 delay = Eluna::CHECKVAL<uint32>(L, 2);
creature->SetRespawnDelay(delay);
return 0;
@@ -1002,9 +1002,9 @@ namespace LuaCreature
*
* @param MovementGeneratorType type
*/
int SetDefaultMovementType(Eluna* E, Creature* creature)
int SetDefaultMovementType(Eluna* /*E*/, lua_State* L, Creature* creature)
{
int32 type = Eluna::CHECKVAL<int32>(E->L, 2);
int32 type = Eluna::CHECKVAL<int32>(L, 2);
creature->SetDefaultMovementType((MovementGeneratorType)type);
return 0;
@@ -1015,9 +1015,9 @@ namespace LuaCreature
*
* @param bool enable = true : `true` to disable searching, `false` to allow
*/
int SetNoSearchAssistance(Eluna* E, Creature* creature)
int SetNoSearchAssistance(Eluna* /*E*/, lua_State* L, Creature* creature)
{
bool val = Eluna::CHECKVAL<bool>(E->L, 2, true);
bool val = Eluna::CHECKVAL<bool>(L, 2, true);
creature->SetNoSearchAssistance(val);
return 0;
@@ -1028,9 +1028,9 @@ namespace LuaCreature
*
* @param bool enable = true : `true` to disable calling for help, `false` to enable
*/
int SetNoCallAssistance(Eluna* E, Creature* creature)
int SetNoCallAssistance(Eluna* /*E*/, lua_State* L, Creature* creature)
{
bool val = Eluna::CHECKVAL<bool>(E->L, 2, true);
bool val = Eluna::CHECKVAL<bool>(L, 2, true);
creature->SetNoCallAssistance(val);
return 0;
@@ -1041,9 +1041,9 @@ namespace LuaCreature
*
* @param bool enable = true : `true` to enable hovering, `false` to disable
*/
int SetHover(Eluna* E, Creature* creature)
int SetHover(Eluna* /*E*/, lua_State* L, Creature* creature)
{
bool enable = Eluna::CHECKVAL<bool>(E->L, 2, true);
bool enable = Eluna::CHECKVAL<bool>(L, 2, true);
#ifdef TRINITY
creature->SetHover(enable);
@@ -1069,9 +1069,9 @@ namespace LuaCreature
*
* @param uint32 delay = 0 : dely to despawn in milliseconds
*/
int DespawnOrUnsummon(Eluna* E, Creature* creature)
int DespawnOrUnsummon(Eluna* /*E*/, lua_State* L, Creature* creature)
{
uint32 msTimeToDespawn = Eluna::CHECKVAL<uint32>(E->L, 2, 0);
uint32 msTimeToDespawn = Eluna::CHECKVAL<uint32>(L, 2, 0);
#ifndef TRINITY
creature->ForcedDespawn(msTimeToDespawn);
@@ -1084,7 +1084,7 @@ namespace LuaCreature
/**
* Respawn this [Creature].
*/
int Respawn(Eluna* /*E*/, Creature* creature)
int Respawn(Eluna* /*E*/, lua_State* /*L*/, Creature* creature)
{
creature->Respawn();
return 0;
@@ -1093,7 +1093,7 @@ namespace LuaCreature
/**
* Remove this [Creature]'s corpse.
*/
int RemoveCorpse(Eluna* /*E*/, Creature* creature)
int RemoveCorpse(Eluna* /*E*/, lua_State* /*L*/, Creature* creature)
{
creature->RemoveCorpse();
return 0;
@@ -1102,7 +1102,7 @@ namespace LuaCreature
/**
* Make the [Creature] start following it's waypoint path.
*/
int MoveWaypoint(Eluna* /*E*/, Creature* creature)
int MoveWaypoint(Eluna* /*E*/, lua_State* /*L*/, Creature* creature)
{
#ifndef TRINITY
creature->GetMotionMaster()->MoveWaypoint();
@@ -1115,7 +1115,7 @@ namespace LuaCreature
/**
* Make the [Creature] call for assistance in combat from other nearby [Creature]s.
*/
int CallAssistance(Eluna* /*E*/, Creature* creature)
int CallAssistance(Eluna* /*E*/, lua_State* /*L*/, Creature* creature)
{
creature->CallAssistance();
return 0;
@@ -1126,9 +1126,9 @@ namespace LuaCreature
*
* @param float radius
*/
int CallForHelp(Eluna* E, Creature* creature)
int CallForHelp(Eluna* /*E*/, lua_State* L, Creature* creature)
{
float radius = Eluna::CHECKVAL<float>(E->L, 2);
float radius = Eluna::CHECKVAL<float>(L, 2);
creature->CallForHelp(radius);
return 0;
@@ -1137,7 +1137,7 @@ namespace LuaCreature
/**
* Make the [Creature] flee combat to get assistance from a nearby friendly [Creature].
*/
int FleeToGetAssistance(Eluna* /*E*/, Creature* creature)
int FleeToGetAssistance(Eluna* /*E*/, lua_State* /*L*/, Creature* creature)
{
creature->DoFleeToGetAssistance();
return 0;
@@ -1148,9 +1148,9 @@ namespace LuaCreature
*
* @param Unit target
*/
int AttackStart(Eluna* E, Creature* creature)
int AttackStart(Eluna* /*E*/, lua_State* L, Creature* creature)
{
Unit* target = Eluna::CHECKOBJ<Unit>(E->L, 2);
Unit* target = Eluna::CHECKOBJ<Unit>(L, 2);
creature->AI()->AttackStart(target);
return 0;
@@ -1159,7 +1159,7 @@ namespace LuaCreature
/**
* Save the [Creature] in the database.
*/
int SaveToDB(Eluna* /*E*/, Creature* creature)
int SaveToDB(Eluna* /*E*/, lua_State* /*L*/, Creature* creature)
{
creature->SaveToDB();
return 0;
@@ -1170,12 +1170,12 @@ namespace LuaCreature
*
* This should be called every update cycle for the Creature's AI.
*/
int SelectVictim(Eluna* E, Creature* creature)
int SelectVictim(Eluna* /*E*/, lua_State* L, Creature* creature)
{
#ifndef TRINITY
Eluna::Push(E->L, creature->SelectHostileTarget());
Eluna::Push(L, creature->SelectHostileTarget());
#else
Eluna::Push(E->L, creature->SelectVictim());
Eluna::Push(L, creature->SelectVictim());
#endif
return 1;
}
@@ -1186,10 +1186,10 @@ 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, Creature* creature)
int UpdateEntry(Eluna* /*E*/, lua_State* L, Creature* creature)
{
uint32 entry = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 dataGuidLow = Eluna::CHECKVAL<uint32>(E->L, 3, 0);
uint32 entry = Eluna::CHECKVAL<uint32>(L, 2);
uint32 dataGuidLow = Eluna::CHECKVAL<uint32>(L, 3, 0);
#ifndef TRINITY
creature->UpdateEntry(entry, ALLIANCE, dataGuidLow ? eObjectMgr->GetCreatureData(dataGuidLow) : NULL);
@@ -1200,23 +1200,23 @@ namespace LuaCreature
}
#ifdef TRINITY
int ResetLootMode(Eluna* /*E*/, Creature* creature) // TODO: Implement LootMode features
int ResetLootMode(Eluna* /*E*/, lua_State* /*L*/, Creature* creature) // TODO: Implement LootMode features
{
creature->ResetLootMode();
return 0;
}
int RemoveLootMode(Eluna* E, Creature* creature) // TODO: Implement LootMode features
int RemoveLootMode(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement LootMode features
{
uint16 lootMode = Eluna::CHECKVAL<uint16>(E->L, 2);
uint16 lootMode = Eluna::CHECKVAL<uint16>(L, 2);
creature->RemoveLootMode(lootMode);
return 0;
}
int AddLootMode(Eluna* E, Creature* creature) // TODO: Implement LootMode features
int AddLootMode(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement LootMode features
{
uint16 lootMode = Eluna::CHECKVAL<uint16>(E->L, 2);
uint16 lootMode = Eluna::CHECKVAL<uint16>(L, 2);
creature->AddLootMode(lootMode);
return 0;

View File

@@ -14,152 +14,152 @@
#endif
namespace LuaQuery
{
void CheckFields(Eluna* E, ElunaQuery* result)
void CheckFields(Eluna* /*E*/, lua_State* L, ElunaQuery* result)
{
if (Eluna::CHECKVAL<uint32>(E->L, 2) >= RESULT->GetFieldCount())
luaL_argerror(E->L, 2, "invalid field index");
if (Eluna::CHECKVAL<uint32>(L, 2) >= RESULT->GetFieldCount())
luaL_argerror(L, 2, "invalid field index");
}
/* BOOLEAN */
int IsNull(Eluna* E, ElunaQuery* result)
int IsNull(Eluna* E, lua_State* L, ElunaQuery* result)
{
uint32 col = Eluna::CHECKVAL<uint32>(E->L, 2);
CheckFields(E, result);
uint32 col = Eluna::CHECKVAL<uint32>(L, 2);
CheckFields(E, L, result);
#ifndef TRINITY
Eluna::Push(E->L, RESULT->Fetch()[col].IsNULL());
Eluna::Push(L, RESULT->Fetch()[col].IsNULL());
#else
Eluna::Push(E->L, RESULT->Fetch()[col].IsNull());
Eluna::Push(L, RESULT->Fetch()[col].IsNull());
#endif
return 1;
}
/* GETTERS */
int GetColumnCount(Eluna* E, ElunaQuery* result)
int GetColumnCount(Eluna* /*E*/, lua_State* L, ElunaQuery* result)
{
Eluna::Push(E->L, RESULT->GetFieldCount());
Eluna::Push(L, RESULT->GetFieldCount());
return 1;
}
int GetRowCount(Eluna* E, ElunaQuery* result)
int GetRowCount(Eluna* /*E*/, lua_State* L, ElunaQuery* result)
{
if (RESULT->GetRowCount() > (uint32)-1)
Eluna::Push(E->L, (uint32)-1);
Eluna::Push(L, (uint32)-1);
else
Eluna::Push(E->L, RESULT->GetRowCount());
Eluna::Push(L, RESULT->GetRowCount());
return 1;
}
int GetBool(Eluna* E, ElunaQuery* result)
int GetBool(Eluna* E, lua_State* L, ElunaQuery* result)
{
uint32 col = Eluna::CHECKVAL<uint32>(E->L, 2);
CheckFields(E, result);
Eluna::Push(E->L, RESULT->Fetch()[col].GetBool());
uint32 col = Eluna::CHECKVAL<uint32>(L, 2);
CheckFields(E, L, result);
Eluna::Push(L, RESULT->Fetch()[col].GetBool());
return 1;
}
int GetUInt8(Eluna* E, ElunaQuery* result)
int GetUInt8(Eluna* E, lua_State* L, ElunaQuery* result)
{
uint32 col = Eluna::CHECKVAL<uint32>(E->L, 2);
CheckFields(E, result);
Eluna::Push(E->L, RESULT->Fetch()[col].GetUInt8());
uint32 col = Eluna::CHECKVAL<uint32>(L, 2);
CheckFields(E, L, result);
Eluna::Push(L, RESULT->Fetch()[col].GetUInt8());
return 1;
}
int GetUInt16(Eluna* E, ElunaQuery* result)
int GetUInt16(Eluna* E, lua_State* L, ElunaQuery* result)
{
uint32 col = Eluna::CHECKVAL<uint32>(E->L, 2);
CheckFields(E, result);
Eluna::Push(E->L, RESULT->Fetch()[col].GetUInt16());
uint32 col = Eluna::CHECKVAL<uint32>(L, 2);
CheckFields(E, L, result);
Eluna::Push(L, RESULT->Fetch()[col].GetUInt16());
return 1;
}
int GetUInt32(Eluna* E, ElunaQuery* result)
int GetUInt32(Eluna* E, lua_State* L, ElunaQuery* result)
{
uint32 col = Eluna::CHECKVAL<uint32>(E->L, 2);
CheckFields(E, result);
Eluna::Push(E->L, RESULT->Fetch()[col].GetUInt32());
uint32 col = Eluna::CHECKVAL<uint32>(L, 2);
CheckFields(E, L, result);
Eluna::Push(L, RESULT->Fetch()[col].GetUInt32());
return 1;
}
int GetUInt64(Eluna* E, ElunaQuery* result)
int GetUInt64(Eluna* E, lua_State* L, ElunaQuery* result)
{
uint32 col = Eluna::CHECKVAL<uint32>(E->L, 2);
CheckFields(E, result);
Eluna::Push(E->L, RESULT->Fetch()[col].GetUInt64());
uint32 col = Eluna::CHECKVAL<uint32>(L, 2);
CheckFields(E, L, result);
Eluna::Push(L, RESULT->Fetch()[col].GetUInt64());
return 1;
}
int GetInt8(Eluna* E, ElunaQuery* result)
int GetInt8(Eluna* E, lua_State* L, ElunaQuery* result)
{
uint32 col = Eluna::CHECKVAL<uint32>(E->L, 2);
CheckFields(E, result);
Eluna::Push(E->L, RESULT->Fetch()[col].GetInt8());
uint32 col = Eluna::CHECKVAL<uint32>(L, 2);
CheckFields(E, L, result);
Eluna::Push(L, RESULT->Fetch()[col].GetInt8());
return 1;
}
int GetInt16(Eluna* E, ElunaQuery* result)
int GetInt16(Eluna* E, lua_State* L, ElunaQuery* result)
{
uint32 col = Eluna::CHECKVAL<uint32>(E->L, 2);
CheckFields(E, result);
Eluna::Push(E->L, RESULT->Fetch()[col].GetInt16());
uint32 col = Eluna::CHECKVAL<uint32>(L, 2);
CheckFields(E, L, result);
Eluna::Push(L, RESULT->Fetch()[col].GetInt16());
return 1;
}
int GetInt32(Eluna* E, ElunaQuery* result)
int GetInt32(Eluna* E, lua_State* L, ElunaQuery* result)
{
uint32 col = Eluna::CHECKVAL<uint32>(E->L, 2);
CheckFields(E, result);
Eluna::Push(E->L, RESULT->Fetch()[col].GetInt32());
uint32 col = Eluna::CHECKVAL<uint32>(L, 2);
CheckFields(E, L, result);
Eluna::Push(L, RESULT->Fetch()[col].GetInt32());
return 1;
}
int GetInt64(Eluna* E, ElunaQuery* result)
int GetInt64(Eluna* E, lua_State* L, ElunaQuery* result)
{
uint32 col = Eluna::CHECKVAL<uint32>(E->L, 2);
CheckFields(E, result);
Eluna::Push(E->L, RESULT->Fetch()[col].GetInt64());
uint32 col = Eluna::CHECKVAL<uint32>(L, 2);
CheckFields(E, L, result);
Eluna::Push(L, RESULT->Fetch()[col].GetInt64());
return 1;
}
int GetFloat(Eluna* E, ElunaQuery* result)
int GetFloat(Eluna* E, lua_State* L, ElunaQuery* result)
{
uint32 col = Eluna::CHECKVAL<uint32>(E->L, 2);
CheckFields(E, result);
Eluna::Push(E->L, RESULT->Fetch()[col].GetFloat());
uint32 col = Eluna::CHECKVAL<uint32>(L, 2);
CheckFields(E, L, result);
Eluna::Push(L, RESULT->Fetch()[col].GetFloat());
return 1;
}
int GetDouble(Eluna* E, ElunaQuery* result)
int GetDouble(Eluna* E, lua_State* L, ElunaQuery* result)
{
uint32 col = Eluna::CHECKVAL<uint32>(E->L, 2);
CheckFields(E, result);
Eluna::Push(E->L, RESULT->Fetch()[col].GetDouble());
uint32 col = Eluna::CHECKVAL<uint32>(L, 2);
CheckFields(E, L, result);
Eluna::Push(L, RESULT->Fetch()[col].GetDouble());
return 1;
}
int GetString(Eluna* E, ElunaQuery* result)
int GetString(Eluna* E, lua_State* L, ElunaQuery* result)
{
uint32 col = Eluna::CHECKVAL<uint32>(E->L, 2);
CheckFields(E, result);
uint32 col = Eluna::CHECKVAL<uint32>(L, 2);
CheckFields(E, L, result);
#ifndef TRINITY
Eluna::Push(E->L, RESULT->Fetch()[col].GetCppString());
Eluna::Push(L, RESULT->Fetch()[col].GetCppString());
#else
Eluna::Push(E->L, RESULT->Fetch()[col].GetString());
Eluna::Push(L, RESULT->Fetch()[col].GetString());
#endif
return 1;
}
int GetCString(Eluna* E, ElunaQuery* result)
int GetCString(Eluna* E, lua_State* L, ElunaQuery* result)
{
uint32 col = Eluna::CHECKVAL<uint32>(E->L, 2);
CheckFields(E, result);
uint32 col = Eluna::CHECKVAL<uint32>(L, 2);
CheckFields(E, L, result);
#ifndef TRINITY
Eluna::Push(E->L, RESULT->Fetch()[col].GetString());
Eluna::Push(L, RESULT->Fetch()[col].GetString());
#else
Eluna::Push(E->L, RESULT->Fetch()[col].GetCString());
Eluna::Push(L, RESULT->Fetch()[col].GetCString());
#endif
return 1;
}
@@ -172,9 +172,9 @@ namespace LuaQuery
*
* @return bool hadNextRow
*/
int NextRow(Eluna* E, ElunaQuery* result)
int NextRow(Eluna* /*E*/, lua_State* L, ElunaQuery* result)
{
Eluna::Push(E->L, RESULT->NextRow());
Eluna::Push(L, RESULT->NextRow());
return 1;
}
@@ -186,10 +186,10 @@ namespace LuaQuery
*
* @return table rowData : table filled with row columns and data where `T[column] = data`
*/
int GetRow(Eluna* E, ElunaQuery* result)
int GetRow(Eluna* /*E*/, lua_State* L, ElunaQuery* result)
{
lua_newtable(E->L);
int tbl = lua_gettop(E->L);
lua_newtable(L);
int tbl = lua_gettop(L);
uint32 col = RESULT->GetFieldCount();
Field* row = RESULT->Fetch();
@@ -201,17 +201,17 @@ namespace LuaQuery
for (uint32 i = 0; i < col; ++i)
{
#ifdef TRINITY
Eluna::Push(E->L, RESULT->GetFieldName(i));
Eluna::Push(L, RESULT->GetFieldName(i));
const char* str = row[i].GetCString();
if (row[i].IsNull() || !str)
Eluna::Push(E->L);
Eluna::Push(L);
#else
Eluna::Push(E->L, names[i]);
Eluna::Push(L, names[i]);
const char* str = row[i].GetString();
if (row[i].IsNULL() || !str)
Eluna::Push(E->L);
Eluna::Push(L);
#endif
else
{
@@ -224,18 +224,18 @@ namespace LuaQuery
case MYSQL_TYPE_LONG:
case MYSQL_TYPE_FLOAT:
case MYSQL_TYPE_DOUBLE:
Eluna::Push(E->L, strtod(str, NULL));
Eluna::Push(L, strtod(str, NULL));
break;
default:
Eluna::Push(E->L, str);
Eluna::Push(L, str);
break;
}
}
lua_settable(E->L, tbl);
lua_settable(L, tbl);
}
lua_settop(E->L, tbl);
lua_settop(L, tbl);
return 1;
}
};

View File

@@ -22,7 +22,7 @@ public:
struct ElunaRegister
{
const char* name;
int(*mfunc)(Eluna*);
int(*mfunc)(Eluna*, lua_State*);
};
static int thunk(lua_State* L)
@@ -30,7 +30,7 @@ public:
ElunaRegister* l = static_cast<ElunaRegister*>(lua_touserdata(L, lua_upvalueindex(1)));
Eluna* E = static_cast<Eluna*>(lua_touserdata(L, lua_upvalueindex(2)));
int args = lua_gettop(L);
int expected = l->mfunc(E);
int expected = l->mfunc(E, L);
args = lua_gettop(L) - args;
if (args < 0 || args > expected) // Assert instead?
{
@@ -105,7 +105,7 @@ template<typename T>
struct ElunaRegister
{
const char* name;
int(*mfunc)(Eluna*, T*);
int(*mfunc)(Eluna*, lua_State*, T*);
};
template<typename T>
@@ -336,7 +336,7 @@ public:
ElunaRegister<T>* l = static_cast<ElunaRegister<T>*>(lua_touserdata(L, lua_upvalueindex(1)));
Eluna* E = static_cast<Eluna*>(lua_touserdata(L, lua_upvalueindex(2)));
int top = lua_gettop(L);
int expected = l->mfunc(E, obj);
int expected = l->mfunc(E, L, obj);
int args = lua_gettop(L) - top;
if (args < 0 || args > expected) // Assert instead?
{

View File

@@ -15,14 +15,14 @@ namespace LuaGameObject
* @param uint32 questId : quest entry Id to check
* @return bool hasQuest
*/
int HasQuest(Eluna* E, GameObject* go)
int HasQuest(Eluna* /*E*/, lua_State* L, GameObject* go)
{
uint32 questId = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 questId = Eluna::CHECKVAL<uint32>(L, 2);
#ifndef TRINITY
Eluna::Push(E->L, go->HasQuest(questId));
Eluna::Push(L, go->HasQuest(questId));
#else
Eluna::Push(E->L, go->hasQuest(questId));
Eluna::Push(L, go->hasQuest(questId));
#endif
return 1;
}
@@ -32,9 +32,9 @@ namespace LuaGameObject
*
* @return bool isSpawned
*/
int IsSpawned(Eluna* E, GameObject* go)
int IsSpawned(Eluna* /*E*/, lua_State* L, GameObject* go)
{
Eluna::Push(E->L, go->isSpawned());
Eluna::Push(L, go->isSpawned());
return 1;
}
@@ -43,9 +43,9 @@ namespace LuaGameObject
*
* @return bool isTransport
*/
int IsTransport(Eluna* E, GameObject* go)
int IsTransport(Eluna* /*E*/, lua_State* L, GameObject* go)
{
Eluna::Push(E->L, go->IsTransport());
Eluna::Push(L, go->IsTransport());
return 1;
}
@@ -54,15 +54,15 @@ namespace LuaGameObject
*
* @return bool isActive
*/
int IsActive(Eluna* E, GameObject* go)
int IsActive(Eluna* /*E*/, lua_State* L, GameObject* go)
{
Eluna::Push(E->L, go->isActiveObject());
Eluna::Push(L, go->isActiveObject());
return 1;
}
/*int IsDestructible(Eluna* E, GameObject* go) // TODO: Implementation core side
/*int IsDestructible(Eluna* E, lua_State* L, GameObject* go) // TODO: Implementation core side
{
Eluna::Push(E->L, go->IsDestructibleBuilding());
Eluna::Push(L, go->IsDestructibleBuilding());
return 1;
}*/
@@ -71,9 +71,9 @@ namespace LuaGameObject
*
* @return uint32 displayId
*/
int GetDisplayId(Eluna* E, GameObject* go)
int GetDisplayId(Eluna* /*E*/, lua_State* L, GameObject* go)
{
Eluna::Push(E->L, go->GetDisplayId());
Eluna::Push(L, go->GetDisplayId());
return 1;
}
@@ -92,9 +92,9 @@ namespace LuaGameObject
*
* @return [GOState] goState
*/
int GetGoState(Eluna* E, GameObject* go)
int GetGoState(Eluna* /*E*/, lua_State* L, GameObject* go)
{
Eluna::Push(E->L, go->GetGoState());
Eluna::Push(L, go->GetGoState());
return 1;
}
@@ -114,9 +114,9 @@ namespace LuaGameObject
*
* @return [LootState] lootState
*/
int GetLootState(Eluna* E, GameObject* go)
int GetLootState(Eluna* /*E*/, lua_State* L, GameObject* go)
{
Eluna::Push(E->L, go->getLootState());
Eluna::Push(L, go->getLootState());
return 1;
}
@@ -134,9 +134,9 @@ namespace LuaGameObject
*
* @param [GOState] state : all available go states can be seen above
*/
int SetGoState(Eluna* E, GameObject* go)
int SetGoState(Eluna* /*E*/, lua_State* L, GameObject* go)
{
uint32 state = Eluna::CHECKVAL<uint32>(E->L, 2, 0);
uint32 state = Eluna::CHECKVAL<uint32>(L, 2, 0);
if (state == 0)
go->SetGoState(GO_STATE_ACTIVE);
@@ -164,9 +164,9 @@ namespace LuaGameObject
*
* @param [LootState] state : all available loot states can be seen above
*/
int SetLootState(Eluna* E, GameObject* go)
int SetLootState(Eluna* /*E*/, lua_State* L, GameObject* go)
{
uint32 state = Eluna::CHECKVAL<uint32>(E->L, 2, 0);
uint32 state = Eluna::CHECKVAL<uint32>(L, 2, 0);
if (state == 0)
go->SetLootState(GO_NOT_READY);
@@ -184,7 +184,7 @@ namespace LuaGameObject
* Saves [GameObject] to the database
*
*/
int SaveToDB(Eluna* /*E*/, GameObject* go)
int SaveToDB(Eluna* /*E*/, lua_State* /*L*/, GameObject* go)
{
go->SaveToDB();
return 0;
@@ -195,9 +195,9 @@ namespace LuaGameObject
*
* @param bool deleteFromDB : if true, it will delete the [GameObject] from the database
*/
int RemoveFromWorld(Eluna* E, GameObject* go)
int RemoveFromWorld(Eluna* /*E*/, lua_State* L, GameObject* go)
{
bool deldb = Eluna::CHECKVAL<bool>(E->L, 2, false);
bool deldb = Eluna::CHECKVAL<bool>(L, 2, false);
if (deldb)
go->DeleteFromDB();
go->RemoveFromWorld();
@@ -209,9 +209,9 @@ namespace LuaGameObject
*
* @param uint32 delay : cooldown time in seconds to restore the [GameObject] back to normal
*/
int UseDoorOrButton(Eluna* E, GameObject* go)
int UseDoorOrButton(Eluna* /*E*/, lua_State* L, GameObject* go)
{
uint32 delay = Eluna::CHECKVAL<uint32>(E->L, 2, 0);
uint32 delay = Eluna::CHECKVAL<uint32>(L, 2, 0);
go->UseDoorOrButton(delay);
return 0;
@@ -222,9 +222,9 @@ namespace LuaGameObject
*
* @param uint32 delay : time in seconds to despawn
*/
int Despawn(Eluna* E, GameObject* go)
int Despawn(Eluna* /*E*/, lua_State* L, GameObject* go)
{
uint32 delay = Eluna::CHECKVAL<uint32>(E->L, 2, 1);
uint32 delay = Eluna::CHECKVAL<uint32>(L, 2, 1);
if (!delay)
delay = 1;
@@ -238,9 +238,9 @@ namespace LuaGameObject
*
* @param uint32 delay : time of respawn in seconds
*/
int Respawn(Eluna* E, GameObject* go)
int Respawn(Eluna* /*E*/, lua_State* L, GameObject* go)
{
uint32 delay = Eluna::CHECKVAL<uint32>(E->L, 2, 1);
uint32 delay = Eluna::CHECKVAL<uint32>(L, 2, 1);
if (!delay)
delay = 1;

File diff suppressed because it is too large Load Diff

View File

@@ -15,10 +15,10 @@ namespace LuaGroup
* @param uint64 guid : guid of a possible leader
* @return bool isLeader
*/
int IsLeader(Eluna* E, Group* group)
int IsLeader(Eluna* /*E*/, lua_State* L, Group* group)
{
uint64 guid = Eluna::CHECKVAL<uint64>(E->L, 2);
Eluna::Push(E->L, group->IsLeader(ObjectGuid(guid)));
uint64 guid = Eluna::CHECKVAL<uint64>(L, 2);
Eluna::Push(L, group->IsLeader(ObjectGuid(guid)));
return 1;
}
@@ -27,9 +27,9 @@ namespace LuaGroup
*
* @return bool isFull
*/
int IsFull(Eluna* E, Group* group)
int IsFull(Eluna* /*E*/, lua_State* L, Group* group)
{
Eluna::Push(E->L, group->IsFull());
Eluna::Push(L, group->IsFull());
return 1;
}
@@ -38,9 +38,9 @@ namespace LuaGroup
*
* @return bool isRaid
*/
int IsRaidGroup(Eluna* E, Group* group)
int IsRaidGroup(Eluna* /*E*/, lua_State* L, Group* group)
{
Eluna::Push(E->L, group->isRaidGroup());
Eluna::Push(L, group->isRaidGroup());
return 1;
}
@@ -49,9 +49,9 @@ namespace LuaGroup
*
* @return bool isBG
*/
int IsBGGroup(Eluna* E, Group* group)
int IsBGGroup(Eluna* /*E*/, lua_State* L, Group* group)
{
Eluna::Push(E->L, group->isBGGroup());
Eluna::Push(L, group->isBGGroup());
return 1;
}
@@ -61,10 +61,10 @@ namespace LuaGroup
* @param [Player] player : [Player] to check
* @return bool isMember
*/
int IsMember(Eluna* E, Group* group)
int IsMember(Eluna* /*E*/, lua_State* L, Group* group)
{
Player* player = Eluna::CHECKOBJ<Player>(E->L, 2);
Eluna::Push(E->L, group->IsMember(player->GET_GUID()));
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
Eluna::Push(L, group->IsMember(player->GET_GUID()));
return 1;
}
@@ -74,11 +74,11 @@ namespace LuaGroup
* @param [Player] player : [Player] to check
* @return bool isAssistant
*/
int IsAssistant(Eluna* E, Group* group)
int IsAssistant(Eluna* /*E*/, lua_State* L, Group* group)
{
Player* player = Eluna::CHECKOBJ<Player>(E->L, 2);
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
Eluna::Push(E->L, group->IsAssistant(player->GET_GUID()));
Eluna::Push(L, group->IsAssistant(player->GET_GUID()));
return 1;
}
@@ -89,11 +89,11 @@ namespace LuaGroup
* @param [Player] player2 : second [Player] to check
* @return bool sameSubGroup
*/
int SameSubGroup(Eluna* E, Group* group)
int SameSubGroup(Eluna* /*E*/, lua_State* L, Group* group)
{
Player* player1 = Eluna::CHECKOBJ<Player>(E->L, 2);
Player* player2 = Eluna::CHECKOBJ<Player>(E->L, 3);
Eluna::Push(E->L, group->SameSubGroup(player1, player2));
Player* player1 = Eluna::CHECKOBJ<Player>(L, 2);
Player* player2 = Eluna::CHECKOBJ<Player>(L, 3);
Eluna::Push(L, group->SameSubGroup(player1, player2));
return 1;
}
@@ -103,10 +103,10 @@ namespace LuaGroup
* @param uint8 subGroup : subGroup ID to check
* @return bool hasFreeSlot
*/
int HasFreeSlotSubGroup(Eluna* E, Group* group)
int HasFreeSlotSubGroup(Eluna* /*E*/, lua_State* L, Group* group)
{
uint8 subGroup = Eluna::CHECKVAL<uint8>(E->L, 2);
Eluna::Push(E->L, group->HasFreeSlotSubGroup(subGroup));
uint8 subGroup = Eluna::CHECKVAL<uint8>(L, 2);
Eluna::Push(L, group->HasFreeSlotSubGroup(subGroup));
return 1;
}
@@ -116,23 +116,23 @@ namespace LuaGroup
* @param [Player] player : [Player] to invite
* @return bool invited
*/
int AddInvite(Eluna* E, Group* group)
int AddInvite(Eluna* /*E*/, lua_State* L, Group* group)
{
Player* player = Eluna::CHECKOBJ<Player>(E->L, 2);
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
Eluna::Push(E->L, group->AddInvite(player));
Eluna::Push(L, group->AddInvite(player));
return 1;
}
/*int IsLFGGroup(Eluna* E, Group* group) // TODO: Implementation
/*int IsLFGGroup(Eluna* E, lua_State* L, Group* group) // TODO: Implementation
{
Eluna::Push(E->L, group->isLFGGroup());
Eluna::Push(L, group->isLFGGroup());
return 1;
}*/
/*int IsBFGroup(Eluna* E, Group* group) // TODO: Implementation
/*int IsBFGroup(Eluna* E, lua_State* L, Group* group) // TODO: Implementation
{
Eluna::Push(E->L, group->isBFGroup());
Eluna::Push(L, group->isBFGroup());
return 1;
}*/
@@ -141,10 +141,10 @@ namespace LuaGroup
*
* @return table groupPlayers : table of [Player]s
*/
int GetMembers(Eluna* E, Group* group)
int GetMembers(Eluna* /*E*/, lua_State* L, Group* group)
{
lua_newtable(E->L);
int tbl = lua_gettop(E->L);
lua_newtable(L);
int tbl = lua_gettop(L);
uint32 i = 0;
for (GroupReference* itr = group->GetFirstMember(); itr; itr = itr->next())
@@ -159,12 +159,12 @@ namespace LuaGroup
continue;
++i;
Eluna::Push(E->L, i);
Eluna::Push(E->L, member);
lua_settable(E->L, tbl);
Eluna::Push(L, i);
Eluna::Push(L, member);
lua_settable(L, tbl);
}
lua_settop(E->L, tbl); // push table to top of stack
lua_settop(L, tbl); // push table to top of stack
return 1;
}
@@ -173,12 +173,12 @@ namespace LuaGroup
*
* @return uint64 leaderGUID
*/
int GetLeaderGUID(Eluna* E, Group* group)
int GetLeaderGUID(Eluna* /*E*/, lua_State* L, Group* group)
{
#ifndef TRINITY
Eluna::Push(E->L, group->GetLeaderGuid());
Eluna::Push(L, group->GetLeaderGuid());
#else
Eluna::Push(E->L, group->GetLeaderGUID());
Eluna::Push(L, group->GetLeaderGUID());
#endif
return 1;
}
@@ -188,12 +188,12 @@ namespace LuaGroup
*
* @return [Player] leader
*/
int GetLeader(Eluna* E, Group* group)
int GetLeader(Eluna* /*E*/, lua_State* L, Group* group)
{
#ifndef TRINITY
Eluna::Push(E->L, eObjectAccessor->FindPlayer(group->GetLeaderGuid()));
Eluna::Push(L, eObjectAccessor->FindPlayer(group->GetLeaderGuid()));
#else
Eluna::Push(E->L, eObjectAccessor->FindPlayer(group->GetLeaderGUID()));
Eluna::Push(L, eObjectAccessor->FindPlayer(group->GetLeaderGUID()));
#endif
return 1;
}
@@ -203,12 +203,12 @@ namespace LuaGroup
*
* @return uint64 groupGUID
*/
int GetGUID(Eluna* E, Group* group)
int GetGUID(Eluna* /*E*/, lua_State* L, Group* group)
{
#ifdef CLASSIC
Eluna::Push(E->L, group->GetId());
Eluna::Push(L, group->GetId());
#else
Eluna::Push(E->L, group->GET_GUID());
Eluna::Push(L, group->GET_GUID());
#endif
return 1;
}
@@ -219,13 +219,13 @@ namespace LuaGroup
* @param string name : the [Player]'s name
* @return uint64 memberGUID
*/
int GetMemberGUID(Eluna* E, Group* group)
int GetMemberGUID(Eluna* /*E*/, lua_State* L, Group* group)
{
const char* name = Eluna::CHECKVAL<const char*>(E->L, 2);
const char* name = Eluna::CHECKVAL<const char*>(L, 2);
#ifndef TRINITY
Eluna::Push(E->L, group->GetMemberGuid(name));
Eluna::Push(L, group->GetMemberGuid(name));
#else
Eluna::Push(E->L, group->GetMemberGUID(name));
Eluna::Push(L, group->GetMemberGUID(name));
#endif
return 1;
}
@@ -235,9 +235,9 @@ namespace LuaGroup
*
* @return uint32 memberCount
*/
int GetMembersCount(Eluna* E, Group* group)
int GetMembersCount(Eluna* /*E*/, lua_State* L, Group* group)
{
Eluna::Push(E->L, group->GetMembersCount());
Eluna::Push(L, group->GetMembersCount());
return 1;
}
@@ -247,11 +247,11 @@ namespace LuaGroup
* @param [Player] player : the [Player] to check
* @return uint8 subGroupID
*/
int GetMemberGroup(Eluna* E, Group* group)
int GetMemberGroup(Eluna* /*E*/, lua_State* L, Group* group)
{
Player* player = Eluna::CHECKOBJ<Player>(E->L, 2);
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
Eluna::Push(E->L, group->GetMemberGroup(player->GET_GUID()));
Eluna::Push(L, group->GetMemberGroup(player->GET_GUID()));
return 1;
}
@@ -260,9 +260,9 @@ namespace LuaGroup
*
* @param [Player] leader : the [Player] leader to change
*/
int SetLeader(Eluna* E, Group* group)
int SetLeader(Eluna* /*E*/, lua_State* L, Group* group)
{
Player* leader = Eluna::CHECKOBJ<Player>(E->L, 2);
Player* leader = Eluna::CHECKOBJ<Player>(L, 2);
group->ChangeLeader(leader->GET_GUID());
return 0;
@@ -275,11 +275,11 @@ namespace LuaGroup
* @param bool ignorePlayersInBg : ignores [Player]s in a battleground
* @param uint64 ignore : ignore a [Player] by their GUID
*/
int SendPacket(Eluna* E, Group* group)
int SendPacket(Eluna* /*E*/, lua_State* L, Group* group)
{
WorldPacket* data = Eluna::CHECKOBJ<WorldPacket>(E->L, 2);
bool ignorePlayersInBg = Eluna::CHECKVAL<bool>(E->L, 3);
uint64 ignore = Eluna::CHECKVAL<uint64>(E->L, 4);
WorldPacket* data = Eluna::CHECKOBJ<WorldPacket>(L, 2);
bool ignorePlayersInBg = Eluna::CHECKVAL<bool>(L, 3);
uint64 ignore = Eluna::CHECKVAL<uint64>(L, 4);
group->BroadcastPacket(data, ignorePlayersInBg, -1, ObjectGuid(ignore));
return 0;
@@ -302,15 +302,15 @@ namespace LuaGroup
* @param [RemoveMethod] method : method used to remove the player
* @return bool removed
*/
int RemoveMember(Eluna* E, Group* group)
int RemoveMember(Eluna* /*E*/, lua_State* L, Group* group)
{
Player* player = Eluna::CHECKOBJ<Player>(E->L, 2);
uint32 method = Eluna::CHECKVAL<uint32>(E->L, 3, 0);
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
uint32 method = Eluna::CHECKVAL<uint32>(L, 3, 0);
#ifndef TRINITY
Eluna::Push(E->L, group->RemoveMember(player->GET_GUID(), method));
Eluna::Push(L, group->RemoveMember(player->GET_GUID(), method));
#else
Eluna::Push(E->L, group->RemoveMember(player->GET_GUID(), (RemoveMethod)method));
Eluna::Push(L, group->RemoveMember(player->GET_GUID(), (RemoveMethod)method));
#endif
return 1;
}
@@ -319,7 +319,7 @@ namespace LuaGroup
* Disbands this [Group]
*
*/
int Disband(Eluna* /*E*/, Group* group)
int Disband(Eluna* /*E*/, lua_State* /*L*/, Group* group)
{
group->Disband();
return 0;
@@ -329,7 +329,7 @@ namespace LuaGroup
* Converts this [Group] to a raid [Group]
*
*/
int ConvertToRaid(Eluna* /*E*/, Group* group)
int ConvertToRaid(Eluna* /*E*/, lua_State* /*L*/, Group* group)
{
group->ConvertToRaid();
return 0;
@@ -341,10 +341,10 @@ namespace LuaGroup
* @param [Player] player : [Player] to move
* @param uint8 groupID : the subGroup's ID
*/
int SetMembersGroup(Eluna* E, Group* group)
int SetMembersGroup(Eluna* /*E*/, lua_State* L, Group* group)
{
Player* player = Eluna::CHECKOBJ<Player>(E->L, 2);
uint8 groupID = Eluna::CHECKVAL<uint8>(E->L, 3);
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
uint8 groupID = Eluna::CHECKVAL<uint8>(L, 3);
group->ChangeMembersGroup(player->GET_GUID(), groupID);
return 0;
@@ -357,14 +357,14 @@ 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, Group* group)
int SetTargetIcon(Eluna* /*E*/, lua_State* L, Group* group)
{
uint8 icon = Eluna::CHECKVAL<uint8>(E->L, 2);
uint64 target = Eluna::CHECKVAL<uint64>(E->L, 3);
uint64 setter = Eluna::CHECKVAL<uint64>(E->L, 4, 0);
uint8 icon = Eluna::CHECKVAL<uint8>(L, 2);
uint64 target = Eluna::CHECKVAL<uint64>(L, 3);
uint64 setter = Eluna::CHECKVAL<uint64>(L, 4, 0);
if (icon >= TARGETICONCOUNT)
return luaL_argerror(E->L, 2, "valid target icon expected");
return luaL_argerror(L, 2, "valid target icon expected");
#if (defined(CLASSIC) || defined(TBC))
group->SetTargetIcon(icon, ObjectGuid(target));
@@ -374,7 +374,7 @@ namespace LuaGroup
return 0;
}
/*int ConvertToLFG(Eluna* E, Group* group) // TODO: Implementation
/*int ConvertToLFG(Eluna* E, lua_State* L, Group* group) // TODO: Implementation
{
group->ConvertToLFG();
return 0;

View File

@@ -10,10 +10,10 @@
namespace LuaGuild
{
/* GETTERS */
int GetMembers(Eluna* E, Guild* guild)
int GetMembers(Eluna* /*E*/, lua_State* L, Guild* guild)
{
lua_newtable(E->L);
int tbl = lua_gettop(E->L);
lua_newtable(L);
int tbl = lua_gettop(L);
uint32 i = 0;
SessionMap const& sessions = eWorld->GetAllSessions();
@@ -24,76 +24,76 @@ namespace LuaGuild
if (player->GetSession() && (player->GetGuildId() == guild->GetId()))
{
++i;
Eluna::Push(E->L, i);
Eluna::Push(E->L, player);
lua_settable(E->L, tbl);
Eluna::Push(L, i);
Eluna::Push(L, player);
lua_settable(L, tbl);
}
}
}
lua_settop(E->L, tbl); // push table to top of stack
lua_settop(L, tbl); // push table to top of stack
return 1;
}
int GetMemberCount(Eluna* E, Guild* guild)
int GetMemberCount(Eluna* /*E*/, lua_State* L, Guild* guild)
{
Eluna::Push(E->L, guild->GetMemberSize());
Eluna::Push(L, guild->GetMemberSize());
return 1;
}
int GetLeader(Eluna* E, Guild* guild)
int GetLeader(Eluna* /*E*/, lua_State* L, Guild* guild)
{
#ifndef TRINITY
Eluna::Push(E->L, eObjectAccessor->FindPlayer(guild->GetLeaderGuid()));
Eluna::Push(L, eObjectAccessor->FindPlayer(guild->GetLeaderGuid()));
#else
Eluna::Push(E->L, eObjectAccessor->FindPlayer(guild->GetLeaderGUID()));
Eluna::Push(L, eObjectAccessor->FindPlayer(guild->GetLeaderGUID()));
#endif
return 1;
}
int GetLeaderGUID(Eluna* E, Guild* guild)
int GetLeaderGUID(Eluna* /*E*/, lua_State* L, Guild* guild)
{
#ifndef TRINITY
Eluna::Push(E->L, guild->GetLeaderGuid());
Eluna::Push(L, guild->GetLeaderGuid());
#else
Eluna::Push(E->L, guild->GetLeaderGUID());
Eluna::Push(L, guild->GetLeaderGUID());
#endif
return 1;
}
int GetId(Eluna* E, Guild* guild)
int GetId(Eluna* /*E*/, lua_State* L, Guild* guild)
{
Eluna::Push(E->L, guild->GetId());
Eluna::Push(L, guild->GetId());
return 1;
}
int GetName(Eluna* E, Guild* guild)
int GetName(Eluna* /*E*/, lua_State* L, Guild* guild)
{
Eluna::Push(E->L, guild->GetName());
Eluna::Push(L, guild->GetName());
return 1;
}
int GetMOTD(Eluna* E, Guild* guild)
int GetMOTD(Eluna* /*E*/, lua_State* L, Guild* guild)
{
Eluna::Push(E->L, guild->GetMOTD());
Eluna::Push(L, guild->GetMOTD());
return 1;
}
int GetInfo(Eluna* E, Guild* guild)
int GetInfo(Eluna* /*E*/, lua_State* L, Guild* guild)
{
#ifndef TRINITY
Eluna::Push(E->L, guild->GetGINFO());
Eluna::Push(L, guild->GetGINFO());
#else
Eluna::Push(E->L, guild->GetInfo());
Eluna::Push(L, guild->GetInfo());
#endif
return 1;
}
/* SETTERS */
#ifndef CATA
int SetLeader(Eluna* E, Guild* guild)
int SetLeader(Eluna* /*E*/, lua_State* L, Guild* guild)
{
Player* player = Eluna::CHECKOBJ<Player>(E->L, 2);
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
#ifndef TRINITY
guild->SetLeader(player->GET_GUID());
@@ -105,10 +105,10 @@ namespace LuaGuild
#endif
#ifndef CLASSIC
int SetBankTabText(Eluna* E, Guild* guild)
int SetBankTabText(Eluna* /*E*/, lua_State* L, Guild* guild)
{
uint8 tabId = Eluna::CHECKVAL<uint8>(E->L, 2);
const char* text = Eluna::CHECKVAL<const char*>(E->L, 3);
uint8 tabId = Eluna::CHECKVAL<uint8>(L, 2);
const char* text = Eluna::CHECKVAL<const char*>(L, 3);
#ifndef TRINITY
guild->SetGuildBankTabText(tabId, text);
#else
@@ -120,43 +120,43 @@ namespace LuaGuild
/* OTHER */
// SendPacketToGuild(packet)
int SendPacket(Eluna* E, Guild* guild)
int SendPacket(Eluna* /*E*/, lua_State* L, Guild* guild)
{
WorldPacket* data = Eluna::CHECKOBJ<WorldPacket>(E->L, 2);
WorldPacket* data = Eluna::CHECKOBJ<WorldPacket>(L, 2);
guild->BroadcastPacket(data);
return 0;
}
// SendPacketToRankedInGuild(packet, rankId)
int SendPacketToRanked(Eluna* E, Guild* guild)
int SendPacketToRanked(Eluna* /*E*/, lua_State* L, Guild* guild)
{
WorldPacket* data = Eluna::CHECKOBJ<WorldPacket>(E->L, 2);
uint8 ranked = Eluna::CHECKVAL<uint8>(E->L, 3);
WorldPacket* data = Eluna::CHECKOBJ<WorldPacket>(L, 2);
uint8 ranked = Eluna::CHECKVAL<uint8>(L, 3);
guild->BroadcastPacketToRank(data, ranked);
return 0;
}
int Disband(Eluna* /*E*/, Guild* guild)
int Disband(Eluna* /*E*/, lua_State* /*L*/, Guild* guild)
{
guild->Disband();
return 0;
}
int AddMember(Eluna* E, Guild* guild)
int AddMember(Eluna* /*E*/, lua_State* L, Guild* guild)
{
Player* player = Eluna::CHECKOBJ<Player>(E->L, 2);
uint8 rankId = Eluna::CHECKVAL<uint8>(E->L, 3, GUILD_RANK_NONE);
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
uint8 rankId = Eluna::CHECKVAL<uint8>(L, 3, GUILD_RANK_NONE);
guild->AddMember(player->GET_GUID(), rankId);
return 0;
}
int DeleteMember(Eluna* E, Guild* guild)
int DeleteMember(Eluna* /*E*/, lua_State* L, Guild* guild)
{
Player* player = Eluna::CHECKOBJ<Player>(E->L, 2);
bool isDisbanding = Eluna::CHECKVAL<bool>(E->L, 3, false);
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
bool isDisbanding = Eluna::CHECKVAL<bool>(L, 3, false);
#ifndef TRINITY
guild->DelMember(player->GET_GUID(), isDisbanding);
@@ -166,10 +166,10 @@ namespace LuaGuild
return 0;
}
int SetMemberRank(Eluna* E, Guild* guild)
int SetMemberRank(Eluna* /*E*/, lua_State* L, Guild* guild)
{
Player* player = Eluna::CHECKOBJ<Player>(E->L, 2);
uint8 newRank = Eluna::CHECKVAL<uint8>(E->L, 3);
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
uint8 newRank = Eluna::CHECKVAL<uint8>(L, 3);
guild->ChangeMemberRank(player->GET_GUID(), newRank);
return 0;
@@ -177,10 +177,10 @@ namespace LuaGuild
#ifndef CLASSIC
// Move to Player methods
int WithdrawBankMoney(Eluna* E, Guild* guild)
int WithdrawBankMoney(Eluna* /*E*/, lua_State* L, Guild* guild)
{
Player* player = Eluna::CHECKOBJ<Player>(E->L, 2);
uint32 money = Eluna::CHECKVAL<uint32>(E->L, 3);
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
uint32 money = Eluna::CHECKVAL<uint32>(L, 3);
#ifndef TRINITY
if (guild->GetGuildBankMoney() < money)
return 0;
@@ -192,10 +192,10 @@ namespace LuaGuild
}
// Move to Player methods
int DepositBankMoney(Eluna* E, Guild* guild)
int DepositBankMoney(Eluna* /*E*/, lua_State* L, Guild* guild)
{
Player* player = Eluna::CHECKOBJ<Player>(E->L, 2);
uint32 money = Eluna::CHECKVAL<uint32>(E->L, 3);
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
uint32 money = Eluna::CHECKVAL<uint32>(L, 3);
#ifndef TRINITY
guild->SetBankMoney(guild->GetGuildBankMoney() + money);

View File

@@ -10,136 +10,136 @@
namespace LuaItem
{
/* BOOLEAN */
int IsSoulBound(Eluna* E, Item* item)
int IsSoulBound(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->IsSoulBound());
Eluna::Push(L, item->IsSoulBound());
return 1;
}
#if (!defined(TBC) && !defined(CLASSIC))
int IsBoundAccountWide(Eluna* E, Item* item)
int IsBoundAccountWide(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->IsBoundAccountWide());
Eluna::Push(L, item->IsBoundAccountWide());
return 1;
}
#endif
int IsBoundByEnchant(Eluna* E, Item* item)
int IsBoundByEnchant(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->IsBoundByEnchant());
Eluna::Push(L, item->IsBoundByEnchant());
return 1;
}
int IsNotBoundToPlayer(Eluna* E, Item* item)
int IsNotBoundToPlayer(Eluna* /*E*/, lua_State* L, Item* item)
{
Player* player = Eluna::CHECKOBJ<Player>(E->L, 2);
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
Eluna::Push(E->L, item->IsBindedNotWith(player));
Eluna::Push(L, item->IsBindedNotWith(player));
return 1;
}
int IsLocked(Eluna* E, Item* item)
int IsLocked(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->IsLocked());
Eluna::Push(L, item->IsLocked());
return 1;
}
int IsBag(Eluna* E, Item* item)
int IsBag(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->IsBag());
Eluna::Push(L, item->IsBag());
return 1;
}
#ifndef CLASSIC
int IsCurrencyToken(Eluna* E, Item* item)
int IsCurrencyToken(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->IsCurrencyToken());
Eluna::Push(L, item->IsCurrencyToken());
return 1;
}
#endif
int IsNotEmptyBag(Eluna* E, Item* item)
int IsNotEmptyBag(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->IsNotEmptyBag());
Eluna::Push(L, item->IsNotEmptyBag());
return 1;
}
int IsBroken(Eluna* E, Item* item)
int IsBroken(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->IsBroken());
Eluna::Push(L, item->IsBroken());
return 1;
}
int CanBeTraded(Eluna* E, Item* item)
int CanBeTraded(Eluna* /*E*/, lua_State* L, Item* item)
{
#if (defined(TBC) || defined(CLASSIC))
Eluna::Push(E->L, item->CanBeTraded());
Eluna::Push(L, item->CanBeTraded());
#else
bool mail = Eluna::CHECKVAL<bool>(E->L, 2, false);
Eluna::Push(E->L, item->CanBeTraded(mail));
bool mail = Eluna::CHECKVAL<bool>(L, 2, false);
Eluna::Push(L, item->CanBeTraded(mail));
#endif
return 1;
}
int IsInTrade(Eluna* E, Item* item)
int IsInTrade(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->IsInTrade());
Eluna::Push(L, item->IsInTrade());
return 1;
}
int IsInBag(Eluna* E, Item* item)
int IsInBag(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->IsInBag());
Eluna::Push(L, item->IsInBag());
return 1;
}
int IsEquipped(Eluna* E, Item* item)
int IsEquipped(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->IsEquipped());
Eluna::Push(L, item->IsEquipped());
return 1;
}
int HasQuest(Eluna* E, Item* item)
int HasQuest(Eluna* /*E*/, lua_State* L, Item* item)
{
uint32 quest = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 quest = Eluna::CHECKVAL<uint32>(L, 2);
#ifndef TRINITY
Eluna::Push(E->L, item->HasQuest(quest));
Eluna::Push(L, item->HasQuest(quest));
#else
Eluna::Push(E->L, item->hasQuest(quest));
Eluna::Push(L, item->hasQuest(quest));
#endif
return 1;
}
int IsPotion(Eluna* E, Item* item)
int IsPotion(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->IsPotion());
Eluna::Push(L, item->IsPotion());
return 1;
}
#ifndef CATA
int IsWeaponVellum(Eluna* E, Item* item)
int IsWeaponVellum(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->IsWeaponVellum());
Eluna::Push(L, item->IsWeaponVellum());
return 1;
}
int IsArmorVellum(Eluna* E, Item* item)
int IsArmorVellum(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->IsArmorVellum());
Eluna::Push(L, item->IsArmorVellum());
return 1;
}
#endif
int IsConjuredConsumable(Eluna* E, Item* item)
int IsConjuredConsumable(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->IsConjuredConsumable());
Eluna::Push(L, item->IsConjuredConsumable());
return 1;
}
/*
* int IsRefundExpired(Eluna* E, Item* item)// TODO: Implement core support
* int IsRefundExpired(Eluna* E, lua_State* L, Item* item)// TODO: Implement core support
* {
* Eluna::Push(E->L, item->IsRefundExpired());
* Eluna::Push(L, item->IsRefundExpired());
* return 1;
* }
*/
@@ -167,11 +167,11 @@ namespace LuaItem
* @param [LocaleConstant] locale = DEFAULT_LOCALE : locale to return the [Item]'s name in
* @return string itemLink
*/
int GetItemLink(Eluna* E, Item* item)
int GetItemLink(Eluna* /*E*/, lua_State* L, Item* item)
{
uint8 locale = Eluna::CHECKVAL<uint8>(E->L, 2, DEFAULT_LOCALE);
uint8 locale = Eluna::CHECKVAL<uint8>(L, 2, DEFAULT_LOCALE);
if (locale >= TOTAL_LOCALES)
return luaL_argerror(E->L, 2, "valid LocaleConstant expected");
return luaL_argerror(L, 2, "valid LocaleConstant expected");
const ItemTemplate* temp = item->GetTemplate();
std::string name = temp->Name1;
@@ -223,200 +223,200 @@ namespace LuaItem
item->GetItemRandomPropertyId() << ":" << item->GetItemSuffixFactor() << ":" <<
(uint32)item->GetOwner()->getLevel() << "|h[" << name << "]|h|r";
Eluna::Push(E->L, oss.str());
Eluna::Push(L, oss.str());
return 1;
}
int GetOwnerGUID(Eluna* E, Item* item)
int GetOwnerGUID(Eluna* /*E*/, lua_State* L, Item* item)
{
#ifndef TRINITY
Eluna::Push(E->L, item->GetOwnerGuid());
Eluna::Push(L, item->GetOwnerGuid());
#else
Eluna::Push(E->L, item->GetOwnerGUID());
Eluna::Push(L, item->GetOwnerGUID());
#endif
return 1;
}
int GetOwner(Eluna* E, Item* item)
int GetOwner(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetOwner());
Eluna::Push(L, item->GetOwner());
return 1;
}
int GetCount(Eluna* E, Item* item)
int GetCount(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetCount());
Eluna::Push(L, item->GetCount());
return 1;
}
int GetMaxStackCount(Eluna* E, Item* item)
int GetMaxStackCount(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetMaxStackCount());
Eluna::Push(L, item->GetMaxStackCount());
return 1;
}
int GetSlot(Eluna* E, Item* item)
int GetSlot(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetSlot());
Eluna::Push(L, item->GetSlot());
return 1;
}
int GetBagSlot(Eluna* E, Item* item)
int GetBagSlot(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetBagSlot());
Eluna::Push(L, item->GetBagSlot());
return 1;
}
int GetEnchantmentId(Eluna* E, Item* item)
int GetEnchantmentId(Eluna* /*E*/, lua_State* L, Item* item)
{
uint32 enchant_slot = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 enchant_slot = Eluna::CHECKVAL<uint32>(L, 2);
if (enchant_slot >= MAX_INSPECTED_ENCHANTMENT_SLOT)
return luaL_argerror(E->L, 2, "valid EnchantmentSlot expected");
return luaL_argerror(L, 2, "valid EnchantmentSlot expected");
Eluna::Push(E->L, item->GetEnchantmentId(EnchantmentSlot(enchant_slot)));
Eluna::Push(L, item->GetEnchantmentId(EnchantmentSlot(enchant_slot)));
return 1;
}
int GetSpellId(Eluna* E, Item* item)
int GetSpellId(Eluna* /*E*/, lua_State* L, Item* item)
{
uint32 index = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 index = Eluna::CHECKVAL<uint32>(L, 2);
if (index >= MAX_ITEM_PROTO_SPELLS)
return luaL_argerror(E->L, 2, "valid SpellIndex expected");
return luaL_argerror(L, 2, "valid SpellIndex expected");
Eluna::Push(E->L, item->GetTemplate()->Spells[index].SpellId);
Eluna::Push(L, item->GetTemplate()->Spells[index].SpellId);
return 1;
}
int GetSpellTrigger(Eluna* E, Item* item)
int GetSpellTrigger(Eluna* /*E*/, lua_State* L, Item* item)
{
uint32 index = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 index = Eluna::CHECKVAL<uint32>(L, 2);
if (index >= MAX_ITEM_PROTO_SPELLS)
return luaL_argerror(E->L, 2, "valid SpellIndex expected");
return luaL_argerror(L, 2, "valid SpellIndex expected");
Eluna::Push(E->L, item->GetTemplate()->Spells[index].SpellTrigger);
Eluna::Push(L, item->GetTemplate()->Spells[index].SpellTrigger);
return 1;
}
int GetClass(Eluna* E, Item* item)
int GetClass(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetTemplate()->Class);
Eluna::Push(L, item->GetTemplate()->Class);
return 1;
}
int GetSubClass(Eluna* E, Item* item)
int GetSubClass(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetTemplate()->SubClass);
Eluna::Push(L, item->GetTemplate()->SubClass);
return 1;
}
int GetName(Eluna* E, Item* item)
int GetName(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetTemplate()->Name1);
Eluna::Push(L, item->GetTemplate()->Name1);
return 1;
}
int GetDisplayId(Eluna* E, Item* item)
int GetDisplayId(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetTemplate()->DisplayInfoID);
Eluna::Push(L, item->GetTemplate()->DisplayInfoID);
return 1;
}
int GetQuality(Eluna* E, Item* item)
int GetQuality(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetTemplate()->Quality);
Eluna::Push(L, item->GetTemplate()->Quality);
return 1;
}
int GetBuyCount(Eluna* E, Item* item)
int GetBuyCount(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetTemplate()->BuyCount);
Eluna::Push(L, item->GetTemplate()->BuyCount);
return 1;
}
int GetBuyPrice(Eluna* E, Item* item)
int GetBuyPrice(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetTemplate()->BuyPrice);
Eluna::Push(L, item->GetTemplate()->BuyPrice);
return 1;
}
int GetSellPrice(Eluna* E, Item* item)
int GetSellPrice(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetTemplate()->SellPrice);
Eluna::Push(L, item->GetTemplate()->SellPrice);
return 1;
}
int GetInventoryType(Eluna* E, Item* item)
int GetInventoryType(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetTemplate()->InventoryType);
Eluna::Push(L, item->GetTemplate()->InventoryType);
return 1;
}
int GetAllowableClass(Eluna* E, Item* item)
int GetAllowableClass(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetTemplate()->AllowableClass);
Eluna::Push(L, item->GetTemplate()->AllowableClass);
return 1;
}
int GetAllowableRace(Eluna* E, Item* item)
int GetAllowableRace(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetTemplate()->AllowableRace);
Eluna::Push(L, item->GetTemplate()->AllowableRace);
return 1;
}
int GetItemLevel(Eluna* E, Item* item)
int GetItemLevel(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetTemplate()->ItemLevel);
Eluna::Push(L, item->GetTemplate()->ItemLevel);
return 1;
}
int GetRequiredLevel(Eluna* E, Item* item)
int GetRequiredLevel(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetTemplate()->RequiredLevel);
Eluna::Push(L, item->GetTemplate()->RequiredLevel);
return 1;
}
#ifdef WOTLK
int GetStatsCount(Eluna* E, Item* item)
int GetStatsCount(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetTemplate()->StatsCount);
Eluna::Push(L, item->GetTemplate()->StatsCount);
return 1;
}
#endif
int GetRandomProperty(Eluna* E, Item* item)
int GetRandomProperty(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetTemplate()->RandomProperty);
Eluna::Push(L, item->GetTemplate()->RandomProperty);
return 1;
}
#ifndef CLASSIC
int GetRandomSuffix(Eluna* E, Item* item)
int GetRandomSuffix(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetTemplate()->RandomSuffix);
Eluna::Push(L, item->GetTemplate()->RandomSuffix);
return 1;
}
#endif
int GetItemSet(Eluna* E, Item* item)
int GetItemSet(Eluna* /*E*/, lua_State* L, Item* item)
{
Eluna::Push(E->L, item->GetTemplate()->ItemSet);
Eluna::Push(L, item->GetTemplate()->ItemSet);
return 1;
}
int GetBagSize(Eluna* E, Item* item)
int GetBagSize(Eluna* /*E*/, lua_State* L, Item* item)
{
if (Bag* bag = item->ToBag())
Eluna::Push(E->L, bag->GetBagSize());
Eluna::Push(L, bag->GetBagSize());
else
Eluna::Push(E->L, 0);
Eluna::Push(L, 0);
return 1;
}
/* SETTERS */
int SetOwner(Eluna* E, Item* item)
int SetOwner(Eluna* /*E*/, lua_State* L, Item* item)
{
Player* player = Eluna::CHECKOBJ<Player>(E->L, 2);
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
#ifndef TRINITY
item->SetOwnerGuid(player->GET_GUID());
#else
@@ -425,75 +425,75 @@ namespace LuaItem
return 0;
}
int SetBinding(Eluna* E, Item* item)
int SetBinding(Eluna* /*E*/, lua_State* L, Item* item)
{
bool soulbound = Eluna::CHECKVAL<bool>(E->L, 2);
bool soulbound = Eluna::CHECKVAL<bool>(L, 2);
item->SetBinding(soulbound);
return 0;
}
int SetCount(Eluna* E, Item* item)
int SetCount(Eluna* /*E*/, lua_State* L, Item* item)
{
uint32 count = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 count = Eluna::CHECKVAL<uint32>(L, 2);
item->SetCount(count);
return 0;
}
int SetEnchantment(Eluna* E, Item* item)
int SetEnchantment(Eluna* /*E*/, lua_State* L, Item* item)
{
Player* owner = item->GetOwner();
if (!owner)
{
Eluna::Push(E->L, false);
Eluna::Push(L, false);
return 1;
}
uint32 enchant = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 enchant = Eluna::CHECKVAL<uint32>(L, 2);
if (!sSpellItemEnchantmentStore.LookupEntry(enchant))
{
Eluna::Push(E->L, false);
Eluna::Push(L, false);
return 1;
}
EnchantmentSlot slot = (EnchantmentSlot)Eluna::CHECKVAL<uint32>(E->L, 3);
EnchantmentSlot slot = (EnchantmentSlot)Eluna::CHECKVAL<uint32>(L, 3);
if (slot >= MAX_INSPECTED_ENCHANTMENT_SLOT)
return luaL_argerror(E->L, 2, "valid EnchantmentSlot expected");
return luaL_argerror(L, 2, "valid EnchantmentSlot expected");
owner->ApplyEnchantment(item, slot, false);
item->SetEnchantment(slot, enchant, 0, 0);
owner->ApplyEnchantment(item, slot, true);
Eluna::Push(E->L, true);
Eluna::Push(L, true);
return 1;
}
/* OTHER */
int ClearEnchantment(Eluna* E, Item* item)
int ClearEnchantment(Eluna* /*E*/, lua_State* L, Item* item)
{
Player* owner = item->GetOwner();
if (!owner)
{
Eluna::Push(E->L, false);
Eluna::Push(L, false);
return 1;
}
EnchantmentSlot slot = (EnchantmentSlot)Eluna::CHECKVAL<uint32>(E->L, 2);
EnchantmentSlot slot = (EnchantmentSlot)Eluna::CHECKVAL<uint32>(L, 2);
if (slot >= MAX_INSPECTED_ENCHANTMENT_SLOT)
return luaL_argerror(E->L, 2, "valid EnchantmentSlot expected");
return luaL_argerror(L, 2, "valid EnchantmentSlot expected");
if (!item->GetEnchantmentId(slot))
{
Eluna::Push(E->L, false);
Eluna::Push(L, false);
return 1;
}
owner->ApplyEnchantment(item, slot, false);
item->ClearEnchantment(slot);
Eluna::Push(E->L, true);
Eluna::Push(L, true);
return 1;
}
int SaveToDB(Eluna* /*E*/, Item* item)
int SaveToDB(Eluna* /*E*/, lua_State* /*L*/, Item* item)
{
#ifndef TRINITY
item->SaveToDB();

View File

@@ -16,9 +16,9 @@ namespace LuaMap
*
* @return bool isArena
*/
int IsArena(Eluna* E, Map* map)
int IsArena(Eluna* /*E*/, lua_State* L, Map* map)
{
Eluna::Push(E->L, map->IsBattleArena());
Eluna::Push(L, map->IsBattleArena());
return 1;
}
#endif
@@ -28,12 +28,12 @@ namespace LuaMap
*
* @return bool isBattleGround
*/
int IsBattleground(Eluna* E, Map* map)
int IsBattleground(Eluna* /*E*/, lua_State* L, Map* map)
{
#ifndef TRINITY
Eluna::Push(E->L, map->IsBattleGround());
Eluna::Push(L, map->IsBattleGround());
#else
Eluna::Push(E->L, map->IsBattleground());
Eluna::Push(L, map->IsBattleground());
#endif
return 1;
}
@@ -43,9 +43,9 @@ namespace LuaMap
*
* @return bool isDungeon
*/
int IsDungeon(Eluna* E, Map* map)
int IsDungeon(Eluna* /*E*/, lua_State* L, Map* map)
{
Eluna::Push(E->L, map->IsDungeon());
Eluna::Push(L, map->IsDungeon());
return 1;
}
@@ -54,9 +54,9 @@ namespace LuaMap
*
* @return bool isEmpty
*/
int IsEmpty(Eluna* E, Map* map)
int IsEmpty(Eluna* /*E*/, lua_State* L, Map* map)
{
Eluna::Push(E->L, map->isEmpty());
Eluna::Push(L, map->isEmpty());
return 1;
}
@@ -66,9 +66,9 @@ namespace LuaMap
*
* @return bool isHeroic
*/
int IsHeroic(Eluna* E, Map* map)
int IsHeroic(Eluna* /*E*/, lua_State* L, Map* map)
{
Eluna::Push(E->L, map->IsHeroic());
Eluna::Push(L, map->IsHeroic());
return 1;
}
#endif
@@ -78,9 +78,9 @@ namespace LuaMap
*
* @return bool isRaid
*/
int IsRaid(Eluna* E, Map* map)
int IsRaid(Eluna* /*E*/, lua_State* L, Map* map)
{
Eluna::Push(E->L, map->IsRaid());
Eluna::Push(L, map->IsRaid());
return 1;
}
@@ -89,9 +89,9 @@ namespace LuaMap
*
* @return string mapName
*/
int GetName(Eluna* E, Map* map)
int GetName(Eluna* /*E*/, lua_State* L, Map* map)
{
Eluna::Push(E->L, map->GetMapName());
Eluna::Push(L, map->GetMapName());
return 1;
}
@@ -103,18 +103,18 @@ namespace LuaMap
* @param float y
* @return float z
*/
int GetHeight(Eluna* E, Map* map)
int GetHeight(Eluna* /*E*/, lua_State* L, Map* map)
{
float x = Eluna::CHECKVAL<float>(E->L, 2);
float y = Eluna::CHECKVAL<float>(E->L, 3);
float x = Eluna::CHECKVAL<float>(L, 2);
float y = Eluna::CHECKVAL<float>(L, 3);
#if (defined(TBC) || defined(CLASSIC))
float z = map->GetHeight(x, y, MAX_HEIGHT);
#else
uint32 phasemask = Eluna::CHECKVAL<uint32>(E->L, 4, 1);
uint32 phasemask = Eluna::CHECKVAL<uint32>(L, 4, 1);
float z = map->GetHeight(phasemask, x, y, MAX_HEIGHT);
#endif
if (z != INVALID_HEIGHT)
Eluna::Push(E->L, z);
Eluna::Push(L, z);
return 1;
}
@@ -123,12 +123,12 @@ namespace LuaMap
*
* @return int32 difficulty
*/
int GetDifficulty(Eluna* E, Map* map)
int GetDifficulty(Eluna* /*E*/, lua_State* L, Map* map)
{
#ifndef CLASSIC
Eluna::Push(E->L, map->GetDifficulty());
Eluna::Push(L, map->GetDifficulty());
#else
Eluna::Push(E->L, (Difficulty)0);
Eluna::Push(L, (Difficulty)0);
#endif
return 1;
}
@@ -138,9 +138,9 @@ namespace LuaMap
*
* @return uint32 instanceId
*/
int GetInstanceId(Eluna* E, Map* map)
int GetInstanceId(Eluna* /*E*/, lua_State* L, Map* map)
{
Eluna::Push(E->L, map->GetInstanceId());
Eluna::Push(L, map->GetInstanceId());
return 1;
}
@@ -150,9 +150,9 @@ namespace LuaMap
*
* @return uint32 playerCount
*/
int GetPlayerCount(Eluna* E, Map* map)
int GetPlayerCount(Eluna* /*E*/, lua_State* L, Map* map)
{
Eluna::Push(E->L, map->GetPlayersCountExceptGMs());
Eluna::Push(L, map->GetPlayersCountExceptGMs());
return 1;
}
@@ -161,9 +161,9 @@ namespace LuaMap
*
* @return uint32 mapId
*/
int GetMapId(Eluna* E, Map* map)
int GetMapId(Eluna* /*E*/, lua_State* L, Map* map)
{
Eluna::Push(E->L, map->GetId());
Eluna::Push(L, map->GetId());
return 1;
}
@@ -175,16 +175,16 @@ namespace LuaMap
* @param float z
* @return uint32 areaId
*/
int GetAreaId(Eluna* E, Map* map)
int GetAreaId(Eluna* /*E*/, lua_State* L, Map* map)
{
float x = Eluna::CHECKVAL<float>(E->L, 2);
float y = Eluna::CHECKVAL<float>(E->L, 3);
float z = Eluna::CHECKVAL<float>(E->L, 4);
float x = Eluna::CHECKVAL<float>(L, 2);
float y = Eluna::CHECKVAL<float>(L, 3);
float z = Eluna::CHECKVAL<float>(L, 4);
#ifndef TRINITY
Eluna::Push(E->L, map->GetTerrain()->GetAreaId(x, y, z));
Eluna::Push(L, map->GetTerrain()->GetAreaId(x, y, z));
#else
Eluna::Push(E->L, map->GetAreaId(x, y, z));
Eluna::Push(L, map->GetAreaId(x, y, z));
#endif
return 1;
}
@@ -194,35 +194,35 @@ namespace LuaMap
*
* @param uint64 guid
*/
int GetWorldObject(Eluna* E, Map* map)
int GetWorldObject(Eluna* /*E*/, lua_State* L, Map* map)
{
uint64 guid = Eluna::CHECKVAL<uint64>(E->L, 2);
uint64 guid = Eluna::CHECKVAL<uint64>(L, 2);
#ifndef TRINITY
Eluna::Push(E->L, map->GetWorldObject(ObjectGuid(guid)));
Eluna::Push(L, map->GetWorldObject(ObjectGuid(guid)));
#else
switch (GUID_HIPART(guid))
{
case HIGHGUID_PLAYER:
Eluna::Push(E->L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Player*)NULL));
Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Player*)NULL));
break;
case HIGHGUID_TRANSPORT:
case HIGHGUID_MO_TRANSPORT:
case HIGHGUID_GAMEOBJECT:
Eluna::Push(E->L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (GameObject*)NULL));
Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (GameObject*)NULL));
break;
case HIGHGUID_VEHICLE:
case HIGHGUID_UNIT:
Eluna::Push(E->L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Creature*)NULL));
Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Creature*)NULL));
break;
case HIGHGUID_PET:
Eluna::Push(E->L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Pet*)NULL));
Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Pet*)NULL));
break;
case HIGHGUID_DYNAMICOBJECT:
Eluna::Push(E->L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (DynamicObject*)NULL));
Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (DynamicObject*)NULL));
break;
case HIGHGUID_CORPSE:
Eluna::Push(E->L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Corpse*)NULL));
Eluna::Push(L, sObjectAccessor->GetObjectInMap(ObjectGuid(guid), map, (Corpse*)NULL));
break;
default:
break;

View File

@@ -10,219 +10,219 @@
namespace LuaObject
{
/* BOOLEAN */
int HasFlag(Eluna* E, Object* obj)
int HasFlag(Eluna* /*E*/, lua_State* L, Object* obj)
{
uint16 index = Eluna::CHECKVAL<uint16>(E->L, 2);
uint32 flag = Eluna::CHECKVAL<uint32>(E->L, 3);
uint16 index = Eluna::CHECKVAL<uint16>(L, 2);
uint32 flag = Eluna::CHECKVAL<uint32>(L, 3);
Eluna::Push(E->L, obj->HasFlag(index, flag));
Eluna::Push(L, obj->HasFlag(index, flag));
return 1;
}
int IsInWorld(Eluna* E, Object* obj)
int IsInWorld(Eluna* /*E*/, lua_State* L, Object* obj)
{
Eluna::Push(E->L, obj->IsInWorld());
Eluna::Push(L, obj->IsInWorld());
return 1;
}
/* GETTERS */
int GetInt32Value(Eluna* E, Object* obj)
int GetInt32Value(Eluna* /*E*/, lua_State* L, Object* obj)
{
uint16 index = Eluna::CHECKVAL<uint16>(E->L, 2);
Eluna::Push(E->L, obj->GetInt32Value(index));
uint16 index = Eluna::CHECKVAL<uint16>(L, 2);
Eluna::Push(L, obj->GetInt32Value(index));
return 1;
}
int GetUInt32Value(Eluna* E, Object* obj)
int GetUInt32Value(Eluna* /*E*/, lua_State* L, Object* obj)
{
uint16 index = Eluna::CHECKVAL<uint16>(E->L, 2);
Eluna::Push(E->L, obj->GetUInt32Value(index));
uint16 index = Eluna::CHECKVAL<uint16>(L, 2);
Eluna::Push(L, obj->GetUInt32Value(index));
return 1;
}
int GetFloatValue(Eluna* E, Object* obj)
int GetFloatValue(Eluna* /*E*/, lua_State* L, Object* obj)
{
uint16 index = Eluna::CHECKVAL<uint16>(E->L, 2);
Eluna::Push(E->L, obj->GetFloatValue(index));
uint16 index = Eluna::CHECKVAL<uint16>(L, 2);
Eluna::Push(L, obj->GetFloatValue(index));
return 1;
}
int GetByteValue(Eluna* E, Object* obj)
int GetByteValue(Eluna* /*E*/, lua_State* L, Object* obj)
{
uint16 index = Eluna::CHECKVAL<uint16>(E->L, 2);
uint8 offset = Eluna::CHECKVAL<uint8>(E->L, 3);
Eluna::Push(E->L, obj->GetByteValue(index, offset));
uint16 index = Eluna::CHECKVAL<uint16>(L, 2);
uint8 offset = Eluna::CHECKVAL<uint8>(L, 3);
Eluna::Push(L, obj->GetByteValue(index, offset));
return 1;
}
int GetUInt16Value(Eluna* E, Object* obj)
int GetUInt16Value(Eluna* /*E*/, lua_State* L, Object* obj)
{
uint16 index = Eluna::CHECKVAL<uint16>(E->L, 2);
uint8 offset = Eluna::CHECKVAL<uint8>(E->L, 3);
Eluna::Push(E->L, obj->GetUInt16Value(index, offset));
uint16 index = Eluna::CHECKVAL<uint16>(L, 2);
uint8 offset = Eluna::CHECKVAL<uint8>(L, 3);
Eluna::Push(L, obj->GetUInt16Value(index, offset));
return 1;
}
int GetScale(Eluna* E, Object* obj)
int GetScale(Eluna* /*E*/, lua_State* L, Object* obj)
{
Eluna::Push(E->L, obj->GetObjectScale());
Eluna::Push(L, obj->GetObjectScale());
return 1;
}
int GetEntry(Eluna* E, Object* obj)
int GetEntry(Eluna* /*E*/, lua_State* L, Object* obj)
{
Eluna::Push(E->L, obj->GetEntry());
Eluna::Push(L, obj->GetEntry());
return 1;
}
int GetGUID(Eluna* E, Object* obj)
int GetGUID(Eluna* /*E*/, lua_State* L, Object* obj)
{
Eluna::Push(E->L, obj->GET_GUID());
Eluna::Push(L, obj->GET_GUID());
return 1;
}
int GetGUIDLow(Eluna* E, Object* obj)
int GetGUIDLow(Eluna* /*E*/, lua_State* L, Object* obj)
{
Eluna::Push(E->L, obj->GetGUIDLow());
Eluna::Push(L, obj->GetGUIDLow());
return 1;
}
int GetTypeId(Eluna* E, Object* obj)
int GetTypeId(Eluna* /*E*/, lua_State* L, Object* obj)
{
Eluna::Push(E->L, obj->GetTypeId());
Eluna::Push(L, obj->GetTypeId());
return 1;
}
int GetUInt64Value(Eluna* E, Object* obj)
int GetUInt64Value(Eluna* /*E*/, lua_State* L, Object* obj)
{
uint16 index = Eluna::CHECKVAL<uint16>(E->L, 2);
uint16 index = Eluna::CHECKVAL<uint16>(L, 2);
obj->GetUInt64Value(index);
return 0;
}
/* SETTERS */
int SetFlag(Eluna* E, Object* obj)
int SetFlag(Eluna* /*E*/, lua_State* L, Object* obj)
{
uint16 index = Eluna::CHECKVAL<uint16>(E->L, 2);
uint32 flag = Eluna::CHECKVAL<uint32>(E->L, 3);
uint16 index = Eluna::CHECKVAL<uint16>(L, 2);
uint32 flag = Eluna::CHECKVAL<uint32>(L, 3);
obj->SetFlag(index, flag);
return 0;
}
int SetInt32Value(Eluna* E, Object* obj)
int SetInt32Value(Eluna* /*E*/, lua_State* L, Object* obj)
{
uint16 index = Eluna::CHECKVAL<uint16>(E->L, 2);
int32 value = Eluna::CHECKVAL<int32>(E->L, 3);
uint16 index = Eluna::CHECKVAL<uint16>(L, 2);
int32 value = Eluna::CHECKVAL<int32>(L, 3);
obj->SetInt32Value(index, value);
return 0;
}
int SetUInt32Value(Eluna* E, Object* obj)
int SetUInt32Value(Eluna* /*E*/, lua_State* L, Object* obj)
{
uint16 index = Eluna::CHECKVAL<uint16>(E->L, 2);
uint32 value = Eluna::CHECKVAL<uint32>(E->L, 3);
uint16 index = Eluna::CHECKVAL<uint16>(L, 2);
uint32 value = Eluna::CHECKVAL<uint32>(L, 3);
obj->SetUInt32Value(index, value);
return 0;
}
int SetFloatValue(Eluna* E, Object* obj)
int SetFloatValue(Eluna* /*E*/, lua_State* L, Object* obj)
{
uint16 index = Eluna::CHECKVAL<uint16>(E->L, 2);
float value = Eluna::CHECKVAL<float>(E->L, 3);
uint16 index = Eluna::CHECKVAL<uint16>(L, 2);
float value = Eluna::CHECKVAL<float>(L, 3);
obj->SetFloatValue(index, value);
return 0;
}
int SetByteValue(Eluna* E, Object* obj)
int SetByteValue(Eluna* /*E*/, lua_State* L, Object* obj)
{
uint16 index = Eluna::CHECKVAL<uint16>(E->L, 2);
uint8 offset = Eluna::CHECKVAL<uint8>(E->L, 3);
uint8 value = Eluna::CHECKVAL<uint8>(E->L, 4);
uint16 index = Eluna::CHECKVAL<uint16>(L, 2);
uint8 offset = Eluna::CHECKVAL<uint8>(L, 3);
uint8 value = Eluna::CHECKVAL<uint8>(L, 4);
obj->SetByteValue(index, offset, value);
return 0;
}
int SetUInt16Value(Eluna* E, Object* obj)
int SetUInt16Value(Eluna* /*E*/, lua_State* L, Object* obj)
{
uint16 index = Eluna::CHECKVAL<uint16>(E->L, 2);
uint8 offset = Eluna::CHECKVAL<uint8>(E->L, 3);
uint16 value = Eluna::CHECKVAL<uint16>(E->L, 4);
uint16 index = Eluna::CHECKVAL<uint16>(L, 2);
uint8 offset = Eluna::CHECKVAL<uint8>(L, 3);
uint16 value = Eluna::CHECKVAL<uint16>(L, 4);
obj->SetUInt16Value(index, offset, value);
return 0;
}
int SetInt16Value(Eluna* E, Object* obj)
int SetInt16Value(Eluna* /*E*/, lua_State* L, Object* obj)
{
uint16 index = Eluna::CHECKVAL<uint16>(E->L, 2);
uint8 offset = Eluna::CHECKVAL<uint8>(E->L, 3);
int16 value = Eluna::CHECKVAL<int16>(E->L, 4);
uint16 index = Eluna::CHECKVAL<uint16>(L, 2);
uint8 offset = Eluna::CHECKVAL<uint8>(L, 3);
int16 value = Eluna::CHECKVAL<int16>(L, 4);
obj->SetInt16Value(index, offset, value);
return 0;
}
int SetScale(Eluna* E, Object* obj)
int SetScale(Eluna* /*E*/, lua_State* L, Object* obj)
{
float size = Eluna::CHECKVAL<float>(E->L, 2);
float size = Eluna::CHECKVAL<float>(L, 2);
obj->SetObjectScale(size);
return 0;
}
int SetUInt64Value(Eluna* E, Object* obj)
int SetUInt64Value(Eluna* /*E*/, lua_State* L, Object* obj)
{
uint16 index = Eluna::CHECKVAL<uint16>(E->L, 2);
uint64 value = Eluna::CHECKVAL<uint64>(E->L, 3);
uint16 index = Eluna::CHECKVAL<uint16>(L, 2);
uint64 value = Eluna::CHECKVAL<uint64>(L, 3);
obj->SetUInt64Value(index, value);
return 0;
}
/* OTHER */
int RemoveFlag(Eluna* E, Object* obj)
int RemoveFlag(Eluna* /*E*/, lua_State* L, Object* obj)
{
uint16 index = Eluna::CHECKVAL<uint16>(E->L, 2);
uint32 flag = Eluna::CHECKVAL<uint32>(E->L, 3);
uint16 index = Eluna::CHECKVAL<uint16>(L, 2);
uint32 flag = Eluna::CHECKVAL<uint32>(L, 3);
obj->RemoveFlag(index, flag);
return 0;
}
int UpdateUInt32Value(Eluna* E, Object* obj)
int UpdateUInt32Value(Eluna* /*E*/, lua_State* L, Object* obj)
{
uint16 index = Eluna::CHECKVAL<uint16>(E->L, 2);
uint32 value = Eluna::CHECKVAL<uint32>(E->L, 3);
uint16 index = Eluna::CHECKVAL<uint16>(L, 2);
uint32 value = Eluna::CHECKVAL<uint32>(L, 3);
obj->UpdateUInt32Value(index, value);
return 0;
}
int ToCorpse(Eluna* E, Object* obj)
int ToCorpse(Eluna* /*E*/, lua_State* L, Object* obj)
{
Eluna::Push(E->L, obj->ToCorpse());
Eluna::Push(L, obj->ToCorpse());
return 1;
}
int ToGameObject(Eluna* E, Object* obj)
int ToGameObject(Eluna* /*E*/, lua_State* L, Object* obj)
{
Eluna::Push(E->L, obj->ToGameObject());
Eluna::Push(L, obj->ToGameObject());
return 1;
}
int ToUnit(Eluna* E, Object* obj)
int ToUnit(Eluna* /*E*/, lua_State* L, Object* obj)
{
Eluna::Push(E->L, obj->ToUnit());
Eluna::Push(L, obj->ToUnit());
return 1;
}
int ToCreature(Eluna* E, Object* obj)
int ToCreature(Eluna* /*E*/, lua_State* L, Object* obj)
{
Eluna::Push(E->L, obj->ToCreature());
Eluna::Push(L, obj->ToCreature());
return 1;
}
int ToPlayer(Eluna* E, Object* obj)
int ToPlayer(Eluna* /*E*/, lua_State* L, Object* obj)
{
Eluna::Push(E->L, obj->ToPlayer());
Eluna::Push(L, obj->ToPlayer());
return 1;
}
};

File diff suppressed because it is too large Load Diff

View File

@@ -46,13 +46,13 @@ namespace LuaQuest
* @param uint32 flag : all available flags can be seen above
* @return bool hasFlag
*/
int HasFlag(Eluna* E, Quest* quest)
int HasFlag(Eluna* /*E*/, lua_State* L, Quest* quest)
{
uint32 flag = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 flag = Eluna::CHECKVAL<uint32>(L, 2);
#ifndef TRINITY
Eluna::Push(E->L, quest->HasQuestFlag((QuestFlags)flag));
Eluna::Push(L, quest->HasQuestFlag((QuestFlags)flag));
#else
Eluna::Push(E->L, quest->HasFlag(flag));
Eluna::Push(L, quest->HasFlag(flag));
#endif
return 1;
}
@@ -63,9 +63,9 @@ namespace LuaQuest
*
* @return bool isDaily
*/
int IsDaily(Eluna* E, Quest* quest)
int IsDaily(Eluna* /*E*/, lua_State* L, Quest* quest)
{
Eluna::Push(E->L, quest->IsDaily());
Eluna::Push(L, quest->IsDaily());
return 1;
}
#endif
@@ -75,9 +75,9 @@ namespace LuaQuest
*
* @return bool isRepeatable
*/
int IsRepeatable(Eluna* E, Quest* quest)
int IsRepeatable(Eluna* /*E*/, lua_State* L, Quest* quest)
{
Eluna::Push(E->L, quest->IsRepeatable());
Eluna::Push(L, quest->IsRepeatable());
return 1;
}
@@ -86,9 +86,9 @@ namespace LuaQuest
*
* @return uint32 entryId
*/
int GetId(Eluna* E, Quest* quest)
int GetId(Eluna* /*E*/, lua_State* L, Quest* quest)
{
Eluna::Push(E->L, quest->GetQuestId());
Eluna::Push(L, quest->GetQuestId());
return 1;
}
@@ -97,9 +97,9 @@ namespace LuaQuest
*
* @return uint32 level
*/
int GetLevel(Eluna* E, Quest* quest)
int GetLevel(Eluna* /*E*/, lua_State* L, Quest* quest)
{
Eluna::Push(E->L, quest->GetQuestLevel());
Eluna::Push(L, quest->GetQuestLevel());
return 1;
}
@@ -108,9 +108,9 @@ namespace LuaQuest
*
* @return uint32 minLevel
*/
int GetMinLevel(Eluna* E, Quest* quest)
int GetMinLevel(Eluna* /*E*/, lua_State* L, Quest* quest)
{
Eluna::Push(E->L, quest->GetMinLevel());
Eluna::Push(L, quest->GetMinLevel());
return 1;
}
@@ -119,9 +119,9 @@ namespace LuaQuest
*
* @return int32 entryId
*/
int GetNextQuestId(Eluna* E, Quest* quest)
int GetNextQuestId(Eluna* /*E*/, lua_State* L, Quest* quest)
{
Eluna::Push(E->L, quest->GetNextQuestId());
Eluna::Push(L, quest->GetNextQuestId());
return 1;
}
@@ -130,9 +130,9 @@ namespace LuaQuest
*
* @return int32 entryId
*/
int GetPrevQuestId(Eluna* E, Quest* quest)
int GetPrevQuestId(Eluna* /*E*/, lua_State* L, Quest* quest)
{
Eluna::Push(E->L, quest->GetPrevQuestId());
Eluna::Push(L, quest->GetPrevQuestId());
return 1;
}
@@ -141,9 +141,9 @@ namespace LuaQuest
*
* @return int32 entryId
*/
int GetNextQuestInChain(Eluna* E, Quest* quest)
int GetNextQuestInChain(Eluna* /*E*/, lua_State* L, Quest* quest)
{
Eluna::Push(E->L, quest->GetNextQuestInChain());
Eluna::Push(L, quest->GetNextQuestInChain());
return 1;
}
@@ -152,12 +152,12 @@ namespace LuaQuest
*
* @return uint32 flags
*/
int GetFlags(Eluna* E, Quest* quest)
int GetFlags(Eluna* /*E*/, lua_State* L, Quest* quest)
{
#ifndef TRINITY
Eluna::Push(E->L, quest->GetQuestFlags());
Eluna::Push(L, quest->GetQuestFlags());
#else
Eluna::Push(E->L, quest->GetFlags());
Eluna::Push(L, quest->GetFlags());
#endif
return 1;
}
@@ -169,15 +169,15 @@ namespace LuaQuest
*
* @return uint32 type
*/
int GetType(Eluna* E, Quest* quest)
int GetType(Eluna* /*E*/, lua_State* L, Quest* quest)
{
Eluna::Push(E->L, quest->GetType());
Eluna::Push(L, quest->GetType());
return 1;
}
/*int GetMaxLevel(Eluna* E, Quest* quest)
/*int GetMaxLevel(Eluna* E, lua_State* L, Quest* quest)
{
Eluna::Push(E->L, quest->GetMaxLevel());
Eluna::Push(L, quest->GetMaxLevel());
return 1;
}*/
};

View File

@@ -14,9 +14,9 @@ namespace LuaSpell
*
* @return bool isAutoRepeating
*/
int IsAutoRepeat(Eluna* E, Spell* spell)
int IsAutoRepeat(Eluna* /*E*/, lua_State* L, Spell* spell)
{
Eluna::Push(E->L, spell->IsAutoRepeat());
Eluna::Push(L, spell->IsAutoRepeat());
return 1;
}
@@ -25,9 +25,9 @@ namespace LuaSpell
*
* @return [Unit] caster
*/
int GetCaster(Eluna* E, Spell* spell)
int GetCaster(Eluna* /*E*/, lua_State* L, Spell* spell)
{
Eluna::Push(E->L, spell->GetCaster());
Eluna::Push(L, spell->GetCaster());
return 1;
}
@@ -36,9 +36,9 @@ namespace LuaSpell
*
* @return int32 castTime
*/
int GetCastTime(Eluna* E, Spell* spell)
int GetCastTime(Eluna* /*E*/, lua_State* L, Spell* spell)
{
Eluna::Push(E->L, spell->GetCastTime());
Eluna::Push(L, spell->GetCastTime());
return 1;
}
@@ -47,9 +47,9 @@ namespace LuaSpell
*
* @return uint32 entryId
*/
int GetEntry(Eluna* E, Spell* spell)
int GetEntry(Eluna* /*E*/, lua_State* L, Spell* spell)
{
Eluna::Push(E->L, spell->m_spellInfo->Id);
Eluna::Push(L, spell->m_spellInfo->Id);
return 1;
}
@@ -58,9 +58,9 @@ namespace LuaSpell
*
* @return uint32 powerCost
*/
int GetPowerCost(Eluna* E, Spell* spell)
int GetPowerCost(Eluna* /*E*/, lua_State* L, Spell* spell)
{
Eluna::Push(E->L, spell->GetPowerCost());
Eluna::Push(L, spell->GetPowerCost());
return 1;
}
@@ -69,12 +69,12 @@ namespace LuaSpell
*
* @return int32 duration
*/
int GetDuration(Eluna* E, Spell* spell)
int GetDuration(Eluna* /*E*/, lua_State* L, Spell* spell)
{
#ifndef TRINITY
Eluna::Push(E->L, GetSpellDuration(spell->m_spellInfo));
Eluna::Push(L, GetSpellDuration(spell->m_spellInfo));
#else
Eluna::Push(E->L, spell->GetSpellInfo()->GetDuration());
Eluna::Push(L, spell->GetSpellInfo()->GetDuration());
#endif
return 1;
}
@@ -86,7 +86,7 @@ namespace LuaSpell
* @return float y : y coordinate of the [Spell]
* @return float z : z coordinate of the [Spell]
*/
int GetTargetDest(Eluna* E, Spell* spell)
int GetTargetDest(Eluna* /*E*/, lua_State* L, Spell* spell)
{
#ifndef TRINITY
if (!(spell->m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION))
@@ -99,9 +99,9 @@ namespace LuaSpell
float x, y, z;
spell->m_targets.GetDstPos()->GetPosition(x, y, z);
#endif
Eluna::Push(E->L, x);
Eluna::Push(E->L, y);
Eluna::Push(E->L, z);
Eluna::Push(L, x);
Eluna::Push(L, y);
Eluna::Push(L, z);
return 3;
}
@@ -111,28 +111,28 @@ namespace LuaSpell
*
* @return [Object] target
*/
int GetTarget(Eluna* E, Spell* spell)
int GetTarget(Eluna* /*E*/, lua_State* L, Spell* spell)
{
#ifndef TRINITY
if (GameObject* target = spell->m_targets.getGOTarget())
Eluna::Push(E->L, target);
Eluna::Push(L, target);
else if (Item* target = spell->m_targets.getItemTarget())
Eluna::Push(E->L, target);
Eluna::Push(L, target);
else if (Corpse* target = spell->GetCaster()->GetMap()->GetCorpse(spell->m_targets.getCorpseTargetGuid()))
Eluna::Push(E->L, target);
Eluna::Push(L, target);
else if (Unit* target = spell->m_targets.getUnitTarget())
Eluna::Push(E->L, target);
Eluna::Push(L, target);
#else
if (GameObject* target = spell->m_targets.GetGOTarget())
Eluna::Push(E->L, target);
Eluna::Push(L, target);
else if (Item* target = spell->m_targets.GetItemTarget())
Eluna::Push(E->L, target);
Eluna::Push(L, target);
else if (Corpse* target = spell->m_targets.GetCorpseTarget())
Eluna::Push(E->L, target);
Eluna::Push(L, target);
else if (Unit* target = spell->m_targets.GetUnitTarget())
Eluna::Push(E->L, target);
Eluna::Push(L, target);
else if (WorldObject* target = spell->m_targets.GetObjectTarget())
Eluna::Push(E->L, target);
Eluna::Push(L, target);
#endif
return 1;
}
@@ -142,9 +142,9 @@ namespace LuaSpell
*
* @param bool repeat : set variable to 'true' for spell to automatically repeat
*/
int SetAutoRepeat(Eluna* E, Spell* spell)
int SetAutoRepeat(Eluna* /*E*/, lua_State* L, Spell* spell)
{
bool repeat = Eluna::CHECKVAL<bool>(E->L, 2);
bool repeat = Eluna::CHECKVAL<bool>(L, 2);
spell->SetAutoRepeat(repeat);
return 0;
}
@@ -154,9 +154,9 @@ 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, Spell* spell)
int Cast(Eluna* /*E*/, lua_State* L, Spell* spell)
{
bool skipCheck = Eluna::CHECKVAL<bool>(E->L, 2, false);
bool skipCheck = Eluna::CHECKVAL<bool>(L, 2, false);
spell->cast(skipCheck);
return 0;
}
@@ -165,7 +165,7 @@ namespace LuaSpell
* Cancels the [Spell].
*
*/
int Cancel(Eluna* /*E*/, Spell* spell)
int Cancel(Eluna* /*E*/, lua_State* /*L*/, Spell* spell)
{
spell->cancel();
return 0;
@@ -175,7 +175,7 @@ namespace LuaSpell
* Finishes the [Spell].
*
*/
int Finish(Eluna* /*E*/, Spell* spell)
int Finish(Eluna* /*E*/, lua_State* /*L*/, Spell* spell)
{
spell->finish();
return 0;

File diff suppressed because it is too large Load Diff

View File

@@ -12,50 +12,50 @@
namespace LuaVehicle
{
/* BOOLEAN */
int IsOnBoard(Eluna* E, Vehicle* vehicle)
int IsOnBoard(Eluna* /*E*/, lua_State* L, Vehicle* vehicle)
{
Unit* passenger = Eluna::CHECKOBJ<Unit>(E->L, 2);
Unit* passenger = Eluna::CHECKOBJ<Unit>(L, 2);
#ifndef TRINITY
Eluna::Push(E->L, vehicle->HasOnBoard(passenger));
Eluna::Push(L, vehicle->HasOnBoard(passenger));
#else
Eluna::Push(E->L, passenger->IsOnVehicle(vehicle->GetBase()));
Eluna::Push(L, passenger->IsOnVehicle(vehicle->GetBase()));
#endif
return 1;
}
/* GETTERS */
int GetOwner(Eluna* E, Vehicle* vehicle)
int GetOwner(Eluna* /*E*/, lua_State* L, Vehicle* vehicle)
{
#ifndef TRINITY
Eluna::Push(E->L, vehicle->GetOwner());
Eluna::Push(L, vehicle->GetOwner());
#else
Eluna::Push(E->L, vehicle->GetBase());
Eluna::Push(L, vehicle->GetBase());
#endif
return 1;
}
int GetEntry(Eluna* E, Vehicle* vehicle)
int GetEntry(Eluna* /*E*/, lua_State* L, Vehicle* vehicle)
{
#ifndef TRINITY
Eluna::Push(E->L, vehicle->GetVehicleEntry()->m_ID);
Eluna::Push(L, vehicle->GetVehicleEntry()->m_ID);
#else
Eluna::Push(E->L, vehicle->GetVehicleInfo()->m_ID);
Eluna::Push(L, vehicle->GetVehicleInfo()->m_ID);
#endif
return 1;
}
int GetPassenger(Eluna* E, Vehicle* vehicle)
int GetPassenger(Eluna* /*E*/, lua_State* L, Vehicle* vehicle)
{
int8 seatId = Eluna::CHECKVAL<int8>(E->L, 2);
Eluna::Push(E->L, vehicle->GetPassenger(seatId));
int8 seatId = Eluna::CHECKVAL<int8>(L, 2);
Eluna::Push(L, vehicle->GetPassenger(seatId));
return 1;
}
/* OTHER */
int AddPassenger(Eluna* E, Vehicle* vehicle)
int AddPassenger(Eluna* /*E*/, lua_State* L, Vehicle* vehicle)
{
Unit* passenger = Eluna::CHECKOBJ<Unit>(E->L, 2);
int8 seatId = Eluna::CHECKVAL<int8>(E->L, 3);
Unit* passenger = Eluna::CHECKOBJ<Unit>(L, 2);
int8 seatId = Eluna::CHECKVAL<int8>(L, 3);
#ifndef TRINITY
if (vehicle->CanBoard(passenger))
vehicle->Board(passenger, seatId);
@@ -65,9 +65,9 @@ namespace LuaVehicle
return 0;
}
int RemovePassenger(Eluna* E, Vehicle* vehicle)
int RemovePassenger(Eluna* /*E*/, lua_State* L, Vehicle* vehicle)
{
Unit* passenger = Eluna::CHECKOBJ<Unit>(E->L, 2);
Unit* passenger = Eluna::CHECKOBJ<Unit>(L, 2);
#ifndef TRINITY
vehicle->UnBoard(passenger, false);
#else

View File

@@ -14,9 +14,9 @@ namespace LuaWeather
*
* @return uint32 zoneId
*/
int GetZoneId(Eluna* E, Weather* weather)
int GetZoneId(Eluna* /*E*/, lua_State* L, Weather* weather)
{
Eluna::Push(E->L, weather->GetZone());
Eluna::Push(L, weather->GetZone());
return 1;
}
@@ -38,10 +38,10 @@ namespace LuaWeather
* @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, Weather* weather)
int SetWeather(Eluna* /*E*/, lua_State* L, Weather* weather)
{
uint32 weatherType = Eluna::CHECKVAL<uint32>(E->L, 2);
float grade = Eluna::CHECKVAL<float>(E->L, 3);
uint32 weatherType = Eluna::CHECKVAL<uint32>(L, 2);
float grade = Eluna::CHECKVAL<float>(L, 3);
weather->SetWeather((WeatherType)weatherType, grade);
return 0;
@@ -52,9 +52,9 @@ namespace LuaWeather
*
* @param [Player] player
*/
int SendWeatherUpdateToPlayer(Eluna* E, Weather* weather)
int SendWeatherUpdateToPlayer(Eluna* /*E*/, lua_State* L, Weather* weather)
{
Player* player = Eluna::CHECKOBJ<Player>(E->L, 2);
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
weather->SendWeatherUpdateToPlayer(player);
return 0;
@@ -70,9 +70,9 @@ namespace LuaWeather
*
* @return bool changed : returns 'true' if [Weather] changed
*/
int Regenerate(Eluna* E, Weather* weather)
int Regenerate(Eluna* /*E*/, lua_State* L, Weather* weather)
{
Eluna::Push(E->L, weather->ReGenerate());
Eluna::Push(L, weather->ReGenerate());
return 1;
}
@@ -81,9 +81,9 @@ namespace LuaWeather
*
* @param bool changed : returns 'true' if weather changed for any [Player] in the zone, 'false' if no [Player] is within the zone
*/
int UpdateWeather(Eluna* E, Weather* weather)
int UpdateWeather(Eluna* /*E*/, lua_State* L, Weather* weather)
{
Eluna::Push(E->L, weather->UpdateWeather());
Eluna::Push(L, weather->UpdateWeather());
return 1;
}
};

View File

@@ -14,9 +14,9 @@ namespace LuaWorldObject
*
* @return string name
*/
int GetName(Eluna* E, WorldObject* obj)
int GetName(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
Eluna::Push(E->L, obj->GetName());
Eluna::Push(L, obj->GetName());
return 1;
}
@@ -25,9 +25,9 @@ namespace LuaWorldObject
*
* @return [Map] mapObject
*/
int GetMap(Eluna* E, WorldObject* obj)
int GetMap(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
Eluna::Push(E->L, obj->GetMap());
Eluna::Push(L, obj->GetMap());
return 1;
}
@@ -37,9 +37,9 @@ namespace LuaWorldObject
*
* @return uint32 phase
*/
int GetPhaseMask(Eluna* E, WorldObject* obj)
int GetPhaseMask(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
Eluna::Push(E->L, obj->GetPhaseMask());
Eluna::Push(L, obj->GetPhaseMask());
return 1;
}
#endif
@@ -49,9 +49,9 @@ namespace LuaWorldObject
*
* @return uint32 instanceId
*/
int GetInstanceId(Eluna* E, WorldObject* obj)
int GetInstanceId(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
Eluna::Push(E->L, obj->GetInstanceId());
Eluna::Push(L, obj->GetInstanceId());
return 1;
}
@@ -60,9 +60,9 @@ namespace LuaWorldObject
*
* @return uint32 areaId
*/
int GetAreaId(Eluna* E, WorldObject* obj)
int GetAreaId(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
Eluna::Push(E->L, obj->GetAreaId());
Eluna::Push(L, obj->GetAreaId());
return 1;
}
@@ -71,9 +71,9 @@ namespace LuaWorldObject
*
* @return uint32 zoneId
*/
int GetZoneId(Eluna* E, WorldObject* obj)
int GetZoneId(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
Eluna::Push(E->L, obj->GetZoneId());
Eluna::Push(L, obj->GetZoneId());
return 1;
}
@@ -82,9 +82,9 @@ namespace LuaWorldObject
*
* @return uint32 mapId
*/
int GetMapId(Eluna* E, WorldObject* obj)
int GetMapId(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
Eluna::Push(E->L, obj->GetMapId());
Eluna::Push(L, obj->GetMapId());
return 1;
}
@@ -93,9 +93,9 @@ namespace LuaWorldObject
*
* @return float x
*/
int GetX(Eluna* E, WorldObject* obj)
int GetX(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
Eluna::Push(E->L, obj->GetPositionX());
Eluna::Push(L, obj->GetPositionX());
return 1;
}
@@ -104,9 +104,9 @@ namespace LuaWorldObject
*
* @return float y
*/
int GetY(Eluna* E, WorldObject* obj)
int GetY(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
Eluna::Push(E->L, obj->GetPositionY());
Eluna::Push(L, obj->GetPositionY());
return 1;
}
@@ -115,9 +115,9 @@ namespace LuaWorldObject
*
* @return float z
*/
int GetZ(Eluna* E, WorldObject* obj)
int GetZ(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
Eluna::Push(E->L, obj->GetPositionZ());
Eluna::Push(L, obj->GetPositionZ());
return 1;
}
@@ -126,9 +126,9 @@ namespace LuaWorldObject
*
* @return float orientation / facing
*/
int GetO(Eluna* E, WorldObject* obj)
int GetO(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
Eluna::Push(E->L, obj->GetOrientation());
Eluna::Push(L, obj->GetOrientation());
return 1;
}
@@ -140,12 +140,12 @@ namespace LuaWorldObject
* @return float z : z coordinate (height) of the [WorldObject]
* @return float o : facing / orientation of the [WorldObject]
*/
int GetLocation(Eluna* E, WorldObject* obj)
int GetLocation(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
Eluna::Push(E->L, obj->GetPositionX());
Eluna::Push(E->L, obj->GetPositionY());
Eluna::Push(E->L, obj->GetPositionZ());
Eluna::Push(E->L, obj->GetOrientation());
Eluna::Push(L, obj->GetPositionX());
Eluna::Push(L, obj->GetPositionY());
Eluna::Push(L, obj->GetPositionZ());
Eluna::Push(L, obj->GetOrientation());
return 4;
}
@@ -156,9 +156,9 @@ namespace LuaWorldObject
*
* @return [Player] nearestPlayer
*/
int GetNearestPlayer(Eluna* E, WorldObject* obj)
int GetNearestPlayer(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
float range = Eluna::CHECKVAL<float>(E->L, 2, SIZE_OF_GRIDS);
float range = Eluna::CHECKVAL<float>(L, 2, SIZE_OF_GRIDS);
Unit* target = NULL;
ElunaUtil::WorldObjectInRangeCheck checker(true, obj, range, TYPEMASK_PLAYER);
@@ -170,7 +170,7 @@ namespace LuaWorldObject
obj->VisitNearbyObject(range, searcher);
#endif
Eluna::Push(E->L, target);
Eluna::Push(L, target);
return 1;
}
@@ -182,10 +182,10 @@ namespace LuaWorldObject
*
* @return [GameObject] nearestGameObject
*/
int GetNearestGameObject(Eluna* E, WorldObject* obj)
int GetNearestGameObject(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
float range = Eluna::CHECKVAL<float>(E->L, 2, SIZE_OF_GRIDS);
uint32 entry = Eluna::CHECKVAL<uint32>(E->L, 3, 0);
float range = Eluna::CHECKVAL<float>(L, 2, SIZE_OF_GRIDS);
uint32 entry = Eluna::CHECKVAL<uint32>(L, 3, 0);
GameObject* target = NULL;
ElunaUtil::WorldObjectInRangeCheck checker(true, obj, range, TYPEMASK_GAMEOBJECT, entry);
@@ -197,7 +197,7 @@ namespace LuaWorldObject
obj->VisitNearbyObject(range, searcher);
#endif
Eluna::Push(E->L, target);
Eluna::Push(L, target);
return 1;
}
@@ -209,10 +209,10 @@ namespace LuaWorldObject
*
* @return [Creature] nearestCreature
*/
int GetNearestCreature(Eluna* E, WorldObject* obj)
int GetNearestCreature(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
float range = Eluna::CHECKVAL<float>(E->L, 2, SIZE_OF_GRIDS);
uint32 entry = Eluna::CHECKVAL<uint32>(E->L, 3, 0);
float range = Eluna::CHECKVAL<float>(L, 2, SIZE_OF_GRIDS);
uint32 entry = Eluna::CHECKVAL<uint32>(L, 3, 0);
Creature* target = NULL;
ElunaUtil::WorldObjectInRangeCheck checker(true, obj, range, TYPEMASK_UNIT, entry);
@@ -224,7 +224,7 @@ namespace LuaWorldObject
obj->VisitNearbyObject(range, searcher);
#endif
Eluna::Push(E->L, target);
Eluna::Push(L, target);
return 1;
}
@@ -235,9 +235,9 @@ namespace LuaWorldObject
*
* @return table playersInRange : table of [Player]s
*/
int GetPlayersInRange(Eluna* E, WorldObject* obj)
int GetPlayersInRange(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
float range = Eluna::CHECKVAL<float>(E->L, 2, SIZE_OF_GRIDS);
float range = Eluna::CHECKVAL<float>(L, 2, SIZE_OF_GRIDS);
std::list<Player*> list;
ElunaUtil::WorldObjectInRangeCheck checker(false, obj, range, TYPEMASK_PLAYER);
@@ -249,18 +249,18 @@ namespace LuaWorldObject
obj->VisitNearbyObject(range, searcher);
#endif
lua_newtable(E->L);
int tbl = lua_gettop(E->L);
lua_newtable(L);
int tbl = lua_gettop(L);
uint32 i = 0;
for (std::list<Player*>::const_iterator it = list.begin(); it != list.end(); ++it)
{
Eluna::Push(E->L, ++i);
Eluna::Push(E->L, *it);
lua_settable(E->L, tbl);
Eluna::Push(L, ++i);
Eluna::Push(L, *it);
lua_settable(L, tbl);
}
lua_settop(E->L, tbl);
lua_settop(L, tbl);
return 1;
}
@@ -272,10 +272,10 @@ namespace LuaWorldObject
*
* @return table creaturesInRange : table of [Creature]s
*/
int GetCreaturesInRange(Eluna* E, WorldObject* obj)
int GetCreaturesInRange(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
float range = Eluna::CHECKVAL<float>(E->L, 2, SIZE_OF_GRIDS);
uint32 entry = Eluna::CHECKVAL<uint32>(E->L, 3, 0);
float range = Eluna::CHECKVAL<float>(L, 2, SIZE_OF_GRIDS);
uint32 entry = Eluna::CHECKVAL<uint32>(L, 3, 0);
std::list<Creature*> list;
ElunaUtil::WorldObjectInRangeCheck checker(false, obj, range, TYPEMASK_UNIT, entry);
@@ -287,18 +287,18 @@ namespace LuaWorldObject
obj->VisitNearbyObject(range, searcher);
#endif
lua_newtable(E->L);
int tbl = lua_gettop(E->L);
lua_newtable(L);
int tbl = lua_gettop(L);
uint32 i = 0;
for (std::list<Creature*>::const_iterator it = list.begin(); it != list.end(); ++it)
{
Eluna::Push(E->L, ++i);
Eluna::Push(E->L, *it);
lua_settable(E->L, tbl);
Eluna::Push(L, ++i);
Eluna::Push(L, *it);
lua_settable(L, tbl);
}
lua_settop(E->L, tbl);
lua_settop(L, tbl);
return 1;
}
@@ -310,10 +310,10 @@ namespace LuaWorldObject
*
* @return table gameObjectsInRange : table of [GameObject]s
*/
int GetGameObjectsInRange(Eluna* E, WorldObject* obj)
int GetGameObjectsInRange(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
float range = Eluna::CHECKVAL<float>(E->L, 2, SIZE_OF_GRIDS);
uint32 entry = Eluna::CHECKVAL<uint32>(E->L, 3, 0);
float range = Eluna::CHECKVAL<float>(L, 2, SIZE_OF_GRIDS);
uint32 entry = Eluna::CHECKVAL<uint32>(L, 3, 0);
std::list<GameObject*> list;
ElunaUtil::WorldObjectInRangeCheck checker(false, obj, range, TYPEMASK_GAMEOBJECT, entry);
@@ -325,18 +325,18 @@ namespace LuaWorldObject
obj->VisitNearbyObject(range, searcher);
#endif
lua_newtable(E->L);
int tbl = lua_gettop(E->L);
lua_newtable(L);
int tbl = lua_gettop(L);
uint32 i = 0;
for (std::list<GameObject*>::const_iterator it = list.begin(); it != list.end(); ++it)
{
Eluna::Push(E->L, ++i);
Eluna::Push(E->L, *it);
lua_settable(E->L, tbl);
Eluna::Push(L, ++i);
Eluna::Push(L, *it);
lua_settable(L, tbl);
}
lua_settop(E->L, tbl);
lua_settop(L, tbl);
return 1;
}
@@ -351,12 +351,12 @@ namespace LuaWorldObject
*
* @return [WorldObject] worldObject
*/
int GetNearObject(Eluna* E, WorldObject* obj)
int GetNearObject(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
float range = Eluna::CHECKVAL<float>(E->L, 2, SIZE_OF_GRIDS);
uint16 type = Eluna::CHECKVAL<uint16>(E->L, 3, 0); // TypeMask
uint32 entry = Eluna::CHECKVAL<uint32>(E->L, 4, 0);
uint32 hostile = Eluna::CHECKVAL<uint32>(E->L, 5, 0); // 0 none, 1 hostile, 2 friendly
float range = Eluna::CHECKVAL<float>(L, 2, SIZE_OF_GRIDS);
uint16 type = Eluna::CHECKVAL<uint16>(L, 3, 0); // TypeMask
uint32 entry = Eluna::CHECKVAL<uint32>(L, 4, 0);
uint32 hostile = Eluna::CHECKVAL<uint32>(L, 5, 0); // 0 none, 1 hostile, 2 friendly
float x, y, z;
obj->GetPosition(x, y, z);
@@ -371,7 +371,7 @@ namespace LuaWorldObject
obj->VisitNearbyObject(range, searcher);
#endif
Eluna::Push(E->L, target);
Eluna::Push(L, target);
return 1;
}
@@ -386,12 +386,12 @@ namespace LuaWorldObject
*
* @return table worldObjectList : table of [WorldObject]s
*/
int GetNearObjects(Eluna* E, WorldObject* obj)
int GetNearObjects(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
float range = Eluna::CHECKVAL<float>(E->L, 2, SIZE_OF_GRIDS);
uint16 type = Eluna::CHECKVAL<uint16>(E->L, 3, 0); // TypeMask
uint32 entry = Eluna::CHECKVAL<uint32>(E->L, 4, 0);
uint32 hostile = Eluna::CHECKVAL<uint32>(E->L, 5, 0); // 0 none, 1 hostile, 2 friendly
float range = Eluna::CHECKVAL<float>(L, 2, SIZE_OF_GRIDS);
uint16 type = Eluna::CHECKVAL<uint16>(L, 3, 0); // TypeMask
uint32 entry = Eluna::CHECKVAL<uint32>(L, 4, 0);
uint32 hostile = Eluna::CHECKVAL<uint32>(L, 5, 0); // 0 none, 1 hostile, 2 friendly
float x, y, z;
obj->GetPosition(x, y, z);
@@ -406,18 +406,18 @@ namespace LuaWorldObject
obj->VisitNearbyObject(range, searcher);
#endif
lua_newtable(E->L);
int tbl = lua_gettop(E->L);
lua_newtable(L);
int tbl = lua_gettop(L);
uint32 i = 0;
for (std::list<WorldObject*>::const_iterator it = list.begin(); it != list.end(); ++it)
{
Eluna::Push(E->L, ++i);
Eluna::Push(E->L, *it);
lua_settable(E->L, tbl);
Eluna::Push(L, ++i);
Eluna::Push(L, *it);
lua_settable(L, tbl);
}
lua_settop(E->L, tbl);
lua_settop(L, tbl);
return 1;
}
@@ -434,17 +434,17 @@ namespace LuaWorldObject
*
* @return float dist : the distance in yards
*/
int GetDistance(Eluna* E, WorldObject* obj)
int GetDistance(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
WorldObject* target = Eluna::CHECKOBJ<WorldObject>(E->L, 2, false);
WorldObject* target = Eluna::CHECKOBJ<WorldObject>(L, 2, false);
if (target && target->IsInWorld())
Eluna::Push(E->L, obj->GetDistance(target));
Eluna::Push(L, obj->GetDistance(target));
else
{
float X = Eluna::CHECKVAL<float>(E->L, 2);
float Y = Eluna::CHECKVAL<float>(E->L, 3);
float Z = Eluna::CHECKVAL<float>(E->L, 4);
Eluna::Push(E->L, obj->GetDistance(X, Y, Z));
float X = Eluna::CHECKVAL<float>(L, 2);
float Y = Eluna::CHECKVAL<float>(L, 3);
float Z = Eluna::CHECKVAL<float>(L, 4);
Eluna::Push(L, obj->GetDistance(X, Y, Z));
}
return 1;
}
@@ -459,17 +459,17 @@ namespace LuaWorldObject
* @return float y
* @return float z
*/
int GetRelativePoint(Eluna* E, WorldObject* obj)
int GetRelativePoint(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
float dist = Eluna::CHECKVAL<float>(E->L, 2);
float rad = Eluna::CHECKVAL<float>(E->L, 3);
float dist = Eluna::CHECKVAL<float>(L, 2);
float rad = Eluna::CHECKVAL<float>(L, 3);
float x, y, z;
obj->GetClosePoint(x, y, z, 0.0f, dist, rad);
Eluna::Push(E->L, x);
Eluna::Push(E->L, y);
Eluna::Push(E->L, z);
Eluna::Push(L, x);
Eluna::Push(L, y);
Eluna::Push(L, z);
return 3;
}
@@ -486,17 +486,17 @@ namespace LuaWorldObject
*
* @return float angle : angle in radians in range 0..2*pi
*/
int GetAngle(Eluna* E, WorldObject* obj)
int GetAngle(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
WorldObject* target = Eluna::CHECKOBJ<WorldObject>(E->L, 2, false);
WorldObject* target = Eluna::CHECKOBJ<WorldObject>(L, 2, false);
if (target && target->IsInWorld())
Eluna::Push(E->L, obj->GetAngle(target));
Eluna::Push(L, obj->GetAngle(target));
else
{
float x = Eluna::CHECKVAL<float>(E->L, 2);
float y = Eluna::CHECKVAL<float>(E->L, 3);
Eluna::Push(E->L, obj->GetAngle(x, y));
float x = Eluna::CHECKVAL<float>(L, 2);
float y = Eluna::CHECKVAL<float>(L, 3);
Eluna::Push(L, obj->GetAngle(x, y));
}
return 1;
}
@@ -506,9 +506,9 @@ namespace LuaWorldObject
*
* @param [WorldPacket] packet
*/
int SendPacket(Eluna* E, WorldObject* obj)
int SendPacket(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
WorldPacket* data = Eluna::CHECKOBJ<WorldPacket>(E->L, 2);
WorldPacket* data = Eluna::CHECKOBJ<WorldPacket>(L, 2);
obj->SendMessageToSet(data, true);
return 0;
}
@@ -524,18 +524,18 @@ namespace LuaWorldObject
* @param uint32 respawnDelay = 30 : respawn time in seconds
* @return [GameObject] gameObject
*/
int SummonGameObject(Eluna* E, WorldObject* obj)
int SummonGameObject(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
uint32 entry = Eluna::CHECKVAL<uint32>(E->L, 2);
float x = Eluna::CHECKVAL<float>(E->L, 3);
float y = Eluna::CHECKVAL<float>(E->L, 4);
float z = Eluna::CHECKVAL<float>(E->L, 5);
float o = Eluna::CHECKVAL<float>(E->L, 6);
uint32 respawnDelay = Eluna::CHECKVAL<uint32>(E->L, 7, 30);
uint32 entry = Eluna::CHECKVAL<uint32>(L, 2);
float x = Eluna::CHECKVAL<float>(L, 3);
float y = Eluna::CHECKVAL<float>(L, 4);
float z = Eluna::CHECKVAL<float>(L, 5);
float o = Eluna::CHECKVAL<float>(L, 6);
uint32 respawnDelay = Eluna::CHECKVAL<uint32>(L, 7, 30);
#ifndef TRINITY
Eluna::Push(E->L, obj->SummonGameObject(entry, x, y, z, o, respawnDelay));
Eluna::Push(L, obj->SummonGameObject(entry, x, y, z, o, respawnDelay));
#else
Eluna::Push(E->L, obj->SummonGameObject(entry, x, y, z, o, 0, 0, 0, 0, respawnDelay));
Eluna::Push(L, obj->SummonGameObject(entry, x, y, z, o, 0, 0, 0, 0, respawnDelay));
#endif
return 1;
}
@@ -552,15 +552,15 @@ namespace LuaWorldObject
* @param uint32 despawnTimer : despawn time in seconds
* @return [Creature] spawnedCreature
*/
int SpawnCreature(Eluna* E, WorldObject* obj)
int SpawnCreature(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
uint32 entry = Eluna::CHECKVAL<uint32>(E->L, 2);
float x = Eluna::CHECKVAL<float>(E->L, 3);
float y = Eluna::CHECKVAL<float>(E->L, 4);
float z = Eluna::CHECKVAL<float>(E->L, 5);
float o = Eluna::CHECKVAL<float>(E->L, 6);
uint32 spawnType = Eluna::CHECKVAL<uint32>(E->L, 7, 8);
uint32 despawnTimer = Eluna::CHECKVAL<uint32>(E->L, 8, 0);
uint32 entry = Eluna::CHECKVAL<uint32>(L, 2);
float x = Eluna::CHECKVAL<float>(L, 3);
float y = Eluna::CHECKVAL<float>(L, 4);
float z = Eluna::CHECKVAL<float>(L, 5);
float o = Eluna::CHECKVAL<float>(L, 6);
uint32 spawnType = Eluna::CHECKVAL<uint32>(L, 7, 8);
uint32 despawnTimer = Eluna::CHECKVAL<uint32>(L, 8, 0);
TempSummonType type;
switch (spawnType)
@@ -602,9 +602,9 @@ namespace LuaWorldObject
break;
#endif
default:
return luaL_argerror(E->L, 7, "valid SpawnType expected");
return luaL_argerror(L, 7, "valid SpawnType expected");
}
Eluna::Push(E->L, obj->SummonCreature(entry, x, y, z, o, type, despawnTimer));
Eluna::Push(L, obj->SummonCreature(entry, x, y, z, o, type, despawnTimer));
return 1;
}
@@ -621,18 +621,18 @@ 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, WorldObject* obj)
int RegisterEvent(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
luaL_checktype(E->L, 2, LUA_TFUNCTION);
uint32 delay = Eluna::CHECKVAL<uint32>(E->L, 3);
uint32 repeats = Eluna::CHECKVAL<uint32>(E->L, 4);
luaL_checktype(L, 2, LUA_TFUNCTION);
uint32 delay = Eluna::CHECKVAL<uint32>(L, 3);
uint32 repeats = Eluna::CHECKVAL<uint32>(L, 4);
lua_pushvalue(E->L, 2);
int functionRef = luaL_ref(E->L, LUA_REGISTRYINDEX);
lua_pushvalue(L, 2);
int functionRef = luaL_ref(L, LUA_REGISTRYINDEX);
if (functionRef != LUA_REFNIL && functionRef != LUA_NOREF)
{
obj->elunaEvents->AddEvent(functionRef, delay, repeats);
Eluna::Push(E->L, functionRef);
Eluna::Push(L, functionRef);
}
return 1;
}
@@ -642,9 +642,9 @@ namespace LuaWorldObject
*
* @param int eventId : event Id to remove
*/
int RemoveEventById(Eluna* E, WorldObject* obj)
int RemoveEventById(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
int eventId = Eluna::CHECKVAL<int>(E->L, 2);
int eventId = Eluna::CHECKVAL<int>(L, 2);
obj->elunaEvents->RemoveEvent(eventId);
return 0;
}
@@ -653,7 +653,7 @@ namespace LuaWorldObject
* Removes all timed events from a [WorldObject]
*
*/
int RemoveEvents(Eluna* /*E*/, WorldObject* obj)
int RemoveEvents(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
obj->elunaEvents->RemoveEvents();
return 0;
@@ -671,18 +671,18 @@ namespace LuaWorldObject
* @param float z
* @return bool isInLoS
*/
int IsWithinLoS(Eluna* E, WorldObject* obj)
int IsWithinLoS(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
WorldObject* target = Eluna::CHECKOBJ<WorldObject>(E->L, 2, false);
WorldObject* target = Eluna::CHECKOBJ<WorldObject>(L, 2, false);
if (target)
Eluna::Push(E->L, obj->IsWithinLOSInMap(target));
Eluna::Push(L, obj->IsWithinLOSInMap(target));
else
{
float x = Eluna::CHECKVAL<float>(E->L, 2);
float y = Eluna::CHECKVAL<float>(E->L, 3);
float z = Eluna::CHECKVAL<float>(E->L, 4);
Eluna::Push(E->L, obj->IsWithinLOS(x, y, z));
float x = Eluna::CHECKVAL<float>(L, 2);
float y = Eluna::CHECKVAL<float>(L, 3);
float z = Eluna::CHECKVAL<float>(L, 4);
Eluna::Push(L, obj->IsWithinLOS(x, y, z));
}
return 1;

View File

@@ -14,9 +14,9 @@ namespace LuaPacket
*
* @return uint16 opcode
*/
int GetOpcode(Eluna* E, WorldPacket* packet)
int GetOpcode(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
Eluna::Push(E->L, packet->GetOpcode());
Eluna::Push(L, packet->GetOpcode());
return 1;
}
@@ -25,9 +25,9 @@ namespace LuaPacket
*
* @return uint32 size : size of [WorldPacket]
*/
int GetSize(Eluna* E, WorldPacket* packet)
int GetSize(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
Eluna::Push(E->L, packet->size());
Eluna::Push(L, packet->size());
return 1;
}
@@ -36,11 +36,11 @@ namespace LuaPacket
*
* @param uint32 opcode : the opcode specified to be set for the [WorldPacket]
*/
int SetOpcode(Eluna* E, WorldPacket* packet)
int SetOpcode(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
uint32 opcode = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 opcode = Eluna::CHECKVAL<uint32>(L, 2);
if (opcode >= NUM_MSG_TYPES)
return luaL_argerror(E->L, 2, "valid opcode expected");
return luaL_argerror(L, 2, "valid opcode expected");
packet->SetOpcode((OpcodesList)opcode);
return 0;
}
@@ -50,11 +50,11 @@ namespace LuaPacket
*
* @return int8 value
*/
int ReadByte(Eluna* E, WorldPacket* packet)
int ReadByte(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
int8 _byte;
(*packet) >> _byte;
Eluna::Push(E->L, _byte);
Eluna::Push(L, _byte);
return 1;
}
@@ -63,11 +63,11 @@ namespace LuaPacket
*
* @return uint8 value
*/
int ReadUByte(Eluna* E, WorldPacket* packet)
int ReadUByte(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
uint8 _ubyte;
(*packet) >> _ubyte;
Eluna::Push(E->L, _ubyte);
Eluna::Push(L, _ubyte);
return 1;
}
@@ -76,11 +76,11 @@ namespace LuaPacket
*
* @return int16 value
*/
int ReadShort(Eluna* E, WorldPacket* packet)
int ReadShort(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
int16 _short;
(*packet) >> _short;
Eluna::Push(E->L, _short);
Eluna::Push(L, _short);
return 1;
}
@@ -89,11 +89,11 @@ namespace LuaPacket
*
* @return uint16 value
*/
int ReadUShort(Eluna* E, WorldPacket* packet)
int ReadUShort(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
uint16 _ushort;
(*packet) >> _ushort;
Eluna::Push(E->L, _ushort);
Eluna::Push(L, _ushort);
return 1;
}
@@ -102,11 +102,11 @@ namespace LuaPacket
*
* @return int32 value
*/
int ReadLong(Eluna* E, WorldPacket* packet)
int ReadLong(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
int32 _long;
(*packet) >> _long;
Eluna::Push(E->L, _long);
Eluna::Push(L, _long);
return 1;
}
@@ -115,11 +115,11 @@ namespace LuaPacket
*
* @return uint32 value
*/
int ReadULong(Eluna* E, WorldPacket* packet)
int ReadULong(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
uint32 _ulong;
(*packet) >> _ulong;
Eluna::Push(E->L, _ulong);
Eluna::Push(L, _ulong);
return 1;
}
@@ -128,11 +128,11 @@ namespace LuaPacket
*
* @return float value
*/
int ReadFloat(Eluna* E, WorldPacket* packet)
int ReadFloat(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
float _val;
(*packet) >> _val;
Eluna::Push(E->L, _val);
Eluna::Push(L, _val);
return 1;
}
@@ -141,11 +141,11 @@ namespace LuaPacket
*
* @return double value
*/
int ReadDouble(Eluna* E, WorldPacket* packet)
int ReadDouble(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
double _val;
(*packet) >> _val;
Eluna::Push(E->L, _val);
Eluna::Push(L, _val);
return 1;
}
@@ -154,11 +154,11 @@ namespace LuaPacket
*
* @return uint64 value : value returned as string
*/
int ReadGUID(Eluna* E, WorldPacket* packet)
int ReadGUID(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
uint64 guid;
(*packet) >> guid;
Eluna::Push(E->L, guid);
Eluna::Push(L, guid);
return 1;
}
@@ -167,11 +167,11 @@ namespace LuaPacket
*
* @return string value
*/
int ReadString(Eluna* E, WorldPacket* packet)
int ReadString(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
std::string _val;
(*packet) >> _val;
Eluna::Push(E->L, _val);
Eluna::Push(L, _val);
return 1;
}
@@ -180,9 +180,9 @@ namespace LuaPacket
*
* @param uint64 value : the value to be written to the [WorldPacket]
*/
int WriteGUID(Eluna* E, WorldPacket* packet)
int WriteGUID(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
uint64 guid = Eluna::CHECKVAL<uint64>(E->L, 2);
uint64 guid = Eluna::CHECKVAL<uint64>(L, 2);
(*packet) << guid;
return 0;
}
@@ -192,9 +192,9 @@ namespace LuaPacket
*
* @param string value : the string to be written to the [WorldPacket]
*/
int WriteString(Eluna* E, WorldPacket* packet)
int WriteString(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
std::string _val = Eluna::CHECKVAL<std::string>(E->L, 2);
std::string _val = Eluna::CHECKVAL<std::string>(L, 2);
(*packet) << _val;
return 0;
}
@@ -204,9 +204,9 @@ namespace LuaPacket
*
* @param int8 value : the int8 value to be written to the [WorldPacket]
*/
int WriteByte(Eluna* E, WorldPacket* packet)
int WriteByte(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
int8 byte = Eluna::CHECKVAL<int8>(E->L, 2);
int8 byte = Eluna::CHECKVAL<int8>(L, 2);
(*packet) << byte;
return 0;
}
@@ -216,9 +216,9 @@ namespace LuaPacket
*
* @param uint8 value : the uint8 value to be written to the [WorldPacket]
*/
int WriteUByte(Eluna* E, WorldPacket* packet)
int WriteUByte(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
uint8 byte = Eluna::CHECKVAL<uint8>(E->L, 2);
uint8 byte = Eluna::CHECKVAL<uint8>(L, 2);
(*packet) << byte;
return 0;
}
@@ -228,9 +228,9 @@ namespace LuaPacket
*
* @param int16 value : the int16 value to be written to the [WorldPacket]
*/
int WriteShort(Eluna* E, WorldPacket* packet)
int WriteShort(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
int16 _short = Eluna::CHECKVAL<int16>(E->L, 2);
int16 _short = Eluna::CHECKVAL<int16>(L, 2);
(*packet) << _short;
return 0;
}
@@ -240,9 +240,9 @@ namespace LuaPacket
*
* @param uint16 value : the uint16 value to be written to the [WorldPacket]
*/
int WriteUShort(Eluna* E, WorldPacket* packet)
int WriteUShort(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
uint16 _ushort = Eluna::CHECKVAL<uint16>(E->L, 2);
uint16 _ushort = Eluna::CHECKVAL<uint16>(L, 2);
(*packet) << _ushort;
return 0;
}
@@ -252,9 +252,9 @@ namespace LuaPacket
*
* @param int32 value : the int32 value to be written to the [WorldPacket]
*/
int WriteLong(Eluna* E, WorldPacket* packet)
int WriteLong(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
int32 _long = Eluna::CHECKVAL<int32>(E->L, 2);
int32 _long = Eluna::CHECKVAL<int32>(L, 2);
(*packet) << _long;
return 0;
}
@@ -264,9 +264,9 @@ namespace LuaPacket
*
* @param uint32 value : the uint32 value to be written to the [WorldPacket]
*/
int WriteULong(Eluna* E, WorldPacket* packet)
int WriteULong(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
uint32 _ulong = Eluna::CHECKVAL<uint32>(E->L, 2);
uint32 _ulong = Eluna::CHECKVAL<uint32>(L, 2);
(*packet) << _ulong;
return 0;
}
@@ -276,9 +276,9 @@ namespace LuaPacket
*
* @param float value : the float value to be written to the [WorldPacket]
*/
int WriteFloat(Eluna* E, WorldPacket* packet)
int WriteFloat(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
float _val = Eluna::CHECKVAL<float>(E->L, 2);
float _val = Eluna::CHECKVAL<float>(L, 2);
(*packet) << _val;
return 0;
}
@@ -288,9 +288,9 @@ namespace LuaPacket
*
* @param double value : the double value to be written to the [WorldPacket]
*/
int WriteDouble(Eluna* E, WorldPacket* packet)
int WriteDouble(Eluna* /*E*/, lua_State* L, WorldPacket* packet)
{
double _val = Eluna::CHECKVAL<double>(E->L, 2);
double _val = Eluna::CHECKVAL<double>(L, 2);
(*packet) << _val;
return 0;
}