/// <summary> /// Completes placement of the carpet /// </summary> public void OnPlacement(Mobile from, Point3D p) { Map map = from.Map; if (map == null || map == Map.Internal) { return; } BaseFlyingCarpet carpet = Carpet; if (carpet == null) { return; } p = new Point3D(p.X - Offset.X, p.Y - Offset.Y, p.Z - Offset.Z); if (CanFit(ref p)) { Delete(); carpet.Owner = from; carpet.MoveToWorld(p, map); from.Z = carpet.Z + 1; } else { carpet.Delete(); from.Z -= 8; from.SendMessage("The carpet cannot be placed there."); } }
public AltitudeChangeTimer(BaseFlyingCarpet carpet, Direction dir) : base(TimeSpan.FromSeconds(0.25), TimeSpan.FromSeconds(0.5)) { _carpet = carpet; _dir = dir; Priority = TimerPriority.TwentyFiveMS; }
public FlyingCarpetControlGump(BaseFlyingCarpet carpet) : base(0, 0) { _carpet = carpet; AddPage(1); AddBackground(0, 0, 295, 245, 9250); AddBackground(215, 85, 40, 20, 9200); AddLabel(15, 10, labelHue, "Directional Movement"); AddButton(57, 29, 4500, 4500, GetButtonID(0, 0), GumpButtonType.Reply, 0); //Up AddButton(87, 40, 4501, 4501, GetButtonID(0, 1), GumpButtonType.Reply, 0); //North AddButton(100, 70, 4502, 4502, GetButtonID(0, 2), GumpButtonType.Reply, 0); //Right AddButton(87, 100, 4503, 4503, GetButtonID(0, 3), GumpButtonType.Reply, 0); //East AddButton(59, 113, 4504, 4504, GetButtonID(0, 4), GumpButtonType.Reply, 0); //Down AddButton(27, 100, 4505, 4505, GetButtonID(0, 5), GumpButtonType.Reply, 0); //South AddButton(15, 70, 4506, 4506, GetButtonID(0, 6), GumpButtonType.Reply, 0); //Left AddButton(27, 41, 4507, 4507, GetButtonID(0, 7), GumpButtonType.Reply, 0); //West AddButton(69, 84, 4020, 4022, GetButtonID(0, 8), GumpButtonType.Reply, 0); //Stop AddLabel(15, 165, labelHue, "Adjust Altitude"); AddButton(30, 190, incrementArrow, incrementPressedArrow, GetButtonID(1, 0), GumpButtonType.Reply, 0); AddButton(30, 210, decrementArrow, decrementPressedArrow, GetButtonID(1, 1), GumpButtonType.Reply, 0); AddButton(55, 195, 4020, 4022, GetButtonID(1, 2), GumpButtonType.Reply, 0); //Stop AddLabel(170, 85, labelHue, "Speed:"); AddLabel(230, 85, labelHue, _carpet.Speed.ToString()); AddButton(260, 78, incrementArrow, incrementPressedArrow, GetButtonID(2, 0), GumpButtonType.Reply, 0); AddButton(260, 98, decrementArrow, decrementPressedArrow, GetButtonID(2, 1), GumpButtonType.Reply, 0); AddLabel(190, 120, labelHue, "Entity Control"); AddButton(215, 140, 4008, 4010, GetButtonID(4, 0), GumpButtonType.Reply, 0); AddButton(250, 140, 4002, 4004, GetButtonID(4, 1), GumpButtonType.Reply, 0); AddLabel(205, 10, labelHue, "Rotate"); AddButton(195, 30, 4014, 4016, GetButtonID(3, 0), GumpButtonType.Reply, 0); //Turn left AddButton(230, 30, 4005, 4007, GetButtonID(3, 1), GumpButtonType.Reply, 0); //Turn right AddItem(210, 196, 2770); AddItem(188, 178, 2772); AddItem(210, 160, 2771); AddItem(232, 178, 2773); }
public MoveTimer(BaseFlyingCarpet carpet) : base(TimeSpan.FromSeconds(0.25), TimeSpan.FromSeconds(0.30)) { _carpet = carpet; Priority = TimerPriority.TwentyFiveMS; }