Jump to content
This site uses cookies! Learn More

This site uses cookies!

By continuing to use this site, you agree to allow us to store cookies on your computer. :)

zealtla

target not in line of sight

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!

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...