Skip to content

Commit

Permalink
Update CMangos files for multistate support
Browse files Browse the repository at this point in the history
  • Loading branch information
Foereaper committed Jan 28, 2024
1 parent ff712ef commit df0c097
Show file tree
Hide file tree
Showing 25 changed files with 2,551 additions and 2,546 deletions.
48 changes: 24 additions & 24 deletions CMangos/AuraMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ namespace LuaAura
*
* @return [Unit] caster
*/
int GetCaster(lua_State* L, Aura* aura)
int GetCaster(Eluna* E, Aura* aura)
{
Eluna::Push(L, aura->GetCaster());
E->Push(aura->GetCaster());
return 1;
}

Expand All @@ -37,9 +37,9 @@ namespace LuaAura
*
* @return string caster_guid : the GUID of the Unit as a decimal string
*/
int GetCasterGUID(lua_State* L, Aura* aura)
int GetCasterGUID(Eluna* E, Aura* aura)
{
Eluna::Push(L, aura->GetCasterGuid());
E->Push(aura->GetCasterGuid());
return 1;
}

Expand All @@ -48,9 +48,9 @@ namespace LuaAura
*
* @return uint32 caster_level
*/
int GetCasterLevel(lua_State* L, Aura* aura)
int GetCasterLevel(Eluna* E, Aura* aura)
{
Eluna::Push(L, aura->GetCaster()->GetLevel());
E->Push(aura->GetCaster()->GetLevel());
return 1;
}

Expand All @@ -59,9 +59,9 @@ namespace LuaAura
*
* @return int32 duration : amount of time left in milliseconds
*/
int GetDuration(lua_State* L, Aura* aura)
int GetDuration(Eluna* E, Aura* aura)
{
Eluna::Push(L, aura->GetAuraDuration());
E->Push(aura->GetAuraDuration());
return 1;
}

Expand All @@ -70,9 +70,9 @@ namespace LuaAura
*
* @return uint32 aura_id
*/
int GetAuraId(lua_State* L, Aura* aura)
int GetAuraId(Eluna* E, Aura* aura)
{
Eluna::Push(L, aura->GetId());
E->Push(aura->GetId());
return 1;
}

Expand All @@ -84,9 +84,9 @@ namespace LuaAura
*
* @return int32 max_duration : the maximum duration of the Aura, in milliseconds
*/
int GetMaxDuration(lua_State* L, Aura* aura)
int GetMaxDuration(Eluna* E, Aura* aura)
{
Eluna::Push(L, aura->GetAuraMaxDuration());
E->Push(aura->GetAuraMaxDuration());
return 1;
}

Expand All @@ -97,9 +97,9 @@ namespace LuaAura
*
* @return uint32 stack_amount
*/
int GetStackAmount(lua_State* L, Aura* aura)
int GetStackAmount(Eluna* E, Aura* aura)
{
Eluna::Push(L, aura->GetStackAmount());
E->Push(aura->GetStackAmount());
return 1;
}

Expand All @@ -108,9 +108,9 @@ namespace LuaAura
*
* @return [Unit] owner
*/
int GetOwner(lua_State* L, Aura* aura)
int GetOwner(Eluna* E, Aura* aura)
{
Eluna::Push(L, aura->GetTarget());
E->Push(aura->GetTarget());
return 1;
}

Expand All @@ -119,9 +119,9 @@ namespace LuaAura
*
* @param int32 duration : the new duration of the Aura, in milliseconds
*/
int SetDuration(lua_State* L, Aura* aura)
int SetDuration(Eluna* E, Aura* aura)
{
int32 duration = Eluna::CHECKVAL<int32>(L, 2);
int32 duration = Eluna::CHECKVAL<int32>(E->L, 2);
aura->GetHolder()->SetAuraDuration(duration);
#if (defined(TBC) || defined(CLASSIC))
aura->GetHolder()->UpdateAuraDuration();
Expand All @@ -139,9 +139,9 @@ namespace LuaAura
*
* @param int32 duration : the new maximum duration of the Aura, in milliseconds
*/
int SetMaxDuration(lua_State* L, Aura* aura)
int SetMaxDuration(Eluna* E, Aura* aura)
{
int32 duration = Eluna::CHECKVAL<int32>(L, 2);
int32 duration = Eluna::CHECKVAL<int32>(E->L, 2);
aura->GetHolder()->SetAuraMaxDuration(duration);
#if (defined(TBC) || defined(CLASSIC))
aura->GetHolder()->UpdateAuraDuration();
Expand All @@ -159,9 +159,9 @@ namespace LuaAura
*
* @param uint32 amount
*/
int SetStackAmount(lua_State* L, Aura* aura)
int SetStackAmount(Eluna* E, Aura* aura)
{
uint8 amount = Eluna::CHECKVAL<uint8>(L, 2);
uint8 amount = Eluna::CHECKVAL<uint8>(E->L, 2);
#ifndef CATA
aura->GetHolder()->SetStackAmount(amount, aura->GetTarget());
#else
Expand All @@ -173,10 +173,10 @@ namespace LuaAura
/**
* Remove this [Aura] from the [Unit] it is applied to.
*/
int Remove(lua_State* L, Aura* aura)
int Remove(Eluna* E, Aura* aura)
{
aura->GetTarget()->RemoveSpellAuraHolder(aura->GetHolder(), AURA_REMOVE_BY_CANCEL);
Eluna::CHECKOBJ<ElunaObject>(L, 1)->Invalidate();
Eluna::CHECKOBJ<ElunaObject>(E->L, 1)->Invalidate();
return 0;
}

Expand Down
80 changes: 40 additions & 40 deletions CMangos/BattleGroundMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ namespace LuaBattleGround
*
* @return string name
*/
int GetName(lua_State* L, BattleGround* bg)
int GetName(Eluna* E, BattleGround* bg)
{
Eluna::Push(L, bg->GetName());
E->Push(bg->GetName());
return 1;
}

Expand All @@ -31,11 +31,11 @@ namespace LuaBattleGround
* @param [Team] team : team ID
* @return uint32 count
*/
int GetAlivePlayersCountByTeam(lua_State* L, BattleGround* bg)
int GetAlivePlayersCountByTeam(Eluna* E, BattleGround* bg)
{
uint32 team = Eluna::CHECKVAL<uint32>(L, 2);
uint32 team = Eluna::CHECKVAL<uint32>(E->L, 2);

Eluna::Push(L, bg->GetAlivePlayersCountByTeam((Team)team));
E->Push(bg->GetAlivePlayersCountByTeam((Team)team));
return 1;
}

Expand All @@ -44,9 +44,9 @@ namespace LuaBattleGround
*
* @return [Map] map
*/
int GetMap(lua_State* L, BattleGround* bg)
int GetMap(Eluna* E, BattleGround* bg)
{
Eluna::Push(L, static_cast<Map*>(bg->GetBgMap()));
E->Push(static_cast<Map*>(bg->GetBgMap()));
return 1;
}

Expand All @@ -56,11 +56,11 @@ namespace LuaBattleGround
* @param uint32 kills : amount of kills
* @return uint32 bonusHonor
*/
int GetBonusHonorFromKillCount(lua_State* L, BattleGround* bg)
int GetBonusHonorFromKillCount(Eluna* E, BattleGround* bg)
{
uint32 kills = Eluna::CHECKVAL<uint32>(L, 2);
uint32 kills = Eluna::CHECKVAL<uint32>(E->L, 2);

Eluna::Push(L, bg->GetBonusHonorFromKill(kills));
E->Push(bg->GetBonusHonorFromKill(kills));
return 1;
}

Expand All @@ -70,9 +70,9 @@ namespace LuaBattleGround
*
* @return [BattleGroundBracketId] bracketId
*/
int GetBracketId(lua_State* L, BattleGround* bg)
int GetBracketId(Eluna* E, BattleGround* bg)
{
Eluna::Push(L, bg->GetBracketId());
E->Push(bg->GetBracketId());
return 1;
}
#endif
Expand All @@ -82,9 +82,9 @@ namespace LuaBattleGround
*
* @return uint32 endTime
*/
int GetEndTime(lua_State* L, BattleGround* bg)
int GetEndTime(Eluna* E, BattleGround* bg)
{
Eluna::Push(L, bg->GetEndTime());
E->Push(bg->GetEndTime());
return 1;
}

Expand All @@ -94,11 +94,11 @@ namespace LuaBattleGround
* @param [Team] team : team ID
* @return uint32 freeSlots
*/
int GetFreeSlotsForTeam(lua_State* L, BattleGround* bg)
int GetFreeSlotsForTeam(Eluna* E, BattleGround* bg)
{
uint32 team = Eluna::CHECKVAL<uint32>(L, 2);
uint32 team = Eluna::CHECKVAL<uint32>(E->L, 2);

Eluna::Push(L, bg->GetFreeSlotsForTeam((Team)team));
E->Push(bg->GetFreeSlotsForTeam((Team)team));
return 1;
}

Expand All @@ -107,12 +107,12 @@ namespace LuaBattleGround
*
* @return uint32 instanceId
*/
int GetInstanceId(lua_State* L, BattleGround* bg)
int GetInstanceId(Eluna* E, BattleGround* bg)
{
#ifndef CATA
Eluna::Push(L, bg->GetInstanceId());
E->Push(bg->GetInstanceId());
#else
Eluna::Push(L, bg->GetInstanceID());
E->Push(bg->GetInstanceID());
#endif
return 1;
}
Expand All @@ -122,9 +122,9 @@ namespace LuaBattleGround
*
* @return uint32 mapId
*/
int GetMapId(lua_State* L, BattleGround* bg)
int GetMapId(Eluna* E, BattleGround* bg)
{
Eluna::Push(L, bg->GetMapId());
E->Push(bg->GetMapId());
return 1;
}

Expand All @@ -133,9 +133,9 @@ namespace LuaBattleGround
*
* @return [BattleGroundTypeId] typeId
*/
int GetTypeId(lua_State* L, BattleGround* bg)
int GetTypeId(Eluna* E, BattleGround* bg)
{
Eluna::Push(L, bg->GetTypeId());
E->Push(bg->GetTypeId());
return 1;
}

Expand All @@ -144,9 +144,9 @@ namespace LuaBattleGround
*
* @return uint32 maxLevel
*/
int GetMaxLevel(lua_State* L, BattleGround* bg)
int GetMaxLevel(Eluna* E, BattleGround* bg)
{
Eluna::Push(L, bg->GetMaxLevel());
E->Push(bg->GetMaxLevel());
return 1;
}

Expand All @@ -155,9 +155,9 @@ namespace LuaBattleGround
*
* @return uint32 minLevel
*/
int GetMinLevel(lua_State* L, BattleGround* bg)
int GetMinLevel(Eluna* E, BattleGround* bg)
{
Eluna::Push(L, bg->GetMinLevel());
E->Push(bg->GetMinLevel());
return 1;
}

Expand All @@ -166,9 +166,9 @@ namespace LuaBattleGround
*
* @return uint32 maxPlayerCount
*/
int GetMaxPlayers(lua_State* L, BattleGround* bg)
int GetMaxPlayers(Eluna* E, BattleGround* bg)
{
Eluna::Push(L, bg->GetMaxPlayers());
E->Push(bg->GetMaxPlayers());
return 1;
}

Expand All @@ -177,9 +177,9 @@ namespace LuaBattleGround
*
* @return uint32 minPlayerCount
*/
int GetMinPlayers(lua_State* L, BattleGround* bg)
int GetMinPlayers(Eluna* E, BattleGround* bg)
{
Eluna::Push(L, bg->GetMinPlayers());
E->Push(bg->GetMinPlayers());
return 1;
}

Expand All @@ -188,9 +188,9 @@ namespace LuaBattleGround
*
* @return uint32 maxTeamPlayerCount
*/
int GetMaxPlayersPerTeam(lua_State* L, BattleGround* bg)
int GetMaxPlayersPerTeam(Eluna* E, BattleGround* bg)
{
Eluna::Push(L, bg->GetMaxPlayersPerTeam());
E->Push(bg->GetMaxPlayersPerTeam());
return 1;
}

Expand All @@ -199,9 +199,9 @@ namespace LuaBattleGround
*
* @return uint32 minTeamPlayerCount
*/
int GetMinPlayersPerTeam(lua_State* L, BattleGround* bg)
int GetMinPlayersPerTeam(Eluna* E, BattleGround* bg)
{
Eluna::Push(L, bg->GetMinPlayersPerTeam());
E->Push(bg->GetMinPlayersPerTeam());
return 1;
}

Expand All @@ -210,9 +210,9 @@ namespace LuaBattleGround
*
* @return [Team] team
*/
int GetWinner(lua_State* L, BattleGround* bg)
int GetWinner(Eluna* E, BattleGround* bg)
{
Eluna::Push(L, bg->GetWinner());
E->Push(bg->GetWinner());
return 1;
}

Expand All @@ -221,9 +221,9 @@ namespace LuaBattleGround
*
* @return [BattleGroundStatus] status
*/
int GetStatus(lua_State* L, BattleGround* bg)
int GetStatus(Eluna* E, BattleGround* bg)
{
Eluna::Push(L, bg->GetStatus());
E->Push(bg->GetStatus());
return 1;
}

Expand Down
Loading

0 comments on commit df0c097

Please sign in to comment.