protected override void OnTick() { CheckAlive(); count++; int level = (int)(count / 60); if (count % 60 == 0) // every minute we need send message to player about level's change { int number = 0; int hue = 0x485; switch (level) { case 1: number = 1050001; break; // It is becoming more difficult for you to breathe as the poisons in the room become more concentrated. case 2: number = 1050003; break; // You begin to panic as the poison clouds thicken. case 3: number = 1050056; break; // Terror grips your spirit as you realize you may never leave this room alive. case 4: number = 1050057; break; // The end is near. You feel hopeless and desolate. The poison is beginning to stiffen your muscles. case 5: number = 1062091; hue = 0x23F3; break; // The poison is becoming too much for you to bear. You fear that you may die at any moment. } if (number != 0) { foreach (var mobile in m_Controller.Map.GetMobilesInBounds(m_Controller.Rect)) { if (mobile.IsPlayer) { mobile.SendLocalizedMessage(number, null, hue); } } } if (level == 5) { PainTimer timer = new PainTimer(m_Controller); timer.Start(); } } if (count % 5 == 0) // every 5 seconds we fill room with a gas { Gas(level); } }
protected override void OnTick() { CheckAlive(); count++; int level = (int) ( count / 60 ); if ( count % 60 == 0 ) // every minute we need send message to player about level's change { int number = 0; int hue = 0x485; switch ( level ) { case 1: number = 1050001; break; // It is becoming more difficult for you to breathe as the poisons in the room become more concentrated. case 2: number = 1050003; break; // You begin to panic as the poison clouds thicken. case 3: number = 1050056; break; // Terror grips your spirit as you realize you may never leave this room alive. case 4: number = 1050057; break; // The end is near. You feel hopeless and desolate. The poison is beginning to stiffen your muscles. case 5: number = 1062091; hue = 0x23F3; break; // The poison is becoming too much for you to bear. You fear that you may die at any moment. } IPooledEnumerable eable = Map.Malas.GetMobilesInBounds( m_Controller.Rect ); foreach ( object obj in eable ) { if ( obj is Mobile ) { Mobile mobile = obj as Mobile; if ( mobile != null && mobile.Player ) { if ( number != 0 ) { mobile.SendLocalizedMessage( number, null, hue ); } } } } eable.Free(); if ( level == 5 ) { PainTimer timer = new PainTimer( m_Controller ); timer.Start(); } } if ( count % 5 == 0 ) // every 5 seconds we fill room with a gas { Gas( level ); } }