feature: Add GetGlyph (#178)

Co-authored-by: 55Honey <71938210+55Honey@users.noreply.github.com>
This commit is contained in:
Tralenor
2024-06-11 21:24:00 +02:00
committed by GitHub
parent cc442de602
commit 067fa20bad
2 changed files with 13 additions and 0 deletions

View File

@@ -706,6 +706,7 @@ ElunaRegister<Player> PlayerMethods[] =
{ "LearnSpell", &LuaPlayer::LearnSpell },
{ "LearnTalent", &LuaPlayer::LearnTalent },
{ "SetGlyph", &LuaPlayer::SetGlyph },
{ "GetGlyph", &LuaPlayer::GetGlyph },
#if !defined(CLASSIC)
{ "RemoveArenaSpellCooldowns", &LuaPlayer::RemoveArenaSpellCooldowns },
#endif

View File

@@ -3953,6 +3953,18 @@ namespace LuaPlayer
return 0;
}
/**
* Get glyphId of the glyph slot specified by `slotIndex` off the [Player]'s current talent specialization.`
* @param uint32 slotIndex
* @return glyphId of the glyph in the selected glyph slot or 0 in case the glyph slot is empty
*/
int GetGlyph(lua_State* L, Player* player)
{
auto slotIndex = Eluna::CHECKVAL<uint32>(L, 2);
Eluna::Push(L,player->GetGlyph(slotIndex));
return 1;
}
#if !defined(CLASSIC)
/**
* Remove cooldowns on spells that have less than 10 minutes of cooldown from the [Player], similarly to when you enter an arena.