Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/LuaEngine/methods/PlayerMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -3561,9 +3561,20 @@ namespace LuaPlayer
uint32 glyphId = ALE::CHECKVAL<uint32>(L, 2);
uint32 slotIndex = ALE::CHECKVAL<uint32>(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;
}

Expand Down
Loading