Exemple #1
0
        public void OnDecayed()
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            MultiComponentList mcl   = Components;
            IPooledEnumerable  eable = map.GetObjectsInBounds(new Rectangle2D(X + mcl.Min.X, Y + mcl.Min.Y, mcl.Width, mcl.Height));

            ArrayList del = new ArrayList();

            foreach (object o in eable)
            {
                if (o is Guildstone)
                {
                    if (Contains((Item)o))
                    {
                        del.Add(o);
                    }
                }
                else if (o is StrongBox)
                {
                    del.Add(o);
                }
                else if (o is PlayerVendor)
                {
                    if (Contains((Mobile)o))
                    {
                        del.Add(o);
                    }
                }
                else if (o is BaseHouse)
                {
                    ((BaseHouse)o).Z = this.Z;
                }
            }
            eable.Free();

            for (int i = 0; i < del.Count; i++)
            {
                object o = del[i];
                if (o is PlayerVendor)
                {
                    PlayerVendor v = (PlayerVendor)o;
                    v.Say(503235);                       // I regret nothing!postal
                    v.Blessed = false;
                    v.Kill();
                    v.Delete();
                }
                else if (o is Item)
                {
                    ((Item)o).Delete();
                }
            }
        }