From d3638cd99da699d9e955fdd0f6bef5ce0fcece68 Mon Sep 17 00:00:00 2001 From: V <125808072+vaiocti@users.noreply.github.com> Date: Sun, 28 Jan 2024 13:51:51 +0100 Subject: [PATCH] feat: Adding SetSpellPower for Player (#162) --- src/LuaEngine/LuaFunctions.cpp | 1 + src/LuaEngine/PlayerMethods.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/LuaEngine/LuaFunctions.cpp b/src/LuaEngine/LuaFunctions.cpp index 58a2ae7321..d7a811a61f 100644 --- a/src/LuaEngine/LuaFunctions.cpp +++ b/src/LuaEngine/LuaFunctions.cpp @@ -571,6 +571,7 @@ ElunaRegister PlayerMethods[] = { "SetRankPoints", &LuaPlayer::SetRankPoints }, { "SetHonorLastWeekStandingPos", &LuaPlayer::SetHonorLastWeekStandingPos }, #endif + { "SetSpellPower", &LuaPlayer::SetSpellPower }, { "SetLifetimeKills", &LuaPlayer::SetLifetimeKills }, { "SetGameMaster", &LuaPlayer::SetGameMaster }, { "SetGMChat", &LuaPlayer::SetGMChat }, diff --git a/src/LuaEngine/PlayerMethods.h b/src/LuaEngine/PlayerMethods.h index 8b3d8c0848..b6684f4cfd 100644 --- a/src/LuaEngine/PlayerMethods.h +++ b/src/LuaEngine/PlayerMethods.h @@ -4369,6 +4369,21 @@ namespace LuaPlayer return 1; } + /** + * The [Player] sets the spell power + * + * @param int value : The spell power value to set + * @param bool apply = false : Whether the spell power should be applied or removed + */ + int SetSpellPower(lua_State* L, Player* player) + { + int value = Eluna::CHECKVAL(L, 2); + bool apply = Eluna::CHECKVAL(L, 3, false); + + player->ApplySpellPowerBonus(value, apply); + return 0; + } + /*int BindToInstance(lua_State* L, Player* player) { player->BindToInstance();