Ejemplo n.º 1
0
        public TrinityPower GetOffensivePower()
        {
            // Ported from Phelon's Jade Harvester Routine

            TrinityPower power;
            TrinityActor target;
            Vector3      position;

            if (Settings.HarvestModeIC == HarvestMode.NonStop && Skills.WitchDoctor.SoulHarvest.CanCast() && TargetUtil.AnyMobsInRange(14f))
            {
                return(SoulHarvest());
            }

            if (ShouldPiranhas(out target))
            {
                return(Piranhas(target));
            }

            if (ShouldSoulHarvest(out position))
            {
                if (Skills.WitchDoctor.SpiritWalk.CanCast())
                {
                    return(SpiritWalk());
                }

                return(SoulHarvest(position));
            }

            if (ShouldWallOfDeath(out target))
            {
                return(WallOfDeath(target));
            }

            if (ShouldLocustSwarm(out target))
            {
                return(LocustSwarm(target));
            }

            if (ShouldHaunt(out target))
            {
                return(Haunt(target));
            }

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

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

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

            if (Player.HasBuff(SNOPower.Witchdoctor_SpiritWalk))
            {
                if (Player.CurrentHealthPct < EmergencyHealthPct &&
                    TargetUtil.BestWalkLocation(35f, true).Distance(Player.Position) > 5)
                {
                    return(new TrinityPower(SNOPower.Walk, 7f, TargetUtil.BestWalkLocation(45f, true)));
                }

                if (TargetUtil.BestDpsPosition(TargetUtil.BestAoeUnit(45, true).Position, 45f, true).Distance(Player.Position) > 5)
                {
                    return(new TrinityPower(SNOPower.Walk, 3f,
                                            TargetUtil.BestDpsPosition(TargetUtil.BestAoeUnit(45, true).Position, 45f, true)));
                }
            }

            return(new TrinityPower(SNOPower.Walk, 3f,
                                    TargetUtil.BestDpsPosition(TargetUtil.BestAoeUnit(45, true).Position, 45f, true)));
        }