mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
feat: Adding SetSpellPower for Player (#162)
This commit is contained in:
@@ -571,6 +571,7 @@ ElunaRegister<Player> PlayerMethods[] =
|
|||||||
{ "SetRankPoints", &LuaPlayer::SetRankPoints },
|
{ "SetRankPoints", &LuaPlayer::SetRankPoints },
|
||||||
{ "SetHonorLastWeekStandingPos", &LuaPlayer::SetHonorLastWeekStandingPos },
|
{ "SetHonorLastWeekStandingPos", &LuaPlayer::SetHonorLastWeekStandingPos },
|
||||||
#endif
|
#endif
|
||||||
|
{ "SetSpellPower", &LuaPlayer::SetSpellPower },
|
||||||
{ "SetLifetimeKills", &LuaPlayer::SetLifetimeKills },
|
{ "SetLifetimeKills", &LuaPlayer::SetLifetimeKills },
|
||||||
{ "SetGameMaster", &LuaPlayer::SetGameMaster },
|
{ "SetGameMaster", &LuaPlayer::SetGameMaster },
|
||||||
{ "SetGMChat", &LuaPlayer::SetGMChat },
|
{ "SetGMChat", &LuaPlayer::SetGMChat },
|
||||||
|
|||||||
@@ -4369,6 +4369,21 @@ namespace LuaPlayer
|
|||||||
return 1;
|
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)
|
/*int BindToInstance(lua_State* L, Player* player)
|
||||||
{
|
{
|
||||||
player->BindToInstance();
|
player->BindToInstance();
|
||||||
|
|||||||
Reference in New Issue
Block a user