Server.Items.BaseExplosionPotion.ThrowTarget.OnTarget C# (CSharp) Méthode

OnTarget() protected méthode

protected OnTarget ( Server.Mobile from, object targeted ) : void
from Server.Mobile
targeted object
Résultat void
			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( m_Potion.Deleted || m_Potion.Map == Map.Internal )
					return;

				IPoint3D p = targeted as IPoint3D;

				if ( p == null )
					return;

				Map map = from.Map;

				if ( map == null )
					return;

				SpellHelper.GetSurfaceTop( ref p );

				from.RevealingAction();

				IEntity to;

				to = new Entity( Serial.Zero, new Point3D( p ), map );

				if( p is Mobile )
				{
					if( !RelativeLocation ) // explosion location = current mob location. 
						p = ((Mobile)p).Location;
					else
						to = (Mobile)p;
				}

				Effects.SendMovingEffect( from, to, m_Potion.ItemID, 7, 0, false, false, m_Potion.Hue, 0 );

				if( m_Potion.Amount > 1 )
				{
					Mobile.LiftItemDupe( m_Potion, 1 );
				}

				m_Potion.Internalize();
				Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( m_Potion.Reposition_OnTick ), new object[]{ from, p, map } );
			}
		}
BaseExplosionPotion.ThrowTarget