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:
My Only Working Solution:
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")
);