diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index 694420199..efbe63059 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -1464,7 +1464,7 @@ namespace Framework.Constants All = (Normal | Magic), } - [System.Flags] + [Flags] public enum SpellCastFlags : uint { None = 0x0, diff --git a/Source/Game/Entities/GameObject/GameObjectData.cs b/Source/Game/Entities/GameObject/GameObjectData.cs index cd6868326..68185b92d 100644 --- a/Source/Game/Entities/GameObject/GameObjectData.cs +++ b/Source/Game/Entities/GameObject/GameObjectData.cs @@ -275,6 +275,19 @@ namespace Game.Entities } } + public uint GetRequireLOS() => type switch + { + GameObjectTypes.Button => Button.requireLOS, + GameObjectTypes.QuestGiver => QuestGiver.requireLOS, + GameObjectTypes.Chest => Chest.requireLOS, + GameObjectTypes.Trap => Trap.requireLOS, + GameObjectTypes.Goober => Goober.requireLOS, + GameObjectTypes.FlagStand => FlagStand.requireLOS, + GameObjectTypes.NewFlag => NewFlag.requireLOS, + GameObjectTypes.GatheringNode => GatheringNode.requireLOS, + _ => 0, + }; + public uint GetLockId() { switch (type) diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index bb20424a6..37942aa5a 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -6557,6 +6557,12 @@ namespace Game.Spells if (m_spellInfo.HasAttribute(SpellAttr2.CanTargetNotInLos) || Global.DisableMgr.IsDisabledFor(DisableType.Spell, m_spellInfo.Id, null, (byte)DisableFlags.SpellLOS)) return true; + // check if gameobject ignores LOS + GameObject gobCaster = m_caster.ToGameObject(); + if (gobCaster != null) + if (!gobCaster.GetGoInfo().GetRequireLOS()) + return true; + // if spell is triggered, need to check for LOS disable on the aura triggering it and inherit that behaviour if (IsTriggered() && m_triggeredByAuraSpell != null && (m_triggeredByAuraSpell.HasAttribute(SpellAttr2.CanTargetNotInLos) || Global.DisableMgr.IsDisabledFor(DisableType.Spell, m_triggeredByAuraSpell.Id, null, (byte)DisableFlags.SpellLOS))) return true;