Core/Spells: Implemented target 115 TARGET_UNIT_SRC_AREA_FURTHEST_ENEMY
Port From (https://github.com/TrinityCore/TrinityCore/commit/b50783ae80bdd6595c8a5f262171fdef5659da2d)
This commit is contained in:
@@ -2689,7 +2689,7 @@ namespace Framework.Constants
|
|||||||
Unk112 = 112,
|
Unk112 = 112,
|
||||||
Unk113 = 113,
|
Unk113 = 113,
|
||||||
Unk114 = 114,
|
Unk114 = 114,
|
||||||
Unk115 = 115,
|
UnitSrcAreaFurthestEnemy = 115,
|
||||||
UnitAndDestLastEnemy = 116,
|
UnitAndDestLastEnemy = 116,
|
||||||
Unk117 = 117,
|
Unk117 = 117,
|
||||||
UnitTargetAllyOrRaid = 118, // If target is in your party or raid, all party and raid members will be affected
|
UnitTargetAllyOrRaid = 118, // If target is in your party or raid, all party and raid members will be affected
|
||||||
|
|||||||
@@ -707,7 +707,7 @@ namespace Game.Spells
|
|||||||
|
|
||||||
void SelectImplicitAreaTargets(SpellEffectInfo spellEffectInfo, SpellImplicitTargetInfo targetType, uint effMask)
|
void SelectImplicitAreaTargets(SpellEffectInfo spellEffectInfo, SpellImplicitTargetInfo targetType, uint effMask)
|
||||||
{
|
{
|
||||||
WorldObject referer = null;
|
WorldObject referer;
|
||||||
switch (targetType.GetReferenceType())
|
switch (targetType.GetReferenceType())
|
||||||
{
|
{
|
||||||
case SpellTargetReferenceTypes.Src:
|
case SpellTargetReferenceTypes.Src:
|
||||||
@@ -808,12 +808,20 @@ namespace Game.Spells
|
|||||||
|
|
||||||
CallScriptObjectAreaTargetSelectHandlers(targets, spellEffectInfo.EffectIndex, targetType);
|
CallScriptObjectAreaTargetSelectHandlers(targets, spellEffectInfo.EffectIndex, targetType);
|
||||||
|
|
||||||
|
if (targetType.GetTarget() == Targets.UnitSrcAreaFurthestEnemy)
|
||||||
|
targets.Sort(new ObjectDistanceOrderPred(referer, false));
|
||||||
|
|
||||||
if (!targets.Empty())
|
if (!targets.Empty())
|
||||||
{
|
{
|
||||||
// Other special target selection goes here
|
// Other special target selection goes here
|
||||||
uint maxTargets = m_spellValue.MaxAffectedTargets;
|
uint maxTargets = m_spellValue.MaxAffectedTargets;
|
||||||
if (maxTargets != 0)
|
if (maxTargets != 0)
|
||||||
targets.RandomResize(maxTargets);
|
{
|
||||||
|
if (targetType.GetTarget() != Targets.UnitSrcAreaFurthestEnemy)
|
||||||
|
targets.RandomResize(maxTargets);
|
||||||
|
else if (targets.Count > maxTargets)
|
||||||
|
targets.Resize(maxTargets);
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var obj in targets)
|
foreach (var obj in targets)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5038,7 +5038,7 @@ namespace Game.Spells
|
|||||||
new StaticData(SpellTargetObjectTypes.Dest, SpellTargetReferenceTypes.Caster, SpellTargetSelectionCategories.Default, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 112
|
new StaticData(SpellTargetObjectTypes.Dest, SpellTargetReferenceTypes.Caster, SpellTargetSelectionCategories.Default, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 112
|
||||||
new StaticData(SpellTargetObjectTypes.None, SpellTargetReferenceTypes.None, SpellTargetSelectionCategories.Nyi, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 113
|
new StaticData(SpellTargetObjectTypes.None, SpellTargetReferenceTypes.None, SpellTargetSelectionCategories.Nyi, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 113
|
||||||
new StaticData(SpellTargetObjectTypes.None, SpellTargetReferenceTypes.None, SpellTargetSelectionCategories.Nyi, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 114
|
new StaticData(SpellTargetObjectTypes.None, SpellTargetReferenceTypes.None, SpellTargetSelectionCategories.Nyi, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 114
|
||||||
new StaticData(SpellTargetObjectTypes.None, SpellTargetReferenceTypes.None, SpellTargetSelectionCategories.Nyi, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 115
|
new StaticData(SpellTargetObjectTypes.Unit, SpellTargetReferenceTypes.Src, SpellTargetSelectionCategories.Area, SpellTargetCheckTypes.Enemy, SpellTargetDirectionTypes.None), // 115 TARGET_UNIT_SRC_AREA_FURTHEST_ENEMY
|
||||||
new StaticData(SpellTargetObjectTypes.UnitAndDest, SpellTargetReferenceTypes.Last, SpellTargetSelectionCategories.Area, SpellTargetCheckTypes.Enemy, SpellTargetDirectionTypes.None), // 116 TARGET_UNIT_AND_DEST_LAST_ENEMY
|
new StaticData(SpellTargetObjectTypes.UnitAndDest, SpellTargetReferenceTypes.Last, SpellTargetSelectionCategories.Area, SpellTargetCheckTypes.Enemy, SpellTargetDirectionTypes.None), // 116 TARGET_UNIT_AND_DEST_LAST_ENEMY
|
||||||
new StaticData(SpellTargetObjectTypes.None, SpellTargetReferenceTypes.None, SpellTargetSelectionCategories.Nyi, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 117
|
new StaticData(SpellTargetObjectTypes.None, SpellTargetReferenceTypes.None, SpellTargetSelectionCategories.Nyi, SpellTargetCheckTypes.Default, SpellTargetDirectionTypes.None), // 117
|
||||||
new StaticData(SpellTargetObjectTypes.Unit, SpellTargetReferenceTypes.Caster, SpellTargetSelectionCategories.Area, SpellTargetCheckTypes.Raid, SpellTargetDirectionTypes.None), // 118 TARGET_UNIT_TARGET_ALLY_OR_RAID
|
new StaticData(SpellTargetObjectTypes.Unit, SpellTargetReferenceTypes.Caster, SpellTargetSelectionCategories.Area, SpellTargetCheckTypes.Raid, SpellTargetDirectionTypes.None), // 118 TARGET_UNIT_TARGET_ALLY_OR_RAID
|
||||||
|
|||||||
Reference in New Issue
Block a user