Okay so this is what I have so far. It *works* decently. Im more of a webdev so my C++ coding style might be bad idk please dont hate xD.
I managed to force the client auto-click that single option so confirmbox automagically pops up but what I couldn't keep track of was the link between what the player (buyer), what he wants to buy (item) and whether he confirms or not. So I added a new public property to the World class (an std::map that links player's guid to item's entryid. Then in OnGossipSelect I retrieve the item's entryid and give it to the player (based on his guid).
World.h modifications - http://pastebin.com/ySiD3Z5i
Player.cpp modifications - http://pastebin.com/DXFvwGnf
Vendor script - http://pastebin.com/DEVuguVE
Oh and I also added this in SharedDefines.h (because I couldn't figure out how to use the already existing codes, they are defined as uint32 hex and I just get mindfucked when I see hex)
const std::string ItemQualityColorsString[MAX_ITEM_QUALITY] =
"ffffffff", //normal white
So now my only problem is that client won't let vendor/gossip windows to show up at the same time. When you try to buy something, the vendor window closes and the confirmation pops up. If you accept, the window opens again (Im calling OnGossipHello in OnGossipSelect) but if you click NO then it just disappears but no vendor windows shows up, it just freezes like that and you have to get away from the vendor to make it completely close ...
If you have anymore tips or anyone else has please share. Thanks a lot