Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using CommonBehaviors.Actions;
- using Styx;
- using Styx.Logic.BehaviorTree;
- using Styx.Logic.Combat;
- using TreeSharp;
- using Action = TreeSharp.Action;
- namespace FishFeasted
- {
- class FishFeasted : BotBase
- {
- Random r = new Random();
- public override string Name
- {
- get { return "FishFeasted"; }
- }
- public override PulseFlags PulseFlags
- {
- get { return PulseFlags.All; }
- }
- float randy(double min, double max)
- {
- double range = (double)max - (double)min;
- double sample = r.NextDouble();
- double scaled = (sample * range) + min;
- return (float)scaled;
- }
- private Composite _root;
- public override Composite Root
- {
- get {
- return _root ?? (_root = new PrioritySelector(
- new Decorator(ret => !StyxWoW.IsInGame || !StyxWoW.IsInWorld || !StyxWoW.Me.IsValid || StyxWoW.Me.IsCasting || SpellManager.GlobalCooldown,
- new ActionAlwaysSucceed()),
- new Decorator(ret => StyxWoW.Me.BagItems.Count(i => i != null && i.IsValid && i.Entry == 43015) > 0,
- new PrioritySelector(
- new Decorator(ret => StyxWoW.Me.CurrentPendingCursorSpell != null && StyxWoW.Me.CurrentPendingCursorSpell.Id == 57426,
- new Action(ret => LegacySpellManager.ClickRemoteLocation(StyxWoW.Me.Location.RayCast(randy(0, 2 * Math.PI), randy(0, 5))))),
- new Action(ret => StyxWoW.Me.BagItems.FirstOrDefault(i => i.Entry == 43015).Use()))),
- new Action(ret => TreeRoot.Stop())
- ));
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment