Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vector3 newPos = ObjectManager.Me.Position;
- for (int r = 5; r < 10; r++)
- {
- float sampleAngle = 15;
- for(int i = 0; i < sampleAngle; i++)
- {
- float angle = i / sampleAngle * 2.0f * 2 * (float)System.Math.PI;
- angle = angle + ((2 * (float)System.Math.PI) / sampleAngle) * (float)rand.NextDouble();
- float px = ObjectManager.Me.Position.X+ r * (float)System.Math.Cos(angle);
- float py = ObjectManager.Me.Position.Y + r * (float)System.Math.Cos(angle);
- float closestPoint = float.MaxValue;
- /*foreach (WoWGameObject obj in objList)
- {
- float magSquared = (px - obj.Position.X) * (px - obj.Position.X) + (py - obj.Position.Y) * (py - obj.Position.Y);
- if (magSquared <= crystalRadius * crystalRadius)
- {
- Logging.Write("px:" + px + " obj.positionx " + obj.Position.X + " dist:" + magSquared);
- newPos = new Vector3(px, py, ObjectManager.Me.Position.Z);
- return;
- }
- }*/
- newPos = new Vector3(px, py, ObjectManager.Me.Position.Z);
- Logging.Write("x:" + ObjectManager.Me.Position.X + " y: " + ObjectManager.Me.Position.Y + " z: " + ObjectManager.Me.Position.Z + " px:" + px + " py: " + py);
- while (ObjectManager.Me.Position.DistanceTo(newPos) > 5 || ObjectManager.GetWoWGameObjectByName("Crystal Spike").Count != 0)
- {
- MovementManager.Go(PathFinder.FindPath(newPos), false);
- Logging.Write("Moving! Dist:" + ObjectManager.Me.Position.DistanceTo(newPos) + " crystal spikes" + ObjectManager.GetWoWGameObjectByName("Crystal Spike").Count);
- Thread.Sleep(1000);
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement