public void BeginTimer()
        {
            EndTimer();

            DecayTimer = Timer.DelayCall(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10), CheckDecay);
            DecayTimer.Start();
        }
 public void EndTimer()
 {
     if (DecayTimer != null)
     {
         DecayTimer.Stop();
         DecayTimer = null;
     }
 }
		public override void OnAfterDelete()
		{
			if( _DecayTimer != null )
			{
				_DecayTimer.Stop();
				_DecayTimer = null;
			}
			
			base.OnAfterDelete();
			
		}
Beispiel #4
0
        public Food(int amount, int itemID)
            : base(itemID)
        {
            Stackable    = true;
            Amount       = amount;
            m_FillFactor = 1;
            m_SeedType   = null;

            DecayTimer timer = new DecayTimer
                                   (TimeSpan.FromHours(12), this);

            timer.Start();
        }
		public void DoDecayTimer(TimeSpan delay)
		{

			if (m_DecayTimer != null)
				m_DecayTimer.Stop();
			if (!m_Decays) return;
			m_DecayTimer = new DecayTimer(this, delay);
			m_DecayTimer.Start();
			m_DecayRunning = true;
			m_DecayEnd = DateTime.Now + delay;
		}
        // no draw tile
        private SpeechItem( Mobile m )
            : base(0x2198)
        {
            Movable = false;

            m_Owner = m;

            m_DecayTimer = new DecayTimer( this );
            m_DecayTimer.Start();
        }
 public SpeechItem( Serial s )
     : base(s)
 {
     m_DecayTimer = new DecayTimer( this );
     m_DecayTimer.Start();
 }
Beispiel #8
0
        public virtual void OnParalyzed(Mobile from)
        {
            this.FightMode = FightMode.None;
            this.Frozen = true;
            this.Blessed = true;
            this.Combatant = null;
            this.Hue = 0x480;
            from.Combatant = null;
            from.Warmode = false;

            this.m_Timer = new DecayTimer(this);
            this.m_Timer.Start();

            Timer.DelayCall(TimeSpan.Zero, new TimerCallback(BroadcastMessage));
        }
Beispiel #9
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadEncodedInt();

            this.m_OpenedBy = reader.ReadMobile();

            if (reader.ReadBool())
            {
                int count = reader.ReadInt();
                int deadline = reader.ReadInt();

                this.m_Timer = new DecayTimer(this, count, deadline);
                this.m_Timer.Start();
            }

            if (this.FightMode == FightMode.None)
                this.Frozen = true;
        }
Beispiel #10
0
        public virtual void Carve(Mobile from, Item item)
        {
            if (this.m_OpenedBy == null && this.IsAccessibleTo(from))
            {
                this.m_OpenedBy = from;

                if (this.m_Timer == null)
                    this.m_Timer = new DecayTimer(this);

                if (!this.m_Timer.Running)
                    this.m_Timer.Start();

                this.m_Timer.StartDissolving();

                PlagueBeastBackpack pack = new PlagueBeastBackpack();
                this.AddItem(pack);
                pack.Initialize();

                foreach (NetState state in this.GetClientsInRange(12))
                {
                    Mobile m = state.Mobile;

                    if (m != null && m.Player && m != from)
                        this.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1071919, from.Name, m.NetState); // * ~1_VAL~ slices through the plague beast's amorphous tissue *
                }

                from.LocalOverheadMessage(MessageType.Regular, 0x21, 1071904); // * You slice through the plague beast's amorphous tissue *
                Timer.DelayCall<Mobile>(TimeSpan.Zero, new TimerStateCallback<Mobile>(pack.Open), from);
            }
        }
Beispiel #11
0
        public static void Initialize()
        {
            DecayTimer MoveSpawnerDecay_timer = new DecayTimer();

            MoveSpawnerDecay_timer.Start();
        }
Beispiel #12
0
 public static void Initialize()
 {
     DecayTimer MoveSpawnerDecay_timer = new DecayTimer();
     MoveSpawnerDecay_timer.Start();
 }
		protected void StartDecayTimer()
		{
			_DecayTimer = new DecayTimer( this );
			_DecayTimer.Start();
			
		}
Beispiel #14
0
		public virtual void OnDeath( Mobile by )
		{
			this.NextAttackEffects.Clear();
			by.NextAttackEffects.Clear();
			if( this.channelTarget )
				by.ChannelEnd();
			this.ChannelEnd();
			if ( MountModel != 0 )
			{
				if ( Mounting == null )
					Console.WriteLine("Npc {0} have an incorrect 'Mounting' value", this.Name );
				else
					World.Add( (BaseCreature)Mounting, X, Y, Z, MapId );
			}
			ReleaseAllAura();
			UpdateXYZ();
			if ( Faction == Factions.Darnasus || Faction == Factions.DarkspearTrolls ||
				Faction == Factions.GnomereganExiles || Faction == Factions.IronForge ||
				Faction == Factions.Ogrimmar || Faction ==  Factions.Stormwind ||
				Faction == Factions.ThunderBluff || Faction == Factions.Undercity || 
				(int)Faction < 12 )
			{
				if ( by is Character && by.Faction != this.Faction )
				{
					if( this.Level > by.Level + 8 )	
					{
						(by as Character).Honor.DishonorableKillsToday += 1;
						(by as Character).Honor.HonorToday -= 1;//(ushort)((by.Level-this.Level)/5);
					}
					else 
					{
						(by as Character).Honor.HonorableKillsToday += 1;
						(by as Character).Honor.HonorToday += 1;//(ushort)((by.Level-this.Level)/5);
					}				
				}
			}
			if ( !moveVector.NearDestination() )
				this.MoveTo( X, Y, Z );
			this.ReleaseAllAura();
			if ( by is Character )
				( by as Character ).CheckKills( this );
			else
				if ( by.summonedBy != null )
				( by.summonedBy as Character ).CheckKills( this );


			by.XpEarn( this );
			if ( SummonedBy != null )
			{
				SummonedBy.Summon = null;
				decay = new DecayTimer( this, 1 );
			}
			else
			{
				GenerateLoot();
				if ( Treasure != null && Treasure.Length > 0 && KnownObjects != null )//&& by is Character )
				{
					foreach( Object obj in this.KnownObjects )
					{
						if ( obj is Character )
						{
							if ( ( obj as Character ).SeeAnyLoot( by, Treasure ) )
								SendSmallUpdateToPlayer( obj as Character, new int[] { (int)UpdateFields.UNIT_FIELD_FLAGS, (int)UpdateFields.UNIT_DYNAMIC_FLAGS }, new object[] { (int)Flags, DynFlags( by ) + 1 } );
							else
								SendSmallUpdateToPlayer( obj as Character, new int[] { (int)UpdateFields.UNIT_FIELD_FLAGS, (int)UpdateFields.UNIT_DYNAMIC_FLAGS }, new object[] { Flags, DynFlags( by ) } );

						}
					}
				}
				else
					SendSmallUpdate( new int[] { (int)UpdateFields.UNIT_FIELD_FLAGS, (int)UpdateFields.UNIT_DYNAMIC_FLAGS }, new object[] { Flags, DynFlags( by ) } );
				decay = new DecayTimer( this, World.DecayTime );
			}
		}
Beispiel #15
0
 public SpeechItem(Serial s)
     : base(s)
 {
     // decay immediately on server up
     m_DecayTimer = new DecayTimer(this);
     m_DecayTimer.Delay = TimeSpan.Zero;
     m_DecayTimer.Start();
 }
Beispiel #16
0
        public Food( int amount, int itemID )
            : base(itemID)
        {
            Stackable = true;
            Amount = amount;
            m_FillFactor = 1;
            m_SeedType = null;

            DecayTimer timer = new DecayTimer
                (TimeSpan.FromHours(12), this);
            timer.Start();
        }