public static bool UnEquipPlayer(Mobile m) { ArrayList ItemsToMove = new ArrayList(); PirateBag bag = new PirateBag(); BankBox bankBox = m.BankBox; if (bankBox == null || !bankBox.TryDropItem(m, bag, false)) { bag.Delete(); return(false); } else { foreach (Item item in m.Items) { if (item.Layer != Layer.Bank && item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Layer != Layer.Mount && item.Layer != Layer.Backpack) { ItemsToMove.Add(item); } } foreach (Item item in ItemsToMove) { bag.AddItem(item); } bag.Owner = m; bag.PlayerTitle = m.Title; bag.PlayerHue = m.Hue; m.Title = "the Cursed Pirate"; m.Hue = Utility.RandomMinMax(0x8596, 0x8599); EquipPirateItems(m); } return(true); }
public static bool RestorePlayerItems(Mobile player) { ArrayList ItemsToEquip = new ArrayList(); BankBox bankBox = player.BankBox; if (bankBox == null) { return(false); } Item bag = bankBox.FindItemByType(typeof(PirateBag)); if (bag == null) { return(false); } PirateBag piratebag = bag as PirateBag; foreach (Item item in piratebag.Items) { ItemsToEquip.Add(item); } foreach (Item item in ItemsToEquip) { player.AddItem(item); } player.Title = piratebag.PlayerTitle; player.Hue = piratebag.PlayerHue; piratebag.Delete(); return(true); }