From 4da07db66ae65aa83a5ca022b969f3b3a2d52221 Mon Sep 17 00:00:00 2001 From: iThorgrim Date: Sat, 25 Jan 2025 12:13:42 +0100 Subject: [PATCH 1/4] Feat(LuaEngine/PlayerMethods): BonusTalent methods --- src/LuaEngine/LuaFunctions.cpp | 4 +++ src/LuaEngine/methods/PlayerMethods.h | 50 +++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/src/LuaEngine/LuaFunctions.cpp b/src/LuaEngine/LuaFunctions.cpp index b5db1b315e..876d699f9b 100644 --- a/src/LuaEngine/LuaFunctions.cpp +++ b/src/LuaEngine/LuaFunctions.cpp @@ -532,6 +532,7 @@ ElunaRegister PlayerMethods[] = { "GetShieldBlockValue", &LuaPlayer::GetShieldBlockValue }, { "GetPlayerSettingValue", &LuaPlayer::GetPlayerSettingValue }, { "GetTrader", &LuaPlayer::GetTrader }, + { "GetBonusTalentCount", &LuaPlayer::GetBonusTalentCount }, // Setters { "AdvanceSkillsToMax", &LuaPlayer::AdvanceSkillsToMax }, @@ -565,6 +566,9 @@ ElunaRegister PlayerMethods[] = { "SetPlayerLock", &LuaPlayer::SetPlayerLock }, { "SetGender", &LuaPlayer::SetGender }, { "SetSheath", &LuaPlayer::SetSheath }, + { "SetBonusTalentCount", &LuaPlayer::SetBonusTalentCount }, + { "AddBonusTalent", &LuaPlayer::AddBonusTalent }, + { "RemoveBonusTalent", &LuaPlayer::RemoveBonusTalent }, // Boolean { "HasTankSpec", &LuaPlayer::HasTankSpec }, diff --git a/src/LuaEngine/methods/PlayerMethods.h b/src/LuaEngine/methods/PlayerMethods.h index b0d3c298ae..ab35678410 100644 --- a/src/LuaEngine/methods/PlayerMethods.h +++ b/src/LuaEngine/methods/PlayerMethods.h @@ -3913,5 +3913,55 @@ namespace LuaPlayer player->RemovePet(player->GetPet(), (PetSaveMode)mode, returnreagent); return 0; }*/ + + /** + * Set bonus talent count to a specific count for the [Player] + * + * @param uint32 value : bonus talent points + */ + int SetBonusTalentCount(lua_State* L, Player* player) + { + uint32 value = Eluna::CHECKVAL(L, 2); + + player->SetBonusTalentCount(value); + return 0; + } + + /** + * Get bonus talents count from the [Player] + * + * @return uint32 bonusTalent + */ + int GetBonusTalentCount(lua_State* L, Player* player) + { + Eluna::Push(L, player->GetBonusTalentCount()); + return 1; + } + + /** + * Add bonus talents count to the [Player] + * + * @param uint32 count = count of bonus talent + */ + int AddBonusTalent(lua_State* L, Player* player) + { + uint32 count = Eluna::CHECKVAL(L, 2); + + player->AddBonusTalent(count); + return 0; + } + + /** + * Remove bonus talents count to the [Player] + * + * @param uint32 count = count of bonus talent + */ + int RemoveBonusTalent(lua_State* L, Player* player) + { + uint32 count = Eluna::CHECKVAL(L, 2); + + player->RemoveBonusTalent(count); + return 0; + } }; #endif \ No newline at end of file From ed5eac42c8ce9330826da4c95a07d8b2164d6673 Mon Sep 17 00:00:00 2001 From: iThorgrim <125808072+iThorgrim@users.noreply.github.com> Date: Tue, 28 Jan 2025 09:53:37 +0100 Subject: [PATCH 2/4] Update src/LuaEngine/methods/PlayerMethods.h Co-authored-by: IntelligentQuantum --- src/LuaEngine/methods/PlayerMethods.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LuaEngine/methods/PlayerMethods.h b/src/LuaEngine/methods/PlayerMethods.h index ab35678410..b4a1460884 100644 --- a/src/LuaEngine/methods/PlayerMethods.h +++ b/src/LuaEngine/methods/PlayerMethods.h @@ -3921,7 +3921,7 @@ namespace LuaPlayer */ int SetBonusTalentCount(lua_State* L, Player* player) { - uint32 value = Eluna::CHECKVAL(L, 2); + uint32 value = Eluna::CHECKVAL(L, 2); player->SetBonusTalentCount(value); return 0; From 8ed790866c2f869c15a38a4f07a6b366e0c0bd1b Mon Sep 17 00:00:00 2001 From: iThorgrim <125808072+iThorgrim@users.noreply.github.com> Date: Tue, 28 Jan 2025 09:53:42 +0100 Subject: [PATCH 3/4] Update src/LuaEngine/methods/PlayerMethods.h Co-authored-by: IntelligentQuantum --- src/LuaEngine/methods/PlayerMethods.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LuaEngine/methods/PlayerMethods.h b/src/LuaEngine/methods/PlayerMethods.h index b4a1460884..3a579ad530 100644 --- a/src/LuaEngine/methods/PlayerMethods.h +++ b/src/LuaEngine/methods/PlayerMethods.h @@ -3945,7 +3945,7 @@ namespace LuaPlayer */ int AddBonusTalent(lua_State* L, Player* player) { - uint32 count = Eluna::CHECKVAL(L, 2); + uint32 count = Eluna::CHECKVAL(L, 2); player->AddBonusTalent(count); return 0; From 252a9d230dbb0cc465a894b75d3366c4ebde3bd0 Mon Sep 17 00:00:00 2001 From: iThorgrim <125808072+iThorgrim@users.noreply.github.com> Date: Tue, 28 Jan 2025 09:53:48 +0100 Subject: [PATCH 4/4] Update src/LuaEngine/methods/PlayerMethods.h Co-authored-by: IntelligentQuantum --- src/LuaEngine/methods/PlayerMethods.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LuaEngine/methods/PlayerMethods.h b/src/LuaEngine/methods/PlayerMethods.h index 3a579ad530..aa565319ef 100644 --- a/src/LuaEngine/methods/PlayerMethods.h +++ b/src/LuaEngine/methods/PlayerMethods.h @@ -3958,7 +3958,7 @@ namespace LuaPlayer */ int RemoveBonusTalent(lua_State* L, Player* player) { - uint32 count = Eluna::CHECKVAL(L, 2); + uint32 count = Eluna::CHECKVAL(L, 2); player->RemoveBonusTalent(count); return 0;