Jump to content

target not in line of sight


zealtla

Recommended Posts

HI,everyone.sometimes target not in line of sight,and player can't cast spell,but bot won't move,so I want to write a function with C# in FC to handle this use  events.

Which events is about  target not in line of sight? tks!

Link to comment
Share on other sites

5 hours ago, zealtla said:

HI,everyone.sometimes target not in line of sight,and player can't cast spell,but bot won't move,so I want to write a function with C# in FC to handle this use  events.

Which events is about  target not in line of sight? tks!

Donno if that helps and its right out of the mind and just an idea...

                    wManager.Events.FightEvents.OnFightStart += (WoWUnit unit, System.ComponentModel.CancelEventArgs e) =>
                    {
                        // Not in LoS
                        if (TraceLine.TraceLineGo(unit.Position))
                        {
                            // Get waypoints to the target
                            IEnumerable<robotManager.Helpful.Vector3> waypoints = PathFinder.Pather.FindPath(ObjectManager.Me.Position, unit.Position, out bool result, out bool resultPartial);

                            foreach (robotManager.Helpful.Vector3 waypoint in waypoints)
                            {
                                if (!TraceLine.TraceLineGo(waypoint))
                                {
                                    // In LoS
                                    MovementManager.MoveTo(waypoint);

                                    // While moving....
                                }
                            }
                        }
                    };

You also need to cancel that event and i'm not sure if its the right one. There is no "not in LoS" event as far i know.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...