April 28Apr 28 Hello, why is bot not flying when im killed, when there is fly mount available for that, aways chose to walk to the corpse. Is there any option to make it use fly in ghost form?
5 hours ago5 hr Hi,It's not the default behavior, the bot only flies to your corpse when it can't make a ground path to it.You can try this plugin (not tested), put it in your Plugins folder and stay on a flying mount when you die: Fly to corpse when dead.csusing System; using System.ComponentModel; using System.Threading; using robotManager.Helpful; using wManager.Events; using wManager.Wow.Helpers; // Force the bot to fly back to its corpse (corpse run on a flying mount). public class Main : wManager.Plugin.IPlugin { private const float MinDistanceToFly = 30f; private const int AscendRetestMs = 5 * 60 * 1000; private const int MinActionIntervalMs = 500; private static bool _testedThisDeath; private static bool _isFlyingMount; private static int _lastAscendTick; private static int _lastActionTick; [ThreadStatic] private static bool _reentry; public void Initialize() { OthersEvents.OnPathFinderFindPath += OnPathFinderFindPath; Logging.Write("[FlyToCorpse] Loaded."); } public void Dispose() { OthersEvents.OnPathFinderFindPath -= OnPathFinderFindPath; Logging.Write("[FlyToCorpse] Unloaded."); } public void Settings() { } private static void OnPathFinderFindPath(Vector3 from, Vector3 to, string continentNameMpq, CancelEventArgs cancelable) { if (_reentry) return; _reentry = true; try { var me = wManager.Wow.ObjectManager.ObjectManager.Me; if (me == null || !me.IsValid) return; if (!me.IsDeadMe) { _testedThisDeath = false; _isFlyingMount = false; return; } if (!me.IsMounted) return; Vector3 corpse = me.PositionCorpse; if (corpse == null || corpse.DistanceTo(Vector3.Zero) <= 0) return; if (to == null || to.DistanceTo(corpse) > 12) return; if (corpse.DistanceTo(me.Position) < MinDistanceToFly) return; int now = Environment.TickCount; if (_lastActionTick != 0 && (uint)(now - _lastActionTick) < MinActionIntervalMs) return; if (!me.IsFlying) { bool mayTest = !_testedThisDeath || (uint)(now - _lastAscendTick) >= AscendRetestMs; if (!mayTest) return; _testedThisDeath = true; _lastAscendTick = now; Move.JumpOrAscend(Move.MoveAction.DownKey); Thread.Sleep(Others.Random(300, 700)); Move.JumpOrAscend(Move.MoveAction.UpKey); Thread.Sleep(Others.Random(300, 700)); _isFlyingMount = me.IsFlying; } if (!me.IsFlying) return; to.Type = "Flying"; _lastActionTick = now; cancelable.Cancel = true; } catch (Exception e) { Logging.WriteError("[FlyToCorpse] " + e); } finally { _reentry = false; } } }
Create an account or sign in to comment