longtianchi
Member
Code:
public static Dictionary<Mobile, List<Item>> m = new Dictionary<Mobile, List<Item>>();
private static void PowerGump11_OnCommand(CommandEventArgs e)
{
if (!m.ContainsKey(e.Mobile))
m.Add(e.Mobile, e.Mobile.Items);
Container pack = new Backpack();
pack.Movable = false;
e.Mobile.Items = new List<Item>();
e.Mobile.AddItem(pack);
}
private static void PowerGump12_OnCommand(CommandEventArgs e)
{
foreach (Item item in e.Mobile.Items)
{
item.Delete();
}
e.Mobile.Items = m[e.Mobile];
}
This can generate new backpacks, but will not be replaced by old ones.