Merge pull request #1 from r-o-b-o-t-o/feat/arena-methods

feat: expose RemoveArenaSpellCooldowns and RemoveArenaAuras
This commit is contained in:
55Honey
2021-10-20 21:11:08 +02:00
committed by GitHub
3 changed files with 28 additions and 0 deletions

View File

@@ -389,6 +389,9 @@ ElunaRegister<Unit> UnitMethods[] =
{ "AddAura", &LuaUnit::AddAura },
{ "RemoveAura", &LuaUnit::RemoveAura },
{ "RemoveAllAuras", &LuaUnit::RemoveAllAuras },
#if !defined(CLASSIC)
{ "RemoveArenaAuras", &LuaUnit::RemoveArenaAuras },
#endif
{ "ClearInCombat", &LuaUnit::ClearInCombat },
{ "DeMorph", &LuaUnit::DeMorph },
{ "SendUnitWhisper", &LuaUnit::SendUnitWhisper },
@@ -663,6 +666,9 @@ ElunaRegister<Player> PlayerMethods[] =
{ "ModifyMoney", &LuaPlayer::ModifyMoney },
{ "LearnSpell", &LuaPlayer::LearnSpell },
{ "LearnTalent", &LuaPlayer::LearnTalent },
#if !defined(CLASSIC)
{ "RemoveArenaSpellCooldowns", &LuaPlayer::RemoveArenaSpellCooldowns },
#endif
{ "RemoveItem", &LuaPlayer::RemoveItem },
{ "RemoveLifetimeKills", &LuaPlayer::RemoveLifetimeKills },
{ "ResurrectPlayer", &LuaPlayer::ResurrectPlayer },

View File

@@ -3728,6 +3728,17 @@ namespace LuaPlayer
return 0;
}
#if !defined(CLASSIC)
/**
* Remove cooldowns on spells that have less than 10 minutes of cooldown from the [Player], similarly to when you enter an arena.
*/
int RemoveArenaSpellCooldowns(lua_State* /*L*/, Player* player)
{
player->RemoveArenaSpellCooldowns();
return 0;
}
#endif
/**
* Resurrects the [Player].
*

View File

@@ -2657,6 +2657,17 @@ namespace LuaUnit
return 0;
}
#if !defined(CLASSIC)
/**
* Removes all positive visible [Aura]'s from the [Unit].
*/
int RemoveArenaAuras(lua_State* /*L*/, Unit* unit)
{
unit->RemoveArenaAuras();
return 0;
}
#endif
/**
* Adds the given unit state for the [Unit].
*