示例#1
0
        public bool IsOwner(Mobile mob)
        {
            BaseHouse       house       = BaseHouse.FindHouseAt(this);
            StaticHouseSign staticHouse = StaticHouseSign.StaticFindHouseAt(this);

            return(house != null && house.IsOwner(mob) || staticHouse != null && staticHouse.IsOwner(mob));
        }
        public override void OnDoubleClick(Mobile from)
        {
            Guildstone stone = m_Stone as Guildstone;

            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                   // 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.SendLocalizedMessage(501197);                   // This teleporting object can not determine what guildstone to teleport
            }
            else
            {
                BaseHouse       house       = BaseHouse.FindHouseAt(from);
                StaticHouseSign staticHouse = StaticHouseSign.StaticFindHouseAt(from);

                if (house == null && staticHouse == null)
                {
                    from.SendLocalizedMessage(501138);                       // You can only place a guildstone in a house.
                }
                else if (staticHouse == null)
                {
                    if (house.FindGuildstone() != null)
                    {
                        from.SendLocalizedMessage(501142);                          //Only one guildstone may reside in a given house.
                    }
                    else if (!house.IsOwner(from))
                    {
                        from.SendLocalizedMessage(501141);                           // You can only place a guildstone in a house you own!
                    }
                    else
                    {
                        m_Stone.MoveToWorld(from.Location, from.Map);
                        Delete();
                        stone.Guild.Teleporter = null;
                    }
                }
                else
                {
                    if (staticHouse.FindGuildstone(from) != null)
                    {
                        from.SendLocalizedMessage(501142);                           //Only one guildstone may reside in a given house.
                    }
                    else if (!staticHouse.IsOwner(from))
                    {
                        from.SendLocalizedMessage(501141);                           // You can only place a guildstone in a house you own!
                    }
                    else
                    {
                        m_Stone.MoveToWorld(from.Location, from.Map);
                        Delete();
                        stone.Guild.Teleporter = null;
                    }
                }
            }
        }
示例#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 (from.Guild != null)
            {
                from.SendLocalizedMessage(501137);                   // You must resign from your current guild before founding another!
            }
            else
            {
                BaseHouse       house       = BaseHouse.FindHouseAt(from);
                StaticHouseSign staticHouse = StaticHouseSign.StaticFindHouseAt(from);

                if (house == null && staticHouse == null)
                {
                    from.SendLocalizedMessage(501138);                       // You can only place a guildstone in a house.
                }
                else if (staticHouse == null)
                {
                    if (house.FindGuildstone() != null)
                    {
                        from.SendLocalizedMessage(501142);                          //Only one guildstone may reside in a given house.
                    }
                    else if (!house.IsOwner(from))
                    {
                        from.SendLocalizedMessage(501141);                           // You can only place a guildstone in a house you own!
                    }
                    else
                    {
                        from.SendLocalizedMessage(1013060);                           // Enter new guild name (40 characters max):
                        from.Prompt = new InternalPrompt(this);
                    }
                }
                else
                {
                    if (staticHouse.FindGuildstone(from) != null)
                    {
                        from.SendLocalizedMessage(501142);                          //Only one guildstone may reside in a given house.
                    }
                    else if (!staticHouse.IsOwner(from))
                    {
                        from.SendLocalizedMessage(501141);                           // You can only place a guildstone in a house you own!
                    }
                    else
                    {
                        from.SendLocalizedMessage(1013060);                           // Enter new guild name (40 characters max):
                        from.Prompt = new InternalPrompt(this);
                    }
                }
            }
        }
 public void OnChop(Mobile from)
 {
     if (m_House != null && !m_House.Deleted && m_Owner != null && !m_Owner.Deleted)
     {
         if (from == m_Owner || m_House.IsOwner(from))
         {
             Chop(from);
         }
     }
     else
     {
         Chop(from);
     }
 }
示例#5
0
        public bool CheckHouse(Mobile from, Point3D p, Map map, int height, ArrayList list)
        {
            if (from == null || from.AccessLevel >= AccessLevel.GameMaster)
            {
                return(true);
            }

            if (this is BallistaEastAddon || this is OrcPalisadeSouthAddon || this is OrcPalisadeEastAddon || this is DwarvenForgeAddon)
            {
                return(true);
            }

            if (from.Region is StaticHouseRegion)
            {
                StaticHouseSign sHouse = StaticHouseSign.StaticFindHouseAt(p, map, height, from);
                if (!sHouse.IsOwner(from))
                {
                    return(false);
                }
                return(true);
            }

            BaseHouse house = BaseHouse.FindHouseAt(p, map, height);

            if (house == null || !house.IsOwner(from))
            {
                return(false);
            }

            if (!list.Contains(house))
            {
                list.Add(house);
            }

            return(true);
        }
示例#6
0
        public virtual void OnChop(Mobile from)
        {
            BaseHouse       house       = BaseHouse.FindHouseAt(this);
            StaticHouseSign staticHouse = StaticHouseSign.StaticFindHouseAt(this);

            if (house != null && house.IsOwner(from) && house.Addons.Contains(this))
            {
                Effects.PlaySound(GetWorldLocation(), Map, 0x3B3);
                from.SendLocalizedMessage(500461);                   // You destroy the item.

                int hue = 0;

                if (RetainDeedHue)
                {
                    for (int i = 0; hue == 0 && i < m_Components.Count; ++i)
                    {
                        AddonComponent c = (AddonComponent)m_Components[i];

                        if (c.Hue != 0)
                        {
                            hue = c.Hue;
                        }
                    }
                }

                Delete();

                house.Addons.Remove(this);

                BaseAddonDeed deed = Deed;

                if (deed != null)
                {
                    if (RetainDeedHue)
                    {
                        deed.Hue = hue;
                    }

                    from.AddToBackpack(deed);
                }
            }
            else if (staticHouse != null && staticHouse.IsOwner(from))                 //&& staticHouse.Addons.Contains( this ) )
            {
                Effects.PlaySound(GetWorldLocation(), Map, 0x3B3);
                from.SendLocalizedMessage(500461);                   // You destroy the item.

                int hue = 0;

                if (RetainDeedHue)
                {
                    for (int i = 0; hue == 0 && i < m_Components.Count; ++i)
                    {
                        AddonComponent c = (AddonComponent)m_Components[i];

                        if (c.Hue != 0)
                        {
                            hue = c.Hue;
                        }
                    }
                }

                Delete();

                //house.Addons.Remove( this );

                BaseAddonDeed deed = Deed;

                if (deed != null)
                {
                    if (RetainDeedHue)
                    {
                        deed.Hue = hue;
                    }

                    from.AddToBackpack(deed);
                }
            }
        }
示例#7
0
            public override void OnResponse(Mobile from, string text)
            {
                if (m_Deed.Deleted)
                {
                    return;
                }

                if (!m_Deed.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1042001);                       // That must be in your pack for you to use it.
                }
                else if (from.Guild != null)
                {
                    from.SendLocalizedMessage(501137);                       // You must resign from your current guild before founding another!
                }
                else
                {
                    BaseHouse       house       = BaseHouse.FindHouseAt(from);
                    StaticHouseSign staticHouse = StaticHouseSign.StaticFindHouseAt(from);


                    if (house == null && staticHouse == null)
                    {
                        from.SendLocalizedMessage(501138);                           // You can only place a guildstone in a house.
                    }
                    else if (staticHouse == null)
                    {
                        if (house.FindGuildstone() != null)
                        {
                            from.SendLocalizedMessage(501142);                              //Only one guildstone may reside in a given house.
                        }
                        else if (!house.IsOwner(from))
                        {
                            from.SendLocalizedMessage(501141);                               // 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, "none");

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

                            Guildstone stone = new Guildstone(guild);

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

                            guild.Guildstone = stone;
                        }
                    }
                    else
                    {
                        if (staticHouse.FindGuildstone(from) != null)
                        {
                            from.SendLocalizedMessage(501142);                              //Only one guildstone may reside in a given house.
                        }
                        else if (!staticHouse.IsOwner(from))
                        {
                            from.SendLocalizedMessage(501141);                               // 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, "none");

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

                            Guildstone stone = new Guildstone(guild);

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

                            guild.Guildstone = stone;
                        }
                    }
                }
            }