Пример #1
0
        public void CheckBank(BankBox bank, Mobile from)
        {
            if (AccountGold.Enabled && bank.Owner == from && from.Account != null)
            {
                List <BankCheck> checks = new List <BankCheck>(Items.OfType <BankCheck>());

                for (var index = 0; index < checks.Count; index++)
                {
                    BankCheck check = checks[index];

                    if (from.Account.DepositGold(check.Worth))
                    {
                        from.SendLocalizedMessage(1042672, true, check.Worth.ToString("#,0"));
                        check.Delete();
                    }
                    else
                    {
                        from.AddToBackpack(check);
                    }
                }

                checks.Clear();
                checks.TrimExcess();

                UpdateTotals();
            }
        }
Пример #2
0
        /// <summary>
        /// award coins to the player
        /// </summary>
        /// <param name="m">player to give coins too</param>
        /// <param name="tourneywinner">is this the tourney winner</param>
        public void GiveGold(Mobile m, bool tourneywinner)
        {
            //set up coin amount based on round and if they are the tourney winner
            int total = tourneywinner ? m_CoinsPerRound * m_CurrentRound + m_CoinsWinner : m_CoinsPerRound * m_CurrentRound;

            //create a floating set of coins
            BankCheck check = new BankCheck(total);

            //if the players pack is full, delete the floating coins
            if (!m.AddToBackpack(check))
            {
                check.Delete();
            }
        }
Пример #3
0
        public override void OnDoubleClick(Mobile from)
        {
            BankBox box = from.BankBox;

            if (box != null && IsChildOf(box))
            {
                PlayerMobile pm = from as PlayerMobile;

                base.OnDoubleClick(from);

                BankCheck check;

                if (this.Amount == 1)
                {
                    check = new BankCheck(1000000);

                    this.Delete();

                    if (box.TryDropItem(pm, check, false))
                    {
                        pm.SendMessage("You return your gold bar to the bank and receive a 1,000,000 check.");
                    }
                    else
                    {
                        check.Delete();
                        pm.AddToBackpack(new BankCheck(1000000));
                        pm.SendMessage("You return your gold bar to the bank and receive a 1,000,000 check.");
                    }
                }
                else if (this.Amount >= 2)
                {
                    check = new BankCheck(1000000);

                    if (box.TryDropItem(pm, check, false))
                    {
                        this.Amount -= 1;
                        pm.SendMessage("You return your gold bar to the bank and receive a 1,000,000 check.");
                    }
                    else
                    {
                        check.Delete();
                        pm.SendMessage("There is not enough room in your bank box for the check.");
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(1047026);                   // That must be in your bank box to use it.
            }
        }
Пример #4
0
		public override void OnDoubleClick( Mobile from )
		{
			BankBox box = from.BankBox;

			if ( box != null && IsChildOf( box ) )
			{
				PlayerMobile pm = from as PlayerMobile;

				base.OnDoubleClick( from );
				
				BankCheck check;

				if( this.Amount == 1 )
				{
					check = new BankCheck( 1000000 );
					
					this.Delete();

					if ( box.TryDropItem( pm, check, false ) )
					{
						pm.SendMessage("You return your gold bar to the bank and receive a 1,000,000 check.");
					}
					else
					{
						check.Delete();
						pm.AddToBackpack( new BankCheck( 1000000 ) );
						pm.SendMessage("You return your gold bar to the bank and receive a 1,000,000 check.");
					}
				}
				else if( this.Amount >= 2 )
					{
					check = new BankCheck( 1000000 );
                                
					if ( box.TryDropItem( pm, check, false ) )
					{
						this.Amount -= 1;
						pm.SendMessage("You return your gold bar to the bank and receive a 1,000,000 check.");
					}
					else
					{
						check.Delete();
						pm.SendMessage("There is not enough room in your bank box for the check.");
					}
				}
			}
			else
			{
				from.SendLocalizedMessage( 1047026 ); // That must be in your bank box to use it.
			}
		}
Пример #5
0
        public void EndCombine(Mobile from, object o)
        {
            if (o is Item && ((Item)o).IsChildOf(from.Backpack))
            {
                if (!(o is Gold) && !(o is BankCheck))
                {
                    from.SendMessage("That is not an item you can put in here.");
                }
                if (o is Gold)
                {
                    if (Token >= 200000000)
                    {
                        from.SendMessage("This check book is too full.");
                    }
                    else
                    {
                        Item curItem = o as Item;
                        Token += curItem.Amount;
                        curItem.Delete();
                        from.SendGump(new CheckBookGump((PlayerMobile)from, this));
                        BeginCombine(from);
                    }
                }

                if (o is BankCheck)
                {
                    if (Token >= 200000000)
                    {
                        from.SendMessage("This check book is too full.");
                    }
                    else
                    {
                        BankCheck bankcheck = o as BankCheck;
                        Token += bankcheck.Worth;
                        bankcheck.Delete();
                        from.SendGump(new CheckBookGump((PlayerMobile)from, this));
                        BeginCombine(from);
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(1045158);                   // You must have the item in your backpack to target it.
            }
        }
        public static bool Withdraw(Mobile from, int amount)
        {
            Item[] gold, checks;
            int    balance = GetBalance(from, out gold, out checks);

            if (balance < amount)
            {
                return(false);
            }

            for (int i = 0; amount > 0 && i < gold.Length; ++i)
            {
                if (gold[i].Amount <= amount)
                {
                    amount -= gold[i].Amount;
                    gold[i].Delete();
                }
                else
                {
                    gold[i].Amount -= amount;
                    amount          = 0;
                }
            }

            for (int i = 0; amount > 0 && i < checks.Length; ++i)
            {
                BankCheck check = (BankCheck)checks[i];

                if (check.Worth <= amount)
                {
                    amount -= check.Worth;
                    check.Delete();
                }
                else
                {
                    check.Worth -= amount;
                    amount       = 0;
                }
            }

            return(true);
        }
        public override void OnSpeech(SpeechEventArgs e)
        {
            if (!e.Handled && e.Mobile.InLOS(this))
            {
                for (int i = 0; i < e.Keywords.Length; ++i)
                {
                    int keyword = e.Keywords[i];

                    switch (keyword)
                    {
                    case 0x0000:                             // *withdraw*
                    {
                        e.Handled = true;

                        string[] split = e.Speech.Split(' ');

                        if (split.Length >= 2)
                        {
                            int amount;

                            try
                            {
                                amount = Convert.ToInt32(split[1]);
                            }
                            catch
                            {
                                break;
                            }

                            if (amount > 5000)
                            {
                                this.Say(500381);                                           // Thou canst not withdraw so much at one time!
                            }
                            else if (amount > 0)
                            {
                                BankBox box = e.Mobile.BankBox;

                                if (box == null || !box.ConsumeTotal(typeof(Gold), amount))
                                {
                                    this.Say(500384);                                               // Ah, art thou trying to fool me? Thou hast not so much gold!
                                }
                                else
                                {
                                    e.Mobile.AddToBackpack(new Gold(amount));

                                    this.Say(1010005);                                               // Thou hast withdrawn gold from thy account.
                                }
                            }
                        }

                        break;
                    }

                    case 0x0001:                             // *balance*
                    {
                        e.Handled = true;

                        BankBox box = e.Mobile.BankBox;

                        if (box != null)
                        {
                            this.Say(String.Format("Thy current bank balance is {0} gold.", box.TotalGold.ToString()));
                        }

                        break;
                    }

                    case 0x0002:                             // *bank*
                    {
                        e.Handled = true;

                        BankBox box = e.Mobile.BankBox;

                        if (box != null)
                        {
                            box.Open();
                        }

                        break;
                    }

                    case 0x0003:                             // *check*
                    {
                        e.Handled = true;

                        string[] split = e.Speech.Split(' ');

                        if (split.Length >= 2)
                        {
                            int amount;

                            try
                            {
                                amount = Convert.ToInt32(split[1]);
                            }
                            catch
                            {
                                break;
                            }

                            if (amount < 5000)
                            {
                                this.Say(1010006);                                           // We cannot create checks for such a paltry amount of gold!
                            }
                            else if (amount > 1000000)
                            {
                                this.Say(1010007);                                           // Our policies prevent us from creating checks worth that much!
                            }
                            else
                            {
                                BankCheck check = new BankCheck(amount);

                                BankBox box = e.Mobile.BankBox;

                                if (box == null || !box.TryDropItem(e.Mobile, check, false))
                                {
                                    this.Say(500386);                                               // There's not enough room in your bankbox for the check!
                                    check.Delete();
                                }
                                else if (!box.ConsumeTotal(typeof(Gold), amount))
                                {
                                    this.Say(500384);                                               // Ah, art thou trying to fool me? Thou hast not so much gold!
                                    check.Delete();
                                }
                                else
                                {
                                    this.Say(String.Format("Into your bank box I have placed a check in the amount of: {0}", amount.ToString()));
                                }
                            }
                        }

                        break;
                    }
                    }
                }
            }

            base.OnSpeech(e);
        }
Пример #8
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            if (!e.Handled && e.Mobile.InRange(this.Location, 12))
            {
                for (int i = 0; i < e.Keywords.Length; ++i)
                {
                    int keyword = e.Keywords[i];

                    switch (keyword)
                    {
                    case 0x0000:     // *withdraw*
                    {
                        e.Handled = true;

                        if (e.Mobile.Criminal)
                        {
                            e.Mobile.Say(500389);         // I will not do business with a criminal!
                            break;
                        }

                        string[] split = e.Speech.Split(' ');

                        if (split.Length >= 2)
                        {
                            int amount;

                            try
                            {
                                amount = Convert.ToInt32(split[1]);
                            }
                            catch
                            {
                                break;
                            }

                            if (amount > 5000)
                            {
                                e.Mobile.Say(500381);         // Thou canst not withdraw so much at one time!
                            }
                            else if (amount > 0)
                            {
                                BankBox box = e.Mobile.FindBankNoCreate();

                                if (box == null || !box.ConsumeTotal(typeof(Gold), amount))
                                {
                                    e.Mobile.Say(500384);         // Ah, art thou trying to fool me? Thou hast not so much gold!
                                }
                                else
                                {
                                    e.Mobile.AddToBackpack(new Gold(amount));

                                    e.Mobile.Say(1010005);         // Thou hast withdrawn gold from thy account.
                                }
                            }
                        }

                        break;
                    }

                    case 0x0001:     // *balance*
                    {
                        e.Handled = true;

                        if (e.Mobile.Criminal)
                        {
                            e.Mobile.Say(500389);         // I will not do business with a criminal!
                            break;
                        }

                        BankBox box = e.Mobile.FindBankNoCreate();

                        if (box != null)
                        {
                            e.Mobile.Say(1042759, box.TotalGold.ToString());         // Thy current bank balance is ~1_AMOUNT~ gold.
                        }
                        else
                        {
                            e.Mobile.Say(1042759, "0");         // Thy current bank balance is ~1_AMOUNT~ gold.
                        }
                        break;
                    }

                    case 0x0002:     // *bank*
                    {
                        e.Handled = true;

                        if (e.Mobile.Criminal)
                        {
                            e.Mobile.Say(500378);         // Thou art a criminal and cannot access thy bank box.
                            break;
                        }

                        e.Mobile.BankBox.Open();

                        break;
                    }

                    case 0x0003:     // *check*
                    {
                        e.Handled = true;

                        if (e.Mobile.Criminal)
                        {
                            e.Mobile.Say(500389);         // I will not do business with a criminal!
                            break;
                        }

                        string[] split = e.Speech.Split(' ');

                        if (split.Length >= 2)
                        {
                            int amount;

                            try
                            {
                                amount = Convert.ToInt32(split[1]);
                            }
                            catch
                            {
                                break;
                            }

                            if (amount < 5000)
                            {
                                e.Mobile.Say(1010006);         // We cannot create checks for such a paltry amount of gold!
                            }
                            else if (amount > 1000000)
                            {
                                e.Mobile.Say(1010007);         // Our policies prevent us from creating checks worth that much!
                            }
                            else
                            {
                                BankCheck check = new BankCheck(amount);

                                BankBox box = e.Mobile.BankBox;

                                if (!box.TryDropItem(e.Mobile, check, false))
                                {
                                    e.Mobile.Say(500386);         // There's not enough room in your bankbox for the check!
                                    check.Delete();
                                }
                                else if (!box.ConsumeTotal(typeof(Gold), amount))
                                {
                                    e.Mobile.Say(500384);         // Ah, art thou trying to fool me? Thou hast not so much gold!
                                    check.Delete();
                                }
                                else
                                {
                                    e.Mobile.Say(1042673, amount.ToString());         // Into your bank box I have placed a check in the amount of:
                                }
                            }
                        }

                        break;
                    }
                    }
                }
            }

            base.OnSpeech(e);
        }
Пример #9
0
        public override void OnSpeech( SpeechEventArgs e )
        {
            if ( !e.Handled && e.Mobile.InRange( this.Location, 4 ) && CanUseTheBank( e.Mobile ) )
            {
                for ( int i = 0; i < e.Keywords.Length; ++i )
                {
                    int keyword = e.Keywords[i];

                    switch ( keyword )
                    {
                        case 0x0000: // *withdraw*
                        {
                            e.Handled = true;

                            string[] split = e.Speech.Split( ' ' );

                            if ( split.Length >= 2 )
                            {
                                int amount;

                                try
                                {
                                    amount = Convert.ToInt32( split[1] );
                                }
                                catch
                                {
                                    break;
                                }

                                if ( amount > 5000 )
                                {
                                    this.Say( 500381 ); // Thou canst not withdraw so much at one time!
                                }
                                else if ( amount > 0 )
                                {
                                    BankBox box = e.Mobile.BankBox;

                                    if ( box == null || !box.ConsumeTotal( typeof( Copper ), amount ) )
                                    {
                                        this.Say( "Ah, art thou trying to fool me? Thou hast not so much copper!" );
                                    }
                                    else
                                    {
                                        e.Mobile.AddToBackpack( new Copper( amount ) );

                                        this.Say( "Thou hast withdrawn copper from thy account." );
                                    }
                                }
                            }

                            break;
                        }
                        case 0x0001: // *balance*
                        {
                            e.Handled = true;

                            BankBox box = e.Mobile.BankBox;

                            if ( box != null )
                            {
                                this.Say( "Thy current bank balance is " + box.TotalGold.ToString() + " copper." );
                            }

                            break;
                        }
                        case 0x0002: // *bank*
                        {
                            e.Handled = true;

                            BankBox box = e.Mobile.BankBox;

                            PlayerMobile pm = e.Mobile as PlayerMobile;

                            if ( box != null )
                                box.Open();

                            break;
                        }
                        case 0x0003: // *check*
                        {
                            e.Handled = true;

                            string[] split = e.Speech.Split( ' ' );

                            if ( split.Length >= 2 )
                            {
                                int amount;

                                try
                                {
                                    amount = Convert.ToInt32( split[1] );
                                }
                                catch
                                {
                                    break;
                                }

                                if ( amount < 5000 )
                                {
                                    this.Say( "We cannot create checks for such a paltry amount of copper!" ); //
                                }
                                else if ( amount > 1000000 )
                                {
                                    this.Say( 1010007 ); // Our policies prevent us from creating checks worth that much!
                                }
                                else
                                {
                                    BankCheck check = new BankCheck( amount );

                                    BankBox box = e.Mobile.BankBox;

                                    if ( box == null || !box.TryDropItem( e.Mobile, check, false ) )
                                    {
                                        this.Say( 500386 ); // There's not enough room in your bankbox for the check!
                                        check.Delete();
                                    }
                                    else if ( !box.ConsumeTotal( typeof( Copper ), amount ) )
                                    {
                                        this.Say( "Ah, art thou trying to fool me? Thou hast not so much copper!" ); //
                                        check.Delete();
                                    }
                                    else
                                    {
                                        this.Say( 1042673, AffixType.Append, amount.ToString(), "" ); // Into your bank box I have placed a check in the amount of:
                                    }
                                }
                            }

                            break;
                        }
                    }
                }
            }

            base.OnSpeech( e );
        }
Пример #10
0
      		public override void OnSpeech( SpeechEventArgs e ) 
      		{ 
         		if ( !e.Handled && e.Mobile.InLOS( this ) ) 
         	{ 
            		for ( int i = 0; i < e.Keywords.Length; ++i ) 
            	{ 
               		int keyword = e.Keywords[i]; 

               		switch ( keyword ) 
               	{ 
                  	case 0x0000: // *withdraw* 
                { 
                     	e.Handled = true; 

                     	string[] split = e.Speech.Split( ' ' ); 

                     	if ( split.Length >= 2 ) 
              	{ 
                        int amount; 

                        try 
             	{ 
                       	amount = Convert.ToInt32( split[1] ); 
                } 
                        catch 
                { 
                        break; 
                } 

                        if ( amount > 5000 ) 
                { 
                        this.Say( 500381 ); // Thou canst not withdraw so much at one time! 
                } 
                        else if ( amount > 0 ) 
                { 
                        BankBox box = e.Mobile.BankBox; 

                       	if ( box == null || !box.ConsumeTotal( typeof( Gold ), amount ) ) 
                { 
                       	this.Say( 500384 ); // Ah, art thou trying to fool me? Thou hast not so much gold! 
                } 
                else 
               	{ 
                        e.Mobile.AddToBackpack( new Gold( amount ) ); 

                   	this.Say( 1010005 ); // Thou hast withdrawn gold from thy account. 
              	} 
   	}
} 

                     	break; 
              	} 
                  	case 0x0001: // *balance* 
              	{ 
                     	e.Handled = true; 

                     	BankBox box = e.Mobile.BankBox; 

                     	if ( box != null ) 
              	{ 
                        this.Say( String.Format("Thy current bank balance is {0} gold.", box.TotalGold.ToString() ) ); 
              	} 

                     	break; 
               	} 
                  	case 0x0002: // *bank* 
          	{ 
                     	e.Handled = true; 

                     	BankBox box = e.Mobile.BankBox; 

                     	if ( box != null ) 
                        box.Open(); 

                     	break; 
               	} 
                  	case 0x0003: // *check* 
              	{ 
                     	e.Handled = true; 

                   	string[] split = e.Speech.Split( ' ' ); 

                     	if ( split.Length >= 2 ) 
                { 
                        int amount; 

                        try 
          	{ 
                        amount = Convert.ToInt32( split[1] ); 
               	} 
                        catch 
               	{ 
                       	break; 
                } 

                        if ( amount < 5000 ) 
                { 
                      	this.Say( 1010006 ); // We cannot create checks for such a paltry amount of gold! 
             	} 
                       	else if ( amount > 1000000 ) 
           	{ 
                       	this.Say( 1010007 ); // Our policies prevent us from creating checks worth that much! 
              	} 
               	else 
             	{ 
                       	BankCheck check = new BankCheck( amount ); 

                       	BankBox box = e.Mobile.BankBox; 

                     	if ( box == null || !box.TryDropItem( e.Mobile, check, false ) ) 
            	{ 
                       	this.Say( 500386 ); // There's not enough room in your bankbox for the check! 
                      	check.Delete(); 
             	} 
                       	else if ( !box.ConsumeTotal( typeof( Gold ), amount ) ) 
             	{ 
                       	this.Say( 500384 ); // Ah, art thou trying to fool me? Thou hast not so much gold! 
                       	check.Delete(); 
                } 
                else 
                { 
                       	this.Say( String.Format("Into your bank box I have placed a check in the amount of: {0}",  amount.ToString() ) ); 
             	} 
     	} 
} 

                     	break; 
                  	} 
               	} 
  	} 
} 

         		base.OnSpeech( e ); 
      		} 
Пример #11
0
        public void EndAddGold(Mobile from, object obj)
        {
            from.CloseGump(typeof(GoldLedgerGump));

            if (obj is Item)
            {
                Item   item      = obj as Item;
                double maxWeight = (WeightOverloading.GetMaxWeight(from));
                int    golda     = 0;

                if (!this.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
                    return;
                }
                if (!item.IsAccessibleTo(from))
                {
                    from.SendGump(new GoldLedgerGump(this));
                    from.SendLocalizedMessage(3000270); // That is not accessible.
                    return;
                }

                if (obj is Gold)
                {
                    Gold gold = obj as Gold;

                    golda = gold.Amount;
                    if ((gold.Amount + this.Gold) > 999999999)
                    {
                        golda = (999999999 - this.Gold);
                    }
                    double maxgold = golda;
                    if (this.d_WeightScale > 0 && gold.RootParent != from)
                    {
                        maxgold = ((maxWeight - ((double)Mobile.BodyWeight + (double)from.TotalWeight)) / this.d_WeightScale);
                    }
                    if (golda > maxgold)
                    {
                        golda = (int)maxgold;
                    }
                    if (golda < gold.Amount)
                    {
                        gold.Amount -= golda;
                    }
                    else
                    {
                        gold.Delete();
                    }

                    this.Gold += golda;

                    from.SendGump(new GoldLedgerGump(this));
                    from.SendMessage(2125, String.Format("You deposit {0} gold into your gold ledger.", golda.ToString("#,0")));
                    from.PlaySound(0x249);
                }
                else if (obj is BankCheck)
                {
                    BankCheck check = obj as BankCheck;

                    golda = check.Worth;
                    if ((check.Worth + this.Gold) > 999999999)
                    {
                        golda = (999999999 - this.Gold);
                    }
                    double maxgold = golda;
                    if (this.d_WeightScale > 0)
                    {
                        maxgold = ((maxWeight - ((double)Mobile.BodyWeight + (double)from.TotalWeight)) / this.d_WeightScale);
                    }
                    if (golda > maxgold)
                    {
                        golda = (int)maxgold;
                    }
                    if (golda < check.Worth)
                    {
                        check.Worth -= golda;
                    }
                    else
                    {
                        check.Delete();
                    }

                    this.Gold += golda;

                    from.SendGump(new GoldLedgerGump(this));
                    from.SendMessage(2125, String.Format("You deposit a bank check worth {0} gold into your gold ledger.", golda.ToString("#,0")));
                    from.PlaySound(0x249);
                }
                else if (obj is GoldLedger && obj != this)
                {
                    GoldLedger gledger = obj as GoldLedger;

                    golda = gledger.Gold;
                    if ((gledger.Gold + this.Gold) > 999999999)
                    {
                        golda = (999999999 - this.Gold);
                    }
                    double maxgold = golda;
                    if (this.d_WeightScale > 0)
                    {
                        maxgold = ((maxWeight - ((double)Mobile.BodyWeight + (double)from.TotalWeight)) / this.d_WeightScale);
                    }
                    if (golda > maxgold)
                    {
                        golda = (int)maxgold;
                    }
                    gledger.Gold -= golda;

                    this.Gold += golda;

                    from.SendGump(new GoldLedgerGump(this));
                    from.SendMessage(2125, String.Format("You transfer {0} gold into your gold ledger.", golda.ToString("#,0")));
                    from.PlaySound(0x249);
                }
                else
                {
                    from.SendGump(new GoldLedgerGump(this));
                    from.SendMessage(2125, "You can only deposit gold or bank checks into your gold ledger.");
                }
            }
            else
            {
                from.SendGump(new GoldLedgerGump(this));
                from.SendMessage(2125, "You can only deposit gold or bank checks into your gold ledger.");
            }

            from.SendMessage(2125, "Do you want to deposit anything else? (ESC to cancel)");
            from.Target = new AddGoldTarget(this);
        }
Пример #12
0
	    public static void HandleSpeech(Mobile vendor, SpeechEventArgs e)
	    {
			if (!e.Handled && e.Mobile.InRange(vendor, 12))
			{
				foreach (var keyword in e.Keywords)
				{
					switch (keyword)
					{
						case 0x0000: // *withdraw*
							{
								e.Handled = true;

								if (e.Mobile.Criminal)
								{
									// I will not do business with a criminal!
									vendor.Say(500389);
									break;
								}

								var split = e.Speech.Split(' ');

								if (split.Length >= 2)
								{
									int amount;

									var pack = e.Mobile.Backpack;

									if (!int.TryParse(split[1], out amount))
									{
										break;
									}

									if ((!Core.ML && amount > 5000) || (Core.ML && amount > 60000))
									{
										// Thou canst not withdraw so much at one time!
										vendor.Say(500381);
									}
									else if (pack == null || pack.Deleted || !(pack.TotalWeight < pack.MaxWeight) ||
											 !(pack.TotalItems < pack.MaxItems))
									{
										// Your backpack can't hold anything else.
										vendor.Say(1048147);
									}
									else if (amount > 0)
									{
										var box = e.Mobile.FindBankNoCreate();

										if (box == null || !Withdraw(e.Mobile, amount))
										{
											// Ah, art thou trying to fool me? Thou hast not so much gold!
											vendor.Say(500384);
										}
										else
										{
											pack.DropItem(new Gold(amount));

											// Thou hast withdrawn gold from thy account.
											vendor.Say(1010005);
										}
									}
								}
							}
							break;
						case 0x0001: // *balance*
							{
								e.Handled = true;

								if (e.Mobile.Criminal)
								{
									// I will not do business with a criminal!
									vendor.Say(500389);
									break;
								}

								if (AccountGold.Enabled && e.Mobile.Account != null)
								{
									vendor.Say(
										"Thy current bank balance is {0:#,0} platinum and {1:#,0} gold.",
										e.Mobile.Account.TotalPlat,
										e.Mobile.Account.TotalGold);
								}
								else
								{
									// Thy current bank balance is ~1_AMOUNT~ gold.
									vendor.Say(1042759, GetBalance(e.Mobile).ToString("#,0"));
								}
							}
							break;
						case 0x0002: // *bank*
							{
								e.Handled = true;

								if (e.Mobile.Criminal)
								{
									// Thou art a criminal and cannot access thy bank box.
									vendor.Say(500378);
									break;
								}

								e.Mobile.BankBox.Open();
							}
							break;
						case 0x0003: // *check*
							{
								e.Handled = true;

								if (e.Mobile.Criminal)
								{
									// I will not do business with a criminal!
									vendor.Say(500389);
									break;
								}

								if (AccountGold.Enabled && e.Mobile.Account != null)
								{
									vendor.Say("We no longer offer a checking service.");
									break;
								}

								var split = e.Speech.Split(' ');

								if (split.Length >= 2)
								{
									int amount;

									if (!int.TryParse(split[1], out amount))
									{
										break;
									}

									if (amount < 5000)
									{
										// We cannot create checks for such a paltry amount of gold!
										vendor.Say(1010006);
									}
									else if (amount > 1000000)
									{
										// Our policies prevent us from creating checks worth that much!
										vendor.Say(1010007);
									}
									else
									{
										var check = new BankCheck(amount);

										var box = e.Mobile.BankBox;

										if (!box.TryDropItem(e.Mobile, check, false))
										{
											// There's not enough room in your bankbox for the check!
											vendor.Say(500386);
											check.Delete();
										}
										else if (!box.ConsumeTotal(typeof(Gold), amount))
										{
											// Ah, art thou trying to fool me? Thou hast not so much gold!
											vendor.Say(500384);
											check.Delete();
										}
										else
										{
											// Into your bank box I have placed a check in the amount of:
											vendor.Say(1042673, AffixType.Append, amount.ToString("#,0"), "");
										}
									}
								}
							}
							break;
					}
				}
			}
	    }
Пример #13
0
		public override void OnSpeech( SpeechEventArgs e )
		{
			if ( !e.Handled && e.Mobile.InRange( this.Location, 12 ) )
			{
				for ( int i = 0; i < e.Keywords.Length; ++i )
				{
					int keyword = e.Keywords[i];

					switch ( keyword )
					{
						case 0x0000: // *withdraw*
						{
							e.Handled = true;

							if ( e.Mobile.Criminal )
							{
								this.Say( 500389 ); // I will not do business with a criminal!
								break;
							}

							string[] split = e.Speech.Split( ' ' );

							if ( split.Length >= 2 )
							{
								int amount;

								Container pack = e.Mobile.Backpack;

                                if ( !int.TryParse( split[1], out amount ) )
                                    break;

								if ( (!Core.ML && amount > 5000) || (Core.ML && amount > 60000) )
								{
									this.Say( 500381 ); // Thou canst not withdraw so much at one time!
								}
								else if (pack == null || pack.Deleted || !(pack.TotalWeight < pack.MaxWeight) || !(pack.TotalItems < pack.MaxItems))
								{
									this.Say(1048147); // Your backpack can't hold anything else.
								}
								else if ( amount > 0 )
								{
									BankBox box = e.Mobile.FindBankNoCreate();

									if ( box == null || !box.ConsumeTotal( typeof( Gold ), amount ) )
									{
										this.Say( 500384 ); // Ah, art thou trying to fool me? Thou hast not so much gold!
									}
									else
									{
										pack.DropItem(new Gold(amount));

										this.Say( 1010005 ); // Thou hast withdrawn gold from thy account.
									}
								}
							}

							break;
						}
						case 0x0001: // *balance*
						{
							e.Handled = true;

							if ( e.Mobile.Criminal )
							{
								this.Say( 500389 ); // I will not do business with a criminal!
								break;
							}

							BankBox box = e.Mobile.FindBankNoCreate();

							if ( box != null )
								this.Say( 1042759, box.TotalGold.ToString() ); // Thy current bank balance is ~1_AMOUNT~ gold.
							else
								this.Say( 1042759, "0" ); // Thy current bank balance is ~1_AMOUNT~ gold.

							break;
						}
						case 0x0002: // *bank*
						{
							e.Handled = true;

							if ( e.Mobile.Criminal )
							{
								this.Say( 500378 ); // Thou art a criminal and cannot access thy bank box.
								break;
							}

							e.Mobile.BankBox.Open();

							break;
						}
						case 0x0003: // *check*
						{
							e.Handled = true;

							if ( e.Mobile.Criminal )
							{
								this.Say( 500389 ); // I will not do business with a criminal!
								break;
							}

							string[] split = e.Speech.Split( ' ' );

							if ( split.Length >= 2 )
							{
								int amount;

                                if ( !int.TryParse( split[1], out amount ) )
                                    break;

								if ( amount < 5000 )
								{
									this.Say( 1010006 ); // We cannot create checks for such a paltry amount of gold!
								}
								else if ( amount > 1000000 )
								{
									this.Say( 1010007 ); // Our policies prevent us from creating checks worth that much!
								}
								else
								{
									BankCheck check = new BankCheck( amount );

									BankBox box = e.Mobile.BankBox;

									if ( !box.TryDropItem( e.Mobile, check, false ) )
									{
										this.Say( 500386 ); // There's not enough room in your bankbox for the check!
										check.Delete();
									}
									else if ( !box.ConsumeTotal( typeof( Gold ), amount ) )
									{
										this.Say( 500384 ); // Ah, art thou trying to fool me? Thou hast not so much gold!
										check.Delete();
									}
									else
									{
										this.Say( 1042673, AffixType.Append, amount.ToString(), "" ); // Into your bank box I have placed a check in the amount of:
									}
								}
							}

							break;
						}
					}
				}
			}

			base.OnSpeech( e );
		}
Пример #14
0
        /// <summary>
        /// award coins to the player
        /// </summary>
        /// <param name="m">player to give coins too</param>
        /// <param name="tourneywinner">is this the tourney winner</param>
        public void GiveGold(Mobile m, bool tourneywinner)
        {
            //set up coin amount based on round and if they are the tourney winner
            int total = tourneywinner ? m_CoinsPerRound * m_CurrentRound + m_CoinsWinner : m_CoinsPerRound * m_CurrentRound;

            //create a floating set of coins
            BankCheck check = new BankCheck( total );

            //if the players pack is full, delete the floating coins
            if (!m.AddToBackpack(check))
            {
                check.Delete();
            }
        }
Пример #15
0
        public override void OnSpeech( SpeechEventArgs e )
        {
            if ( !e.Handled && e.Mobile.InRange( this.Location, 12 ) )
            {
                if (e.Speech.Contains("deposit"))
                {
                    e.Handled = true;
                    if ( e.Mobile.Criminal && !(this is CriminalBanker))
                        this.Say( 500389 ); // I will not do business with a criminal!
                    else
                    {
                        e.Mobile.Target = new SendTarget();
                        this.Say("Target the gold you wish to deposit.");
                    }
                }

                for ( int i = 0; i < e.Keywords.Length; ++i )
                {
                    int keyword = e.Keywords[i];

                    switch ( keyword )
                    {
                        case 0x0000: // *withdraw*
                        {
                            e.Handled = true;

                            if ( e.Mobile.Criminal && !(this is CriminalBanker))
                            {
                                this.Say( 500389 ); // I will not do business with a criminal!
                                break;
                            }

                            string[] split = e.Speech.Split( ' ' );

                            if ( split.Length >= 2 )
                            {
                                int amount;

                                if ( !int.TryParse( split[1], out amount ) )
                                    break;

                                if ( amount > 5000 )
                                {
                                    this.Say( 500381 ); // Thou canst not withdraw so much at one time!
                                }
                                else if ( amount > 0 )
                                {
                                    BankBox box = e.Mobile.FindBankNoCreate();

                                    if ( box == null || !Withdraw( e.Mobile, amount ) )
                                    {
                                        this.Say( 500384 ); // Ah, art thou trying to fool me? Thou hast not so much gold!
                                    }
                                    else
                                    {
                                        e.Mobile.AddToBackpack( new Gold( amount ) );

                                        this.Say( 1010005 ); // Thou hast withdrawn gold from thy account.
                                    }
                                }
                            }

                            break;
                        }
                        case 0x0001: // *balance*
                        {
                            e.Handled = true;

                            if ( e.Mobile.Criminal && !(this is CriminalBanker))
                            {
                                this.Say( 500389 ); // I will not do business with a criminal!
                                break;
                            }

                            //Added by Blady - Gold + Checks will be displayed in the Lost Lands.
                            if (SpellHelper.IsFeluccaT2A(e.Mobile.Map, e.Mobile.Location) || ( e.Mobile.Region != null && e.Mobile.Region.IsPartOf( "Khaldun" ) ) )
                            {
                                this.Say( 1042759, GetBalance(e.Mobile).ToString() ); // Thy current bank balance is ~1_AMOUNT~ gold.
                                break;
                            }

                            BankBox box = e.Mobile.FindBankNoCreate();
                            if ( box != null )
                                this.Say( 1042759, box.TotalGold.ToString() ); // Thy current bank balance is ~1_AMOUNT~ gold.
                            else
                                this.Say( 1042759, "0" ); // Thy current bank balance is ~1_AMOUNT~ gold.

                            break;
                        }
                        case 0x0002: // *bank*
                        {
                            e.Handled = true;

                            if (SpellHelper.IsFeluccaT2A(e.Mobile.Map, e.Mobile.Location) || ( e.Mobile.Region != null && e.Mobile.Region.IsPartOf( "Khaldun" ) ) )
                            {
                                this.Say("You do not have access to your bank box here. You should say \"balance\", \"withdraw\" or \"deposit\"");
                                break;
                            }
                            if ( e.Mobile.Criminal && !(this is CriminalBanker) )
                            {
                                this.Say( 500378 ); // Thou art a criminal and cannot access thy bank box.
                                break;
                            }

                            e.Mobile.BankBox.Open();

                            break;
                        }
                        case 0x0003: // *check*
                        {
                            e.Handled = true;

                            if ( e.Mobile.Criminal && !(this is CriminalBanker))
                            {
                                this.Say( 500389 ); // I will not do business with a criminal!
                                break;
                            }

                            string[] split = e.Speech.Split( ' ' );

                            if ( split.Length >= 2 )
                            {
                                int amount;

                                if ( !int.TryParse( split[1], out amount ) )
                                    break;

                                if ( amount < 5000 )
                                {
                                    this.Say( 1010006 ); // We cannot create checks for such a paltry amount of gold!
                                }
                                else if ( amount > 1000000 )
                                {
                                    this.Say( 1010007 ); // Our policies prevent us from creating checks worth that much!
                                }
                                else
                                {
                                    BankCheck check = new BankCheck( amount );

                                    BankBox box = e.Mobile.BankBox;

                                    if ( !box.TryDropItem( e.Mobile, check, false ) )
                                    {
                                        this.Say( 500386 ); // There's not enough room in your bankbox for the check!
                                        check.Delete();
                                    }
                                    else if ( !box.ConsumeTotal( typeof( Gold ), amount ) )
                                    {
                                        this.Say( 500384 ); // Ah, art thou trying to fool me? Thou hast not so much gold!
                                        check.Delete();
                                    }
                                    else
                                    {
                                        this.Say( 1042673, AffixType.Append, amount.ToString(), "" ); // Into your bank box I have placed a check in the amount of:
                                    }
                                }
                            }

                            break;
                        }
                    }
                }
            }

            base.OnSpeech( e );
        }
Пример #16
0
        public override void OnSpeech( SpeechEventArgs e )
        {
            Mobile from = e.Mobile;
            bool murderer = (Notoriety.Compute(this, this) != Notoriety.Murderer && Notoriety.Compute(this, from) == Notoriety.Murderer);

            if ( !e.Handled && e.Mobile.InRange( this.Location, 12 ) )
            {
                for ( int i = 0; i < e.Keywords.Length; ++i )
                {
                    int keyword = e.Keywords[i];

                    switch ( keyword )
                    {
                        case 0x0000: // *withdraw*
                        {
                            e.Handled = true;

                            if ( e.Mobile.Criminal || murderer )
                            {
                                this.Say( 500389 ); // I will not do business with a criminal!
                                break;
                            }

                            string[] split = e.Speech.Split( ' ' );

                            if ( split.Length >= 2 )
                            {
                                int amount;

                                try
                                {
                                    amount = Convert.ToInt32( split[1] );
                                }
                                catch
                                {
                                    break;
                                }

                                if ( amount > 5000 )
                                {
                                    this.Say( 500381 ); // Thou canst not withdraw so much at one time!
                                }
                                else if ( amount > 0 )
                                {
                                    BankBox box = e.Mobile.FindBankNoCreate();

                                    if ( box == null || !box.ConsumeTotal( typeof( Gold ), amount ) )
                                    {
                                        this.Say( 500384 ); // Ah, art thou trying to fool me? Thou hast not so much gold!
                                    }
                                    else
                                    {
                                        e.Mobile.AddToBackpack( new Gold( amount ) );

                                        this.Say( 1010005 ); // Thou hast withdrawn gold from thy account.
                                    }
                                }
                            }

                            break;
                        }
                        case 0x0001: // *balance*
                        {
                            e.Handled = true;

                            if (e.Mobile.Criminal || murderer)
                            {
                                this.Say( 500389 ); // I will not do business with a criminal!
                                break;
                            }

                            BankBox box = e.Mobile.FindBankNoCreate();

                            if ( box != null )
                                this.Say( 1042759, box.TotalGold.ToString() ); // Thy current bank balance is ~1_AMOUNT~ gold.
                            else
                                this.Say( 1042759, "0" ); // Thy current bank balance is ~1_AMOUNT~ gold.

                            break;
                        }
                        case 0x0002: // *bank*
                        {
                            e.Handled = true;

                            if (e.Mobile.Criminal || murderer)
                            {
                                this.Say( 500378 ); // Thou art a criminal and cannot access thy bank box.
                                break;
                            }

                            e.Mobile.BankBox.Open();

                            break;
                        }
                        case 0x0003: // *check*
                        {
                            e.Handled = true;

                            if (e.Mobile.Criminal || murderer)
                            {
                                this.Say( 500389 ); // I will not do business with a criminal!
                                break;
                            }

                            string[] split = e.Speech.Split( ' ' );

                            if ( split.Length >= 2 )
                            {
                                int amount;

                                try
                                {
                                    amount = Convert.ToInt32( split[1] );
                                }
                                catch
                                {
                                    break;
                                }

                                if ( amount < 5000 )
                                {
                                    this.Say( 1010006 ); // We cannot create checks for such a paltry amount of gold!
                                }
                                else if ( amount > 1000000 )
                                {
                                    this.Say( 1010007 ); // Our policies prevent us from creating checks worth that much!
                                }
                                else
                                {
                                    BankCheck check = new BankCheck( amount );

                                    BankBox box = e.Mobile.BankBox;

                                    if ( !box.TryDropItem( e.Mobile, check, false ) )
                                    {
                                        this.Say( 500386 ); // There's not enough room in your bankbox for the check!
                                        check.Delete();
                                    }
                                    else if ( !box.ConsumeTotal( typeof( Gold ), amount ) )
                                    {
                                        this.Say( 500384 ); // Ah, art thou trying to fool me? Thou hast not so much gold!
                                        check.Delete();
                                    }
                                    else
                                    {
                                        this.Say( 1042673, AffixType.Append, amount.ToString(), "" ); // Into your bank box I have placed a check in the amount of:
                                    }
                                }
                            }

                            break;
                        }
                    }
                }
            }

            base.OnSpeech( e );
        }
Пример #17
0
		public static void CashCheck(Mobile from, BankCheck check)
		{
			BankBox box = from.BankBox;

			if (box != null)
			{
				int deposited = 0;
				int toAdd = check.Worth;

				check.Delete();
				Gold gold;

				while (toAdd > 60000)
				{
					gold = new Gold(60000);

					if (box.TryDropItem(from, gold, false))
					{
						toAdd -= 60000;
						deposited += 60000;
					}
					else
					{
						gold.Delete();

						from.AddToBackpack(new BankCheck(toAdd));
						toAdd = 0;

						break;
					}
				}

				if (toAdd > 0)
				{
					gold = new Gold(toAdd);

					if (box.TryDropItem(from, gold, false))
					{
						deposited += toAdd;
					}
					else
					{
						gold.Delete();

						from.AddToBackpack(new BankCheck(toAdd));
					}
				}
			}
		}
Пример #18
0
		public override void OnSpeech( SpeechEventArgs e )
		{
			if ( !e.Handled && e.Mobile.InRange( this.Location, 12 ) )
			{
				for ( int i = 0; i < e.Keywords.Length; ++i )
				{
					int keyword = e.Keywords[i];

					switch ( keyword )
					{
						case 0x0000: // *withdraw*
						{
							e.Handled = true;

							if ( e.Mobile.Criminal )
							{
								this.Say( 500389 ); // I will not do business with a criminal!
								break;
							}

							string[] split = e.Speech.Split( ' ' );

							if ( split.Length >= 2 )
							{
								int amount;

								try
								{
									amount = Convert.ToInt32( split[1] );
								}
								catch
								{
									break;
								}

								if ( amount > 5000 )
								{
									this.Say( 500381 ); // Thou canst not withdraw so much at one time!
								}
								else if ( amount > 0 )
								{
									BankBox box = e.Mobile.BankBox;

									if ( box == null || !box.ConsumeTotal( typeof( Gold ), amount ) )
									{
										this.Say( 500384 ); // Ah, art thou trying to fool me? Thou hast not so much gold!
									}
									else
									{
										e.Mobile.AddToBackpack( new Gold( amount ) );

										this.Say( 1010005 ); // Thou hast withdrawn gold from thy account.
									}
								}
							}

							break;
						}
						case 0x0001: // *balance*
						{
							e.Handled = true;

							if ( e.Mobile.Criminal )
							{
								this.Say( 500389 ); // I will not do business with a criminal!
								break;
							}

							BankBox box = e.Mobile.BankBox;

							if ( box != null )
							{
								this.Say( 1042759, box.TotalGold.ToString() ); // Thy current bank balance is ~1_AMOUNT~ gold.
							}

							break;
						}
						case 0x0002: // *bank*
						{
							e.Handled = true;

							if ( e.Mobile.Criminal )
							{
								this.Say( 500378 ); // Thou art a criminal and cannot access thy bank box.
								break;
							}

							if (e.Mobile.Player == true)
							{
								if (e.Mobile is PlayerMobile)
								{
									PlayerMobile pm = e.Mobile as PlayerMobile;

									if (DateTime.Now - pm.LastStoleAt < TimeSpan.FromMinutes(2))
									{
										this.Say(500378); // Thou art a criminal and cannot access thy bank box.
										break;
									}

									//check that we're not actively involved in a fight:
                                    bool bBreak = false;
									for (int a = 0; a < pm.Aggressed.Count; a++)
									{
										AggressorInfo info = (AggressorInfo)pm.Aggressed[a];
                                        if (!info.Expired)
                                        {
                                            if (info.Attacker == pm && info.Defender is PlayerMobile)
                                            {
                                                this.Say("You seem to be busy to bank, come back when you're not fighting.");
                                                bBreak = true;
                                                break;
                                            }
                                        }
									}
                                    if (bBreak) break;
									
								}
							}
							BankBox box = e.Mobile.BankBox;

							if ( box != null )
								box.Open();

							break;
						}
						case 0x0003: // *check*
						{
							e.Handled = true;

							if ( e.Mobile.Criminal )
							{
								this.Say( 500389 ); // I will not do business with a criminal!
								break;
							}

							string[] split = e.Speech.Split( ' ' );

							if ( split.Length >= 2 )
							{
								int amount;

								try
								{
									amount = Convert.ToInt32( split[1] );
								}
								catch
								{
									break;
								}

								if ( amount < 5000 )
								{
									this.Say( 1010006 ); // We cannot create checks for such a paltry amount of gold!
								}
								else if ( amount > 1000000 )
								{
									this.Say( 1010007 ); // Our policies prevent us from creating checks worth that much!
								}
								else
								{
									BankCheck check = new BankCheck( amount );

									BankBox box = e.Mobile.BankBox;

									if ( box == null || !box.TryDropItem( e.Mobile, check, false ) )
									{
										this.Say( 500386 ); // There's not enough room in your bankbox for the check!
										check.Delete();
									}
									else if ( !box.ConsumeTotal( typeof( Gold ), amount ) )
									{
										this.Say( 500384 ); // Ah, art thou trying to fool me? Thou hast not so much gold!
										check.Delete();
									}
									else
									{
										this.Say( 1042673, AffixType.Append, amount.ToString(), "" ); // Into your bank box I have placed a check in the amount of:
									}
								}
							}

							break;
						}
					}
				}
			}

			base.OnSpeech( e );
		}
Пример #19
0
		public override void OnSpeech(SpeechEventArgs e)
		{
			Mobile m = e.Mobile;

			if (XmlScript.HasTrigger(this, TriggerName.onSpeech) &&
				UberScriptTriggers.Trigger(this, e.Mobile, TriggerName.onSpeech, null, e.Speech))
			{
				return;
			}

			if (!e.Handled && m.InRange(Location, 12))
			{
				string speech = e.Speech.Trim().ToLower();

				if (e.HasKeyword(0x00)) // *withdraw*
				{
					e.Handled = true;

					if (!CheckVendorAccess(m))
					{
						Say(500389); // I will not do business with a criminal!
					}
					else
					{
						string[] split = e.Speech.Split(' ');

						if (split.Length >= 2)
						{
							int amount;

							Container pack = m.Backpack;

							if (Int32.TryParse(split[1], out amount))
							{
								if (amount > 60000)
								{
									Say(500381); // Thou canst not withdraw so much at one time!
								}
								else if (amount > 0)
								{
									BankBox box = m.FindBankNoCreate();

									if (box == null || !WithdrawCredit(m, TypeOfCurrency, amount))
									{
										Say("Ah, art thou trying to fool me? Thou hast not so much {0}!", TypeOfCurrency.Name);
									}
									else
									{
										Item currency = TypeOfCurrency.CreateInstanceSafe<Item>();

										currency.Stackable = true;
										currency.Amount = amount;

										if (pack != null && !pack.Deleted && pack.TryDropItem(m, currency, false))
										{
											Say("Thou hast withdrawn {0} from thy account.", TypeOfCurrency.Name);
											//Say(1010005); // Thou hast withdrawn gold from thy account.
										}
										else
										{
											currency.Delete();

											box.Credit += (ulong)amount;

											Say(1048147); // Your backpack can't hold anything else.
										}
									}
								}
							}
						}
					}
				}
				else if (e.HasKeyword(0x01)) // *balance*
				{
					e.Handled = true;

					if (!CheckVendorAccess(m))
					{
						Say(500389); // I will not do business with a criminal!
					}
					else
					{
						BankBox box = m.FindBankNoCreate();

						if (box != null)
						{
							Say("Thy current bank balance is {0:#,0} {1}.", (ulong)GetBalance(m, TypeOfCurrency) + box.Credit, TypeOfCurrency.Name);
						}
						else
						{
							Say("Thy current bank balance is 0 {0}.", TypeOfCurrency.Name);
						}
					}
				}
				else if (e.HasKeyword(0x02)) // *bank*
				{
					e.Handled = true;

					if (!CheckVendorAccess(m))
					{
						Say(500378); // Thou art a criminal and cannot access thy bank box.
					}
					else
					{
						m.BankBox.Open();
					}
				}
				else if (e.HasKeyword(0x03)) // *check*
				{
					e.Handled = true;

					if (!CheckVendorAccess(m))
					{
						Say(500389); // I will not do business with a criminal!
					}
					else
					{
						string[] split = e.Speech.Split(' ');

						if (split.Length >= 2)
						{
							int amount;

							if (int.TryParse(split[1], out amount))
							{
								if (amount < 5000)
								{
									Say("We cannot create checks for such a paltry amount of {0}!", TypeOfCurrency.Name);
									//Say(1010006); // We cannot create checks for such a paltry amount of gold!
								}
								else if (amount > 1000000)
								{
									Say(1010007); // Our policies prevent us from creating checks worth that much!
								}
								else
								{
									var check = new BankCheck(amount);

									BankBox box = m.BankBox;

									if (!box.TryDropItem(m, check, false))
									{
										Say(500386); // There's not enough room in your bankbox for the check!
										check.Delete();
									}
									else if (!WithdrawCredit(m, TypeOfCurrency, amount))
									{
										Say("Ah, art thou trying to fool me? Thou hast not so much {0}!", TypeOfCurrency.Name);
										//Say(500384); // Ah, art thou trying to fool me? Thou hast not so much gold!
										check.Delete();
									}
									else
									{
										// Into your bank box I have placed a check in the amount of:
										Say(1042673, AffixType.Append, Utility.MoneyFormat(amount, m), "");
									}
								}
							}
						}
					}
				}
				else if (speech.IndexOf("deposit", StringComparison.Ordinal) > -1 || speech.IndexOf("credit", StringComparison.Ordinal) > -1)
				{
					e.Handled = true;

					if (!CheckVendorAccess(m))
					{
						Say(500389); // I will not do business with a criminal!
					}
					else
					{
						BankBox box = m.FindBankNoCreate();

						if (box == null || box.Items.Count == 0)
						{
							Say("Ah, art thou trying to fool me? Thou hast nothing to deposit!");
						}
						else
						{
							Item[] currency = box.FindItemsByType(TypeOfCurrency, true).ToArray();
							BankCheck[] checks = box.FindItemsByType<BankCheck>(true).ToArray();

							foreach (Item c in currency)
							{
								ulong amount = Math.Min(box.Credit + (ulong)c.Amount, BankBox.MaxCredit);
								c.Consume((int)(amount - box.Credit));
								box.Credit = amount;
							}

							foreach (BankCheck c in checks)
							{
								ulong amount = Math.Min(box.Credit + (ulong)c.Worth, BankBox.MaxCredit);
								c.ConsumeWorth((int)(amount - box.Credit));

								box.Credit = amount;
							}

							Say(
								box.Credit == BankBox.MaxCredit
									? "You have reached the maximum limit.  We do not have the facilities to deposit more {0} and bank checks."
									: "I have deposited all of the {0} and bank checks from your bank box.",
								TypeOfCurrency.Name);

							Say("You currently have {0:#,0} {1} stored in credit.", box.Credit, TypeOfCurrency.Name);
						}
					}
				}
			}

			base.OnSpeech(e);
		}