Describes a condition for a single unit
Example #1
0
        public override void Initialize()
        {
            Priority = SkillPriority.Medium;
            Range = 60;
            PreCast=new SkillPreCast((SkillPrecastFlags.CheckCanCast |SkillPrecastFlags.CheckPlayerIncapacitated));

            var IntersectingUnitTargetConditions =
                new UnitTargetConditions
                {
                    TrueConditionFlags = TargetProperties.None,
                    MaximumDistance = Range,
                    Criteria = (unit) => unit.TargetInfo.IntersectingUnits>2
                };
            SingleUnitCondition.Add(IntersectingUnitTargetConditions);
            SingleUnitCondition.Add(new UnitTargetConditions(TargetProperties.None, Range, falseConditionalFlags: TargetProperties.Normal));
            SingleUnitCondition.Add(new UnitTargetConditions(TargetProperties.Summoner, Range, falseConditionalFlags: TargetProperties.LowHealth));
            SingleUnitCondition.Add(new UnitTargetConditions(TargetProperties.AvoidanceSummoner, Range, falseConditionalFlags: TargetProperties.LowHealth));
            SingleUnitCondition.Add(new UnitTargetConditions(TargetProperties.Debuffing, Range, falseConditionalFlags: TargetProperties.LowHealth));
            //SingleUnitCondition.Add(new UnitTargetConditions(TargetProperties.Ranged, Range, MinimumHealthPercent: 0.50d));
            SingleUnitCondition.Add(new UnitTargetConditions
            {
                Criteria = (unit) => FunkyGame.Hero.dCurrentEnergyPct > 0.80d,
                MaximumDistance = Range,
                FalseConditionFlags = TargetProperties.LowHealth,
            });
        }
Example #2
0
        public override void Initialize()
        {
            Priority = SkillPriority.Medium;
            Range = 60;
            PreCast = new SkillPreCast(SkillPrecastFlags.CheckCanCast | SkillPrecastFlags.CheckPlayerIncapacitated);

            ClusterConditions.Add(new SkillClusterConditions(4d, Range, 3, false, useRadiusDistance: true));

            var IntersectingUnitTargetConditions =
                new UnitTargetConditions
                {
                    TrueConditionFlags = TargetProperties.None,
                    MaximumDistance = Range,
                    Criteria = (unit) => unit.TargetInfo.IntersectingUnits>2
                };

            SingleUnitCondition.Add(IntersectingUnitTargetConditions);
            SingleUnitCondition.Add(new UnitTargetConditions(TargetProperties.None, Range, falseConditionalFlags: TargetProperties.Normal));
            SingleUnitCondition.Add(new UnitTargetConditions(TargetProperties.Summoner, Range, falseConditionalFlags: TargetProperties.LowHealth));
            SingleUnitCondition.Add(new UnitTargetConditions(TargetProperties.AvoidanceSummoner, Range, falseConditionalFlags: TargetProperties.LowHealth));
            SingleUnitCondition.Add(new UnitTargetConditions(TargetProperties.Debuffing, Range, falseConditionalFlags: TargetProperties.LowHealth));

            FCombatMovement = v =>
            {
                float fDistanceFromTarget = FunkyGame.Hero.Position.Distance(v);
                if (FunkyBaseExtension.Settings.General.OutOfCombatMovement && !FunkyGame.Hero.Class.bWaitingForSpecial && FunkyBaseExtension.Difference(FunkyGame.Hero.Position.Z, v.Z) <= 4 && fDistanceFromTarget >= 20f)
                {
                    if (fDistanceFromTarget > Range)
                        return MathEx.CalculatePointFrom(v, FunkyGame.Hero.Position, Range);
                    return v;
                }

                return Vector3.Zero;
            };
            FOutOfCombatMovement = v =>
            {
                float fDistanceFromTarget = FunkyGame.Hero.Position.Distance(v);
                if (FunkyBaseExtension.Difference(FunkyGame.Hero.Position.Z, v.Z) <= 4 && fDistanceFromTarget >= 20f)
                {
                    if (fDistanceFromTarget > Range)
                        return MathEx.CalculatePointFrom(v, FunkyGame.Hero.Position, Range);
                    return v;
                }

                return Vector3.Zero;
            };
        }