Ejemplo n.º 1
0
		public void Target( IPoint3D point )
		{
			Point3D p = new Point3D( point );
			Map map = Caster.Map;

			if ( map == null )
				return;

			HouseRegion r = Region.Find( p, map ).GetRegion( typeof( HouseRegion ) ) as HouseRegion;

			if ( r != null && r.House != null && !r.House.IsFriend( Caster ) )
				return;

			if ( !map.CanSpawnMobile( p.X, p.Y, p.Z ) )
			{
				Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
			}
			else if ( SpellHelper.CheckTown( p, Caster ) && CheckSequence() )
			{
				TimeSpan duration = TimeSpan.FromSeconds( Caster.Skills.Spellweaving.Value / 24 + 25 + FocusLevel * 2 );

				NatureFury nf = new NatureFury();
				BaseCreature.Summon( nf, false, Caster, p, 0x5CB, duration );

				new InternalTimer( nf ).Start();
			}

			FinishSequence();
		}
Ejemplo n.º 2
0
		public void Target( IPoint3D point )
		{
			//What happens if you cast it on yourself?	OSI ANSWER: You're an idiot for wasting the mana, and it'll just look for another target.
			Mobile m = point as Mobile;
			Point3D p = new Point3D( point );
			Map map = Caster.Map;

			m_MobileTarg = (m != null);

			BaseHouse house = BaseHouse.FindHouseAt( p, map, 0 );
			if ( house != null)
				if ( !house.IsFriend ( Caster ) )
					return;
			if (m != null) //say "Target can not be seen" if you target directly a mobile, like in OSI
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( map == null || !map.CanSpawnMobile( p.X, p.Y, p.Z ) )
			{
				Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
			}
			else if( SpellHelper.CheckTown( p, Caster ) && (m_MobileTarg ? CheckHSequence( m ) : CheckSequence()) )
			{
				TimeSpan duration = TimeSpan.FromSeconds( Caster.Skills.Spellweaving.Value/24 + 25 + FocusLevel*2 );

				if( m == Caster )
					m = null;

				NatureFury nf = new NatureFury( m );

				BaseCreature.Summon( nf, false, Caster, p , 0x5CB, duration );

				Timer t = null;

				t = Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), TimeSpan.FromSeconds( 5.0 ), delegate
				 {
					 if( !nf.Alive || nf.Deleted || nf.DamageMin > 20 )	//sanity
						 t.Stop();

					 nf.DamageMin++;
					 nf.DamageMax++;
				 } );
			}

			FinishSequence();
		}
Ejemplo n.º 3
0
			public InternalTimer( NatureFury nf )
				: base( TimeSpan.FromSeconds( 5.0 ), TimeSpan.FromSeconds( 5.0 ) )
			{
				m_NatureFury = nf;
			}
Ejemplo n.º 4
0
        public void Target( IPoint3D point )
        {
            //What happens if you cast it on yourself?	OSI ANSWER: You're an idiot for wasting the mana, and it'll just look for another target.
            Mobile m = point as Mobile;
            Point3D p = new Point3D( point );
            Map map = Caster.Map;

            m_MobileTarg = (m != null);

            if( !SpellHelper.FindValidSpawnLocation( map, ref p, m_MobileTarg ) )
            {
                Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
            }
            else if( SpellHelper.CheckTown( p, Caster ) && (m_MobileTarg ? CheckHSequence( m ) : CheckSequence()) )
            {
                TimeSpan duration = TimeSpan.FromSeconds( Caster.Skills.Spellweaving.Value/24 + 25 + FocusLevel*2 );

                if( m == Caster )
                    m = null;

                NatureFury nf = new NatureFury( m );
                BaseCreature.Summon( nf, false, Caster, p , 0x5CB, duration );

                Timer t = null;

                t = Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), TimeSpan.FromSeconds( 5.0 ), delegate
                 {
                     if( !nf.Alive || nf.Deleted || nf.DamageMin > 20 )	//sanity
                         t.Stop();

                     nf.DamageMin++;
                     nf.DamageMax++;
                 } );
            }

            FinishSequence();
        }