Server.Spells.Fifth.PoisonFieldSpell.Target C# (CSharp) Method

Target() public method

public Target ( IPoint3D p ) : void
p IPoint3D
return void
		public void Target( IPoint3D p )
		{
			if ( !Caster.CanSee( p ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( SpellHelper.CheckTown( p, Caster ) && CheckSequence() )
			{
				SpellHelper.Turn( Caster, p );

				SpellHelper.GetSurfaceTop( ref p );

				int dx = Caster.Location.X - p.X;
				int dy = Caster.Location.Y - p.Y;
				int rx = (dx - dy) * 44;
				int ry = (dx + dy) * 44;

				bool eastToWest;

				if ( rx >= 0 && ry >= 0 )
				{
					eastToWest = false;
				}
				else if ( rx >= 0 )
				{
					eastToWest = true;
				}
				else if ( ry >= 0 )
				{
					eastToWest = true;
				}
				else
				{
					eastToWest = false;
				}

				Effects.PlaySound( p, Caster.Map, 0x20B );

				int itemID = eastToWest ? 0x3915 : 0x3922;

				TimeSpan duration = TimeSpan.FromSeconds( 3 + (Caster.Skills.Magery.Fixed / 25) );

				for ( int i = -2; i <= 2; ++i )
				{
					Point3D loc = new Point3D( eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z );

					new InternalItem( itemID, loc, Caster, Caster.Map, duration, i );
				}
			}

			FinishSequence();
		}

Usage Example

示例#1
0
 protected override void OnTarget(Mobile from, object o)
 {
     if (o is IPoint3D point3D)
     {
         m_Owner.Target(point3D);
     }
 }
All Usage Examples Of Server.Spells.Fifth.PoisonFieldSpell::Target