public static bool IsCursed(Mobile m) { BankBox bankBox = m.BankBox; if (bankBox == null) { return(false); } Item piratebag = bankBox.FindItemByType(typeof(PirateBag)); if (piratebag == null) { return(false); } m.SendMessage("You are already under the effects of the pirate curse!"); 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); }
public SavingsGump( Mobile from ) : base( 400, 300 ) { from.CloseGump( typeof( SavingsGump )); m_Bank = from.BankBox; m_Pack = from.Backpack; m_Account = (SavingsAccount)m_Bank.FindItemByType( typeof( SavingsAccount )); String gold = m_Account.Gold.ToString( "#,0" ) + " Gold"; String tokens = m_Account.Tokens.ToString( "#,0" ) + " Tokens"; m_MaximumCheckValue = AuctionConfig.MaximumCheckValue.ToString( "#,0" ); Closable = true; Disposable = true; Dragable = true; Resizable = false; AddPage( 0 ); AddBackground( 0, 0, 240, 268, 9200 ); AddAlphaRegion( 10, 9, 220, 100 ); AddAlphaRegion( 10, 115, 220, 145 ); AddLabel( 50, 15, 4, @"Savings Account Ledger" ); AddLabel( 50, 35, 4, @"-----------------------" ); AddLabel( 25, 55, 53, gold ); if ( Arya.Savings.SavingsAccount.EnableTokens ) AddLabel( 25, 80, 18, tokens ); AddLabel( 40, 130, 4, @"Withdraw 1 to " + m_MaximumCheckValue ); AddBackground( 75, 155, 95, 25, 0x2486 ); AddTextEntry( 85, 155, 90, 20, 0, m_AmountID, "" ); AddButton( 25, 180, 4005, 4007, 1, GumpButtonType.Reply, 0 ); AddLabel( 65, 180, 53, @"Make this gold check." ); if ( Arya.Savings.SavingsAccount.EnableTokens ) { AddButton( 25, 205, 4005, 4007, 2, GumpButtonType.Reply, 0 ); AddLabel( 65, 205, 18, @"Make this token check." ); } AddButton( 25, 230, 4017, 4019, 0, GumpButtonType.Reply, 0 ); AddLabel( 65, 230, 4, @"Done." ); }