I have a NPC that offers players a Gump displaying items for sale (as a gold sink).
The price he charges is always Gold coins PLUS Quest Medallions. My problem is . . the NPC has been cheating players *grins*
For example the item might cost 75000 Gold coins PLUS 750 Quest Medallions. The payment must always be from their Bank Box.
If they have 75000 gold but do not have 750 medallions he will take the gold and give them nothing
If they have 750 medallions but do not have 75000 gold he will take the medallions and give them nothing
My only good news is . . if they have the correct amount of both then he will take that and give the item they want.
Here is the Response Button protion of the script that is not working correctly. I know there is something here I am missing but I am blind to it.
Can anyone see where the problem is with this?
Any help is appreciated.
*bows*
The price he charges is always Gold coins PLUS Quest Medallions. My problem is . . the NPC has been cheating players *grins*
For example the item might cost 75000 Gold coins PLUS 750 Quest Medallions. The payment must always be from their Bank Box.
If they have 75000 gold but do not have 750 medallions he will take the gold and give them nothing
If they have 750 medallions but do not have 75000 gold he will take the medallions and give them nothing
My only good news is . . if they have the correct amount of both then he will take that and give the item they want.
Here is the Response Button protion of the script that is not working correctly. I know there is something here I am missing but I am blind to it.
Code:
public override void OnResponse(NetState sender, RelayInfo info)
{
Mobile from = sender.Mobile;
BankBox bank = from.FindBankNoCreate();
if (info.ButtonID == 1)
{
if ( bank != null && ( bank.ConsumeTotal( typeof( QuestMedallion ), 750 ) ) && ( bank.ConsumeTotal( typeof( Gold ), 75000 ) ) )
{
from.AddToBackpack( new ItemBlessDeed() );
}
else
{
from.SendMessage( 0x22, "You do need 750 Medallions and 75,000 Gold Coins in your bank for that." );
}
}
Any help is appreciated.
*bows*