Beispiel #1
0
 public static Composite BarbarianMovement()
 {
     return
         (new PrioritySelector(
              Common.CreateWaitForAttack(),
              Common.CreateWaitForCast(),
              new SelfCast(SNOPower.Barbarian_Sprint,
                           extra => SprintTimer.IsFinished && !ZetaDia.Me.HasBuff(SNOPower.Barbarian_Sprint),
                           s => SprintTimer.Reset()),
              new CastAtLocation(SNOPower.Barbarian_Leap, ctx => (Vector3)ctx,
                                 ctx =>
                                 BelphegorSettings.Instance.Barbarian.UseLeapForMovement &&
                                 ZetaDia.Me.Position.Distance((Vector3)ctx) >
                                 BelphegorSettings.Instance.Barbarian.LeapDistance),
              new CastAtLocation(SNOPower.Barbarian_FuriousCharge, ctx => (Vector3)ctx,
                                 ctx =>
                                 BelphegorSettings.Instance.Barbarian.UseFuriousChargeForMovement &&
                                 ZetaDia.Me.Position.Distance((Vector3)ctx) >
                                 BelphegorSettings.Instance.Barbarian.FuriousChargeDistance),
              new Action(ret =>
     {
         ZetaDia.Me.Movement.MoveActor((Vector3)ret);
         return RunStatus.Success;
     })
              ));
 }
Beispiel #2
0
        public static Composite BarbarianCombat()
        {
            return
                (new PrioritySelector(CtxChanger,
                                      new Decorator(ctx => ctx != null && ((CombatContext)ctx).CurrentTarget != null,
                                                    new PrioritySelector(

                                                        // Buff attack rate or get free!
                                                        new SelfCast(SNOPower.Barbarian_WrathOfTheBerserker, extra => ((CombatContext)extra).IsPlayerIncapacited
                                                                     ),

                                                        Common.CreateUsePotion(),
                                                        Common.CreateGetHealthGlobe(),
                                                        Common.CreateWaitWhileFearedStunnedFrozenOrBlind(),
                                                        Common.CreateWaitForAttack(),

                                                        // Defence low hp or many attackers.
                                                        new SelfCast(SNOPower.Barbarian_IgnorePain, require =>
                                                                     ((CombatContext)require).CurrentHealthPercentage <= BelphegorSettings.Instance.Barbarian.IgnorePainPct ||
                                                                     Clusters.GetClusterCount(ZetaDia.Me, (CombatContext)require, ClusterType.Radius, 12f) >= 6
                                                                     ),

                                                        ThrowBarbBehavior(),
                                                        // Pull phase.
                                                        new Decorator(ctx =>
                                                                      ((CombatContext)ctx).TargetDistance > BelphegorSettings.Instance.Barbarian.MaximumRange && !((CombatContext)ctx).IsPlayerIncapacited,
                                                                      new PrioritySelector(
                                                                          new CastAtLocation(SNOPower.Barbarian_Leap, ctx => ((CombatContext)ctx).TargetPosition),
                                                                          new CastOnUnit(SNOPower.Barbarian_FuriousCharge, ctx => ((CombatContext)ctx).TargetGuid),
                                                                          new CastOnUnit(SNOPower.Barbarian_AncientSpear, ctx => ((CombatContext)ctx).TargetGuid)
                                                                          )
                                                                      ),

                                                        //Leap on cooldown, usefull for the increased armour buff
                                                        new CastAtLocation(SNOPower.Barbarian_Leap, ctx => ((CombatContext)ctx).TargetPosition,
                                                                           extra => BelphegorSettings.Instance.Barbarian.LeapOnCooldown &&
                                                                           !((CombatContext)extra).IsPlayerIncapacited
                                                                           ),

                                                        new SelfCast(SNOPower.Barbarian_Sprint,
                                                                     extra => SprintTimer.IsFinished &&
                                                                     !ZetaDia.Me.HasBuff(SNOPower.Barbarian_Sprint),
                                                                     s => SprintTimer.Reset()
                                                                     ),

                                                        new SelfCast(SNOPower.Barbarian_BattleRage, extra => !ZetaDia.Me.HasBuff(SNOPower.Barbarian_BattleRage)),
                                                        new SelfCast(SNOPower.Barbarian_Rend, ctx => RendTimer.Elapsed >=
                                                                     TimeSpan.FromSeconds(BelphegorSettings.Instance.Barbarian.RendTimer) &&
                                                                     ((CombatContext)ctx).TargetDistance <= BelphegorSettings.Instance.Barbarian.RendRange,
                                                                     s => RendTimer.Restart()
                                                                     ),

                                                        new CastAtLocation(SNOPower.Barbarian_Revenge,
                                                                           ctx => ((CombatContext)ctx).TargetPosition,
                                                                           ctx => ((CombatContext)ctx).TargetDistance < 16f
                                                                           ),

                                                        //Uses Dreadnought rune to heal
                                                        new CastOnUnit(SNOPower.Barbarian_FuriousCharge, ctx => ((CombatContext)ctx).TargetGuid,
                                                                       extra => BelphegorSettings.Instance.Barbarian.FuriousChargeDreadnought &&
                                                                       ((CombatContext)extra).CurrentHealthPercentage <= BelphegorSettings.Instance.Barbarian.FuriousChargeDreadnoughtHP
                                                                       ),


                                                        //Rage
                                                        new SelfCast(SNOPower.Barbarian_WrathOfTheBerserker,
                                                                     ctx => Unit.IsEliteInRange(16f) ||
                                                                     Clusters.GetClusterCount(ZetaDia.Me, (CombatContext)ctx, ClusterType.Radius, 16f) >=
                                                                     BelphegorSettings.Instance.Barbarian.WotBAoeCount
                                                                     ),

                                                        new SelfCast(SNOPower.Barbarian_CallOfTheAncients,
                                                                     ctx => Unit.IsEliteInRange(16f) ||
                                                                     Clusters.GetClusterCount(ZetaDia.Me, (CombatContext)ctx, ClusterType.Radius, 16f) >=
                                                                     BelphegorSettings.Instance.Barbarian.CotAAoeCount
                                                                     ),

                                                        new SelfCast(SNOPower.Barbarian_Earthquake,
                                                                     ctx => Unit.IsEliteInRange(16f) ||
                                                                     Clusters.GetClusterCount(ZetaDia.Me, (CombatContext)ctx, ClusterType.Radius, 16f) >=
                                                                     BelphegorSettings.Instance.Barbarian.EarthquakeAoeCount
                                                                     ),

                                                        new SelfCast(SNOPower.Barbarian_GroundStomp,
                                                                     ctx => Clusters.GetClusterCount(ZetaDia.Me, (CombatContext)ctx, ClusterType.Radius, 12f) >= 2 ||
                                                                     Unit.IsEliteInRange(18f)
                                                                     ),

                                                        new SelfCast(SNOPower.Barbarian_Overpower,
                                                                     ctx => Clusters.GetClusterCount(ZetaDia.Me, (CombatContext)ctx, ClusterType.Radius, 16f) >=
                                                                     BelphegorSettings.Instance.Barbarian.OverpowerAoeCount ||
                                                                     Unit.IsEliteInRange(16f)
                                                                     ),

                                                        // Threatning shout.
                                                        new SelfCast(SNOPower.Barbarian_ThreateningShout,
                                                                     ctx => Clusters.GetClusterCount(ZetaDia.Me, (CombatContext)ctx, ClusterType.Radius, 16f) >= 2 ||
                                                                     Unit.IsEliteInRange(16f)
                                                                     ),

                                                        // Fury spenders.
                                                        new CastOnUnit(SNOPower.Barbarian_HammerOfTheAncients,
                                                                       ctx => ((CombatContext)ctx).TargetGuid
                                                                       ),

                                                        new CastAtLocation(SNOPower.Barbarian_SeismicSlam,
                                                                           ctx => ((CombatContext)ctx).TargetPosition
                                                                           ),

                                                        new CastOnUnit(SNOPower.Barbarian_WeaponThrow,
                                                                       ctx => ((CombatContext)ctx).TargetGuid
                                                                       ),

                                                        new CastAtLocation(SNOPower.Barbarian_Whirlwind,
                                                                           ctx => ((CombatContext)ctx).WhirlWindTargetPosition,
                                                                           ctx => Clusters.GetClusterCount(ZetaDia.Me, (CombatContext)ctx, ClusterType.Radius, BelphegorSettings.Instance.Barbarian.WhirlwindClusterRange) >=
                                                                           BelphegorSettings.Instance.Barbarian.WhirlwindAoeCount ||
                                                                           ((CombatContext)ctx).CurrentTarget.IsElite()
                                                                           ),

                                                        // Fury Generators
                                                        new CastOnUnit(SNOPower.Barbarian_Cleave,
                                                                       ctx => ((CombatContext)ctx).TargetGuid, null,
                                                                       ctx => PrimarySpamTimer.Reset(),
                                                                       keepSpamming => !PrimarySpamTimer.IsFinished, CtxChanger
                                                                       ),

                                                        new CastOnUnit(SNOPower.Barbarian_Bash,
                                                                       ctx => ((CombatContext)ctx).TargetGuid, null,
                                                                       ctx => PrimarySpamTimer.Reset(),
                                                                       keepSpamming => !PrimarySpamTimer.IsFinished, CtxChanger
                                                                       ),

                                                        new CastOnUnit(SNOPower.Barbarian_Frenzy,
                                                                       ctx => ((CombatContext)ctx).TargetGuid, null,
                                                                       ctx => PrimarySpamTimer.Reset(),
                                                                       keepSpamming => !PrimarySpamTimer.IsFinished, CtxChanger
                                                                       )

                                                        //new Action(ctx => ZetaDia.Me.UsePower(SNOPower.Weapon_Melee_Instant, ((DiaUnit)ctx).Position, ZetaDia.CurrentWorldDynamicId))
                                                        )
                                                    ),

                                      new Action(ret => RunStatus.Success)
                                      ));
        }