public override void OnResponse(NetState sender, RelayInfo info) { Mobile from = sender.Mobile; switch (info.ButtonID) { case (int)Buttons.Okay: { Item[] Token = sender.Mobile.BankBox.FindItemsByType(typeof(Gold)); if (sender.Mobile.BankBox.ConsumeTotal(typeof(Gold), 50000)) { //AccountDepositBox box = new AccountDepositBox(sender.Mobile);//Will Not Compile. AccountDepositBox box = new AccountDepositBox(); //Compiles but doesn't let m_Account, Hue, and Name be set. box.m_Account = sender.Mobile.Account.Username; box.Hue = 0x482; box.Name = sender.Mobile.Name.ToString() + "'s Account Deposit Box"; sender.Mobile.SendMessage("You successfully bought use of this Account Deposit Box!"); sender.Mobile.SendMessage("This Account Deposit Box is now linked to all characters on this account."); } else { sender.Mobile.SendMessage("You do not have enough gold in the bank to purchase the Account Deposit Box."); return; } break; } case (int)Buttons.Cancel: { sender.Mobile.SendMessage("You decide against buying use of this Account Deposit Box."); sender.Mobile.CloseGump(typeof(AccountDBox)); break; } } }
public override void OnResponse(NetState sender, RelayInfo info) { Mobile from = sender.Mobile; switch(info.ButtonID) { case (int)Buttons.Okay: { Item[] Token = sender.Mobile.BankBox.FindItemsByType( typeof( Gold ) ); if ( sender.Mobile.BankBox.ConsumeTotal( typeof( Gold ), 50000 ) ) { //AccountDepositBox box = new AccountDepositBox(sender.Mobile);//Will Not Compile. AccountDepositBox box = new AccountDepositBox();//Compiles but doesn't let m_Account, Hue, and Name be set. box.m_Account = sender.Mobile.Account.Username; box.Hue = 0x482; box.Name = sender.Mobile.Name.ToString() + "'s Account Deposit Box"; sender.Mobile.SendMessage("You successfully bought use of this Account Deposit Box!"); sender.Mobile.SendMessage("This Account Deposit Box is now linked to all characters on this account."); } else { sender.Mobile.SendMessage( "You do not have enough gold in the bank to purchase the Account Deposit Box." ); return; } break; } case (int)Buttons.Cancel: { sender.Mobile.SendMessage("You decide against buying use of this Account Deposit Box."); sender.Mobile.CloseGump(typeof(AccountDBox)); break; } } }
public AccountDBoxRenewGump(Mobile from, AccountDepositBox box) : this() { m_box = box; }