public override void OnDoubleClick(Mobile from) { BankBox box = from.BankBox; if (box != null && IsChildOf(box)) { Delete(); int deposited = 0; int toAdd = m_Worth; Deathcoin Deathcoin; while (toAdd > 60000) { Deathcoin = new Deathcoin(60000); if (box.TryDropItem(from, Deathcoin, false)) { toAdd -= 60000; deposited += 60000; } else { Deathcoin.Delete(); from.AddToBackpack(new DeathCoinBankCheck(toAdd)); toAdd = 0; break; } } if (toAdd > 0) { Deathcoin = new Deathcoin(toAdd); if (box.TryDropItem(from, Deathcoin, false)) { deposited += toAdd; } else { Deathcoin.Delete(); from.AddToBackpack(new DeathCoinBankCheck(toAdd)); } } // Tokens was deposited in your Backpack: from.SendMessage(m_Worth / 1000 + "Death Coins were placed in your backpack."); } else { from.SendLocalizedMessage(1047026); } }
public override void OnDoubleClick( Mobile from ) { BankBox box = from.BankBox; if ( box != null && IsChildOf( box ) ) { Delete(); int deposited = 0; int toAdd = m_Worth; Deathcoin Deathcoin; while ( toAdd > 60000 ) { Deathcoin = new Deathcoin( 60000 ); if ( box.TryDropItem( from, Deathcoin, false ) ) { toAdd -= 60000; deposited += 60000; } else { Deathcoin.Delete(); from.AddToBackpack( new DeathCoinBankCheck( toAdd ) ); toAdd = 0; break; } } if ( toAdd > 0 ) { Deathcoin = new Deathcoin( toAdd ); if ( box.TryDropItem( from, Deathcoin, false ) ) { deposited += toAdd; } else { Deathcoin.Delete(); from.AddToBackpack( new DeathCoinBankCheck( toAdd ) ); } } // Tokens was deposited in your Backpack: from.SendMessage( m_Worth/1000 + "Death Coins were placed in your backpack." ); } else { from.SendLocalizedMessage( 1047026 ); } }