Core/Spells: Implemented SPELL_ATTR8_CAN_HIT_AOE_UNTARGETABLE

Port From (https://github.com/TrinityCore/TrinityCore/commit/877ae5b47d56a754b56f1326990f5ae41aa989c9)
This commit is contained in:
hondacrx
2024-02-21 21:05:21 -05:00
parent a9b13b7891
commit 33f3e9d68f
3 changed files with 5 additions and 5 deletions
@@ -1932,7 +1932,7 @@ namespace Framework.Constants
IgnoreDynamicObjectCaster = 0x02, /*Nyi*/ // Ignore Dynamic Object Caster IgnoreDynamicObjectCaster = 0x02, /*Nyi*/ // Ignore Dynamic Object Caster
RemoveOutsideDungeonsAndRaids = 0x04, // Remove Outside Dungeons And Raids RemoveOutsideDungeonsAndRaids = 0x04, // Remove Outside Dungeons And Raids
OnlyTargetIfSameCreator = 0x08, // Only Target If Same Creator OnlyTargetIfSameCreator = 0x08, // Only Target If Same Creator
CanHitAoeUntargetable = 0x10, /*Nyi - No Aoe Immunity Implementation*/ // Can Hit Aoe Untargetable CanHitAoeUntargetable = 0x10, // Can Hit Aoe Untargetable
AllowWhileCharmed = 0x20, /*Nyi - Not Implementable Currently, Charming Replaces Ai*/ // Allow While Charmed AllowWhileCharmed = 0x20, /*Nyi - Not Implementable Currently, Charming Replaces Ai*/ // Allow While Charmed
AuraRequiredByClient = 0x40, /*Nyi - We Send All Auras To Client*/ // Aura Required By Client AuraRequiredByClient = 0x40, /*Nyi - We Send All Auras To Client*/ // Aura Required By Client
IgnoreSanctuary = 0x80, // Ignore Sanctuary IgnoreSanctuary = 0x80, // Ignore Sanctuary
@@ -1959,7 +1959,7 @@ namespace Framework.Constants
NotInBattleground = 0x10000000, // Not In Battleground NotInBattleground = 0x10000000, // Not In Battleground
MasteryAffectsPoints = 0x20000000, // Mastery Affects Points MasteryAffectsPoints = 0x20000000, // Mastery Affects Points
DisplayLargeAuraIconOnUnitFramesBossAura = 0x40000000, // Display Large Aura Icon On Unit Frames (Boss Aura) DisplayLargeAuraIconOnUnitFramesBossAura = 0x40000000, // Display Large Aura Icon On Unit Frames (Boss Aura)
AttackIgnoreImmuneToPcFlag = 0x80000000 // Can Attack Immunepc Description Do Not Check UnitFlagImmuneToPc In Isvalidattacktarget CanAttackImmunePC = 0x80000000 // Can Attack Immunepc Description Do Not Check UnitFlagImmuneToPc In Isvalidattacktarget
} }
public enum SpellAttr9 : uint public enum SpellAttr9 : uint
{ {
+2 -2
View File
@@ -2616,7 +2616,7 @@ namespace Game.Entities
if (!unitTarget.HasUnitFlag(UnitFlags.PlayerControlled) && unitOrOwner.IsImmuneToNPC()) if (!unitTarget.HasUnitFlag(UnitFlags.PlayerControlled) && unitOrOwner.IsImmuneToNPC())
return false; return false;
if (bySpell == null || !bySpell.HasAttribute(SpellAttr8.AttackIgnoreImmuneToPcFlag)) if (bySpell == null || !bySpell.HasAttribute(SpellAttr8.CanAttackImmunePC))
{ {
if (unitOrOwner.HasUnitFlag(UnitFlags.PlayerControlled) && unitTarget.IsImmuneToPC()) if (unitOrOwner.HasUnitFlag(UnitFlags.PlayerControlled) && unitTarget.IsImmuneToPC())
return false; return false;
@@ -2761,7 +2761,7 @@ namespace Game.Entities
{ {
if (unit != null && unit.HasUnitFlag(UnitFlags.PlayerControlled)) if (unit != null && unit.HasUnitFlag(UnitFlags.PlayerControlled))
{ {
if (bySpell == null || !bySpell.HasAttribute(SpellAttr8.AttackIgnoreImmuneToPcFlag)) if (bySpell == null || !bySpell.HasAttribute(SpellAttr8.CanAttackImmunePC))
if (unitTarget != null && unitTarget.IsImmuneToPC()) if (unitTarget != null && unitTarget.IsImmuneToPC())
return false; return false;
} }
+1 -1
View File
@@ -9191,7 +9191,7 @@ namespace Game.Spells
switch (_searchReason) switch (_searchReason)
{ {
case WorldObjectSpellAreaTargetSearchReason.Area: case WorldObjectSpellAreaTargetSearchReason.Area:
if (unitTarget.GetSpellOtherImmunityMask().HasFlag(SpellOtherImmunity.AoETarget)) if (!_spellInfo.HasAttribute(SpellAttr8.CanHitAoeUntargetable) && unitTarget.GetSpellOtherImmunityMask().HasFlag(SpellOtherImmunity.AoETarget))
return false; return false;
break; break;
case WorldObjectSpellAreaTargetSearchReason.Chain: case WorldObjectSpellAreaTargetSearchReason.Chain: