fix: Fixes bank box withdraw using account gold (#671)

Fixes various locations where account gold is not used.
This commit is contained in:
Kamron Batman 2021-08-02 19:23:25 -07:00 committed by GitHub
parent 677e44d35f
commit 3dc406624e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 28 deletions

View file

@ -161,22 +161,14 @@ namespace Server.Engines.Quests.Collector
return;
}
if (player.Backpack?.ConsumeTotal(typeof(Gold), 10) == true)
if (player.Backpack?.ConsumeTotal(typeof(Gold), 10) == true || Banker.Withdraw(player, 10))
{
obj.Complete();
}
else
{
if (player.FindBankNoCreate()?.ConsumeTotal(typeof(Gold), 10) == true)
{
obj.Complete();
}
else
{
player.SendLocalizedMessage(
1055108
); // You don't have enough gold to buy the sheet music.
}
// You don't have enough gold to buy the sheet music.
player.SendLocalizedMessage(1055108);
}
}
}

View file

@ -5,6 +5,7 @@ using System.Text;
using Server.Accounting;
using Server.ContextMenus;
using Server.Gumps;
using Server.Mobiles;
using Server.Network;
using Server.Regions;
@ -518,7 +519,7 @@ namespace Server.Items
Container bank = from.FindBankNoCreate();
if (m_TicketPrice == 0 || from.Backpack?.ConsumeTotal(typeof(Gold), m_TicketPrice) == true ||
bank?.ConsumeTotal(typeof(Gold), m_TicketPrice) == true)
Banker.Withdraw(from, m_TicketPrice))
{
Entries.Add(new RaffleEntry(from));

View file

@ -280,15 +280,7 @@ namespace Server.Mobiles
}
}
public override bool HandlesOnSpeech(Mobile from)
{
if (from.InRange(Location, 12))
{
return true;
}
return base.HandlesOnSpeech(from);
}
public override bool HandlesOnSpeech(Mobile from) => from.InRange(Location, 12) || base.HandlesOnSpeech(from);
public override void OnSpeech(SpeechEventArgs e)
{
@ -441,11 +433,11 @@ namespace Server.Mobiles
else
{
Say(
1042673,
1042673, // Into your bank box I have placed a check in the amount of:
AffixType.Append,
amount.ToString(),
""
); // Into your bank box I have placed a check in the amount of:
);
}
}
}

View file

@ -230,8 +230,7 @@ namespace Server.Mobiles
if (!bought && totalCost >= 2000)
{
cont = buyer.FindBankNoCreate();
if (cont?.ConsumeTotal(typeof(Gold), totalCost) == true)
if (Banker.Withdraw(buyer, totalCost))
{
bought = true;
fromBank = true;

View file

@ -181,7 +181,7 @@ namespace Server.Mobiles
Container bank = from.FindBankNoCreate();
if (!(from.Backpack?.GetAmount(typeof(Gold)) >= 30) &&
!(bank?.GetAmount(typeof(Gold)) >= 30))
!(Banker.GetBalance(from) >= 30))
{
SayTo(from, 1042556); // Thou dost not have enough gold, not even in thy bank account.
}
@ -246,8 +246,7 @@ namespace Server.Mobiles
{
Container bank = from.FindBankNoCreate();
if (from.Backpack?.ConsumeTotal(typeof(Gold), 30) == true ||
bank?.ConsumeTotal(typeof(Gold), 30) == true)
if (from.Backpack?.ConsumeTotal(typeof(Gold), 30) == true || Banker.Withdraw(from, 30))
{
pet.ControlTarget = null;
pet.ControlOrder = OrderType.Stay;