From 31b9b46ec674708f7d270761a0c4bcb291ba4f7f Mon Sep 17 00:00:00 2001 From: Axel Cocat Date: Sat, 24 Jul 2021 18:53:39 +0200 Subject: [PATCH] feat: add RemoveArenaSpellCooldowns and RemoveArenaAuras --- LuaFunctions.cpp | 2 ++ PlayerMethods.h | 9 +++++++++ UnitMethods.h | 11 ++++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index 841a86c..6960189 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -389,6 +389,7 @@ ElunaRegister UnitMethods[] = { "AddAura", &LuaUnit::AddAura }, { "RemoveAura", &LuaUnit::RemoveAura }, { "RemoveAllAuras", &LuaUnit::RemoveAllAuras }, + { "RemoveArenaAuras", &LuaUnit::RemoveArenaAuras }, { "ClearInCombat", &LuaUnit::ClearInCombat }, { "DeMorph", &LuaUnit::DeMorph }, { "SendUnitWhisper", &LuaUnit::SendUnitWhisper }, @@ -663,6 +664,7 @@ ElunaRegister PlayerMethods[] = { "ModifyMoney", &LuaPlayer::ModifyMoney }, { "LearnSpell", &LuaPlayer::LearnSpell }, { "LearnTalent", &LuaPlayer::LearnTalent }, + { "RemoveArenaSpellCooldowns", &LuaPlayer::RemoveArenaSpellCooldowns }, { "RemoveItem", &LuaPlayer::RemoveItem }, { "RemoveLifetimeKills", &LuaPlayer::RemoveLifetimeKills }, { "ResurrectPlayer", &LuaPlayer::ResurrectPlayer }, diff --git a/PlayerMethods.h b/PlayerMethods.h index 4e8f8f0..3fb76d2 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -3733,6 +3733,15 @@ namespace LuaPlayer return 0; } + /** + * 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; + } + /** * Resurrects the [Player]. * diff --git a/UnitMethods.h b/UnitMethods.h index 2e9a673..0946b7a 100644 --- a/UnitMethods.h +++ b/UnitMethods.h @@ -2656,7 +2656,16 @@ namespace LuaUnit unit->RemoveAllAuras(); return 0; } - + + /** + * Removes all positive visible [Aura]'s from the [Unit]. + */ + int RemoveArenaAuras(lua_State* /*L*/, Unit* unit) + { + unit->RemoveArenaAuras(); + return 0; + } + /** * Adds the given unit state for the [Unit]. *