Confirm Purchase

Hey All; I was hoping someone could help me understand how to create a confirmation pop up when a user goes to buy something with a custom token;

This way when user goes to buy an item it will confirm the purchase amount of tokens the same way it would if you were buying something from a Badge Quartermaster. Thanks in advance.

You can’t do that with a vendor.

Really… Is it item specific then?

it’s only able with a gossip option

Okay; that’s what I thought, so for my Gossip_Changer with

TOKEN_ID = 37711,
RACE_CHANGE_TOKENS_REQUIRED = 7,
FACTION_CHANGE_TOKENS_REQUIRED = 10,
NAME_CHANGE_TOKENS_REQUIRED = 7,
GET_GOLD_TOKENS_REQUIRED = 10,
GET_LEVEL_TOKENS_REQUIRED = 1,

};

class Gossip_Changer : public CreatureScript
{
public:
Gossip_Changer() : CreatureScript(“Gossip_Changer”){}

bool OnGossipHello(Player * pPlayer, Creature * pCreature)
{
pPlayer->ADD_GOSSIP_ITEM(1, “Change my race [125 Tokens]”, GOSSIP_SENDER_MAIN, 0);
pPlayer->ADD_GOSSIP_ITEM(1, “Change my faction [250 Tokens]”, GOSSIP_SENDER_MAIN, 1);
pPlayer->ADD_GOSSIP_ITEM(1, “Change my name [50 Tokens]”, GOSSIP_SENDER_MAIN, 2);
pPlayer->ADD_GOSSIP_ITEM(1, “Make it Rain [250 Tokens]”, GOSSIP_SENDER_MAIN, 3);
//pPlayer->ADD_GOSSIP_ITEM(1, “Level Up [250 Tokens]”, GOSSIP_SENDER_MAIN, 4);
pPlayer->PlayerTalkClass->SendGossipMenu(27853, pCreature->GetGUID());
return true;
}

bool OnGossipSelect(Player * Player, Creature * Creature, uint32 /uiSender/, uint32 uiAction)
{
if(!Player)
return true;

WorldSession * m_session = Player->GetSession();

switch(uiAction)
{
case 0:
if(Player->HasItemCount(TOKEN_ID, RACE_CHANGE_TOKENS_REQUIRED))
{
Player->DestroyItemCount(TOKEN_ID, RACE_CHANGE_TOKENS_REQUIRED, true, false);
Player->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
CharacterDatabase.PExecute(“UPDATE characters SET at_login = at_login | ‘128’ WHERE guid = %u”, (Player->GetGUID()));
m_session->SendNotification(“Relog. You will be prompted on your next login.”);
Player->PlayerTalkClass->SendCloseGossip();

}
else
{
m_session->SendNotification(“You don’t have enough Doxramos PVP Tokens”);
Player->PlayerTalkClass->SendCloseGossip();
}
The Level Req is changed to say 20 Tokens, so when they kill 20 players they can buy a level or buy gold; I’m trying to script it to where instead of

if(Player->HasItemCount(TOKEN_ID, RACE_CHANGE_TOKENS_REQUIRED))
{
Player->DestroyItemCount(TOKEN_ID, RACE_CHANGE_TOKENS_REQUIRED, true, false);
Player->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '128' WHERE guid = %u", (Player->GetGUID()));
m_session->SendNotification("Relog. You will be prompted on your next login.");
Player->PlayerTalkClass->SendCloseGossip();

Being ran; it would instead run the script to open a confirmation window on the exchange and then run the script above if they click okay; Does that make any sense?