protected override void OnTarget(Mobile from, object targeted) { IPoint3D p = targeted as IPoint3D; Point3D targ3D; Point3D Right; Point3D Left; if (p is Item) { targ3D = ((Item)p).GetWorldLocation(); } else { targ3D = new Point3D(p); } AmbushTrap AmbushTrap = new AmbushTrap(); bool canFit = AmbushTrap.AdjustField(ref targ3D, from.Map, 22, true); if (canFit) { AmbushTrap.Map = from.Map; AmbushTrap.Location = targ3D; //Add Sparkles Effects.SendLocationParticles(AmbushTrap, 0x376A, 9, 10, 5025); //Add Dispel Timer AmbushTimer DispellTimer = new AmbushTimer(AmbushTrap, TimeSpan.FromMinutes(20.0)); DispellTimer.Start(); } else { AmbushTrap.Delete(); from.SendMessage("You could not create a trap there!"); } }
public AmbushTimer( AmbushTrap trap, TimeSpan delay ) : base( delay ) { m_Trap = trap; Priority = TimerPriority.OneSecond; }
protected override void OnTarget( Mobile from, object targeted ) { IPoint3D p = targeted as IPoint3D; Point3D targ3D; Point3D Right; Point3D Left; if ( p is Item ) targ3D = ((Item)p).GetWorldLocation(); else targ3D = new Point3D( p ); AmbushTrap AmbushTrap = new AmbushTrap(); bool canFit = AmbushTrap.AdjustField( ref targ3D, from.Map, 22, true ); if ( canFit ) { AmbushTrap.Map = from.Map; AmbushTrap.Location = targ3D; //Add Sparkles Effects.SendLocationParticles( AmbushTrap, 0x376A, 9, 10, 5025 ); //Add Dispel Timer AmbushTimer DispellTimer = new AmbushTimer( AmbushTrap, TimeSpan.FromMinutes( 20.0 )); DispellTimer.Start(); } else { AmbushTrap.Delete(); from.SendMessage("You could not create a trap there!"); } }
public AmbushTimer(AmbushTrap trap, TimeSpan delay) : base(delay) { m_Trap = trap; Priority = TimerPriority.OneSecond; }