public static void EmptyTrash(Mobile from, Trash4TokensBackpack backpack) { if (backpack == null) { return; } backpack.cleaningBag = true; List <Item> items = backpack.Items; int i_Reward = 0; if (items.Count > 0) { from.PlaySound(0x76); for (int i = items.Count - 1; i >= 0; --i) { if (i >= items.Count) { continue; } Item it = (Item)items[i] as Item; if (it.Stackable == false && !((Item)items[i] is BaseBook)) { i_Reward += Utility.RandomMinMax(2, 5); } ((Item)items[i]).Delete(); } } }
public static void EmptyTrash(Mobile from, Trash4TokensBackpack backpack) { if (backpack == null) { return; } backpack.cleaningBag = true; List <Item> items = backpack.Items; int i_Reward = 0; if (items.Count > 0) { from.PlaySound(0x76); for (int i = items.Count - 1; i >= 0; --i) { if (i >= items.Count) { continue; } Item it = (Item)items[i] as Item; if (it.Stackable == false && !((Item)items[i] is BaseBook)) { i_Reward += Utility.RandomMinMax(2, 5); } ((Item)items[i]).Delete(); } } if (i_Reward > 0 && TokenSystem.GiveTokensToPlayer(from as Server.Mobiles.PlayerMobile, i_Reward)) { from.SendMessage(1173, "You were rewarded {0} Tokens to your account for cleaning the shard.", i_Reward); } backpack.cleaningBag = false; }
public EmptyTrash4TokensBackpack(Mobile from, Item item) : base(0154, 5) { m_From = from; m_Backpack = item as Trash4TokensBackpack; }