public override SpellFailedReason Initialize()
 {
     return(this.m_cast.GlyphSlot != 0U &&
            (int)GlyphInfoHolder.GetPropertiesEntryForGlyph((uint)this.m_cast.Spell.Effects[0].MiscValue)
            .TypeFlags !=
            (int)GlyphInfoHolder
            .GetGlyphSlotEntryForGlyphSlotId(
                this.m_cast.CasterChar.GetGlyphSlot((byte)this.m_cast.GlyphSlot)).TypeFlags
         ? SpellFailedReason.InvalidGlyph
         : SpellFailedReason.Ok);
 }
Esempio n. 2
0
        public override SpellFailedReason Initialize()
        {
            if (m_cast.GlyphSlot != 0)
            {
                var glyph      = (uint)m_cast.Spell.Effects[0].MiscValue;
                var properties = GlyphInfoHolder.GetPropertiesEntryForGlyph(glyph);
                var slot       = GlyphInfoHolder.GetGlyphSlotEntryForGlyphSlotId(m_cast.CasterChar.GetGlyphSlot((byte)m_cast.GlyphSlot));
                if (properties.TypeFlags != slot.TypeFlags)
                {
                    return(SpellFailedReason.InvalidGlyph);
                }
            }

            return(SpellFailedReason.Ok);
        }