Пример #1
0
        public virtual void OnChop(Mobile from)
        {
            BaseHouse house = BaseHouse.FindHouseAt(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 = 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);
                }
            }
        }
Пример #2
0
            public InternalTarget(BaseAddonDeed deed) : base(-1, true, TargetFlags.None)
            {
                m_Deed = deed;

                CheckLOS = false;
            }