blahblah999
Community Developer
- Joined
- Apr 29, 2014
- Messages
- 6
- Reaction score
- 0
Purposes
To spam Dash Strike with RoTS set bonus and Jawbreaker. Prioritized for cluster and mobs with distance over 30 yards.
two file modifications are required. [tested with trinity 1.9.8]
1) Plugins\Trinity\Combat\TargetUtil.cs
after "#endregion",(line 57 for trinity 1.9.8), insert the following lines.
2)Plugins\Trinity\Combat\Abilities\Monk.cs
Original:
Modified:
or you can download the modified files to replace your originals.
View attachment Monk.cs
View attachment TargetUtil.cs
To spam Dash Strike with RoTS set bonus and Jawbreaker. Prioritized for cluster and mobs with distance over 30 yards.
two file modifications are required. [tested with trinity 1.9.8]
1) Plugins\Trinity\Combat\TargetUtil.cs
after "#endregion",(line 57 for trinity 1.9.8), insert the following lines.
Code:
internal static TrinityCacheObject GetDashStrikeFarthestTarget(float maxRange,float procDistance = 33f, int arcDegrees = 0)
{
var result =
(from u in ObjectCache
where u.IsUnit && u.Distance >= procDistance &&
u.RadiusDistance <= maxRange
orderby u.RadiusDistance descending
select u).FirstOrDefault();
return result;
}
internal static Vector3 GetDashStrikeBestClusterPoint(float radius = 15f, float maxRange = 65f, float procDistance = 33f, bool useWeights = true, bool includeUnitsInAoe = true)
{
if (radius < 5f)
radius = 5f;
if (maxRange > 300f)
maxRange = 300f;
bool includeHealthGlobes = false;
switch (Trinity.Player.ActorClass)
{
case ActorClass.Barbarian:
includeHealthGlobes = CombatBase.Hotbar.Contains(SNOPower.Barbarian_Whirlwind) &&
Trinity.Settings.Combat.Misc.CollectHealthGlobe &&
ObjectCache.Any(g => g.Type == GObjectType.HealthGlobe && g.Weight > 0);
break;
}
Vector3 bestClusterPoint;
var clusterUnits =
(from u in ObjectCache
where (u.IsUnit || (includeHealthGlobes && u.Type == GObjectType.HealthGlobe)) &&
((useWeights && u.Weight > 0) || !useWeights) &&
(includeUnitsInAoe || !UnitOrPathInAoE(u)) &&
u.RadiusDistance <= maxRange && u.Distance >= procDistance
orderby u.Type != GObjectType.HealthGlobe // if it's a globe this will be false and sorted at the top
orderby !u.IsBossOrEliteRareUnique
orderby u.NearbyUnitsWithinDistance(radius) descending
orderby u.Distance
orderby u.HitPointsPct descending
select u.Position).ToList();
if (clusterUnits.Any())
bestClusterPoint = clusterUnits.FirstOrDefault();
else
bestClusterPoint = Trinity.Player.Position;
return bestClusterPoint;
}
2)Plugins\Trinity\Combat\Abilities\Monk.cs
Original:
Code:
// Dashing Strike
if (!UseOOCBuff && !IsCurrentlyAvoiding && !Player.IsIncapacitated && CurrentTarget.Distance >= 16f &&
CombatBase.CanCast(SNOPower.X1_Monk_DashingStrike, CombatBase.CanCastFlags.NoTimer))
{
Monk_TickSweepingWindSpam();
return new TrinityPower(SNOPower.X1_Monk_DashingStrike, Monk_MaxDashingStrikeRange, CurrentTarget.Position, CurrentWorldDynamicId, -1, 2, 2);
}
Modified:
Code:
// Dashing Strike 2#
var procDistance = 33f;
if (!UseOOCBuff && !IsCurrentlyAvoiding && !Player.IsIncapacitated && CombatBase.CanCast(SNOPower.X1_Monk_DashingStrike, CombatBase.CanCastFlags.NoTimer) )
{ // able to cast
if ( TargetUtil.AnyMobsInRange(25f, 3) || TargetUtil.IsEliteTargetInRange(70f) ) // surround by mobs or elite engaged.
{
var farthestTarget = TargetUtil.GetDashStrikeFarthestTarget(49f,procDistance);
if (farthestTarget != null) // found a target within 33-49 yards.
{
Monk_TickSweepingWindSpam();
return new TrinityPower(SNOPower.X1_Monk_DashingStrike, Monk_MaxDashingStrikeRange, farthestTarget.Position, CurrentWorldDynamicId, -1, 2, 2);
} else { // no free target found, get a nearby cluster point instead.
var bestClusterPoint = TargetUtil.GetBestClusterPoint(15f, procDistance);
Monk_TickSweepingWindSpam();
return new TrinityPower(SNOPower.X1_Monk_DashingStrike, Monk_MaxDashingStrikeRange, bestClusterPoint, CurrentWorldDynamicId, -1, 2, 2);
}
}
else if ( TargetUtil.ClusterExists(20,50,3) ) //usually this trigger after dash to the farthest target. dash a single mobs >30 yards, trying to dash back the cluster
{
var dashStrikeBestClusterPoint = TargetUtil.GetDashStrikeBestClusterPoint(20f, 50f, procDistance);
if (dashStrikeBestClusterPoint != Trinity.Player.Position)
{
Monk_TickSweepingWindSpam();
return new TrinityPower(SNOPower.X1_Monk_DashingStrike, Monk_MaxDashingStrikeRange, dashStrikeBestClusterPoint, CurrentWorldDynamicId, -1, 2, 2);
}
}
else // dash to anything which is free.
{
var farthestTarget = TargetUtil.GetDashStrikeFarthestTarget(49f,procDistance);
if (farthestTarget != null)
{
Monk_TickSweepingWindSpam();
return new TrinityPower(SNOPower.X1_Monk_DashingStrike, Monk_MaxDashingStrikeRange, farthestTarget.Position, CurrentWorldDynamicId, -1, 2, 2);
}
}
}
or you can download the modified files to replace your originals.
View attachment Monk.cs
View attachment TargetUtil.cs
Last edited: