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();