public InternalTimer(Mobile sower, CropSeedling seedling) : base(TimeSpan.FromHours(4.0)) { m_Sower = sower; m_Seedling = seedling; Priority = TimerPriority.OneMinute; }
public override void OnDoubleClick(Mobile from) { if (this.ItemID == 0x913) { } else if (!IsChildOf(from.Backpack)) { from.SendLocalizedMessage(CommonLocs.MustBeInPack); } else if (from.Mounted) { from.SendMessage("You cannot do that while mounted."); } else if (!CheckPlantSeed(from.Location, from.Map, 0)) { from.SendMessage("You cannot plant this so close to another crop."); } else if (CheckWeeds(from.Location, from.Map)) { from.SendMessage("These weeds will not help your crop grow!"); } else if (CanGrow(from.Location, from.Map)) { from.Animate(32, 5, 1, true, false, 0); from.SendMessage("You have planted the seed."); try { CropSeedling seedling = Activator.CreateInstance(typeof(CropSeedling), m_FullCropType, m_SeedlingID) as CropSeedling; BaseCropSeed tempSeed = new BaseCropSeed(0, null); tempSeed.ItemID = 0x913; tempSeed.Movable = false; tempSeed.MoveToWorld(from.Location, from.Map); if (seedling != null) { seedling.Plant(from, tempSeed); } } catch (Exception e) { Server.Utilities.ExceptionManager.LogException("BaseCropSeed.cs", e); from.SendMessage("A problem has ocurred while planting the seed. This exception has been logged. Please contact an administrator for further assistance."); } if (--(this.Amount) <= 0) { this.Delete(); } } else { from.SendMessage("You cannot plant this seed at this location."); } }
public InternalTimer( Mobile sower, CropSeedling seedling ) : base( TimeSpan.FromHours( 4.0 ) ) { m_Sower = sower; m_Seedling = seedling; Priority = TimerPriority.OneMinute; }