Пример #1
0
        public override void Initialize()
        {
            Cooldown                = 10000;
            ExecutionType           = AbilityExecuteFlags.ClusterLocation | AbilityExecuteFlags.ZigZagPathing;
            WaitVars                = new WaitLoops(1, 1, true);
            Range                   = 48;
            UseageType              = AbilityUseage.Anywhere;
            IsASpecialMovementPower = true;
            Priority                = AbilityPriority.High;
            PreCast                 = new SkillPreCast((AbilityPreCastFlags.CheckPlayerIncapacitated | AbilityPreCastFlags.CheckCanCast));

            ClusterConditions = new SkillClusterConditions(5d, 48f, 2, false, minDistance: 15f);

            FcriteriaCombat = () =>
            {
                return((Bot.Settings.Class.bTeleportFleeWhenLowHP &&
                        (Bot.Character.Data.dCurrentHealthPct < 0.5d) ||
                        (Bot.Targeting.Cache.RequiresAvoidance))
                       ||
                       (Bot.Settings.Class.bTeleportIntoGrouping && LastConditionPassed == ConditionCriteraTypes.Cluster)
                       ||
                       (!Bot.Settings.Class.bTeleportFleeWhenLowHP && !Bot.Settings.Class.bTeleportIntoGrouping));
            };
            FCombatMovement = v =>
            {
                float fDistanceFromTarget = Bot.Character.Data.Position.Distance(v);
                if (!Bot.Character.Class.bWaitingForSpecial && Funky.Difference(Bot.Character.Data.Position.Z, v.Z) <= 4 && fDistanceFromTarget >= 20f)
                {
                    if (fDistanceFromTarget > 35f)
                    {
                        return(MathEx.CalculatePointFrom(v, Bot.Character.Data.Position, 35f));
                    }
                    return(v);
                }

                return(Vector3.Zero);
            };
            FOutOfCombatMovement = v =>
            {
                float fDistanceFromTarget = Bot.Character.Data.Position.Distance(v);
                if (Funky.Difference(Bot.Character.Data.Position.Z, v.Z) <= 4 && fDistanceFromTarget >= 20f)
                {
                    if (fDistanceFromTarget > 35f)
                    {
                        return(MathEx.CalculatePointFrom(v, Bot.Character.Data.Position, 35f));
                    }
                    return(v);
                }

                return(Vector3.Zero);
            };
        }
Пример #2
0
        public override void Initialize()
        {
            Cooldown                = 16000;
            ExecutionType           = AbilityExecuteFlags.ClusterLocation | AbilityExecuteFlags.ZigZagPathing;
            WaitVars                = new WaitLoops(0, 1, true);
            Cost                    = 15;
            Range                   = 35;
            UseageType              = AbilityUseage.Combat;
            IsASpecialMovementPower = true;
            Priority                = AbilityPriority.High;
            PreCast                 = new SkillPreCast((AbilityPreCastFlags.CheckPlayerIncapacitated | AbilityPreCastFlags.CheckCanCast |
                                                        AbilityPreCastFlags.CheckEnergy));
            ClusterConditions = new SkillClusterConditions(5d, 48f, 2, false);
            //TestCustomCombatConditionAlways=true,
            FcriteriaCombat = () => ((Bot.Settings.Class.bTeleportFleeWhenLowHP && Bot.Character.Data.dCurrentHealthPct < 0.5d)
                                     ||
                                     (Bot.Settings.Class.bTeleportIntoGrouping &&
                                      Bot.Targeting.Cache.Clusters.AbilityClusterCache(combatClusterCondition).Count > 0 &&
                                      Bot.Targeting.Cache.Clusters.AbilityClusterCache(combatClusterCondition)[0].Midpoint.Distance(
                                          Bot.Character.Data.PointPosition) > 15f) ||
                                     (!Bot.Settings.Class.bTeleportFleeWhenLowHP && !Bot.Settings.Class.bTeleportIntoGrouping));
            FCombatMovement = v =>
            {
                float fDistanceFromTarget = Bot.Character.Data.Position.Distance(v);
                if (!Bot.Character.Class.bWaitingForSpecial && Funky.Difference(Bot.Character.Data.Position.Z, v.Z) <= 4 && fDistanceFromTarget >= 20f)
                {
                    if (fDistanceFromTarget > 35f)
                    {
                        return(MathEx.CalculatePointFrom(v, Bot.Character.Data.Position, 35f));
                    }
                    return(v);
                }

                return(Vector3.Zero);
            };
            FOutOfCombatMovement = v =>
            {
                float fDistanceFromTarget = Bot.Character.Data.Position.Distance(v);
                if (Funky.Difference(Bot.Character.Data.Position.Z, v.Z) <= 4 && fDistanceFromTarget >= 20f)
                {
                    if (fDistanceFromTarget > 35f)
                    {
                        return(MathEx.CalculatePointFrom(v, Bot.Character.Data.Position, 35f));
                    }
                    return(v);
                }

                return(Vector3.Zero);
            };
        }
Пример #3
0
        public override void Initialize()
        {
            Cooldown                = 10200;
            WaitVars                = new WaitLoops(2, 2, true);
            ExecutionType           = AbilityExecuteFlags.ClusterLocation | AbilityExecuteFlags.Location;
            Range                   = 35;
            Priority                = AbilityPriority.Medium;
            UseageType              = AbilityUseage.Combat;
            IsASpecialMovementPower = true;
            PreCast                 = new SkillPreCast((AbilityPreCastFlags.CheckPlayerIncapacitated | AbilityPreCastFlags.CheckRecastTimer |
                                                        AbilityPreCastFlags.CheckCanCast));
            ClusterConditions   = new SkillClusterConditions(5d, 30, 2, true);
            SingleUnitCondition = new UnitTargetConditions(TargetProperties.IsSpecial,
                                                           falseConditionalFlags: TargetProperties.Fast, MinimumDistance: 30);

            FCombatMovement = (v) =>
            {
                float fDistanceFromTarget = Bot.Character.Data.Position.Distance(v);
                if (!Bot.Character.Class.bWaitingForSpecial && Funky.Difference(Bot.Character.Data.Position.Z, v.Z) <= 4 && fDistanceFromTarget >= 20f)
                {
                    if (fDistanceFromTarget > 35f)
                    {
                        return(MathEx.CalculatePointFrom(v, Bot.Character.Data.Position, 35f));
                    }
                    else
                    {
                        return(v);
                    }
                }

                return(Vector3.Zero);
            };
            FOutOfCombatMovement = (v) =>
            {
                float fDistanceFromTarget = Bot.Character.Data.Position.Distance(v);
                if (Funky.Difference(Bot.Character.Data.Position.Z, v.Z) <= 4 && fDistanceFromTarget >= 20f)
                {
                    if (fDistanceFromTarget > 35f)
                    {
                        return(MathEx.CalculatePointFrom(v, Bot.Character.Data.Position, 35f));
                    }
                    else
                    {
                        return(v);
                    }
                }

                return(Vector3.Zero);
            };
        }
Пример #4
0
        public override void Initialize()
        {
            Cooldown      = 500;
            ExecutionType = AbilityExecuteFlags.Target;
            WaitVars      = new WaitLoops(1, 2, true);
            Cost          = 20;
            Range         = 35;
            UseageType    = AbilityUseage.Combat;
            Priority      = AbilityPriority.Medium;
            PreCast       = new SkillPreCast((AbilityPreCastFlags.CheckRecastTimer | AbilityPreCastFlags.CheckEnergy |
                                              AbilityPreCastFlags.CheckCanCast | AbilityPreCastFlags.CheckPlayerIncapacitated));
            ElitesWithinRangeConditions = new Tuple <RangeIntervals, int>(RangeIntervals.Range_25, 1);
            UnitsWithinRangeConditions  = new Tuple <RangeIntervals, int>(RangeIntervals.Range_15, 3);
            SingleUnitCondition         = new UnitTargetConditions(TargetProperties.IsSpecial, 15);

            FCombatMovement = v =>
            {
                float fDistanceFromTarget = Bot.Character.Data.Position.Distance(v);
                if (!Bot.Character.Class.bWaitingForSpecial && Funky.Difference(Bot.Character.Data.Position.Z, v.Z) <= 4 && fDistanceFromTarget >= 20f)
                {
                    if (fDistanceFromTarget > 35f)
                    {
                        return(MathEx.CalculatePointFrom(v, Bot.Character.Data.Position, 35f));
                    }
                    return(v);
                }

                return(Vector3.Zero);
            };
            FOutOfCombatMovement = v =>
            {
                float fDistanceFromTarget = Bot.Character.Data.Position.Distance(v);
                if (Funky.Difference(Bot.Character.Data.Position.Z, v.Z) <= 4 && fDistanceFromTarget >= 20f)
                {
                    if (fDistanceFromTarget > 35f)
                    {
                        return(MathEx.CalculatePointFrom(v, Bot.Character.Data.Position, 35f));
                    }
                    return(v);
                }

                return(Vector3.Zero);
            };
        }
Пример #5
0
        public override void Initialize()
        {
            Cooldown                = 400;
            ExecutionType           = AbilityExecuteFlags.ZigZagPathing;
            WaitVars                = new WaitLoops(1, 2, true);
            Cost                    = 8;
            SecondaryEnergy         = true;
            Range                   = 20;
            UseageType              = AbilityUseage.Combat;
            Priority                = AbilityPriority.Medium;
            IsASpecialMovementPower = true;
            PreCast                 = new SkillPreCast((AbilityPreCastFlags.CheckPlayerIncapacitated | AbilityPreCastFlags.CheckCanCast |
                                                        AbilityPreCastFlags.CheckEnergy | AbilityPreCastFlags.CheckRecastTimer));
            //SingleUnitCondition=new UnitTargetConditions(TargetProperties.None, 10);
            //UnitsWithinRangeConditions=new Tuple<RangeIntervals, int>(RangeIntervals.Range_6, 1);

            FCombatMovement = v =>
            {
                float fDistanceFromTarget = Bot.Character.Data.Position.Distance(v);
                if (!Bot.Character.Class.bWaitingForSpecial && Funky.Difference(Bot.Character.Data.Position.Z, v.Z) <= 4 && fDistanceFromTarget >= 18f &&
                    (LastUsedMilliseconds >= Bot.Settings.Class.iDHVaultMovementDelay))
                {
                    return(MathEx.CalculatePointFrom(v, Bot.Character.Data.Position, Math.Max(fDistanceFromTarget, 35f)));
                }

                return(Vector3.Zero);
            };
            FOutOfCombatMovement = v =>
            {
                float fDistanceFromTarget = Bot.Character.Data.Position.Distance(v);
                if (Funky.Difference(Bot.Character.Data.Position.Z, v.Z) <= 4 && fDistanceFromTarget >= 18f &&
                    (LastUsedMilliseconds >= Bot.Settings.Class.iDHVaultMovementDelay))
                {
                    return(MathEx.CalculatePointFrom(v, Bot.Character.Data.Position, Math.Max(fDistanceFromTarget, 35f)));
                }

                return(Vector3.Zero);
            };
        }
Пример #6
0
        public override void Initialize()
        {
            Cooldown         = 15200;
            ExecutionType    = AbilityExecuteFlags.Buff;
            WaitVars         = new WaitLoops(0, 0, true);
            Cost             = 49;
            UseageType       = AbilityUseage.Anywhere;
            IsSpecialAbility = true;
            Priority         = AbilityPriority.High;
            PreCast          = new SkillPreCast((AbilityPreCastFlags.CheckEnergy | AbilityPreCastFlags.CheckCanCast));

            IsBuff        = true;
            FcriteriaBuff = () => Bot.Settings.OutOfCombatMovement;

            FCombatMovement = (v) =>
            {
                float fDistanceFromTarget = Bot.Character.Data.Position.Distance(v);
                if (!Bot.Character.Class.bWaitingForSpecial && Funky.Difference(Bot.Character.Data.Position.Z, v.Z) <= 4 && fDistanceFromTarget >= 20f)
                {
                    if (fDistanceFromTarget > 35f)
                    {
                        return(MathEx.CalculatePointFrom(v, Bot.Character.Data.Position, 35f));
                    }
                    else
                    {
                        return(v);
                    }
                }

                return(Vector3.Zero);
            };
            FcriteriaCombat = () => ((Bot.Character.Data.dCurrentHealthPct <= 0.35d) ||
                                     (RuneIndex == 3 && Bot.Character.Data.dCurrentEnergyPct < 0.25d) ||
                                     (Bot.Targeting.Cache.Environment.FleeTriggeringUnits.Count > 0) ||
                                     (Bot.Targeting.Cache.Environment.TriggeringAvoidances.Count > 0) ||
                                     (Bot.Character.Data.bIsIncapacitated || Bot.Character.Data.bIsRooted));
        }
Пример #7
0
        ///<summary>
        ///Runs raycasting and intersection tests to validate LOS.
        ///</summary>
        public bool LOSTest(Vector3 PositionToTestFrom, bool NavRayCast = true, bool ServerObjectIntersection = true, NavCellFlags Flags = NavCellFlags.None, bool ContinueOnFailures = true)
        {
            LastLOSCheck = DateTime.Now;
            bool Failed = false;


            if (NavRayCast)
            {              //This is a basic raycast test to see if we have clear view of the object.
                //Navigator.SearchGridProvider.Update();
                Vector2 hitpos;
                Vector3 ObjectPosition = Obj.Position;

                //Must check the Z difference.. (so we don't get false-positive result)
                if (PositionToTestFrom.Z >= ObjectPosition.Z)
                {
                    RayCast = !Navigator.SearchGridProvider.Raycast(PositionToTestFrom.ToVector2(), ObjectPosition.ToVector2(), out hitpos);
                }
                else
                {
                    RayCast = !Navigator.SearchGridProvider.Raycast(ObjectPosition.ToVector2(), PositionToTestFrom.ToVector2(), out hitpos);
                }

                if (!RayCast.Value)
                {
                    Failed = true;
                    if (!ContinueOnFailures)
                    {
                        return(false);
                    }
                }
            }

            if (ServerObjectIntersection)
            {              //This test uses the obstacle cache to check objects for intersection
                Vector3 TargetTestLocation = Obj.Position;
                if (Funky.Difference(Bot.Character.Data.Position.Z, TargetTestLocation.Z) > 1f)
                {
                    //Get actual height using MGP
                    TargetTestLocation.Z = Navigation.MGP.GetHeight(TargetTestLocation.ToVector2());
                }

                ObjectIntersection = ObjectCache.Obstacles.Values.OfType <CacheServerObject>()
                                     .Any(obstacle =>
                                          obstacle.RAGUID != Obj.RAGUID &&
                                          obstacle.Obstacletype.HasValue &&
                                          obstacle.Obstacletype.Value != ObstacleType.Monster &&
                                          obstacle.TestIntersection(PositionToTestFrom, TargetTestLocation));

                if (!Failed && ObjectIntersection.Value)
                {
                    Failed = true;
                    if (!ContinueOnFailures)
                    {
                        return(false);
                    }
                }
            }


            if (!Flags.Equals(NavCellFlags.None))
            {              //Raycast test to validate it can preform the path -- walk/projectile
                bool NavTest = Navigation.CanRayCast(PositionToTestFrom, Obj.Position, Flags);

                if (Flags.HasFlag(NavCellFlags.AllowWalk))
                {
                    NavCellWalk = NavTest;
                }
                if (Flags.HasFlag(NavCellFlags.AllowProjectile))
                {
                    NavCellProjectile = NavTest;
                }
                if (!Failed && !NavTest)
                {
                    Failed = true;
                }
            }

            //this.LastVectorTested=PositionToTestFrom;
            return(!Failed);
        }