Skip to content

Commit d869057

Browse files
feat(LuaEngine/PlayerMethods): BonusTalent methods (azerothcore#235)
Co-authored-by: IntelligentQuantum <[email protected]>
1 parent b799efd commit d869057

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

src/LuaEngine/LuaFunctions.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ ElunaRegister<Player> PlayerMethods[] =
539539
{ "GetShieldBlockValue", &LuaPlayer::GetShieldBlockValue },
540540
{ "GetPlayerSettingValue", &LuaPlayer::GetPlayerSettingValue },
541541
{ "GetTrader", &LuaPlayer::GetTrader },
542+
{ "GetBonusTalentCount", &LuaPlayer::GetBonusTalentCount },
542543

543544
// Setters
544545
{ "AdvanceSkillsToMax", &LuaPlayer::AdvanceSkillsToMax },
@@ -572,6 +573,9 @@ ElunaRegister<Player> PlayerMethods[] =
572573
{ "SetPlayerLock", &LuaPlayer::SetPlayerLock },
573574
{ "SetGender", &LuaPlayer::SetGender },
574575
{ "SetSheath", &LuaPlayer::SetSheath },
576+
{ "SetBonusTalentCount", &LuaPlayer::SetBonusTalentCount },
577+
{ "AddBonusTalent", &LuaPlayer::AddBonusTalent },
578+
{ "RemoveBonusTalent", &LuaPlayer::RemoveBonusTalent },
575579
{ "GetHomebind", &LuaPlayer::GetHomebind },
576580
{ "GetSpells", &LuaPlayer::GetSpells },
577581

src/LuaEngine/methods/PlayerMethods.h

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3914,6 +3914,30 @@ namespace LuaPlayer
39143914
return 0;
39153915
}*/
39163916

3917+
/**
3918+
* Set bonus talent count to a specific count for the [Player]
3919+
*
3920+
* @param uint32 value : bonus talent points
3921+
*/
3922+
int SetBonusTalentCount(lua_State* L, Player* player)
3923+
{
3924+
uint32 value = Eluna::CHECKVAL<uint32>(L, 2);
3925+
3926+
player->SetBonusTalentCount(value);
3927+
return 0;
3928+
}
3929+
3930+
/**
3931+
* Get bonus talents count from the [Player]
3932+
*
3933+
* @return uint32 bonusTalent
3934+
*/
3935+
int GetBonusTalentCount(lua_State* L, Player* player)
3936+
{
3937+
Eluna::Push(L, player->GetBonusTalentCount());
3938+
return 1;
3939+
}
3940+
39173941
/**
39183942
* Returns the [Player] spells list
39193943
*
@@ -3938,6 +3962,32 @@ namespace LuaPlayer
39383962
return 1;
39393963
}
39403964

3965+
/**
3966+
* Add bonus talents count to the [Player]
3967+
*
3968+
* @param uint32 count = count of bonus talent
3969+
*/
3970+
int AddBonusTalent(lua_State* L, Player* player)
3971+
{
3972+
uint32 count = Eluna::CHECKVAL<uint32>(L, 2);
3973+
3974+
player->AddBonusTalent(count);
3975+
return 0;
3976+
}
3977+
3978+
/**
3979+
* Remove bonus talents count to the [Player]
3980+
*
3981+
* @param uint32 count = count of bonus talent
3982+
*/
3983+
int RemoveBonusTalent(lua_State* L, Player* player)
3984+
{
3985+
uint32 count = Eluna::CHECKVAL<uint32>(L, 2);
3986+
3987+
player->RemoveBonusTalent(count);
3988+
return 0;
3989+
}
3990+
39413991
/**
39423992
* Returns the [Player] homebind location.
39433993
*

0 commit comments

Comments
 (0)