Skip to content

Commit

Permalink
add Player:SetGlyph (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tralenor authored Aug 7, 2023
1 parent b92b8bf commit 510eb1d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/LuaEngine/LuaFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ ElunaRegister<Player> PlayerMethods[] =
{ "ModifyMoney", &LuaPlayer::ModifyMoney },
{ "LearnSpell", &LuaPlayer::LearnSpell },
{ "LearnTalent", &LuaPlayer::LearnTalent },
{ "SetGlyph", &LuaPlayer::SetGlyph },
#if !defined(CLASSIC)
{ "RemoveArenaSpellCooldowns", &LuaPlayer::RemoveArenaSpellCooldowns },
#endif
Expand Down
17 changes: 17 additions & 0 deletions src/LuaEngine/PlayerMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -3834,6 +3834,23 @@ namespace LuaPlayer
return 0;
}

/**
* Adds a glyph specified by `glyphId` to the [Player]'s current talent specialization into the slot with the index `slotIndex`
*
* @param uint32 glyphId
* @param uint32 slotIndex
*/
int SetGlyph(lua_State* L, Player* player)
{
uint32 glyphId = Eluna::CHECKVAL<uint32>(L, 2);
uint32 slotIndex = Eluna::CHECKVAL<uint32>(L, 3);

player->SetGlyph(slotIndex, glyphId, true);
player->SendTalentsInfoData(false); // Also handles GlyphData

return 0;
}

#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.
Expand Down

0 comments on commit 510eb1d

Please sign in to comment.