void OpenBox(Mobile m) { this.Delete(); int rand = Utility.Random(8); Item reward = null; string rewardName = null; if (rand == 0) { reward = new CandyCane(); } else if (rand == 2) { reward = new Coal(); } else if (rand == 4) { reward = new CookedBird(2); } else if (rand == 6) { //reward = new FurBedRoll(); } else if (rand == 8) { reward = new BadCard(); } if (reward != null) { if (rewardName == null) { rewardName = reward.Name; } m.AddToBackpack(reward); m.SendLocalizedMessage(1074853, rewardName); // You have been given ~1_name~ } else { switch (Utility.Random(3)) { default: m.SendMessage("Krumpus box!"); AOS.Damage(m, 99, 0, 100, 0, 0, 0); m.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head); m.PlaySound(0x307); break; case 1: m.SendMessage("The box was empty"); break; case 2: Poison poison = Poison.Lethal; m.ApplyPoison(m, poison); m.SendMessage("A puff of green dust comes out of the box, words appear Krumpus Strikes again!"); break; } } }
public override void OnResponse(NetState sender, RelayInfo info) { Mobile from = sender.Mobile; switch (info.ButtonID) { case 0: { from.SendMessage("You Have Created Meat."); Item o_item = null; switch (Utility.Random(3)) { case 0: o_item = new Ham(); break; case 1: o_item = new CookedBird(); break; case 2: o_item = new Sausage(); break; } from.AddToBackpack(o_item); from.CloseGump(typeof(CreateFoodGump)); break; } case 1: { from.SendMessage("You Have Created Fruits & Vegies."); Item o_item = null; switch (Utility.Random(3)) { case 0: o_item = new Apple(); break; case 1: o_item = new Carrot(); break; case 2: o_item = new Grapes(); break; } from.AddToBackpack(o_item); from.CloseGump(typeof(CreateFoodGump)); break; } } }
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); } } } }