public override void OnComponentUsed(AddonComponent component, Mobile from) { BaseHouse house = BaseHouse.FindHouseAt(from); if (house != null && house.IsOwner(from)) { if (m_NextUse < DateTime.UtcNow) { Container cont = from.Backpack; Engines.Plants.Seed seed = new Engines.Plants.Seed(); if (cont == null || !cont.TryDropItem(from, seed, false)) { from.BankBox.DropItem(seed); from.SendLocalizedMessage(1072224); // An item has been placed in your bank box. } else { from.SendLocalizedMessage(1072223); // An item has been placed in your backpack. } m_NextUse = DateTime.UtcNow + TimeSpan.FromDays(7); } } else { from.SendLocalizedMessage(502092); // You must be in your house to do } }
public override void OnComponentUsed(AddonComponent component, Mobile from) { if (m_NextUse < DateTime.Now) { Container cont = from.Backpack; Engines.Plants.Seed seed = new Engines.Plants.Seed(); if (cont == null || !cont.TryDropItem(from, seed, false)) { from.BankBox.DropItem(seed); from.SendLocalizedMessage(1072224); // An item has been placed in your bank box. } else { from.SendLocalizedMessage(1072223); // An item has been placed in your backpack. } m_NextUse = DateTime.Now + TimeSpan.FromDays(7); } }