示例#1
0
        public override void Use(Mobile from)
        {
            //find any keys on the person OR on the ground to avoid exploit.
            if (Key.ContainsKey(from.Backpack, KeyValue))
            {
                Key.RemoveKeys(from.Backpack, KeyValue);
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "As you unlock the door, the key crubles in your hand."); // You quickly unlock, open, and relock the door

                BaseDoor link = (BaseDoor)base.Link;
                //unlock door and its link
                base.Locked = false;
                if (link != null)
                {
                    link.Locked = false;
                }
            }

            ArrayList keys = new ArrayList();

            foreach (Item i in this.GetItemsInRange(5))
            {
                if (i is Key)
                {
                    keys.Add(i);
                }
            }
            foreach (Key k in keys)
            {
                k.Delete();
            }

            base.Use(from);
        }
示例#2
0
        public override void Open(Mobile from)
        {
            base.Open(from);

            if (m_House != null && Key.ContainsKey(from.Backpack, this.KeyValue) && from.AccessLevel == AccessLevel.Player && !Locked)
            {
                m_House.RefreshDecay();
            }
        }
示例#3
0
            public override void OnResponse(Mobile from, string text)
            {
                if (m_Deed.Deleted)
                {
                    return;
                }

                if (!m_Deed.IsChildOf(from.Backpack))
                {
                    from.SendAsciiMessage("That must be in your pack for you to use it.");                       // That must be in your pack for you to use it.
                }
                else if (from.Guild != null)
                {
                    from.SendAsciiMessage("You must resign from your current guild before founding another!");                       // You must resign from your current guild before founding another!
                }
                else
                {
                    BaseHouse house = BaseHouse.FindHouseAt(from);
                    BaseBoat  boat  = BaseBoat.FindBoatAt(from.Location, from.Map);

                    if (house == null && boat == null)
                    {
                        from.SendAsciiMessage("You can only place a guildstone in a house or on a ship."); // You can only place a guildstone in a house.
                    }
                    else if ((house != null && (house.FindGuildstone() != null)) || (boat != null && (boat.FindGuildstone() != null)))
                    {
                        from.SendAsciiMessage("Only one guildstone may reside in a given house or ship.");//Only one guildstone may reside in a given house.
                    }
                    else if ((house != null && (!Key.ContainsKey(from.Backpack, house.keyValue))) || (boat != null && !Key.ContainsKey(from.Backpack, boat.PPlank.KeyValue)))
                    {
                        from.SendAsciiMessage("You can only place a guildstone in a house or ship you own!"); // You can only place a guildstone in a house you own!
                    }
                    else
                    {
                        m_Deed.Delete();

                        if (text.Length > 40)
                        {
                            text = text.Substring(0, 40);
                        }

                        Guild guild = new Guild(from, text, text);

                        from.Guild      = guild;
                        from.GuildTitle = "Guildmaster";

                        Guildstone stone = new Guildstone(guild);

                        stone.MoveToWorld(from.Location, from.Map);

                        guild.Guildstone = stone;
                    }
                }
            }
示例#4
0
        public virtual void VerifyAndUse(Mobile from)
        {
            if (m_Locked && !m_Open && this.UseLocks())
            {
                if (from.AccessLevel >= AccessLevel.GameMaster)
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502502); // That is locked, but you open it with your godly powers.
                }
                else if (Key.ContainsKey(from.Backpack, this.KeyValue))
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501282); // You quickly unlock, open, and relock the door
                }

                else
                {
                    from.SendMessage("The portcullis seems to be locked and wont budge.");
                    return;
                }
            }

            if (this.m_Open && !this.IsFreeToClose())
            {
                return;
            }

            if (this.m_Open)
            {
                this.OnClosed(from);
            }
            else
            {
                this.OnOpened(from);
            }

            if (this.UseChainedFunction) //&& !m_Locked)
            {
                List <PortcullisS> list = this.GetChain();

                for (int i = 0; i < list.Count; ++i)
                {
                    new PortcullisOpenTimer(list[i]).Start();
                }
                return;
            }

            else
            {
                new PortcullisOpenTimer(this).Start();
            }
        }
示例#5
0
        public override void OnOpened(Mobile from)
        {
            BaseHouse house = FindHouse();

            if (house != null && Key.ContainsKey(from.Backpack, house.keyValue) && from.AccessLevel == AccessLevel.Player)
            {
                house.RefreshDecay();//if ( house != null && house.IsFriend( from ) && from.AccessLevel == AccessLevel.Player && house.RefreshDecay() )
            }
            //from.SendLocalizedMessage( 1043293 ); // Your house's age and contents have been refreshed.

            if (house != null && house.Public && !house.IsFriend(from))
            {
                house.Visits++;
            }
        }
示例#6
0
        public bool ValidatePlacement(Mobile from, Point3D loc)
        {
            if (from.AccessLevel >= AccessLevel.GameMaster)
            {
                return(true);
            }

            if (!from.InRange(this.GetWorldLocation(), 1))
            {
                from.SendAsciiMessage("That is too far away.");                   // That is too far away.
                return(false);
            }

            if (DateTime.Now.Month != 12)
            {
                from.SendAsciiMessage("You will have to wait till next December to put your tree back up for display.");                   // You will have to wait till next December to put your tree back up for display.
                return(false);
            }

            Map map = from.Map;

            if (map == null)
            {
                return(false);
            }

            BaseHouse house = BaseHouse.FindHouseAt(loc, map, 20);

            if (house == null || !Key.ContainsKey(from.Backpack, house.keyValue))
            {
                from.SendAsciiMessage("The holiday tree can only be placed in your house.");                   // The holiday tree can only be placed in your house.
                return(false);
            }

            if (!map.CanFit(loc, 20))
            {
                from.SendAsciiMessage("You cannot build that there.");                   // You cannot build that there.
                return(false);
            }

            return(true);
        }
示例#7
0
        public override void OnDoubleClick(Mobile from)
        {
            if (Guild.NewGuildSystem)
            {
                return;
            }

            if (!IsChildOf(from.Backpack))
            {
                from.SendAsciiMessage("That must be in your pack for you to use it.");                   // That must be in your pack for you to use it.
            }
            else if (from.Guild != null)
            {
                from.SendAsciiMessage("You must resign from your current guild before founding another!");                   // You must resign from your current guild before founding another!
            }
            else
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);
                BaseBoat  boat  = BaseBoat.FindBoatAt(from.Location, from.Map);

                if (house == null && boat == null)
                {
                    from.SendAsciiMessage("You can only place a guildstone in a house or on a ship."); // You can only place a guildstone in a house.
                }
                else if ((house != null && (house.FindGuildstone() != null)) || (boat != null && (boat.FindGuildstone() != null)))
                {
                    from.SendAsciiMessage("Only one guildstone may reside in a given house or ship.");//Only one guildstone may reside in a given house.
                }
                else if ((house != null && (!Key.ContainsKey(from.Backpack, house.keyValue))) || (boat != null && !Key.ContainsKey(from.Backpack, boat.PPlank.KeyValue)))
                {
                    from.SendAsciiMessage("You can only place a guildstone in a house or ship you own!");                       // You can only place a guildstone in a house you own!
                }
                else
                {
                    from.SendAsciiMessage("Enter new guild name (40 characters max):");                       // Enter new guild name (40 characters max):
                    from.Prompt = new InternalPrompt(this);
                }
            }
        }
示例#8
0
        public override void OnDoubleClick(Mobile from)
        {
            if (Guild.NewGuildSystem)
            {
                return;
            }

            Guildstone stone = m_Stone as Guildstone;

            if (!IsChildOf(from.Backpack))
            {
                from.SendAsciiMessage("That must be in your pack for you to use it.");                   // That must be in your pack for you to use it.
            }
            else if (stone == null || stone.Deleted || stone.Guild == null || stone.Guild.Teleporter != this)
            {
                from.SendAsciiMessage("This teleporting object can not determine what guildstone to teleport.");                   // This teleporting object can not determine what guildstone to teleport
            }
            else
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);
                BaseBoat  boat  = BaseBoat.FindBoatAt(from.Location, from.Map);

                if (house == null && boat == null)
                {
                    from.SendAsciiMessage("You can only place a guildstone in a house or on a ship."); // You can only place a guildstone in a house.
                }
                else if ((house != null && (!Key.ContainsKey(from.Backpack, house.keyValue))) || (boat != null && !Key.ContainsKey(from.Backpack, boat.PPlank.KeyValue)))
                {
                    from.SendAsciiMessage("You can only place a guildstone in a house or ship you own!"); // You can only place a guildstone in a house you own!
                }
                else
                {
                    m_Stone.MoveToWorld(from.Location, from.Map);
                    Delete();
                    stone.Guild.Teleporter = null;
                }
            }
        }
        public virtual bool CheckLocked(Mobile from)
        {
            bool inaccessible = false;

            if (m_Locked)
            {
                //int number;

                if (from.AccessLevel >= AccessLevel.GameMaster)
                {
                    from.SendAsciiMessage("That is locked but you open it with your godly powers."); //number = 502502; // That is locked, but you open it with your godly powers.
                }
                else if (KeyValue == 0 || !Key.ContainsKey(from.Backpack, KeyValue))
                {
                    from.SendLocalizedMessage(501747);//number = 501747; // It appears to be locked.
                    inaccessible = true;
                }

                //from.Send( new MessageLocalized( Serial, ItemID, MessageType.Regular, 0x3B2, 3, number, "", "" ) );//Previous version: displayed over box
            }

            return(inaccessible);
        }
示例#10
0
        public virtual void Use(Mobile from)
        {
            if (m_Locked && !m_Open && UseLocks())
            {
                if (from.AccessLevel >= AccessLevel.GameMaster)
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502502); // That is locked, but you open it with your godly powers.
                    //from.Send( new MessageLocalized( Serial, ItemID, MessageType.Regular, 0x3B2, 3, 502502, "", "" ) ); // That is locked, but you open it with your godly powers.
                }
                else if (Key.ContainsKey(from.Backpack, KeyValue))
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501282); // You quickly unlock, open, and relock the door
                }
                else if (IsInside(from))
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501280); // That is locked, but is usable from the inside.
                }
                else
                {
                    if (Hue == 0x44E && Map == Map.Malas)      // doom door into healer room in doom
                    {
                        SendLocalizedMessageTo(from, 1060014); // Only the dead may pass.
                    }
                    else
                    {
                        from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502503); // That is locked.
                    }
                    return;
                }
            }

            if (m_Open && !IsFreeToClose())
            {
                return;
            }

            if (m_Open)
            {
                OnClosed(from);
            }
            else
            {
                OnOpened(from);
            }

            if (UseChainedFunctionality)
            {
                bool open = !m_Open;

                List <BaseDoor> list = GetChain();

                for (int i = 0; i < list.Count; ++i)
                {
                    list[i].Open = open;
                }
            }
            else
            {
                Open = !m_Open;

                BaseDoor link = Link;

                if (m_Open && link != null && !link.Open)
                {
                    link.Open = true;
                }
            }
        }
示例#11
0
        public virtual void Use(Mobile from)
        {
            if (m_Locked && !m_Open && UseLocks())
            {
                if (from.AccessLevel >= AccessLevel.GameMaster)
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502502);                       // That is locked, but you open it with your godly powers.
                    //from.Send( new MessageLocalized( Serial, ItemID, MessageType.Regular, 0x3B2, 3, 502502, "", "" ) ); // That is locked, but you open it with your godly powers.
                }
                else if (Key.ContainsKey(from.Backpack, this.KeyValue))
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501282);                       // You quickly unlock, open, and relock the door
                }
                else if (IsInside(from))
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501280);                       // That is locked, but is usable from the inside.
                }
                else
                {
                    if (Hue == 0x44E && Map == Map.SerpentIsland)                       // doom door into healer room in doom
                    {
                        this.SendLocalizedMessageTo(from, 1060014);                     // Only the dead may pass.
                    }
                    else
                    {
                        from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502503);                           // That is locked.
                    }
                    return;
                }
            }

            if (m_Open && !IsFreeToClose())
            {
                return;
            }

            if (m_Open && from.Blessed)               // INVULNERABLE CANNOT CLOSE DOORS...ONLY OPEN THEM
            {
                return;
            }

            if (m_Open)
            {
                OnClosed(from);
            }
            else
            {
                OnOpened(from);
            }

            if (from.Hidden && from is PlayerMobile && from.Skills[SkillName.Hiding].Value < Utility.RandomMinMax(1, 125))
            {
                from.RevealingAction();
            }

            if (UseChainedFunctionality)
            {
                bool open = !m_Open;

                List <BaseDoor> list = GetChain();

                for (int i = 0; i < list.Count; ++i)
                {
                    list[i].Open = open;
                }
            }
            else
            {
                Open = !m_Open;

                BaseDoor link = this.Link;

                if (m_Open && link != null && !link.Open)
                {
                    link.Open = true;
                }
            }
        }
示例#12
0
        public override void OnDoubleClick(Mobile from)
        {
            //OVERRIDE: No Longer Using Planks
            return;

            if (m_Ship == null)
            {
                return;
            }

            if (from.InRange(GetWorldLocation(), 13))
            {
                if (m_Ship.Contains(from))
                {
                    if (IsOpen)
                    {
                        Close();
                    }
                    else
                    {
                        Open();
                    }
                }
                else
                {
                    if (!IsOpen)
                    {
                        if (!Locked)
                        {
                            Open();
                        }
                        else if (from.AccessLevel >= AccessLevel.GameMaster)
                        {
                            from.LocalOverheadMessage(Network.MessageType.Regular, 0x00, 502502);                               // That is locked but your godly powers allow access
                            Open();
                        }
                        else if (Key.ContainsKey(from.Backpack, this.KeyValue))
                        {
                            from.LocalOverheadMessage(Network.MessageType.Regular, 0x00, true, "You quickly unlock, open, and relock the gang plank");
                            Open();
                        }
                        else
                        {
                            from.LocalOverheadMessage(Network.MessageType.Regular, 0x00, 502503);                               // That is locked.
                        }
                    }
                    else if (!Locked)
                    {
                        from.Location = new Point3D(this.X, this.Y, this.Z + 3);
                    }
                    else if (from.AccessLevel >= AccessLevel.GameMaster)
                    {
                        from.LocalOverheadMessage(Network.MessageType.Regular, 0x00, 502502);                           // That is locked but your godly powers allow access
                        from.Location = new Point3D(this.X, this.Y, this.Z + 3);
                    }
                    else if (Key.ContainsKey(from.Backpack, this.KeyValue))
                    {
                        from.LocalOverheadMessage(Network.MessageType.Regular, 0x00, true, "You quickly unlock, use, and relock the gang plank");
                        from.Location = new Point3D(this.X, this.Y, this.Z + 3);
                    }
                    else
                    {
                        from.LocalOverheadMessage(Network.MessageType.Regular, 0x00, 502503);                           // That is locked.
                    }
                }
            }
        }
示例#13
0
        public virtual void Use(Mobile from)
        {
            if (GuildID != -1) //Guild door
            {
                if (from.InRange(GetWorldLocation(), 2) && from.InLOS(this))
                {
                    if (GuildID != -1 && from.Guild != null && !(from.Guild.Disbanded))
                    {
                        if (from.Guild.Id == GuildID)
                        {
                            from.MoveToWorld(Location, Map);
                            Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                            from.PlaySound(510);
                            return;
                        }
                    }
                    from.SendAsciiMessage("You cannot use that!");
                }
                else
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                }
                return;
            }

            if (m_Locked && !m_Open && UseLocks())
            {
                if (from.AccessLevel >= AccessLevel.GameMaster)
                {
                    PrivateOverheadMessage(MessageType.Regular, 906, 502502, from.NetState);
                    //from.Send( new MessageLocalized( Serial, ItemID, MessageType.Regular, 0x3B2, 3, 502502, "", "" ) ); // That is locked, but you open it with your godly powers.
                }
                else if (KeyValue != 0 && Key.ContainsKey(from.Backpack, KeyValue))
                {
                    //from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501282 ); // You quickly unlock, open, and relock the door
                }
                else
                {
                    if (Hue == 0x44E && Map == Map.Malas)      // doom door into healer room in doom
                    {
                        SendLocalizedMessageTo(from, 1060014); // Only the dead may pass.
                    }
                    else
                    {
                        PrivateOverheadMessage(MessageType.Regular, 906, 502503, from.NetState); // That is locked.
                        return;
                    }
                }
            }

            if (m_Open && !IsFreeToClose())
            {
                return;
            }

            if (m_Open)
            {
                OnClosed(from);
            }
            else
            {
                OnOpened(from);
            }

            if (UseChainedFunctionality)
            {
                bool open = !m_Open;

                List <BaseDoor> list = GetChain();

                for (int i = 0; i < list.Count; ++i)
                {
                    list[i].Open = open;
                }
            }
            else
            {
                Open = !m_Open;

                BaseDoor link = Link;

                if (m_Open && link != null && !link.Open)
                {
                    link.Open = true;
                }
            }
        }
示例#14
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendAsciiMessage("That must be in your pack for you to use it.");                   // That must be in your pack for you to use it.
            }
            else if (from.AccessLevel >= AccessLevel.GameMaster)
            {
                from.SendAsciiMessage("Your godly powers allow you to place this vendor whereever you wish.");                   // Your godly powers allow you to place this vendor whereever you wish.

                Mobile v = new PlayerVendor(from, BaseHouse.FindHouseAt(from));

                v.Direction = from.Direction & Direction.Mask;
                v.MoveToWorld(from.Location, from.Map);

                v.SayTo(from, true, "Ah! it feels good to be working again.");                   // Ah! it feels good to be working again.

                this.Delete();
            }
            else
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);

                if (house == null)
                {
                    from.SendAsciiMessage("Vendors can only be placed in houses.");                       // Vendors can only be placed in houses.
                }
                else if (!Key.ContainsKey(from.Backpack, house.keyValue))
                {
                    from.SendAsciiMessage("You can only place this in a house that you own!");
                }

                /*else if ( !BaseHouse.NewVendorSystem && !house.IsFriend( from ) )
                 * {
                 *  from.SendAsciiMessage("You can only place this in a house that you own!"); // You must ask the owner of this building to name you a friend of the household in order to place a vendor here.
                 * }
                 * else if ( BaseHouse.NewVendorSystem && !house.IsOwner( from ) )
                 * {
                 *  from.SendAsciiMessage("You can only place this in a house that you own!"); // Only the house owner can directly place vendors.  Please ask the house owner to offer you a vendor contract so that you may place a vendor in this house.
                 * }
                 * else if ( !house.Public || !house.CanPlaceNewVendor() )
                 * {
                 *  from.SendAsciiMessage( "You cannot place this vendor or barkeep.  Make sure the house is public and has sufficient storage available." ); // You cannot place this vendor or barkeep.  Make sure the house is public and has sufficient storage available.
                 * }*/
                else
                {
                    bool vendor, contract;
                    BaseHouse.IsThereVendor(from.Location, from.Map, out vendor, out contract);

                    if (vendor)
                    {
                        from.SendAsciiMessage("You cannot place a vendor at this location."); // You cannot place a vendor or barkeep at this location.
                    }
                    else if (contract)
                    {
                        from.SendLocalizedMessage(1062678); // You cannot place a vendor or barkeep on top of a rental contract!
                    }
                    else
                    {
                        Mobile v = new PlayerVendor(from, house);

                        v.Direction = from.Direction & Direction.Mask;
                        v.MoveToWorld(from.Location, from.Map);

                        v.SayTo(from, true, "Ah! it feels good to be working again."); // Ah! it feels good to be working again.

                        this.Delete();
                    }
                }
            }
        }