Core/SAI: Add maxSize parameter to SMART_TARGET_CREATURE_DISTANCE, SMART_TARGET_GAMEOBJECT_DISTANCE, SMART_TARGET_CREATURE_RANGE and SMART_TARGET_GAMEOBJECT_RANGE
Port From (https://github.com/TrinityCore/TrinityCore/commit/d6ce2fa8b8b48c6634a6fc55c4e7d7e93278f94b)
This commit is contained in:
@@ -3163,6 +3163,7 @@ namespace Game.AI
|
|||||||
public uint creature;
|
public uint creature;
|
||||||
public uint minDist;
|
public uint minDist;
|
||||||
public uint maxDist;
|
public uint maxDist;
|
||||||
|
public uint maxSize;
|
||||||
}
|
}
|
||||||
public struct UnitGUID
|
public struct UnitGUID
|
||||||
{
|
{
|
||||||
@@ -3173,6 +3174,7 @@ namespace Game.AI
|
|||||||
{
|
{
|
||||||
public uint creature;
|
public uint creature;
|
||||||
public uint dist;
|
public uint dist;
|
||||||
|
public uint maxSize;
|
||||||
}
|
}
|
||||||
public struct PlayerDistance
|
public struct PlayerDistance
|
||||||
{
|
{
|
||||||
@@ -3192,6 +3194,7 @@ namespace Game.AI
|
|||||||
public uint entry;
|
public uint entry;
|
||||||
public uint minDist;
|
public uint minDist;
|
||||||
public uint maxDist;
|
public uint maxDist;
|
||||||
|
public uint maxSize;
|
||||||
}
|
}
|
||||||
public struct GoGUID
|
public struct GoGUID
|
||||||
{
|
{
|
||||||
@@ -3202,6 +3205,7 @@ namespace Game.AI
|
|||||||
{
|
{
|
||||||
public uint entry;
|
public uint entry;
|
||||||
public uint dist;
|
public uint dist;
|
||||||
|
public uint maxSize;
|
||||||
}
|
}
|
||||||
public struct Position
|
public struct Position
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2726,6 +2726,9 @@ namespace Game.AI
|
|||||||
if ((e.Target.unitRange.creature == 0 || obj.ToCreature().GetEntry() == e.Target.unitRange.creature) && baseObject.IsInRange(obj, e.Target.unitRange.minDist, e.Target.unitRange.maxDist))
|
if ((e.Target.unitRange.creature == 0 || obj.ToCreature().GetEntry() == e.Target.unitRange.creature) && baseObject.IsInRange(obj, e.Target.unitRange.minDist, e.Target.unitRange.maxDist))
|
||||||
targets.Add(obj);
|
targets.Add(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (e.Target.unitRange.maxSize != 0)
|
||||||
|
targets.RandomResize(e.Target.unitRange.maxSize);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SmartTargets.CreatureDistance:
|
case SmartTargets.CreatureDistance:
|
||||||
@@ -2742,6 +2745,9 @@ namespace Game.AI
|
|||||||
if (e.Target.unitDistance.creature == 0 || obj.ToCreature().GetEntry() == e.Target.unitDistance.creature)
|
if (e.Target.unitDistance.creature == 0 || obj.ToCreature().GetEntry() == e.Target.unitDistance.creature)
|
||||||
targets.Add(obj);
|
targets.Add(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (e.Target.unitDistance.maxSize != 0)
|
||||||
|
targets.RandomResize(e.Target.unitDistance.maxSize);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SmartTargets.GameobjectDistance:
|
case SmartTargets.GameobjectDistance:
|
||||||
@@ -2758,6 +2764,9 @@ namespace Game.AI
|
|||||||
if (e.Target.goDistance.entry == 0 || obj.ToGameObject().GetEntry() == e.Target.goDistance.entry)
|
if (e.Target.goDistance.entry == 0 || obj.ToGameObject().GetEntry() == e.Target.goDistance.entry)
|
||||||
targets.Add(obj);
|
targets.Add(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (e.Target.goDistance.maxSize != 0)
|
||||||
|
targets.RandomResize(e.Target.goDistance.maxSize);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SmartTargets.GameobjectRange:
|
case SmartTargets.GameobjectRange:
|
||||||
@@ -2774,6 +2783,9 @@ namespace Game.AI
|
|||||||
if ((e.Target.goRange.entry == 0 && obj.ToGameObject().GetEntry() == e.Target.goRange.entry) && baseObject.IsInRange(obj, e.Target.goRange.minDist, e.Target.goRange.maxDist))
|
if ((e.Target.goRange.entry == 0 && obj.ToGameObject().GetEntry() == e.Target.goRange.entry) && baseObject.IsInRange(obj, e.Target.goRange.minDist, e.Target.goRange.maxDist))
|
||||||
targets.Add(obj);
|
targets.Add(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (e.Target.goRange.maxSize != 0)
|
||||||
|
targets.RandomResize(e.Target.goRange.maxSize);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SmartTargets.CreatureGuid:
|
case SmartTargets.CreatureGuid:
|
||||||
|
|||||||
Reference in New Issue
Block a user