February 12, 20188 yr Hello, I'm writing a plugin for Blood of Sargeras exchange and I want to use it in pair with Gatherer, but if I try to pause Gatherer product and make plugin go on a custom routine GoTo tasks do not work, is there a proper way to supress main product or insert a custom function into main Engine with priority higher than Gatherer? Thanks in advance.
February 14, 20188 yr Hello, you can subscribe to the movement events to block the movement. It could look like this(not tested): //call at initialize public void SubscribeEvents() { MovementEvents.OnMovementPulse += MovementEventsOnOnMovementPulse; } //call at dispose public void UnSubscribeEvents() { MovementEvents.OnMovementPulse -= MovementEventsOnOnMovementPulse; } private void MovementEventsOnOnMovementPulse(List<Vector3> path, CancelEventArgs cancelEventArgs) { if (DestinationTmp != Vector3.Empty && path.LastOrDefault()?.Action != "custom" ) { cancelEventArgs.Cancel = true; } } public static Vector3 DestinationTmp = Vector3.Empty; public static void MoveTo(Vector3 destination) { List<Vector3> path = PathFinder.FindPath(ObjectManager.Me.Position, destination); var last = path.LastOrDefault(); if (last != null) last.Action = "custom"; DestinationTmp = MovementManager.CurrentPath.LastOrDefault() ?? ObjectManager.Me.Position; MovementManager.Go(path); } public static void GoBack() { List<Vector3> path = PathFinder.FindPath(ObjectManager.Me.Position, DestinationTmp); DestinationTmp = Vector3.Empty; MovementManager.Go(path); }
Create an account or sign in to comment