Exemplo n.º 1
0
 public static int LineOfSightTest(Location start, Location end)
 {
     start.Z += 1.3f;
     end.Z += 1.3f;
     Location result;
     return Traceline(start, end, out result, 0x120171); // 0x100121
 }
Exemplo n.º 2
0
        public static bool HandleTerrainClick(Location loc)
        {
            if (_handleTerrainClick == null)
                _handleTerrainClick = Manager.Memory.RegisterDelegate<HandleTerrainClickDelegate>((IntPtr)Pointers.World.HandleTerrainClick, true);

            return _handleTerrainClick(new TerrainClickEvent { GUID = 0ul, Position = loc, Button = MouseButton.None | MouseButton.Left });
        }
Exemplo n.º 3
0
        public static int Traceline(Location start, Location end, out Location result, uint flags)
        {
            if (_traceline == null)
                _traceline = Manager.Memory.RegisterDelegate<TracelineDelegate>((IntPtr) Pointers.World.Traceline);

            float dist = 1.0f;
            return _traceline(ref start, ref end, out result, ref dist, flags, 0);
        }
Exemplo n.º 4
0
 private void lblPos1_Click(object sender, EventArgs e)
 {
     if (!Manager.ObjectManager.IsInGame)
         return;
     _pos1 = Manager.LocalPlayer.Location;
     lblPos1.Text = _pos1.ToString();
 }
Exemplo n.º 5
0
 public bool MoveTo(Location loc, double tolerance = 5)
 {
     Manager.LocalPlayer.ClickToMove(loc);
     return Manager.LocalPlayer.Location.DistanceTo(loc) <= tolerance;
 }
Exemplo n.º 6
0
        public bool PathTo(Location pos)
        {
            if (!Manager.ObjectManager.IsInGame)
                return false;

            //if (CurrentMap != WoWWorld.CurrentMap)
            //{
            //    CurrentMap = WoWWorld.CurrentMap;
            //    PatherInstance = new Pather(CurrentMap);
            //}

            //if (PatherInstance == null)
            //    return false;

            //Destination = pos;
            //var path = PatherInstance.FindPath(Manager.LocalPlayer.Location, pos, false);
            ////var path = PatherInstance.FindPath(Manager.LocalPlayer.Location, pos.ToVector3());
            //if (path == null)
            //{
            //    Log.WriteLine("Could not path to {0}", pos);
            //    return false;
            //}

            //FollowPath(path.ToLocation());

            return true;
        }
Exemplo n.º 7
0
 public static int Traceline(Location start, Location end)
 {
     Location result;
     return Traceline(start, end, out result, 0x120171);
 }
Exemplo n.º 8
0
 public Blackspot(float x, float y, float z, float r)
     : this()
 {
     Location = new Location(x, y, z);
     Radius = r;
 }
Exemplo n.º 9
0
 public double DistanceTo(Location loc)
 {
     return Math.Sqrt(Math.Pow(X - loc.X, 2) + Math.Pow(Y - loc.Y, 2) + Math.Pow(Z - loc.Z, 2));
 }
Exemplo n.º 10
0
        private void DrawCircle(Location loc, float radius, Color innerColor, Color outerColor, int complexity = 24, bool isFilled = true)
        {
            var vertices = new List<PositionColored>();
            if (isFilled)
                vertices.Add(new PositionColored(Vector3.Zero, innerColor.ToArgb()));

            double stepAngle = (Math.PI * 2) / complexity;
            for (int i = 0; i <= complexity; i++)
            {
                double angle = (Math.PI * 2) - (i * stepAngle);
                float x = (float)(radius * Math.Cos(angle));
                float y = (float)(-radius * Math.Sin(angle));
                vertices.Add(new PositionColored(new Vector3(x, y, 0), outerColor.ToArgb()));
            }

            var buffer = vertices.ToArray();

            SetTarget(loc.ToVector3() + new Vector3(0, 0, 0.3f));

            D3D.Device.DrawUserPrimitives(PrimitiveType.TriangleFan, buffer.Length - 2, buffer);
        }
Exemplo n.º 11
0
 public IEnumerable<Vector3> FindPath(Location start, Location end, bool hardFail)
 {
     return FindPath(start.ToVector3(), end.ToVector3(), this.Filter, hardFail);
 }