Ejemplo n.º 1
0
        public void OnTarget(Mobile from, object obj)
        {
            IPoint3D p3D = obj as IPoint3D;

            if (p3D == null)
            {
                return;
            }

            Point3D m_pnt = from.Location;
            Map     m_map = from.Map;
            int     x = p3D.X, y = p3D.Y;
            Point3D p = new Point3D(x, y, m_map.GetAverageZ(x, y));

            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042010);
                return;
            }
            else if (!from.InRange(p3D, 4))
            {
                from.SendMessage("The trap is too cumbersome to deploy that far away.");
                return;
            }

            ArrayList trapshere = TrapHelper.CheckTrap(p, m_map, 0);

            if (trapshere.Count > 0)
            {
                from.SendMessage("This location is too close to another trap. ");
                return;
            }

            ArrayList trapsnear = TrapHelper.CheckTrap(p, m_map, 1);

            if ((trapsnear.Count > 0))
            {
                from.SendMessage("You can't place any more");
                return;
            }

            if (this.BumpZ)
            {
                ++m_pnt.Z;
            }

            if (!from.Mounted)
            {
                from.Animate(32, 5, 1, true, false, 0);
            }

            from.SendMessage("You deploy the Lobster trap.");

            this.Consume();

            Item item = new Buoy(from);

            item.MoveToWorld(p, m_map);
        }
        public void OnTarget(Mobile from, object obj)
        {

            IPoint3D p3D = obj as IPoint3D;

            if (p3D == null)
                return;

            Point3D m_pnt = from.Location;
            Map m_map = from.Map;
            int x = p3D.X, y = p3D.Y;
            Point3D p = new Point3D(x, y, m_map.GetAverageZ(x, y));

            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042010);
                return;
            }
            else if (!from.InRange(p3D, 4))
            {
                from.SendMessage("The trap is too cumbersome to deploy that far away.");
                return;
            }

            ArrayList trapshere = TrapHelper.CheckTrap(p, m_map, 0);
            if (trapshere.Count > 0)
            {
                from.SendMessage("This location is too close to another trap. ");
                return;
            }

            ArrayList trapsnear = TrapHelper.CheckTrap(p, m_map, 1);
            if ((trapsnear.Count > 0))
            {
                from.SendMessage("You can't place any more");
                return;
            }

            if (this.BumpZ)
                ++m_pnt.Z;

            if (!from.Mounted)
                from.Animate(32, 5, 1, true, false, 0);

            from.SendMessage("You deploy the Lobster trap.");

            this.Consume();

            Item item = new Buoy(from);
            item.MoveToWorld(p, m_map);
        }
        public static void init(Buoy buoy)
		{
            buoy.thisTimer = new TrapHelper.CatchTimer(buoy, typeof(Bobbingbouy), buoy.Owner);
            buoy.thisTimer.Start();
		}
Ejemplo n.º 4
0
 public static void init(Buoy buoy)
 {
     buoy.thisTimer = new TrapHelper.CatchTimer(buoy, typeof(Bobbingbouy), buoy.Owner);
     buoy.thisTimer.Start();
 }