From 1e5c6d6f46121a6dbffdc119abddaf14a4d719e5 Mon Sep 17 00:00:00 2001 From: kissingers Date: Thu, 16 Jul 2026 00:27:15 +0800 Subject: [PATCH] Remove the old and apply now glyph effect --- src/LuaEngine/methods/PlayerMethods.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/LuaEngine/methods/PlayerMethods.h b/src/LuaEngine/methods/PlayerMethods.h index c39801fc98..f2ba5b5cdd 100644 --- a/src/LuaEngine/methods/PlayerMethods.h +++ b/src/LuaEngine/methods/PlayerMethods.h @@ -3561,9 +3561,20 @@ namespace LuaPlayer uint32 glyphId = ALE::CHECKVAL(L, 2); uint32 slotIndex = ALE::CHECKVAL(L, 3); + // Remove the effect of the old glyph if it exists + uint32 oldGlyphId = player->GetGlyph(slotIndex); + if (oldGlyphId) + if (GlyphPropertiesEntry const* oldEntry = sGlyphPropertiesStore.LookupEntry(oldGlyphId)) + player->RemoveAurasDueToSpell(oldEntry->SpellId); + player->SetGlyph(slotIndex, glyphId, true); player->SendTalentsInfoData(false); // Also handles GlyphData + // Apply the effect of the new glyph if it exists + if (glyphId) + if (GlyphPropertiesEntry const* glyphEntry = sGlyphPropertiesStore.LookupEntry(glyphId)) + player->CastSpell(player, glyphEntry->SpellId, TriggerCastFlags(TRIGGERED_FULL_MASK & ~(TRIGGERED_IGNORE_SHAPESHIFT | TRIGGERED_IGNORE_CASTER_AURASTATE))); + return 0; }