diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index 5fa8190b6..9c1c97d8e 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -2903,9 +2903,7 @@ namespace Framework.Constants Raid, RaidClass, Passenger, - Summoned, - Threat, - Tap + Summoned } public enum SpellTargetDirectionTypes diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index 9a9260e67..90f6c613e 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -6,6 +6,7 @@ using Framework.Dynamic; using Game.AI; using Game.BattleFields; using Game.BattleGrounds; +using Game.Combat; using Game.Conditions; using Game.DataStorage; using Game.Entities; @@ -889,6 +890,7 @@ namespace Game.Spells switch (targetType.GetTarget()) { case Targets.UnitCasterAndPassengers: + { targets.Add(m_caster); Unit unit = m_caster.ToUnit(); if (unit != null) @@ -903,7 +905,9 @@ namespace Game.Spells } } break; + } case Targets.UnitTargetAllyOrRaid: + { Unit targetedUnit = m_targets.GetUnitTarget(); if (targetedUnit != null) { @@ -913,10 +917,41 @@ namespace Game.Spells SearchAreaTargets(targets, spellEffectInfo, radius, targetedUnit, referer, targetType.GetObjectType(), targetType.GetCheckType(), spellEffectInfo.ImplicitTargetConditions, WorldObjectSpellAreaTargetSearchReason.Area); } break; + } case Targets.UnitCasterAndSummons: + { targets.Add(m_caster); SearchAreaTargets(targets, spellEffectInfo, radius, center, referer, targetType.GetObjectType(), targetType.GetCheckType(), spellEffectInfo.ImplicitTargetConditions, WorldObjectSpellAreaTargetSearchReason.Area); break; + } + case Targets.UnitAreaThreatList: + { + Unit unit = m_caster.ToUnit(); + if (unit != null) + { + foreach (ThreatReference threatRef in unit.GetThreatManager().GetSortedThreatList()) + { + Unit threateningUnit = threatRef.GetVictim(); + if (threateningUnit != null) + targets.Add(threateningUnit); + } + } + break; + } + case Targets.UnitAreaTapList: + { + Creature creature = m_caster.ToCreature(); + if (creature != null) + { + foreach (ObjectGuid tapperGuid in creature.GetTapList()) + { + Player tapper = Global.ObjAccessor.GetPlayer(m_caster, tapperGuid); + if (tapper != null) + targets.Add(tapper); + } + } + break; + } default: SearchAreaTargets(targets, spellEffectInfo, radius, center, referer, targetType.GetObjectType(), targetType.GetCheckType(), spellEffectInfo.ImplicitTargetConditions, WorldObjectSpellAreaTargetSearchReason.Area); break; @@ -9112,16 +9147,6 @@ namespace Game.Spells if (unitTarget.ToTempSummon().GetSummonerGUID() != _caster.GetGUID()) return false; break; - case SpellTargetCheckTypes.Threat: - if (!_referer.IsUnit() || _referer.ToUnit().GetThreatManager().GetThreat(unitTarget, true) <= 0.0f) - return false; - break; - case SpellTargetCheckTypes.Tap: - if (_referer.GetTypeId() != TypeId.Unit || unitTarget.GetTypeId() != TypeId.Player) - return false; - if (!_referer.ToCreature().IsTappedBy(unitTarget.ToPlayer())) - return false; - break; default: break; } diff --git a/Source/Game/Spells/SpellInfo.cs b/Source/Game/Spells/SpellInfo.cs index 0ccc788dc..b1248a779 100644 --- a/Source/Game/Spells/SpellInfo.cs +++ b/Source/Game/Spells/SpellInfo.cs @@ -5099,8 +5099,8 @@ namespace Game.Spells new StaticData(SpellTargetObjectTypes.Corpse, SpellTargetReferenceTypes.Caster, SpellTargetSelectionCategories.Area, SpellTargetCheckTypes.Raid, SpellTargetDirectionTypes.None), // 119 TARGET_CORPSE_SRC_AREA_RAID new StaticData(SpellTargetObjectTypes.Unit, SpellTargetReferenceTypes.Caster, SpellTargetSelectionCategories.Area, SpellTargetCheckTypes.Summoned, SpellTargetDirectionTypes.None), // 120 TARGET_UNIT_SELF_AND_SUMMONS new StaticData(SpellTargetObjectTypes.Corpse, SpellTargetReferenceTypes.Target, SpellTargetSelectionCategories.Default, SpellTargetCheckTypes.Ally, SpellTargetDirectionTypes.None), // 121 TARGET_CORPSE_TARGET_ALLY - new StaticData(SpellTargetObjectTypes.Unit, SpellTargetReferenceTypes.Caster, SpellTargetSelectionCategories.Area, SpellTargetCheckTypes.Threat, SpellTargetDirectionTypes.None), // 122 TARGET_UNIT_AREA_THREAT_LIST - new StaticData(SpellTargetObjectTypes.Unit, SpellTargetReferenceTypes.Caster, SpellTargetSelectionCategories.Area, SpellTargetCheckTypes.Tap, SpellTargetDirectionTypes.None), // 123 TARGET_UNIT_AREA_TAP_LIST + new StaticData(SpellTargetObjectTypes.Unit, SpellTargetReferenceTypes.Caster, SpellTargetSelectionCategories.Area, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 122 TARGET_UNIT_AREA_THREAT_LIST + new StaticData(SpellTargetObjectTypes.Unit, SpellTargetReferenceTypes.Caster, SpellTargetSelectionCategories.Area, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 123 TARGET_UNIT_AREA_TAP_LIST new StaticData(SpellTargetObjectTypes.Unit, SpellTargetReferenceTypes.Caster, SpellTargetSelectionCategories.Default, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 124 TARGET_UNIT_TARGET_TAP_LIST new StaticData(SpellTargetObjectTypes.Dest, SpellTargetReferenceTypes.Caster, SpellTargetSelectionCategories.Default, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 125 TARGET_DEST_CASTER_GROUND_2 new StaticData(SpellTargetObjectTypes.Unit, SpellTargetReferenceTypes.None, SpellTargetSelectionCategories.Nyi, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 126 TARGET_UNIT_CASTER_AREA_ENEMY_CLUMP