From 502136e5d6e1142b50eda12955cc9968799109d4 Mon Sep 17 00:00:00 2001 From: V <125808072+vaiocti@users.noreply.github.com> Date: Sun, 28 Jan 2024 13:50:07 +0100 Subject: [PATCH] feat: Add Specialization Check Methods to Player (#163) --- src/LuaEngine/LuaFunctions.cpp | 4 ++++ src/LuaEngine/PlayerMethods.h | 44 ++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/src/LuaEngine/LuaFunctions.cpp b/src/LuaEngine/LuaFunctions.cpp index ebf32d8459..c9aa1698fe 100644 --- a/src/LuaEngine/LuaFunctions.cpp +++ b/src/LuaEngine/LuaFunctions.cpp @@ -593,6 +593,10 @@ ElunaRegister PlayerMethods[] = #endif // Boolean + { "HasTankSpec", &LuaPlayer::HasTankSpec }, + { "HasMeleeSpec", &LuaPlayer::HasMeleeSpec }, + { "HasCasterSpec", &LuaPlayer::HasCasterSpec }, + { "HasHealSpec", &LuaPlayer::HasHealSpec }, { "IsInGroup", &LuaPlayer::IsInGroup }, { "IsInGuild", &LuaPlayer::IsInGuild }, { "IsGM", &LuaPlayer::IsGM }, diff --git a/src/LuaEngine/PlayerMethods.h b/src/LuaEngine/PlayerMethods.h index c7737c66f9..37d7914950 100644 --- a/src/LuaEngine/PlayerMethods.h +++ b/src/LuaEngine/PlayerMethods.h @@ -405,6 +405,50 @@ namespace LuaPlayer } #endif + /** + * Returns `true` if the [Player] has a Tank Specialization, `false` otherwise. + * + * @return bool HasTankSpec + */ + int HasTankSpec(lua_State* L, Player* player) + { + Eluna::Push(L, player->HasTankSpec()); + return 1; + } + + /** + * Returns `true` if the [Player] has a Melee Specialization, `false` otherwise. + * + * @return bool HasMeleeSpec + */ + int HasMeleeSpec(lua_State* L, Player* player) + { + Eluna::Push(L, player->HasMeleeSpec()); + return 1; + } + + /** + * Returns `true` if the [Player] has a Caster Specialization, `false` otherwise. + * + * @return bool HasCasterSpec + */ + int HasCasterSpec(lua_State* L, Player* player) + { + Eluna::Push(L, player->HasCasterSpec()); + return 1; + } + + /** + * Returns `true` if the [Player] has a Heal Specialization, `false` otherwise. + * + * @return bool HasHealSpec + */ + int HasHealSpec(lua_State* L, Player* player) + { + Eluna::Push(L, player->HasHealSpec()); + return 1; + } + /** * Returns `true` if the [Player] is in a [Group], `false` otherwise. *