Exemple #1
0
        public AOEUnit(int itemID, Point3D loc, BaseCreature caster, Map map, TimeSpan duration, int val)
            : base(itemID)
        {
            bool canFit = SpellHelper.AdjustField(ref loc, map, 12, false);

            Visible = false;
            Movable = false;
            Light = LightType.Circle300;
            Hue = caster.AOEBreathEffectHue;
            Name = caster.AOEBreathName;

            MoveToWorld(loc, map);

            m_Caster = caster;

            m_End = DateTime.Now + duration;

            m_Timer = new InternalTimer(this, TimeSpan.FromSeconds(Math.Abs(val) * 0.2), caster.InLOS(this), canFit);
            m_Timer.Start();
        }
Exemple #2
0
 // A check to see if the seen mobile meets all the conditions for identifying criminal activity.
 public static bool VisionCheck(Mobile m, BaseCreature s, int range)
 {
     if ((m.Combatant != s) && s.CanSee(m) && s.InLOS(m) && (m.AccessLevel < AccessLevel.Counselor))
     {
         if (m.Hidden)
             return (s.InFieldOfVision(m) && m.InRange(s, range));
         else
             return m.InRange(s, range);
     }
     else
         return false;
 }
Exemple #3
0
        public AOEUnit(int itemID, Point3D loc, BaseCreature caster, Map map, TimeSpan duration, int val)
            : base(itemID)
        {
            bool canFit = SpellHelper.AdjustField(ref loc, map, 12, false);

            Visible = false;
            Movable = false;
            Light   = LightType.Circle300;
            Hue     = caster.AOEBreathEffectHue;
            Name    = caster.AOEBreathName;

            MoveToWorld(loc, map);

            m_Caster = caster;

            m_End = DateTime.Now + duration;

            m_Timer = new InternalTimer(this, TimeSpan.FromSeconds(Math.Abs(val) * 0.2), caster.InLOS(this), canFit);
            m_Timer.Start();
        }
		public static void DoBomber(BaseCreature mobile, Mobile player)
		{
			Mobile combatant = player;

			if ( combatant == null || combatant.Deleted || combatant.Map != mobile.Map || !mobile.InRange( combatant, 12 ) || !mobile.CanBeHarmful( combatant ) || !mobile.InLOS( combatant ) )
				return;

			if ( DateTime.Now >= m_NextBomb )
			{
				ThrowBomb( combatant, player );

				m_Thrown++;

				if ( 0.75 >= Utility.RandomDouble() && (m_Thrown % 2) == 1 )
					m_NextBomb = DateTime.Now + TimeSpan.FromSeconds( 3.0 );
				else
					m_NextBomb = DateTime.Now + TimeSpan.FromSeconds( 5.0 + (10.0 * Utility.RandomDouble()) );
			}
		}