diff --git a/src/LuaEngine/LuaFunctions.cpp b/src/LuaEngine/LuaFunctions.cpp index c4dfa33..1d7028e 100644 --- a/src/LuaEngine/LuaFunctions.cpp +++ b/src/LuaEngine/LuaFunctions.cpp @@ -689,6 +689,7 @@ ElunaRegister PlayerMethods[] = { "ModifyMoney", &LuaPlayer::ModifyMoney }, { "LearnSpell", &LuaPlayer::LearnSpell }, { "LearnTalent", &LuaPlayer::LearnTalent }, + { "SetGlyph", &LuaPlayer::SetGlyph }, #if !defined(CLASSIC) { "RemoveArenaSpellCooldowns", &LuaPlayer::RemoveArenaSpellCooldowns }, #endif diff --git a/src/LuaEngine/PlayerMethods.h b/src/LuaEngine/PlayerMethods.h index 30df491..c7737c6 100644 --- a/src/LuaEngine/PlayerMethods.h +++ b/src/LuaEngine/PlayerMethods.h @@ -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(L, 2); + uint32 slotIndex = Eluna::CHECKVAL(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.