public void DoTask() { while (_ambuscade) { // Wait for all palyers to start. while (!_proceed && _ambuscade) { Thread.Sleep(100); } _proceed = false; Thread.Sleep(1000); if (!job.Tracking()) { job.TrackBuffs(true); } if (_KeyCapped && _initialKeyItem) { _proceed = true; goto SkipRoEFarming; } // Travel to Home Point then RoE Zone. client.Send("RELAY TASK 1 0"); DoRoute(_route2); NavigateToZone(_hpMenuItemString, 41); // Wait for all players to arrive at the RoE Zone. while (!_proceed && _ambuscade) { Thread.Sleep(100); } _proceed = false; // Farm Key Item, then ReturnHome() //DoRoute(_route3, true); client.Send("RELAY TASK 5 0"); // -- obtain KI ObtainKI(); fface.Navigator.Reset(); Thread.Sleep(4000); client.Send("RELAY TASK 6 0"); // -- tell players to stop farming KI while (!_proceed && _ambuscade) { Thread.Sleep(100); } _proceed = false; Thread.Sleep(3500); // allow time to disengage // Tell clients to return home! client.Send("RELAY TASK 2 0"); ReturnHome(); // Wait for everyone to return home. while (!_proceed && _ambuscade) { Thread.Sleep(100); } SkipRoEFarming: // Run to the book, and enter legion. DoRoute(_route1); DoEntry(); // Wait until I'm in legion to proceed. while (fface.Player.Zone != Zone.Maquette_Abdhaljs_Legion && _ambuscade) { Thread.Sleep(100); } // Once in Legion, wait for everything to load. Thread.Sleep(15000); // Add trusts to the party. if (fface.Party.Party0Count < 6 && _ambuscade) { SummonTrusts(); } // Look for a target List <TargetInfo> targs = Combat.FindTarget(ambuscadeTargetMonster.MonsterName); while (!targs.Any() && _ambuscade) { targs = Combat.FindTarget(ambuscadeTargetMonster.MonsterName); Thread.Sleep(1); } if (targs.Any() && _ambuscade) { // Fight le target. Fight(targs[0].Id, Combat.Mode.None); } _hasKeyItem = false; _KeyCapped = false; _initialKeyItem = false; while (fface.Player.Zone != Zone.Mhaura && _ambuscade) { Thread.Sleep(100); } // After fighting the target, loop back to the start. Thread.Sleep(15000); } }
public bool ObtainKI() { Combat.LoadBlacklist(fface.Player.Zone); Combat.LoadCoords(fface.Player.Zone); Combat.LoadHotspots(fface.Player.Zone); List <Hotspot> hotspots = Combat.GetHotspots(); List <Node> path = new List <Node>(); int hotspotIndex = 0; List <Monster> targets = new List <Monster>(); targets.Add(roeTargetMonster); targets.Add(new Monster() { HitBox = 4.5, MonsterName = "Korrigan", TimeSpecific = false }); while (!HasKeyItem() && _ambuscade) { NoPath: if (HasKeyItem()) { goto done; } hotspotIndex = (hotspotIndex + 1) % hotspots.Count; float destx = hotspots[hotspotIndex].Waypoint.X; float destz = hotspots[hotspotIndex].Waypoint.Z; NewPath: path = Combat.GetPath(destx, destz); if (path == null) { goto NoPath; } float targetx; float targetz; while (path.Any() && !HasKeyItem() && _ambuscade) { foreach (Monster m in targets) { _targetId = Combat.FindTarget(50, m.MonsterName); if (_targetId > 0 && !HasKeyItem()) { fface.Navigator.Reset(); Fight(_targetId, Combat.Mode.Meshing); _targetId = 0; goto NewPath; } } fface.Navigator.HeadingTolerance = 1; fface.Navigator.DistanceTolerance = 0.7; targetx = path[0].X; targetz = path[0].Z; path.RemoveAt(0); fface.Navigator.Goto(() => targetx, () => targetz, path.Any()); } fface.Navigator.Reset(); Thread.Sleep(1); } done: fface.Navigator.Reset(); return(true); }