protected override void OnStart() { _min = Convert.ToInt32(MinLevel); _max = Convert.ToInt32(MaxLevel); _timeout = Convert.ToInt32(timeout); currentstep = 0; Logging.Write("Doing fates and hunt in between."); Logging.Write("Stats: MinFate level={0} MaxFatelvl={1}", _min, _max); // MaxLevel = "34"; // MinLevel = "25"; CachedProvider = CombatTargeting.Instance.Provider; CombatTargeting.Instance.Provider = new MySuperAwesomeTargetingProvider(); saveNow = DateTime.Now; }
protected override void OnTagStart() { Chocobo.BlockSummon = true; LeashSquared = LeashDistance * LeashDistance; StaticGuardianNPCId = GuardianNPCId; StaticSearchDistance = SearchDistance; CachedProvider = CombatTargeting.Instance.Provider; if (IgnoreNpcIds == null) { IgnoreNpcIds = new int[0]; } CombatTargeting.Instance.Provider = new SoSmallDutyCombatTargetingProvider(IgnoreNpcIds); CombatTargeting.Instance.Locked = true; GameEvents.OnPlayerDied += GameEvents_OnPlayerDied; }
protected override Composite CreateBehavior() { return(new PrioritySelector( new Decorator(ret => ShouldStop(), new Action(r => OnDoneWhile())), new Decorator(ret => DateTime.Now > saveNow + TimeSpan.FromSeconds(_timeout) && currentstep == 0, new Action(r => OnTimeout())), // This one will run always kind of a pulse one new Sequence( new Action(r => CountDeath()), new Action(r => IsFateStillActive()), new Action(r => UpdateFateData()), new ActionAlwaysFail() //always fail that the rest of the tree is traveresd ), //Start fighting Fate Mobs but only when we are in close range to the fate position.TBD enhance this filter #region sync//level Sync new Decorator(r => currentfate != null && FateManager.WithinFate && currentfate.MaxLevel < Core.Player.ClassLevel && !Core.Me.IsLevelSynced, new ActionRunCoroutine(async r => { Logging.Write("Applying Level Sync."); ToDoList.LevelSync(); await Coroutine.Sleep(500); return false; }) ), #endregion sync//level Sync #region Movment new Decorator( ret => currentstep == 1 && Vector3.Distance(Core.Player.Location, Position) > (currentfate.Radius - 10), UseFlight ? new ActionRunCoroutine(obj => FlyTo(Position, true, true)) : CommonBehaviors.MoveAndStop(ret => Position, Distance, stopInRange: true, destinationName: "Moving to Fates.") ), #region Handin new Decorator(r => currentfate != null && FateManager.WithinFate && currentfate.Icon == FateIconType.KillHandIn && currentfate.TimeLeft.Minutes <= 8, new Sequence( new Action(r => { Poi.Clear("Handing in items."); Logging.Write("Hand-in Fate"); var npc = GameObjectManager .GetObjectsOfType <BattleCharacter>() .Where( b => b.IsFate && !b.CanAttack && b.FateId == currentfate.Id); var q = from s in npc group s by s into g orderby g.Count() descending select g.Key; if (q.LastOrDefault() == null) { Logging.Write("Could not find handin NPC. Something is wrong."); return; } tempProvider = CombatTargeting.Instance.Provider; CombatTargeting.Instance.Provider = new NullTargetingProvider(); MoveTo(q.LastOrDefault().Location); GameObjectManager.GetObjectByNPCId(q.LastOrDefault().NpcId).Interact(); Talk.Next(); InventoryManager.GetBagByInventoryBagId(InventoryBagId.KeyItems).FilledSlots.LastOrDefault().Handover(); Request.HandOver(); CombatTargeting.Instance.Provider = tempProvider; }), new ActionAlwaysFail() //always fail that the rest of the tree is traveresd )), new Decorator(ret => Talk.DialogOpen, new Action(r => { Talk.Next(); })), new Decorator(ret => Request.IsOpen, new Action(r => { GameObjectManager.GetObjectByNPCId(npc.NpcId).Interact(); InventoryManager.GetBagByInventoryBagId(InventoryBagId.KeyItems).FilledSlots.LastOrDefault().Handover(); Request.HandOver(); })), //Find fates #endregion Handin #endregion Movment #region escort new Decorator(r => currentfate != null && fateid != 0 && Poi.Current.Type != PoiType.Kill, new ActionRunCoroutine(async r => MoveToFocusedFate()) ), #endregion escort new Decorator(ret => currentfate == null && currentstep == 0, new Sequence( new Action(r => { getFates(); if (currentfate != null) { GoFate(); } else { GoHunting(); } } ) )), new ActionAlwaysSucceed() )); }
public GilesLootTargetingProvider(ITargetingProvider source) { this.source = source; }
protected override void OnStart() { if (FateIds == null) { FateIds = new List<string>(); } foreach (var fateId in FateIds) { Logging.Write("Fate: Added fate " + fateId); } _min = Convert.ToInt32(MinLevel); _max = Convert.ToInt32(MaxLevel); _timeout = Convert.ToInt32(timeout); currentstep = 0; Logging.Write("Doing fates and hunt in between"); Logging.Write("Stats: MinFate level={0} MaxFatelvl={1}", _min, _max); // MaxLevel = "34"; // MinLevel = "25"; CachedProvider = CombatTargeting.Instance.Provider; CombatTargeting.Instance.Provider = new MySuperAwesomeTargetingProvider(); saveNow = DateTime.Now; }