private void Restock_Callback() { if (TotalItems < ItemsMax) { for (int i = TotalItems; i < ItemsMax; i++) { Item item = null; switch (Utility.RandomMinMax(1, 11)) { default: case 1: item = new Grapes(); break; case 2: item = new Ham(); break; case 3: item = new CheeseWedge(); break; case 4: item = new Muffins(); break; case 5: item = new FishSteak(); break; case 6: item = new Ribs(); break; case 7: item = new CookedBird(); break; case 8: item = new Sausage(); break; case 9: item = new Apple(); break; case 10: item = new Peach(); break; case 11: item = new Bandage(); break; } if (item != null) { DropItem(item); } } } }
/// <summary> /// Register this event /// </summary> /// <param name="method">The method to call when this event gets excuted</param> /// <param name="priority">The importance of the call</param> public static void Register(OnCall method, Priority priority, object passdata = null, Player target = null) { Muffins temp = new Muffins(method, priority, new OnPlayerChat(), passdata, target); Muffins.GiveDerpyMuffins(temp); }
public override void OnDoubleClick(Mobile from) { if (m_sower == null || m_sower.Deleted) { m_sower = from; } if (from.Mounted && !CropHelper.CanWorkMounted) { from.SendMessage("You cannot harvest a crop while mounted."); return; } if (DateTime.Now > lastpicked.AddSeconds(3)) // 3 seconds between picking { lastpicked = DateTime.Now; int lumberValue = (int)from.Skills[SkillName.Lumberjacking].Value / 20; if (lumberValue == 0) { from.SendMessage("You have no idea how to harvest this crop."); return; } if (from.InRange(this.GetWorldLocation(), 1)) { if (m_yield < 1) { from.SendMessage("There is nothing here to harvest."); if (PlayerCanDestroy && !(m_sower.AccessLevel > AccessLevel.Counselor)) { UpRootGump g = new UpRootGump(from, this); from.SendGump(g); } } else //check skill and sower { from.Direction = from.GetDirectionTo(this); from.Animate(from.Mounted ? 29:32, 5, 1, true, false, 0); if (from == m_sower) { lumberValue *= 2; m_lastvisit = DateTime.Now; } if (lumberValue > m_yield) { lumberValue = m_yield + 1; } int pick = Utility.Random(lumberValue); if (pick == 0) { from.SendMessage("You do not manage to harvest any crops."); return; } // *** Limit to one yield until we have Corn item *** if (pick > 1) { pick = 1; } m_yield -= pick; from.SendMessage("You harvest {0} crop{1}!", pick, (pick == 1 ? "" : "s")); //PublicOverheadMessage( MessageType.Regular, 0x3BD, false, string.Format( "{0}", m_yield )); ((Item)this).ItemID = pickedGraphic; // ******************************* // *** Corn does not yet exist *** // ******************************* //Corn crop = new Corn( pick ); Muffins crop = new Muffins(); from.AddToBackpack(crop); if (SowerPickTime != TimeSpan.Zero && m_lastvisit + SowerPickTime < DateTime.Now && !(m_sower.AccessLevel > AccessLevel.Counselor)) { this.UpRoot(from); return; } if (!regrowTimer.Running) { regrowTimer.Start(); } } } else { from.SendMessage("You are too far away to harvest anything."); } } }
/// <summary> /// Register this event /// </summary> /// <param name="method">The method to call when this event gets excuted</param> /// <param name="priority">The importance of the call</param> public static void Register(OnCall method, Priority priority, object datapass = null, Player target = null) { Muffins temp = new Muffins(method, priority, new OnPlayerCommand(), datapass, target); Muffins.GiveDerpyMuffins(temp); }