protected override bool ShouldEnergyTwister(out TrinityActor target)
        {
            target = null;

            if (!Skills.Wizard.EnergyTwister.CanCast())
            {
                return(false);
            }

            if (Skills.Wizard.EnergyTwister.TimeSinceUse < Settings.EnergyTwisterDelay)
            {
                return(false);
            }

            target = TargetUtil.BestEliteInRange(50, true);
            if (target != null)
            {
                return(true);
            }

            target = TargetUtil.BestAoeUnit(50, true);
            if (TargetUtil.BestAoeUnit(50, true) != null)
            {
                return(true);
            }

            target = TargetUtil.GetBestClusterUnit() ?? CurrentTarget;
            if (Skills.Wizard.Archon.CooldownRemaining < 2000 && TalRashaStacks < 3)
            {
                return(true);
            }

            target = TargetUtil.GetBestClusterUnit() ?? CurrentTarget;
            return(target != null);
        }
Exemple #2
0
        protected override bool ShouldCripplingWave(out TrinityActor target)
        {
            target = null;

            if (!Skills.Monk.CripplingWave.CanCast())
            {
                return(false);
            }

            target = TargetUtil.BestEliteInRange(45, true);
            if (target != null && target.Distance < 12)
            {
                return(true);
            }

            target = TargetUtil.BestAoeUnit(45, true);
            if (target != null && target.Distance < 12) //removed resource check here
            {
                return(true);
            }

            target = TargetUtil.BestAuraUnit(SNOPower.Monk_CripplingWave, 12f, true);
            if (target != null && target.Distance < 12)
            {
                return(true);
            }

            target = TargetUtil.GetClosestUnit(12f);
            return(target != null);
        }
        protected override bool ShouldBlackHole(out TrinityActor target)
        {
            target = null;

            if (!Skills.Wizard.BlackHole.CanCast())
            {
                return(false);
            }

            if (Skills.Wizard.BlackHole.TimeSinceUse < Settings.BlackHoleDelay)
            {
                return(false);
            }

            target = TargetUtil.BestEliteInRange(50, true);
            if (target != null)
            {
                return(true);
            }

            target = TargetUtil.BestAoeUnit(50, true);
            if (TargetUtil.BestAoeUnit(50, true) != null)
            {
                return(true);
            }

            //Make sure that we get all of our Tal Stacks before Archon!
            target = TargetUtil.GetBestClusterUnit() ?? CurrentTarget;
            if (Skills.Wizard.Archon.CooldownRemaining < 2000 && TalRashaStacks < 3)
            {
                return(true);
            }

            return(target != null);
        }
Exemple #4
0
        private Target GetTarget(SkillSettings settings)
        {
            var    maxRange = Math.Max(TrashRange, EliteRange);
            Target target   = null;

            if (settings.Target.HasFlag(UseTarget.Default))
            {
                target = new Target(CurrentTarget);
            }

            else if (settings.Target.HasFlag(UseTarget.CurrentTarget))
            {
                target = new Target(CurrentTarget);
            }

            else if (settings.Target.HasFlag(UseTarget.BestCluster))
            {
                target = new Target(TargetUtil.GetBestClusterUnit(maxRange));
            }

            else if (settings.Target.HasFlag(UseTarget.ClosestMonster))
            {
                target = new Target(TargetUtil.ClosestUnit(maxRange));
            }

            else if (settings.Target.HasFlag(UseTarget.ElitesOnly))
            {
                target = new Target(TargetUtil.BestEliteInRange(maxRange));
            }

            else if (settings.Target.HasFlag(UseTarget.Self))
            {
                target = new Target(Player.Actor);
            }

            else if (settings.Target.HasFlag(UseTarget.SafeSpot))
            {
                target = new Target(Avoider.SafeSpot);
            }

            return(target);
        }
Exemple #5
0
        protected override bool ShouldCorpseLance(out TrinityActor target)
        {
            target = null;

            if (!Skills.Necromancer.CorpseLance.CanCast())
            {
                return(false);
            }

            var shouldRefreshNays = Legendary.NayrsBlackDeath.IsBuffActive && Core.Buffs.GetBuffStacks(SNOPower.P6_ItemPassive_Unique_Ring_066) < 3;

            if (shouldRefreshNays || Skills.Necromancer.LandOfTheDead.IsBuffActive ||
                (Settings.UseExtraCorpses && TargetUtil.CorpseCount(60f) > 0))
            {
                target = TargetUtil.BestEliteInRange(60f) ?? CurrentTarget;
                return(target != null);
            }

            return(false);
        }
Exemple #6
0
        protected override bool ShouldBoneSpear(out TrinityActor target)
        {
            target = null;

            if (!Skills.Necromancer.BoneSpear.CanCast())
            {
                return(false);
            }


            if (Skills.Necromancer.LandOfTheDead.IsBuffActive)
            {
                return(false);
            }

            var boneSpearTarget = TargetUtil.AnyElitesInRange(60f) ?
                                  TargetUtil.BestEliteInRange(60f, true) : TargetUtil.LowestHealthTarget(60f);

            target = boneSpearTarget ?? CurrentTarget;
            return(target != null);
        }
        public TrinityPower GetOffensivePower()
        {
            if (Player.IsCastingPortal)
            {
                return(null);
            }

            if (Player.IsInRift && ZetaDia.Storage.RiftCompleted && !Player.IsCastingPortal && !TargetUtil.AnyMobsInRange(12) && InventoryManager.Backpack.Any(i => i.ActorSnoId == 408416))
            {
                ZetaDia.Me.UseTownPortal();
                return(null);
            }

            // 锁定奥拉什
            var target = Core.Actors.Actors.Where(u => u.ActorSnoId == 360636).ToList().FirstOrDefault();

            if (target == null)
            {
                target = TargetUtil.BestEliteInRange(50) ?? TrinityCombat.Targeting.CurrentTarget;
            }

            if (target.Distance > 15 && Skills.Wizard.Teleport.CanCast())
            {
                return(Teleport(target.Position));
            }

            if (target.Distance > 10)
            {
                return(Walk(target.Position));
            }

            if (target.IsUnit && target.IsValid && !target.IsDead)
            {
                return(SpectralBlade(target));
            }

            return(null);
        }
Exemple #8
0
        public TrinityPower GetOffensivePower()
        {
            TrinityPower power;
            var          target   = CurrentTarget;
            Vector3      position = Vector3.Zero;

            if (Skills.Wizard.ArchonTeleport.CanCast() || Skills.Wizard.Teleport.CanCast())
            {
                if (!Core.Buffs.HasInvulnerableShrine && Core.Avoidance.InAvoidance(Core.Player.Position))
                {
                    Core.Avoidance.Avoider.TryGetSafeSpot(out position, 35, 50, Player.Position);

                    if (position == Vector3.Zero)
                    {
                        Core.Avoidance.Avoider.TryGetSafeSpot(out position, 15, 50, Player.Position);
                    }
                }
                if (!Core.Buffs.HasInvulnerableShrine)
                {
                    if (IsArchonActive)
                    {
                        if (TargetUtil.AnyElitesInRange(10) && Skills.Wizard.ArchonTeleport.TimeSinceUse > 2000)
                        {
                            Core.Avoidance.Avoider.TryGetSafeSpot(out position, 35, 50, CurrentTarget.Position);

                            if (position == Vector3.Zero)
                            {
                                Core.Avoidance.Avoider.TryGetSafeSpot(out position, 20, 50, CurrentTarget.Position);
                            }
                        }
                        if (TargetUtil.AnyMobsInRange(15, 3) && Skills.Wizard.ArchonTeleport.TimeSinceUse > 3000)
                        {
                            Core.Avoidance.Avoider.TryGetSafeSpot(out position, 35, 50, CurrentTarget.Position);

                            if (position == Vector3.Zero)
                            {
                                Core.Avoidance.Avoider.TryGetSafeSpot(out position, 20, 50, CurrentTarget.Position);
                            }
                        }
                        if (Player.CurrentHealthPct < 1 && Skills.Wizard.ArchonTeleport.TimeSinceUse > 2000)
                        {
                            Core.Avoidance.Avoider.TryGetSafeSpot(out position, 35, 50, Player.Position);

                            if (position == Vector3.Zero)
                            {
                                Core.Avoidance.Avoider.TryGetSafeSpot(out position, 15, 50, Player.Position);
                            }
                        }
                    }
                    if (!IsArchonActive)
                    {
                        if (TargetUtil.AnyElitesInRange(10) && Skills.Wizard.Teleport.TimeSinceUse > 1200)
                        {
                            Core.Avoidance.Avoider.TryGetSafeSpot(out position, 35, 50, CurrentTarget.Position);

                            if (position == Vector3.Zero)
                            {
                                Core.Avoidance.Avoider.TryGetSafeSpot(out position, 20, 50, CurrentTarget.Position);
                            }
                        }

                        if (TargetUtil.AnyMobsInRange(15, 3) && Skills.Wizard.Teleport.TimeSinceUse > 1200)
                        {
                            Core.Avoidance.Avoider.TryGetSafeSpot(out position, 35, 50, CurrentTarget.Position);

                            if (position == Vector3.Zero)
                            {
                                Core.Avoidance.Avoider.TryGetSafeSpot(out position, 20, 50, CurrentTarget.Position);
                            }
                        }
                        if (Player.CurrentHealthPct < 1 && Skills.Wizard.Teleport.TimeSinceUse > 1200)
                        {
                            Core.Avoidance.Avoider.TryGetSafeSpot(out position, 35, 50, Player.Position);

                            if (position == Vector3.Zero)
                            {
                                Core.Avoidance.Avoider.TryGetSafeSpot(out position, 15, 50, Player.Position);
                            }
                        }
                    }
                }

                if (target.IsBoss && target.Distance < 25 && (Skills.Wizard.ArchonTeleport.TimeSinceUse > 2000 || Skills.Wizard.Teleport.TimeSinceUse > 2000))
                {
                    Core.Avoidance.Avoider.TryGetSafeSpot(out position, 40, 50, CurrentTarget.Position);
                }

                if (position != Vector3.Zero && !TrinityGrid.Instance.IsIntersectedByFlags(ZetaDia.Me.Position, position, AvoidanceFlags.Combat, AvoidanceFlags.CriticalAvoidance))
                {
                    return(Teleport(position));
                }
            }

            if (!IsArchonActive)
            {
                if (Player.CurrentHealthPct <= 0.7f && Skills.Wizard.Archon.CanCast())
                {
                    Core.Logger.Log(LogCategory.Spells, $"Emergency Archon, LOW ON HP {Player.CurrentHealthPct}%!");
                    return(Archon());
                }
                if (Legendary.ConventionOfElements.IsEquipped)
                {
                    if (Skills.Wizard.Archon.CanCast())
                    {
                        if (Core.Buffs.ConventionElement == Element.Fire && TalRashaStacks >= 3)
                        {
                            Core.Logger.Log(LogCategory.Spells, $"Archon conditions met (TalRasha {TalRashaStacks} stacks && We are on {Core.Buffs.ConventionElement}!)");
                            return(Archon());
                        }

                        if (Core.Buffs.ConventionElement == Element.Fire && TalRashaStacks >= 2)
                        {
                            Core.Logger.Log(LogCategory.Spells, $"Archon conditions met (TalRasha {TalRashaStacks} stacks && We are on {Core.Buffs.ConventionElement}!)");
                            return(Archon());
                        }
                    }
                }
                if (!Legendary.ConventionOfElements.IsEquipped)
                {
                    if (Skills.Wizard.Archon.CanCast() && TalRashaStacks >= 2)
                    {
                        Core.Logger.Log(LogCategory.Spells, $"Archon conditions met (TalRasha {TalRashaStacks} stacks!)");
                        return(Archon());
                    }
                }
            }

            if (IsArchonActive)
            {
                target = null;
                var targetElite = TargetUtil.BestEliteInRange(75);
                var targett     = TargetUtil.BestRangedAoeUnit(30, 75, Settings.ClusterSize, true, true);
                var targettt    = TargetUtil.GetBestClusterUnit(30, 75, true, true, false, true) ?? CurrentTarget;
                if (targetElite != null)
                {
                    Core.Logger.Log(LogCategory.Targetting, $"Ladies first!");
                    return(ArchonDisintegrationWave(targetElite));
                }
                else if (targett != null)
                {
                    Core.Logger.Log(LogCategory.Targetting, $"Good hunts are second!");
                    return(ArchonDisintegrationWave(targett));
                }
                else
                {
                    Core.Logger.Log(LogCategory.Targetting, $"Archon Disintegration: Pew Pew Pew!");
                    return(ArchonDisintegrationWave(targettt));
                }
            }

            var lastBlackHolePosition = Vector3.Zero;

            power = null;
            if (Skills.Wizard.BlackHole.CanCast() && Core.Player.PrimaryResource > 18)
            {
                if (Skills.Wizard.BlackHole.CurrentRune == Runes.Wizard.Spellsteal || Skills.Wizard.BlackHole.CurrentRune == Runes.Wizard.AbsoluteZero)
                {
                    if (TargetUtil.NumMobsInRangeOfPosition(target.Position, 15) > Skills.Wizard.BlackHole.BuffStacks)
                    {
                        lastBlackHolePosition = target.Position;
                        {
                            Core.Logger.Log(LogCategory.Targetting, $"Placing BlackHole: Good place for stacks!");
                            return(BlackHole(target));
                        }
                    }
                }

                if (target.Position.Distance2D(lastBlackHolePosition) > 10)
                {
                    lastBlackHolePosition = target.Position;
                    {
                        Core.Logger.Log(LogCategory.Targetting, $"Placing BlackHole: The bomb has been planted!");
                        return(BlackHole(target));
                    }
                }

                if (Skills.Wizard.BlackHole.TimeSinceUse > 2000)
                {
                    lastBlackHolePosition = target.Position;
                    {
                        Core.Logger.Log(LogCategory.Targetting, $"Placing BlackHole: Well placed.");
                        return(BlackHole(target));
                    }
                }
            }

            if (TrySecondaryPower(out power))
            {
                Core.Logger.Log(LogCategory.Targetting, $"OffensivePower SecondaryPower");
                return(power);
            }

            if (TryPrimaryPower(out power))
            {
                Core.Logger.Log(LogCategory.Targetting, $"OffensivePower PrimaryPower");
                return(power);
            }
            return(Walk(CurrentTarget.Position));
        }
Exemple #9
0
        public TrinityPower GetOffensivePower()
        {
            #region Skill Descriptions

            /* ExplosiveBlast Cost: 20 Arcane PowerCooldown: 6 secondsGather an infusion of energy around you 
             *         * that explodes after 1.5 seconds for 945% weapon damage as Arcane to all enemies within 12 yards.
             *         * 
             *         * Spectral Blade: This is a Signature spell. Signature spells are free to cast.Summon a spectral 
             *         * blade that strikes all enemies up to 15 yards in front of you for 168% weapon damage as Arcane. 
             *         * 
             *         * Arcane Orb: Cost: 30 Arcane PowerHurl an orb of pure energy that explodes on contact, dealing 435% 
             *         * weapon damage as Arcane to all enemies within 15 yards.*/
            #endregion

            #region Shorteners
            var          targetSelector = TargetUtil.BestEliteInRange(50f) ?? TargetUtil.GetBestClusterUnit(0f, 50f);
            var          target         = targetSelector ?? CurrentTarget;
            TrinityPower power;
            Vector3      position = Vector3.Zero;
            #endregion


            if (TrySpecialPower(out power))
            {
                return(power);
            }

            if (TrySecondaryPower(out power))
            {
                return(power);
            }

            if (TryPrimaryPower(out power))
            {
                return(power);
            }

            if (!Core.Buffs.HasInvulnerableShrine)
            {
                if (Player.CurrentHealthPct < 1 && Skills.Wizard.Teleport.TimeSinceUse > 1200 && CanTeleportTo(position))
                {
                    Core.Avoidance.Avoider.TryGetSafeSpot(out position, 30, 50, Player.Position);

                    if (position == Vector3.Zero)
                    {
                        Core.Avoidance.Avoider.TryGetSafeSpot(out position, 15, 50, Player.Position);
                    }
                }
                if (Core.Avoidance.InAvoidance(ZetaDia.Me.Position) && CanTeleportTo(position))
                {
                    Core.Avoidance.Avoider.TryGetSafeSpot(out position, 15, 50, Player.Position);
                }
                if (position != Vector3.Zero && !Core.Grids.Avoidance.IsIntersectedByFlags(ZetaDia.Me.Position, position, AvoidanceFlags.Combat, AvoidanceFlags.CriticalAvoidance))
                {
                    return(Teleport(position));
                }
            }

            if (Core.Buffs.HasInvulnerableShrine)
            {
                if (target != null && Core.Grids.CanRayCast(position) && CanTeleportTo(position) && Skills.Wizard.Teleport.TimeSinceUse > 1200)
                {
                    if (TargetUtil.UnitsBetweenLocations(ZetaDia.Me.Position, CurrentTarget.Position).Count > 3 && CurrentTarget.Distance < 50)
                    {
                        return(Teleport(position));
                    }
                }
            }

            if (CanTeleportTo(CurrentTarget.Position) && TargetUtil.UnitsBetweenLocations(ZetaDia.Me.Position, CurrentTarget.Position).Count > 3)
            {
                return(Teleport(CurrentTarget.Position));
            }
            return(Walk(CurrentTarget.Position));
        }