Exemplo n.º 1
0
            public InternalTimer(UOACZFirefield UOACZFirefield, Mobile owner) : base(TimeSpan.FromSeconds(0), TimeSpan.FromSeconds(1))
            {
                Priority = TimerPriority.TwoFiftyMS;

                m_UOACZFirefield = UOACZFirefield;
                m_Owner          = owner;
            }
Exemplo n.º 2
0
        public void Ignite(Mobile from)
        {
            if (Burning)
            {
                return;
            }

            Burning = true;

            Effects.PlaySound(Location, Map, 0x5CF);
            Effects.SendLocationParticles(EffectItem.Create(Location, Map, TimeSpan.FromSeconds(1.0)), 0x3709, 10, 30, 0, 0, 5052, 0);

            Queue m_Queue = new Queue();

            IPooledEnumerable nearbyItems = Map.GetItemsInRange(Location, 1);

            foreach (Item item in nearbyItems)
            {
                if (item is UOACZOilLocation)
                {
                    m_Queue.Enqueue(item);
                }
            }

            nearbyItems.Free();

            while (m_Queue.Count > 0)
            {
                Item item = (Item)m_Queue.Dequeue();

                if (item is UOACZOilLocation)
                {
                    Timer.DelayCall(TimeSpan.FromSeconds(.2), delegate
                    {
                        if (item == null)
                        {
                            return;
                        }
                        if (item.Deleted)
                        {
                            return;
                        }

                        UOACZOilLocation oilLocation = item as UOACZOilLocation;

                        oilLocation.Ignite(from);
                    });
                }
            }

            Timer.DelayCall(TimeSpan.FromSeconds(.5), delegate
            {
                if (Deleted)
                {
                    return;
                }

                UOACZFirefield firefield = new UOACZFirefield(from);
                firefield.MoveToWorld(Location, Map);

                Delete();
            });
        }