Skip to content

Commit

Permalink
feat: Adding SetSpellPower for Player (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
iThorgrim committed Jan 28, 2024
1 parent fe1b709 commit d3638cd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/LuaEngine/LuaFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
15 changes: 15 additions & 0 deletions src/LuaEngine/PlayerMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit d3638cd

Please sign in to comment.