BuddyMe
Community Developer
- Joined
- Jun 13, 2014
- Messages
- 447
- Reaction score
- 16
DH Routine Request
Avoid power :
Mis reserve :
Sentry :
Min reserve logique for save primary :
Remove this part :
:hap:
Avoid power :
Code:
/// <summary>
/// Gets the best (non-movement related) avoidance power
/// </summary>
/// <returns></returns>
private static TrinityPower GetCombatAvoidancePower()
{
// Vault
int kiteDistance = 25;
if (TargetUtil.EliteOrTrashInRange(5f))
kiteDistance = 0;
if (CombatBase.CanCast(SNOPower.DemonHunter_Vault) &&
(kiteDistance <= 0 || (kiteDistance > 0 &&
(!CacheData.TimeBoundAvoidance.Any(a => a.Position.Distance(Trinity.CurrentDestination) <= kiteDistance) ||
(!CacheData.TimeBoundAvoidance.Any(a => MathEx.IntersectsPath(a.Position, a.Radius, Trinity.Player.Position, Trinity.CurrentDestination))) ||
!CacheData.MonsterObstacles.Any(a => a.Position.Distance(Trinity.CurrentDestination) <= kiteDistance)))))
{
return new TrinityPower(SNOPower.DemonHunter_Vault, 90f, Trinity.CurrentDestination);
}
// Smoke Screen
if (CanCast(SNOPower.DemonHunter_SmokeScreen, CanCastFlags.NoTimer))
{
return new TrinityPower(SNOPower.DemonHunter_SmokeScreen);
}
return null;
}
Mis reserve :
Code:
int MinEnergyReserve = 5;
if (Sets.EmbodimentOfTheMarauder.IsFullyEquipped || Hotbar.Contains(SNOPower.DemonHunter_Sentry))
MinEnergyReserve = 30;
Sentry :
Code:
// Sentry Turret
if (CanCast(SNOPower.DemonHunter_Sentry, CanCastFlags.NoTimer) &&
TargetUtil.AnyMobsInRange(150f) && Player.PrimaryResource >= 30)
{
// Low Health
if ((Player.CurrentHealthPct < 0.3f) &&
(Runes.DemonHunter.PolarStation.IsActive || Runes.DemonHunter.GuardianTurret.IsActive) &&
(TargetUtil.EliteOrTrashInRange(16f) || TargetUtil.AnyMobsInRange(16f, 2)))
{
return new TrinityPower(SNOPower.DemonHunter_Sentry, 5f, ZetaDia.Me.Position);
}
// Boss/Elite/Rare/Unique
if (CurrentTarget.IsBossOrEliteRareUnique)
return new TrinityPower(SNOPower.DemonHunter_Sentry, 65f, CurrentTarget.Position);
// Polar Station/Stun
if (Runes.DemonHunter.PolarStation.IsActive)
{
// try to Stun enemies on player position
if (TargetUtil.AnyMobsInRange(5f, 4))
return new TrinityPower(SNOPower.DemonHunter_Sentry, 5f, ZetaDia.Me.Position);
// try to Stun close enemies
if (TargetUtil.AnyMobsInRange(10f, 4))
return new TrinityPower(SNOPower.DemonHunter_Sentry, 65f, MathEx.CalculatePointFrom(Player.Position, CurrentTarget.Position, 15f));
}
// Guardian Turret, on player position for minimise damage
if ((TargetUtil.EliteOrTrashInRange(40f) || TargetUtil.AnyMobsInRange(10f, 5)) && Runes.DemonHunter.GuardianTurret.IsActive)
return new TrinityPower(SNOPower.DemonHunter_Sentry, 65f, ZetaDia.Me.Position);
// Best cluster point
var clusterPoint = Enemies.BestCluster.Position;
if (clusterPoint != Vector3.Zero)
return new TrinityPower(SNOPower.DemonHunter_Sentry, 65f, clusterPoint);
return new TrinityPower(SNOPower.DemonHunter_Sentry, 65f, CurrentTarget.ACDGuid);
}
Min reserve logique for save primary :
Code:
// Cluster Arrow
if (CanCast(SNOPower.DemonHunter_ClusterArrow) && !Player.IsIncapacitated &&
Player.PrimaryResource >= [B][COLOR="#00FF00"]MinEnergyReserve + 40[/COLOR][/B])
{
return new TrinityPower(SNOPower.DemonHunter_ClusterArrow, 60f, CurrentTarget.ACDGuid);
}
// Multi Shot
if (CanCast(SNOPower.DemonHunter_Multishot) && !Player.IsIncapacitated &&
Player.PrimaryResource >= [B][COLOR="#00FF00"]MinEnergyReserve + 25[/COLOR][/B])
{
return new TrinityPower(SNOPower.DemonHunter_Multishot, 55f, CurrentTarget.Position);
}
// Impale
if (CanCast(SNOPower.DemonHunter_Impale) && !Player.IsIncapacitated &&
Player.PrimaryResource >= [B][COLOR="#00FF00"]MinEnergyReserve + 20[/COLOR][/B])
{
return new TrinityPower(SNOPower.DemonHunter_Impale, 60f, CurrentTarget.ACDGuid);
}
// Elemental Arrow
if (CanCast(SNOPower.DemonHunter_ElementalArrow) && !Player.IsIncapacitated &&
(Player.PrimaryResource >= [B][COLOR="#00FF00"]MinEnergyReserve + 10[/COLOR][/B] || Legendary.Kridershot.IsEquipped))
{
return new TrinityPower(SNOPower.DemonHunter_ElementalArrow, 65f, CurrentTarget.ACDGuid);
}
// Elemental Arrow for Lightning DH
if (CanCast(SNOPower.DemonHunter_ElementalArrow) && !Player.IsIncapacitated && Runes.DemonHunter.BallLightning.IsActive &&
Passives.DemonHunter.NightStalker.IsActive && [B][COLOR="#00FF00"](Player.PrimaryResource >= MinEnergyReserve + 10 || Legendary.Kridershot.IsEquipped)[/COLOR][/B])
{
var bestTarget = TargetUtil.GetBestPierceTarget(60f, 0, true);
if (bestTarget != null)
return new TrinityPower(SNOPower.DemonHunter_ElementalArrow, 65f, bestTarget.Position);
return new TrinityPower(SNOPower.DemonHunter_ElementalArrow, 65f, CurrentTarget.Position);
}
// Chakram normal attack
if (Hotbar.Contains(SNOPower.DemonHunter_Chakram) && !Player.IsIncapacitated &&
!Runes.DemonHunter.ShurikenCloud.IsActive &&
(Player.PrimaryResource >= [B][COLOR="#00FF00"]MinEnergyReserve + 10[/COLOR][/B]))
{
return new TrinityPower(SNOPower.DemonHunter_Chakram, 50f, CurrentTarget.ACDGuid);
}
// Rapid Fire
if (CanCast(SNOPower.DemonHunter_RapidFire, CanCastFlags.NoTimer) &&
!Player.IsIncapacitated && Player.PrimaryResource >= [B][COLOR="#00FF00"]MinEnergyReserve + 16[/COLOR][/B] &&
(Player.PrimaryResource >= Settings.Combat.DemonHunter.RapidFireMinHatred || LastPowerUsed == SNOPower.DemonHunter_RapidFire))
{
// Players with grenades *AND* rapid fire should spam grenades at close-range instead
if (CanCast(SNOPower.DemonHunter_Grenades) && CurrentTarget.RadiusDistance <= 18f)
{
return new TrinityPower(SNOPower.DemonHunter_Grenades, 18f, CurrentTarget.ACDGuid);
}
// Now return rapid fire, if not sending grenades instead
return new TrinityPower(SNOPower.DemonHunter_RapidFire, 40f, CurrentTarget.Position);
}
// Strafe spam - similar to barbarian whirlwind routine
if (CanCast(SNOPower.DemonHunter_Strafe, CanCastFlags.NoTimer) &&
!Player.IsIncapacitated && !Player.IsRooted && Player.PrimaryResource >= [B][COLOR="#00FF00"]MinEnergyReserve + Settings.Combat.DemonHunter.StrafeMinHatred[/COLOR][/B])
{
bool shouldGetNewZigZag =
(DateTime.UtcNow.Subtract(LastChangedZigZag).TotalMilliseconds >= V.I("Barbarian.Whirlwind.ZigZagMaxTime") ||
CurrentTarget.ACDGuid != LastZigZagUnitAcdGuid ||
ZigZagPosition.Distance2D(Player.Position) <= 5f);
if (shouldGetNewZigZag)
{
var wwdist = V.F("Barbarian.Whirlwind.ZigZagDistance");
ZigZagPosition = TargetUtil.GetZigZagTarget(CurrentTarget.Position, wwdist);
LastZigZagUnitAcdGuid = CurrentTarget.ACDGuid;
LastChangedZigZag = DateTime.UtcNow;
}
int postCastTickDelay = TrinityPower.MillisecondsToTickDelay(250);
return new TrinityPower(SNOPower.DemonHunter_Strafe, 15f, ZigZagPosition, Trinity.Player.WorldDynamicID, -1, 0, postCastTickDelay);
}
Remove this part :
Code:
[COLOR="#FF0000"]// Vault
if (CanCast(SNOPower.DemonHunter_Vault) && !Player.IsRooted && !Player.IsIncapacitated &&
Settings.Combat.DemonHunter.VaultMode != DemonHunterVaultMode.MovementOnly &&
(TargetUtil.AnyMobsInRange(7f, 6) || Player.CurrentHealthPct <= 0.7) &&
// if we have ShadowPower and Disicpline is >= 16
// or if we don't have ShadoWpower and Discipline is >= 22
(Player.SecondaryResource >= (Hotbar.Contains(SNOPower.DemonHunter_ShadowPower) ? 22 : 16)) &&
TimeSincePowerUse(SNOPower.DemonHunter_Vault) >= Settings.Combat.DemonHunter.VaultMovementDelay)
{
Vector3 vNewTarget = NavHelper.MainFindSafeZone(Player.Position, true);
return new TrinityPower(SNOPower.DemonHunter_Vault, 20f, vNewTarget);
}[/COLOR]
:hap:

Attachments
Last edited: