public void DeleteAllWayPoints()
 {
     while (m_Waypoint != null && !m_Waypoint.Deleted)
     {
         WayPoint t = m_Waypoint;
         m_Waypoint = m_Waypoint.NextPoint;
         t.Delete();
     }
 }
            protected override void OnTarget(Mobile from, object targeted)
            {
                IPoint3D spot = targeted as IPoint3D;

                if (spot == null)
                {
                    return;
                }

                SpellHelper.GetSurfaceTop(ref spot);

                Point3D location = new Point3D(spot);

                WayPoint wp = (prevWayPoint != null) ? new WalkWayPoint(prevWayPoint) : new WalkWayPoint();

                wp.MoveToWorld(location, from.Map);
                wp.Movable = false;

                baseCreature.Frozen       = false;
                baseCreature.CantWalk     = false;
                baseCreature.CurrentSpeed = 0.2;

                if (baseCreature.CurrentWayPoint == null)
                {
                    baseCreature.CurrentWayPoint = wp;
                }

                Timer.DelayCall(Config.AutoDeleteDelay, delegate
                {
                    wp.Delete();

                    if (baseCreature.CurrentWayPoint == null)
                    {
                        baseCreature.CurrentSpeed = baseCreature.PassiveSpeed;
                    }
                }
                                );

                from.Target = new AddWalkWayPointTarget(baseCreature, wp);
            }
Beispiel #3
0
        public static void AddWaypoints()
        {
            VoidPoolController one = VoidPoolController.InstanceTram;
            VoidPoolController two = VoidPoolController.InstanceFel;

            if (one == null || two == null)
            {
                return;
            }

            for (var index = 0; index < one.WaypointsA.Count; index++)
            {
                WayPoint w = one.WaypointsA[index];

                if (w != null && !w.Deleted)
                {
                    w.Delete();
                }
            }

            for (var index = 0; index < one.WaypointsB.Count; index++)
            {
                WayPoint w = one.WaypointsB[index];

                if (w != null && !w.Deleted)
                {
                    w.Delete();
                }
            }

            for (var index = 0; index < two.WaypointsA.Count; index++)
            {
                WayPoint w = two.WaypointsA[index];

                if (w != null && !w.Deleted)
                {
                    w.Delete();
                }
            }

            for (var index = 0; index < two.WaypointsB.Count; index++)
            {
                WayPoint w = two.WaypointsB[index];

                if (w != null && !w.Deleted)
                {
                    w.Delete();
                }
            }

            // patha
            WayPoint wp = new WayPoint();

            wp.MoveToWorld(new Point3D(5590, 2024, 0), Map.Trammel);
            one.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5590, 2024, 0), Map.Felucca);
            two.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5578, 2029, 0), Map.Trammel);
            one.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5578, 2029, 0), Map.Felucca);
            two.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5566, 2027, 0), Map.Trammel);
            one.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5566, 2027, 0), Map.Felucca);
            two.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5555, 2021, 0), Map.Trammel);
            one.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5555, 2021, 0), Map.Felucca);
            two.WaypointsA.Add(wp);

            wp = new WayPoint();
            wp.MoveToWorld(new Point3D(5545, 2015, 0), Map.Trammel);
            one.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5545, 2015, 0), Map.Felucca);
            two.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5537, 2020, 0), Map.Trammel);
            one.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5537, 2020, 0), Map.Felucca);
            two.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5527, 2015, 0), Map.Trammel);
            one.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5527, 2015, 0), Map.Felucca);
            two.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5509, 2005, 0), Map.Trammel);
            one.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5509, 2005, 0), Map.Felucca);
            two.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5500, 1998, 0), Map.Trammel);
            one.WaypointsA.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5500, 1998, 0), Map.Felucca);
            two.WaypointsA.Add(wp);

            // pathb
            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5469, 2016, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5469, 2016, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5478, 2025, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5478, 2025, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5484, 2029, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5484, 2029, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5490, 2027, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5490, 2027, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5504, 2027, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5504, 2027, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5516, 2020, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5516, 2020, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5524, 2012, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5524, 2012, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5513, 2005, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5513, 2005, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5502, 2004, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5502, 2004, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5500, 1998, 0), Map.Trammel);
            one.WaypointsB.Add(wp);

            wp = new WayPoint();
            WeakEntityCollection.Add("newcovetous", wp);
            wp.MoveToWorld(new Point3D(5500, 1998, 0), Map.Felucca);
            two.WaypointsB.Add(wp);

            for (int i = 0; i < one.WaypointsA.Count; i++)
            {
                WayPoint waypoint = one.WaypointsA[i];

                if (i < one.WaypointsA.Count - 1)
                {
                    waypoint.NextPoint = one.WaypointsA[i + 1];
                }
            }

            for (int i = 0; i < one.WaypointsB.Count; i++)
            {
                WayPoint waypoint = one.WaypointsB[i];

                if (i < one.WaypointsB.Count - 1)
                {
                    waypoint.NextPoint = one.WaypointsB[i + 1];
                }
            }

            for (int i = 0; i < two.WaypointsA.Count; i++)
            {
                WayPoint waypoint = two.WaypointsA[i];

                if (i < two.WaypointsA.Count - 1)
                {
                    waypoint.NextPoint = two.WaypointsA[i + 1];
                }
            }

            for (int i = 0; i < two.WaypointsB.Count; i++)
            {
                WayPoint waypoint = two.WaypointsB[i];

                if (i < two.WaypointsB.Count - 1)
                {
                    waypoint.NextPoint = two.WaypointsB[i + 1];
                }
            }

            one.WaypointACount = one.WaypointsA.Count;
            one.WaypointBCount = one.WaypointsB.Count;

            two.WaypointACount = two.WaypointsA.Count;
            two.WaypointBCount = two.WaypointsB.Count;
        }