feat: Adding SetSpellPower for Player (#162)

This commit is contained in:
V
2024-01-28 13:51:51 +01:00
committed by GitHub
parent fe1b709c18
commit d3638cd99d
2 changed files with 16 additions and 0 deletions

View File

@@ -571,6 +571,7 @@ ElunaRegister<Player> PlayerMethods[] =
{ "SetRankPoints", &LuaPlayer::SetRankPoints },
{ "SetHonorLastWeekStandingPos", &LuaPlayer::SetHonorLastWeekStandingPos },
#endif
{ "SetSpellPower", &LuaPlayer::SetSpellPower },
{ "SetLifetimeKills", &LuaPlayer::SetLifetimeKills },
{ "SetGameMaster", &LuaPlayer::SetGameMaster },
{ "SetGMChat", &LuaPlayer::SetGMChat },

View File

@@ -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<int>(L, 2);
bool apply = Eluna::CHECKVAL<bool>(L, 3, false);
player->ApplySpellPowerBonus(value, apply);
return 0;
}
/*int BindToInstance(lua_State* L, Player* player)
{
player->BindToInstance();