Ejemplo n.º 1
0
 public static Composite ThrowBarbBehavior()
 {
     return(new Decorator(
                ctx => BelphegorSettings.Instance.Barbarian.IsThrowBarbEnabled,
                new PrioritySelector(
                    new SelfCast(SNOPower.Barbarian_BattleRage,
                                 extra => !ZetaDia.Me.HasBuff(SNOPower.Barbarian_BattleRage)),
                    new SelfCast(SNOPower.Barbarian_WarCry, extra => !ZetaDia.Me.HasBuff(SNOPower.Barbarian_WarCry)),
                    new SelfCast(SNOPower.Barbarian_Overpower),
                    new CastOnUnit(SNOPower.Barbarian_AncientSpear, ctx => ((CombatContext)ctx).TargetGuid, null,
                                   ctx => PrimarySpamTimer.Reset(), keepSpamming => !PrimarySpamTimer.IsFinished,
                                   CtxChanger),
                    new CastOnUnit(SNOPower.Barbarian_WeaponThrow, ctx => ((CombatContext)ctx).TargetGuid),
                    new SelfCast(SNOPower.Barbarian_WarCry)
                    )
                ));
 }
Ejemplo n.º 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)
                                      ));
        }
Ejemplo n.º 3
0
 public static Composite MonkCombat()
 {
     return
         (new PrioritySelector(CtxChanger,
                               new SelfCast(SNOPower.Monk_Serenity,
                                            extra =>
                                            ZetaDia.Me.HitpointsCurrentPct <=
                                            BelphegorSettings.Instance.Monk.SerenityHp ||
                                            ((CombatContext)extra).IsPlayerIncapacited),
                               Common.CreateUsePotion(),
                               Common.CreateWaitWhileFearedStunnedFrozenOrBlind(),
                               Common.CreateGetHealthGlobe(),
                               Common.CreateWaitForAttack(),
                               //Heals
                               new SelfCast(SNOPower.Monk_BreathOfHeaven,
                                            extra =>
                                            ((CombatContext)extra).CurrentHealthPercentage <=
                                            BelphegorSettings.Instance.Monk.BreathOfHeavenHp
                                            ||
                                            (!ZetaDia.Me.HasBuff(SNOPower.Monk_BreathOfHeaven) &&
                                             BelphegorSettings.Instance.Monk.BoHBlazingWrath)),
                               new SelfCast(SNOPower.Monk_InnerSanctuary,
                                            extra => ZetaDia.Me.HitpointsCurrentPct <= 0.4),
                               new Decorator(
                                   ctx =>
                                   ctx is CombatContext &&
                                   ((CombatContext)ctx).CurrentTarget != null,
                                   new PrioritySelector(
                                       //Mantra
                                       new Decorator(
                                           ret =>
                                           MantraTimer.IsFinished &&
                                           ZetaDia.Me.CurrentPrimaryResource >=
                                           BelphegorSettings.Instance.Monk.MantraSpirit &&
                                           (!BelphegorSettings.Instance.Monk.WaitForSweepingWind ||
                                            ZetaDia.Me.HasBuff(SNOPower.Monk_SweepingWind)),
                                           new PrioritySelector(
                                               new SelfCast(SNOPower.Monk_MantraOfEvasion,
                                                            extra =>
                                                            !ZetaDia.Me.HasBuff(SNOPower.Monk_MantraOfEvasion) ||
                                                            BelphegorSettings.Instance.Monk.SpamMantra,
                                                            s => MantraTimer.Reset()),
                                               new SelfCast(SNOPower.Monk_MantraOfConviction,
                                                            extra =>
                                                            !ZetaDia.Me.HasBuff(SNOPower.Monk_MantraOfConviction) ||
                                                            BelphegorSettings.Instance.Monk.SpamMantra,
                                                            s => MantraTimer.Reset()),
                                               new SelfCast(SNOPower.Monk_MantraOfHealing,
                                                            extra =>
                                                            !ZetaDia.Me.HasBuff(SNOPower.Monk_MantraOfHealing) ||
                                                            BelphegorSettings.Instance.Monk.SpamMantra,
                                                            s => MantraTimer.Reset()),
                                               new SelfCast(SNOPower.Monk_MantraOfRetribution,
                                                            extra =>
                                                            !ZetaDia.Me.HasBuff(SNOPower.Monk_MantraOfRetribution) ||
                                                            BelphegorSettings.Instance.Monk.SpamMantra,
                                                            s => MantraTimer.Reset())
                                               )),
                                       // Pull phase.
                                       new Decorator(
                                           ctx =>
                                           ((CombatContext)ctx).TargetDistance >
                                           BelphegorSettings.Instance.Monk.MaximumRange,
                                           new PrioritySelector(
                                               new CastOnUnit(SNOPower.Monk_DashingStrike,
                                                              ctx => ((CombatContext)ctx).TargetGuid),
                                               new CastOnUnit(SNOPower.Monk_FistsofThunder,
                                                              ctx => ((CombatContext)ctx).TargetGuid)
                                               //CommonBehaviors.MoveTo(ctx => ((DiaUnit)ctx).Position, "Moving towards unit")
                                               )),
                                       //Buffs
                                       new SelfCast(SNOPower.Monk_SweepingWind,
                                                    extra =>
                                                    !ZetaDia.Me.HasBuff(SNOPower.Monk_SweepingWind) &&
                                                    (Unit.IsEliteInRange(16f) ||
                                                     Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)extra),
                                                                              ClusterType.Radius, 16f) > 3)),
                                       //Focus Skills
                                       new SelfCast(SNOPower.Monk_CycloneStrike,
                                                    extra =>
                                                    Unit.IsEliteInRange(16f) ||
                                                    Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)extra),
                                                                             ClusterType.Radius, 20f) >=
                                                    BelphegorSettings.Instance.Monk.CycloneStrikeAoECount),
                                       new SelfCast(SNOPower.Monk_SevenSidedStrike,
                                                    extra =>
                                                    Unit.IsEliteInRange(16f) ||
                                                    Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)extra),
                                                                             ClusterType.Radius, 20f) >=
                                                    BelphegorSettings.Instance.Monk.SevenSidedStrikeAoECount),
                                       //Secondary
                                       new CastOnUnit(SNOPower.Monk_ExplodingPalm,
                                                      ctx => ((CombatContext)ctx).TargetGuid,
                                                      extra => ExplodingPalm.IsFinished,
                                                      s => ExplodingPalm.Reset()),
                                       new CastOnUnit(SNOPower.Monk_LashingTailKick,
                                                      ctx => ((CombatContext)ctx).TargetGuid,
                                                      ctx =>
                                                      (Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)ctx),
                                                                                ClusterType.Radius, 16f) >=
                                                       BelphegorSettings.Instance.Monk.LashingTailKickAoECount ||
                                                       Unit.IsEliteInRange(16f)) &&
                                                      ZetaDia.Me.CurrentPrimaryResource >
                                                      BelphegorSettings.Instance.Monk.
                                                      LashingTailKickSpiritTreshold),
                                       new SelfCast(SNOPower.Monk_BlindingFlash,
                                                    ctx =>
                                                    Clusters.GetClusterCount(ZetaDia.Me, ((CombatContext)ctx),
                                                                             ClusterType.Radius, 18f) >= 5 ||
                                                    Unit.IsEliteInRange(18f)),
                                       new CastOnUnit(SNOPower.Monk_WaveOfLight,
                                                      ctx => ((CombatContext)ctx).TargetGuid,
                                                      ctx => ((CombatContext)ctx).TargetDistance <= 16f),
                                       new CastOnUnit(SNOPower.Monk_TempestRush,
                                                      ctx => ((CombatContext)ctx).TargetGuid,
                                                      ctx => ZetaDia.Me.CurrentPrimaryResource > 15),
                                       // Primary Skills.
                                       new CastOnUnit(SNOPower.Monk_DeadlyReach,
                                                      ctx => ((CombatContext)ctx).TargetGuid, null,
                                                      ctx => PrimarySpamTimer.Reset(),
                                                      keepSpamming => !PrimarySpamTimer.IsFinished, CtxChanger),
                                       new CastOnUnit(SNOPower.Monk_CripplingWave,
                                                      ctx => ((CombatContext)ctx).TargetGuid, null,
                                                      ctx => PrimarySpamTimer.Reset(),
                                                      keepSpamming => !PrimarySpamTimer.IsFinished, CtxChanger),
                                       new CastOnUnit(SNOPower.Monk_WayOfTheHundredFists,
                                                      ctx => ((CombatContext)ctx).TargetGuid, null,
                                                      ctx => PrimarySpamTimer.Reset(),
                                                      keepSpamming => !PrimarySpamTimer.IsFinished, CtxChanger),
                                       new CastOnUnit(SNOPower.Monk_FistsofThunder,
                                                      ctx => ((CombatContext)ctx).TargetGuid, null,
                                                      ctx => PrimarySpamTimer.Reset(),
                                                      keepSpamming => !PrimarySpamTimer.IsFinished, CtxChanger)
                                       )
                                   ),
                               new Action(ret => RunStatus.Success)
                               ));
 }