Exemplo n.º 1
0
        public override void OnDoubleClick(Mobile from)
        {
            Region reg = Region.Find(from.Location, from.Map);

            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
            }
            else if (DockSearch.NearDock(from) == false)
            {
                from.SendMessage("You must be near a dock to launch your ship!");
            }
            else if (
                reg.IsPartOf(typeof(OutDoorBadRegion)) ||
                reg.IsPartOf(typeof(VillageRegion)) ||
                reg.IsPartOf(typeof(BargeDeadRegion)) ||
                reg.IsPartOf(typeof(DeadRegion)) ||
                reg.IsPartOf(typeof(PirateRegion)) ||
                reg.IsPartOf(typeof(OutDoorRegion)) ||
                reg.IsPartOf(typeof(PublicRegion)) ||
                Server.Misc.Worlds.IsMainRegion(Server.Misc.Worlds.GetRegionName(from.Map, from.Location)))
            {
                from.LocalOverheadMessage(Network.MessageType.Emote, 0x25, false, "Where do you wish to place the ship?");
                from.Target = new InternalTarget(this);
            }
            else
            {
                from.LocalOverheadMessage(Network.MessageType.Emote, 0x25, false, "You may not place a boat from this location.");
            }
        }
Exemplo n.º 2
0
 public override void OnDoubleClick(Mobile from)
 {
     if (m_Boat != null)
     {
         if (m_Boat.Owner == from || from.AccessLevel >= AccessLevel.Administrator)
         {
             if (m_Boat.Contains(from))
             {
                 from.SendGump(new TillerManGump(from, m_Boat, false));                             //m_Boat.BeginRename( from );
             }
             else if (DockSearch.NearDock(from) == false)
             {
                 from.SendMessage("You must be near a dock to dry dock your ship!");
             }
             else
             {
                 m_Boat.BeginDryDock(from, m_Boat.Hue);
             }
         }
         else
         {
             from.SendLocalizedMessage(501023);                    // You must be the owner to use this item
         }
     }
 }
Exemplo n.º 3
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!IsChildOf(from.Backpack))
     {
         from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
     }
     else if (DockSearch.NearDock(from) == false)
     {
         from.SendMessage("You must be near a dock to launch your ship!");
     }
     else
     {
         from.SendLocalizedMessage(502482);                   // Where do you wish to place the ship?
         from.Target = new InternalTarget(this);
     }
 }
Exemplo n.º 4
0
        public override void OnDoubleClick(Mobile from)
        {
            string phrase_a = "Where do you wish to place the ship?";
            string phrase_b = "You may not place a boat from this location.";

            if (BaseBoat.isCarpet(Boat))
            {
                phrase_a = "Where do you wish to place the carpet?";
                phrase_b = "There is not magic from the carpet in this location.";
            }

            Region reg = Region.Find(from.Location, from.Map);

            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
            }
            else if (DockSearch.NearDock(from) == false && !BaseBoat.isCarpet(Boat))
            {
                from.SendMessage("You must be near a dock to launch your ship!");
            }
            else if (
                reg.IsPartOf(typeof(OutDoorBadRegion)) ||
                reg.IsPartOf(typeof(VillageRegion)) ||
                reg.IsPartOf(typeof(BargeDeadRegion)) ||
                reg.IsPartOf(typeof(NecromancerRegion)) ||
                reg.IsPartOf(typeof(DeadRegion)) ||
                reg.IsPartOf("the Forgotten Lighthouse") ||
                reg.IsPartOf("Anchor Rock Docks") ||
                reg.IsPartOf("Kraken Reef Docks") ||
                reg.IsPartOf("Savage Sea Docks") ||
                reg.IsPartOf("Serpent Sail Docks") ||
                reg.IsPartOf(typeof(PirateRegion)) ||
                reg.IsPartOf(typeof(OutDoorRegion)) ||
                reg.IsPartOf(typeof(PublicRegion)) ||
                Server.Misc.Worlds.IsMainRegion(Server.Misc.Worlds.GetRegionName(from.Map, from.Location)))
            {
                from.LocalOverheadMessage(Network.MessageType.Emote, 0x25, false, phrase_a);
                from.Target = new InternalTarget(this);
            }
            else
            {
                from.LocalOverheadMessage(Network.MessageType.Emote, 0x25, false, phrase_b);
            }
        }
Exemplo n.º 5
0
        public void OnPlacement(Mobile from, Point3D p, int hue)
        {
            if (Deleted)
            {
                return;
            }
            else if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
            }
            else
            {
                Map    map = from.Map;
                Region reg = Region.Find(from.Location, from.Map);

                if (map == null)
                {
                    return;
                }

                BaseBoat boat = Boat;
                boat.Hue = hue;

                if (boat == null)
                {
                    return;
                }

                p = new Point3D(p.X - m_Offset.X, p.Y - m_Offset.Y, p.Z - m_Offset.Z);

                bool CanBuild = false;

                if (reg.IsPartOf(typeof(OutDoorBadRegion)) ||
                    reg.IsPartOf(typeof(VillageRegion)) ||
                    reg.IsPartOf(typeof(BargeDeadRegion)) ||
                    reg.IsPartOf(typeof(DeadRegion)) ||
                    reg.IsPartOf(typeof(PirateRegion)) ||
                    reg.IsPartOf(typeof(OutDoorRegion)) ||
                    reg.IsPartOf(typeof(PublicRegion)) ||
                    Server.Misc.Worlds.IsMainRegion(Server.Misc.Worlds.GetRegionName(from.Map, from.Location)))
                {
                    CanBuild = true;
                }

                if (DockSearch.NearDock(from) == false)
                {
                    from.SendMessage("You must be near a dock to launch your ship!");
                }
                else if (BaseBoat.IsValidLocation(p, map) && CanBuild == true && boat.CanFit(p, map, boat.ItemID))
                {
                    Delete();

                    boat.Owner    = from;
                    boat.Anchored = true;
                    boat.ShipName = m_ShipName;

                    if (from.Skills[SkillName.Fishing].Base >= 90)
                    {
                        boat.m_BoatDoor.Visible = true;
                    }

                    uint keyValue = boat.CreateKeys(from);

                    if (boat.PPlank != null)
                    {
                        boat.PPlank.KeyValue = keyValue;
                    }

                    if (boat.SPlank != null)
                    {
                        boat.SPlank.KeyValue = keyValue;
                    }

                    boat.TillerMan.Hue = hue;
                    boat.Hold.Hue      = hue;
                    boat.BoatDoor.Hue  = hue;
                    boat.PPlank.Hue    = hue;
                    boat.SPlank.Hue    = hue;

                    boat.MoveToWorld(p, map);
                    from.PlaySound(0x026);
                }
                else
                {
                    boat.Delete();
                    from.SendLocalizedMessage(1043284);                       // A ship can not be created here.
                }
            }
        }
Exemplo n.º 6
0
        public void OnPlacement(Mobile from, Point3D p, int hue)
        {
            if (Deleted)
            {
                return;
            }
            else if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
            }
            else
            {
                string phrase_a = "You must be near a dock to launch your ship!";
                string phrase_b = "A ship can not be launched here.";
                if (BaseBoat.isCarpet(Boat))
                {
                    phrase_b = "The magic of the carpet cannot be used here.";
                }

                Map    map = from.Map;
                Region reg = Region.Find(from.Location, from.Map);

                if (map == null)
                {
                    return;
                }

                if (from.Region.IsPartOf(typeof(HouseRegion)) || BaseBoat.FindBoatAt(from, from.Map) != null)
                {
                    from.SendMessage(phrase_a);
                    return;
                }

                BaseBoat boat = Boat;
                boat.Hue = hue;

                if (boat == null)
                {
                    return;
                }

                p = new Point3D(p.X - m_Offset.X, p.Y - m_Offset.Y, p.Z - m_Offset.Z);

                bool CanBuild = false;

                if (reg.IsPartOf(typeof(OutDoorBadRegion)) ||
                    reg.IsPartOf(typeof(VillageRegion)) ||
                    reg.IsPartOf(typeof(BargeDeadRegion)) ||
                    reg.IsPartOf(typeof(NecromancerRegion)) ||
                    reg.IsPartOf(typeof(DeadRegion)) ||
                    reg.IsPartOf("the Forgotten Lighthouse") ||
                    reg.IsPartOf("Anchor Rock Docks") ||
                    reg.IsPartOf("Kraken Reef Docks") ||
                    reg.IsPartOf("Savage Sea Docks") ||
                    reg.IsPartOf("Serpent Sail Docks") ||
                    reg.IsPartOf(typeof(PirateRegion)) ||
                    reg.IsPartOf(typeof(OutDoorRegion)) ||
                    reg.IsPartOf(typeof(PublicRegion)) ||
                    Server.Misc.Worlds.IsMainRegion(Server.Misc.Worlds.GetRegionName(from.Map, from.Location)))
                {
                    CanBuild = true;
                }

                if (!DockSearch.NearDock(from) && !BaseBoat.isCarpet(boat))
                {
                    from.SendMessage(phrase_a);
                }
                else if (BaseBoat.IsValidLocation(p, map) && CanBuild == true && boat.CanFit(p, map, boat.ItemID))
                {
                    Delete();

                    boat.Owner    = from;
                    boat.Anchored = true;
                    boat.ShipName = m_ShipName;

                    if (from.Skills[SkillName.Fishing].Base >= 90 && boat.m_BoatDoor != null)
                    {
                        boat.m_BoatDoor.Visible = true; boat.BoatDoor.Hue = hue;
                    }

                    uint keyValue = boat.CreateKeys(from);

                    if (boat.PPlank != null)
                    {
                        boat.PPlank.KeyValue = keyValue;
                    }

                    if (boat.SPlank != null)
                    {
                        boat.SPlank.KeyValue = keyValue;
                    }

                    boat.TillerMan.Hue = hue;
                    boat.Hold.Hue      = hue;
                    boat.PPlank.Hue    = hue;
                    boat.SPlank.Hue    = hue;

                    boat.MoveToWorld(p, map);
                    if (BaseBoat.isCarpet(boat))
                    {
                        from.PlaySound(0x1FD);
                    }
                    else
                    {
                        from.PlaySound(0x026);
                    }
                }
                else
                {
                    boat.Delete();
                    from.SendMessage(phrase_b);
                }
            }
        }