public Composite CreateBasicCombat()
        {
            return(new PrioritySelector(ctx => Core.Player.CurrentTarget as BattleCharacter,
                                        new Decorator(ctx => ctx != null,
                                                      new PrioritySelector(
                                                          new Decorator(ctx => !RoutineManager.IsAnyDisallowed(CapabilityFlags.Movement), new PrioritySelector(
                                                                            CommonBehaviors.MoveToLos(ctx => ctx as GameObject),
                                                                            CommonBehaviors.MoveAndStop(ctx => (ctx as GameObject).Location, ctx => Core.Player.CombatReach + PullRange, true, "Moving to unit")
                                                                            )),
                                                          //CombatBuffs
                                                          Spell.Cast("Toad Oil", r => !Core.Me.HasAura("Toad Oil")),

                                                          //Interrupt
                                                          Spell.Cast("Flying Sardine", r => shouldFishSlap),

                                                          //Basic Combat
                                                          Spell.Cast("Triple Trident", r => Core.Me.HasAura("Tingling") && Core.Me.HasAura("Harmonized")),
                                                          Spell.Cast("Whistle", r => ActionManager.LastSpell.Name == "Tingle"),
                                                          Spell.Cast("Tingle", r => DataManager.GetSpellData(23264).Cooldown.TotalMilliseconds == 0 && Core.Me.CurrentTarget.CurrentHealthPercent > 30 && Core.Target.Distance2D(Core.Me) <= 6f),
                                                          Spell.Cast("Lucid Dreaming", r => ActionManager.HasSpell("Lucid Dreaming") && Core.Player.CurrentManaPercent < 50),
                                                          Spell.Cast("Blood Drain", r => Core.Player.CurrentManaPercent < 20),
                                                          Spell.Cast("Off-guard", r => Core.Me.CurrentTarget.CurrentHealthPercent < 50),
                                                          Spell.Cast("Bad Breath", r => ActionManager.LastSpell.Name != "Bad Breath" && Core.Me.IsFacing(Core.Target) && Core.Target.Distance2D(Core.Me) <= 8f && !Core.Target.HasAura("Poison") && Core.Me.CurrentTarget.CurrentHealthPercent > 40),
                                                          Spell.Cast("Plaincracker", r => GameObjectManager.NumberOfAttackers >= 2 && Core.Target.Distance2D(Core.Me) <= 4f),
                                                          Spell.Cast("Whistle", r => !Core.Me.HasAura("Boost") && !Core.Me.HasAura("Harmonized") && !Core.Target.HasAura("Off-guard") && ActionManager.HasSpell("Abyssal Transfixion")),
                                                          Spell.Cast("Abyssal Transfixion", r => true),
                                                          Spell.Cast("1000 Needles", r => Core.Me.CurrentTarget.CurrentHealthPercent > 75 && ActionManager.LastSpell.Name != "1000 Needles"),
                                                          Spell.Cast("Water Cannon", r => true)
                                                          ))));
        }
Example #2
0
 public static Composite MoveToLineOfSight(ValueRetriever <DiaUnit> unit)
 {
     return
         (new Decorator(ret => unit != null && !unit(ret).InLineOfSight,
                        CommonBehaviors.MoveToLos(unit, true)
                        ));
 }
 public Composite CreateBasicPull()
 {
     return(new PrioritySelector(ctx => Core.Player.CurrentTarget as BattleCharacter,
                                 new Decorator(ctx => ctx != null, new PrioritySelector(
                                                   CommonBehaviors.MoveToLos(ctx => ctx as GameObject),
                                                   CommonBehaviors.MoveAndStop(ctx => (ctx as GameObject).Location, ctx => Core.Player.CombatReach + PullRange + (ctx as GameObject).CombatReach, true, "Moving to unit"),
                                                   Spell.PullCast("Shield Lob"),
                                                   Spell.PullCast("Fast Blade")
                                                   ))));
 }
 public Composite CreateBasicPull()
 {
     return(new PrioritySelector(ctx => Core.Player.CurrentTarget as BattleCharacter,
                                 new Decorator(ctx => ctx != null, new PrioritySelector(
                                                   new Decorator(ctx => !RoutineManager.IsAnyDisallowed(CapabilityFlags.Movement), new PrioritySelector(
                                                                     CommonBehaviors.MoveToLos(ctx => ctx as GameObject),
                                                                     CommonBehaviors.MoveAndStop(ctx => (ctx as GameObject).Location, ctx => Core.Player.CombatReach + PullRange + (ctx as GameObject).CombatReach, true, "Moving to unit")
                                                                     )),
                                                   Spell.PullCast(r => "Sticky Tongue", r => ActionManager.LastSpell.Name != "Sticky Tongue" && Core.Target.Distance2D(Core.Me) >= 5f),
                                                   Spell.PullCast(r => "Water Cannon", r => ActionManager.LastSpell.Name != "Water Cannon" && !ActionManager.HasSpell("Sticky Tongue"))
                                                   ))));
 }
Example #5
0
        internal static Composite MovementComposite()
        {
            double pullRange = 3;

            if (Me.IsHealer() || (Me.IsRangedDps() && (Me.CurrentJob != ClassJobType.RedMage || Me.ClassLevel >= 2)))
            {
                pullRange = 20;
            }

            return(new PrioritySelector(ctx => Target as BattleCharacter,
                                        new Decorator(ctx => ctx != null, new PrioritySelector(
                                                          CommonBehaviors.MoveToLos(target => Target),
                                                          CommonBehaviors.MoveAndStop(target => Target.Location, Math.Max(Target.CombatReach, Me.CombatReach) + (float)pullRange, true)))));
        }
Example #6
0
 protected override Composite CreateBehavior()
 {
     return(new PrioritySelector(
                new Decorator(ret => !ConditionCheck(),
                              new Action(ret => _done = true)),
                new Decorator(ret => Talk.DialogOpen,
                              new Action(r =>
     {
         Talk.Next();
     })
                              ),
                new Decorator(ret => casted,
                              new Sequence(
                                  new Sleep(3, 5),
                                  new Action(r => casted = false)
                                  )
                              ),
                new Decorator(ret => Core.Me.Location.Distance(Position) <= Distance && IsFinished,
                              new Action(ret => _done = true)),
                new Decorator(ret => Core.Me.Location.Distance(Position) <= Distance,
                              new PrioritySelector(
                                  new Decorator(ret => ActionManager.InSpellInRangeLOS(1, GameObjectManager.GetObjectByNPCId(NPC)) == Enums.SpellRangeCheck.ErrorNotInLineOfSight,
                                                CommonBehaviors.MoveToLos(r => GameObjectManager.GetObjectByNPCId(NPC), true)
                                                ),
                                  new Decorator(ret => true,
                                                new Action(r =>
     {
         if (Core.Player.IsMounted)
         {
             ActionManager.Dismount();
         }
         Navigator.PlayerMover.MoveStop();
         if (!Core.Player.IsCasting)
         {
             ActionManager.DoActionLocation(Enums.ActionType.KeyItem, ItemID, XYZ);
             casted = true;
         }
     })
                                                )
                                  )
                              ),
                CommonBehaviors.MoveAndStop(ret => Position, Distance, stopInRange: true, destinationName: Name)
                ));
 }
 public Composite CreateBasicCombat()
 {
     return(new PrioritySelector(ctx => Core.Player.CurrentTarget as BattleCharacter,
                                 new Decorator(ctx => ctx != null,
                                               new PrioritySelector(
                                                   CommonBehaviors.MoveToLos(ctx => ctx as BattleCharacter),
                                                   CommonBehaviors.MoveAndStop(ctx => (ctx as BattleCharacter).Location, ctx => PullRange + (ctx as BattleCharacter).CombatReach, true, "Moving to unit"),
                                                   Spell.Cast("Fight or Flight", r => Core.Player),
                                                   Spell.Cast("Circle of Scorn", r => Core.Player),
                                                   Spell.Cast("Goring Blade", r => ActionManager.LastSpell.Name == "Riot Blade" && !Core.Target.HasAura("Goring Blade", false)),
                                                   Spell.Cast("Goring Blade", r => ActionManager.LastSpell.Name == "Riot Blade" && !Core.Target.HasAura("Goring Blade", true, 7000)),
                                                   Spell.Cast("Royal Authority", r => ActionManager.LastSpell.Name == "Riot Blade"),
                                                   //Check for mana level at higher level when theother combo action is avail
                                                   Spell.Cast("Riot Blade", r => ActionManager.LastSpell.Name == "Fast Blade"),
                                                   Spell.Cast("Fast Blade", r => true),
                                                   Spell.Cast("Requiescat", r => true),
                                                   Spell.Cast("Shield Swipe", r => true),
                                                   Spell.Cast("Spirits Within", r => true),
                                                   Spell.Cast(r => "Sheltron", r => ShieldSwipe.Cooldown.TotalSeconds <= 5, r => Core.Player)
                                                   // r => ActionManager.LastSpellId == 0 || ActionManager.LastSpell.Name == "Full Thrust" )
                                                   ))));
 }