What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

[BT] Please Assist

Smarter

Member
Joined
Jan 15, 2010
Messages
763
Reaction score
9
I have been having nothing but issues with Behavior Trees .... even using Locker as a template, and simply modifying code, I cannot reproduce the results that seem to be written in front of me, for example, if I change Apoc's Pull code in his Locker class, and replace Metamorphosis, with Curse of the Elements, it will cast CoE and that's it. Then wait for the Felguard to kill the mob. Only if I make a Sequence will it cast all the spells. And if I replace Corruption with it instead, it casts it, but not till almost the last spell?

Apoc's Default Code:
Code:
private Composite CreatePullComposite()
        {
            return new PrioritySelector(
                new Decorator(
                    ret => Me.CurrentTarget.DistanceSqr >= 35 * 35,
                    new Action(ret => Navigator.MoveTo(Me.CurrentTarget.Location))),

                new Decorator(
                    ret => Me.IsMoving,
                    new Action(ret => WoWMovement.MoveStop())),

                new Decorator(
                    ret => !Me.IsFacing(Me.CurrentTarget),
                    new Action(ret => Me.CurrentTarget.Face())),

                new Decorator(
                    ret => Me.IsCasting,
                    new ActionAlwaysSucceed()),

                new Action(
                    delegate
                        {
                            Lua.DoString("PetAttack()");
                            return RunStatus.Failure;
                        }),

                new Decorator(
                    ret => Talents.CurrentSpec == TalentSpec.Destruction,
                    new PrioritySelector(
                        new Decorator(
                            ret => Me.CurrentTarget.Elite,
                            CreateBuffCast("Bane of Doom", () => Me.CurrentTarget)),
                        CreateBuffCast("Immolate", () => Me.CurrentTarget),
                        CreateSpellCast("Chaos Bolt"),
                        CreateSpellCast("Conflagrate"),
                        CreateSpellCast("Incinerate")
                        )),

                new Decorator(
                    ret => Talents.CurrentSpec == TalentSpec.Affliction,
                    new PrioritySelector(
                        CreateBuffCast("Corruption", () => Me.CurrentTarget),
                        CreateSpellCast("Haunt"),
                        CreateBuffCast("Unstable Affliction", () => Me.CurrentTarget),
                        CreateBuffCast("Bane of Agony", () => Me.CurrentTarget))
                    ),

                new Decorator(
                    ret => Talents.CurrentSpec == TalentSpec.Demonology,
                    new PrioritySelector(
                        CreateBuffCast("Metamorphosis"),
                        CreateBuffCast("Immolate", () => Me.CurrentTarget),
                        CreateBuffCast("Hand of Gul'dan", () => Me.CurrentTarget),
                        CreateBuffCast("Corruption", () => Me.CurrentTarget),
                        CreateBuffCast("Immolation Aura"),
                        CreateBuffCast("Incinerate", () => Me.ActiveAuras.ContainsKey("Molten Core")),
                        CreateBuffCast("Soulburn"),
                        CreateBuffCast("Soul Fire", () => Me.ActiveAuras.ContainsKey("Soulburn") || Me.ActiveAuras.ContainsKey("Decimation"))
                        )),

                // Fall back on this as a last resort... really only for low levels
                CreateBuffCast("Corruption", () => Me.CurrentTarget),
                CreateSpellCast("Shadow Bolt")
                );
        }

My Only Working Solution:
Code:
private Composite CreatePullComposite()
        {
            return new PrioritySelector(
                new Decorator(
                    ret => Me.CurrentTarget.DistanceSqr >= 35 * 35,
                    new Action(ret => Navigator.MoveTo(Me.CurrentTarget.Location))),

                new Decorator(
                    ret => Me.IsMoving,
                    new Action(ret => WoWMovement.MoveStop())),

                new Decorator(
                    ret => !Me.IsFacing(Me.CurrentTarget),
                    new Action(ret => Me.CurrentTarget.Face())),

                new Decorator(
                    ret => Me.IsCasting,
                    new ActionAlwaysSucceed()),

                new Action(
                    delegate
                        {
                            Lua.DoString("PetAttack()");
                            return RunStatus.Failure;
                        }),

                new Decorator(
                    ret => Talents.CurrentSpec == TalentSpec.Destruction,
                    new PrioritySelector(
                        new Decorator(
                            ret => Me.CurrentTarget.Elite,
                            CreateBuffCast("Bane of Doom", () => Me.CurrentTarget)),
                        CreateBuffCast("Immolate", () => Me.CurrentTarget),
                        CreateSpellCast("Chaos Bolt"),
                        CreateSpellCast("Conflagrate"),
                        CreateSpellCast("Incinerate")
                        )),

                new Decorator(
                    ret => Talents.CurrentSpec == TalentSpec.Affliction,
                    new PrioritySelector(
                        CreateBuffCast("Corruption", () => Me.CurrentTarget),
                        CreateSpellCast("Haunt"),
                        CreateBuffCast("Unstable Affliction", () => Me.CurrentTarget),
                        CreateBuffCast("Bane of Agony", () => Me.CurrentTarget))
                    ),

                new Decorator(
                    ret => Talents.CurrentSpec == TalentSpec.Demonology,
                    new Sequence(
                        new Action(ret => CreateBuffCast("Demonic Empowerment")),
                        new Action(ret => CreateBuffCast("Curse of the Elements", () => Me.CurrentTarget)),
                        new Action(ret => CreateBuffCast("Bane of Doom", () => Me.CurrentTarget)),
                        new Action(ret => CreateBuffCast("Corruption", () => Me.CurrentTarget)),
                        new Action(ret => CreateBuffCast("Immolate", () => Me.CurrentTarget)),
                        new Action(ret => CreateBuffCast("Incinerate", () => Me.ActiveAuras.ContainsKey("Molten Core"))),
                        new Action(ret => CreateBuffCast("Hand of Gul'dan", () => Me.CurrentTarget)),
                        new Action(ret => CreateBuffCast("Soul Fire", () => Me.ActiveAuras.ContainsKey("Soulburn") || Me.ActiveAuras.ContainsKey("Decimation")))
                        ))

                // Fall back on this as a last resort... really only for low levels
                //CreateSpellCast("Shadow Bolt")
                );
 
you probally wanna do something like this.
Code:
                                new Decorator(ret => Talents.CurrentSpec == TalentSpec.Demonology,
                    new PrioritySelector(
                        CreateBuffCast("Demonic Empowerment")),
                        CreateBuffCast("Curse of the Elements", () => Me.CurrentTarget)),
                        CreateBuffCast("Bane of Doom", () => Me.CurrentTarget)),
                        CreateBuffCast("Corruption", () => Me.CurrentTarget)),
                        CreateBuffCast("Immolate", () => Me.CurrentTarget)),
                        CreateBuffCast("Incinerate", () => Me.ActiveAuras.ContainsKey("Molten Core"))),
                        CreateBuffCast("Hand of Gul'dan", () => Me.CurrentTarget)),
                        CreateBuffCast("Soul Fire", () => Me.ActiveAuras.ContainsKey("Soulburn") || Me.ActiveAuras.ContainsKey("Decimation")))
                        ))
whats happening is the code will run though whatever "CreatBuffCast"s it can before combat hits. once combat hits it moveds to Combat()
even with the sequence thats an issue, because no matter what, once honorbuddy starts combat() pull() stops. so if its really not casting it and you want it to, consider moving it to the start of Combat() instead.
 
Combat is a mimic of that, and it will still only cast CotE if it's first?

I have adapted alot of Locker's code into my own two Composites, and neither of them function properly either:

Pull:
Code:
protected Composite CreatePullBehavior()
        {
            return new PrioritySelector(
                new Decorator(
                    ret => Me.CurrentTarget.DistanceSqr >= 35*35,
                    new Action(ret => Navigator.MoveTo(Me.CurrentTarget.Location))),
                new Decorator(
                    ret => Me.IsMoving,
                    new Action(ret => WoWMovement.MoveStop())),
                new Decorator(
                    ret => !Me.IsFacing(Me.CurrentTarget),
                    new Action(ret => Me.CurrentTarget.Face())),
                new Decorator(
                    ret => Me.IsCasting,
                    new ActionAlwaysSucceed()),

                new Action(
                    delegate
                        {
                            Lua.DoString("PetAttack()");
                            return RunStatus.Failure;
                        }),
                new Decorator(
                    ret => Me.CurrentTarget.IsAlive,
                    new PrioritySelector(
                        CreateBuffCast("Immolate", () => Me.CurrentTarget),
                        CreateBuffCast("Curse of the Elements", () => Me.CurrentTarget),
                        CreateBuffCast("Bane of Doom", () => Me.CurrentTarget),
                        CreateBuffCast("Hand of Gul'Dan", () => Me.CurrentTarget),
                        CreateBuffCast("Incinerate", () => Me.ActiveAuras.ContainsKey("Molten Core")))),

                CreateSpellCast("Shadow Bolt"));
        }

Combat:
Code:
protected Composite CreateCombatBehavior()
        {
            return new PrioritySelector(
                new Decorator(ret => !Me.GotTarget,
                    new PrioritySelector(
                        new Decorator(ret => Targeting.Instance.FirstUnit == null || Targeting.Instance.FirstUnit.Dead || !Targeting.Instance.FirstUnit.Combat,
                            new PrioritySelector(
                                new Decorator(ret => Me.Pet != null && Me.Pet.Combat && Me.Pet.CurrentTarget != null,
                                    new Action(ret => Me.Pet.CurrentTarget.Target())),
                                new Action(ret => Logging.Write(Color.Red, "No Valid Target -- Acquiring new Target")))),
                        new Action(ret => Targeting.Instance.FirstUnit.Target()))),
                new Decorator(
                    ret => Me.CurrentTarget.DistanceSqr >= 35 * 35,
                    new Action(ret => Navigator.MoveTo(Me.CurrentTarget.Location))),
                new Decorator(
                    ret => Me.IsMoving,
                    new Action(ret => WoWMovement.MoveStop())),
                new Decorator(
                    ret => !Me.IsFacing(Me.CurrentTarget),
                    new Action(ret => Me.CurrentTarget.Face())),
                new Decorator(
                    ret => Me.IsCasting,
                    new ActionAlwaysSucceed()),
                CreateSummonPet(),
                new Decorator(ret => !Me.Pet.IsAutoAttacking,
                    new Action(
                        delegate
                            {
                                Lua.DoString("PetAttack()");
                                // Yes, we want to 'fail' here. This is on purpose!
                                return RunStatus.Failure;
                            })),
                new Decorator(ret => Me.ManaPercent <= 50 && Me.HealthPercent > 60,
                    CreateSpellCast("Life Tap")),
                new Decorator(ret => Me.Pet != null && Me.Pet.HealthPercent < 60,
                    CreateSpellCast("Health Funnel")),
                //new Action(ret => UsePetAction(PetAction.AxeToss)),
                //new Action(ret => UsePetAction(PetAction.Felstorm)),
                new Decorator(
                    ret => Me.CurrentTarget.IsAlive,
                    new PrioritySelector(
                        CreateBuffCast("Immolate", () => Me.CurrentTarget),
                        CreateBuffCast("Curse of the Elements", () => Me.CurrentTarget),
                        CreateBuffCast("Bane of Doom", () => Me.CurrentTarget),
                        CreateBuffCast("Hand of Gul'Dan", () => Me.CurrentTarget),
                        CreateBuffCast("Incinerate", () => Me.ActiveAuras.ContainsKey("Molten Core")))),

                CreateSpellCast("Shadow Bolt"));
        }
 
Back
Top