Skip to content

Commit

Permalink
feat: Add Specialization Check Methods to Player (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
iThorgrim committed Jan 28, 2024
1 parent a3997ac commit 502136e
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/LuaEngine/LuaFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,10 @@ ElunaRegister<Player> PlayerMethods[] =
#endif

// Boolean
{ "HasTankSpec", &LuaPlayer::HasTankSpec },
{ "HasMeleeSpec", &LuaPlayer::HasMeleeSpec },
{ "HasCasterSpec", &LuaPlayer::HasCasterSpec },
{ "HasHealSpec", &LuaPlayer::HasHealSpec },
{ "IsInGroup", &LuaPlayer::IsInGroup },
{ "IsInGuild", &LuaPlayer::IsInGuild },
{ "IsGM", &LuaPlayer::IsGM },
Expand Down
44 changes: 44 additions & 0 deletions src/LuaEngine/PlayerMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit 502136e

Please sign in to comment.