scsfl 2 Posted October 31, 2022 Share Posted October 31, 2022 hello community! I'm trying to implement following method in druid FC: when condition met bot has to use flying mount, else ground mount. There is following logic: I'm subscribing to OnPathFinderFindPath event and checking if I need to use flying path to destination point. If so then I'm setting destination flying and calling LongMove.LongMoveGo(destination). private static void checkIfNeedFlyingPath(Vector3 from, Vector3 to, string continentNameMpq, CancelEventArgs cancelable) { if (NeedToUseFlyingPath(to)) { to.SetFlying(); UseFlightForm(); Logging.WriteNavigator($"LongMove to {to}"); LongMove.LongMoveGo(to); cancelable.Cancel = true; } } Function that check if I need to fly. private static bool NeedToUseFlyingPath(Vector3 dest) { RotationLogger.Debug($"Calling NeedToUseFlyingPath({dest})"); if (!FlightForm.IsKnown() || Me.IsDead || Me.IsSwimming || Usefuls.ContinentNameMpq == "Azeroth") { RotationLogger.Debug($"NeedToUseFlyingPath() precondition failed!"); return false; } float dist = Me.Position.DistanceTo(dest); RotationLogger.Debug($"[Movement] Distance to point {dist}"); if (dist >= FCSettings.CurrentSetting.MinDistanceToFly && (Logging.Status == "To Town" || Logging.Status == "Farming" || Logging.Status == "Looting" || ToTown.GoToTownInProgress || dist >= FCSettings.CurrentSetting.DistanceToFly)) { RotationLogger.Debug($"[Movement] Need to use flying path to {dest}"); return true; } RotationLogger.Debug($"[Movement] Need to use ground path to {dest}"); return false; } The problem that this method is not stable. Sometimes it works fine, sometimes especially after farming state bot literally walks by the ground in flying form, then he might continue flying. I couldn't get where does he get this ground points when there is LongMove between 2 points 🙂 When I use built-in flying mechanics everything works decent. But I don't know how to implement similar flight mechanics. Link to comment https://wrobot.eu/forums/topic/14921-implement-own-mount-routine/ Share on other sites More sharing options...
TechMecca 7 Posted November 1, 2022 Share Posted November 1, 2022 I’d suggest inputting your own state to over rude default states. Link to comment https://wrobot.eu/forums/topic/14921-implement-own-mount-routine/#findComment-67124 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now