Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class VW_confirmation_test : public CreatureScript
- {
- public:
- VW_confirmation_test() : CreatureScript("VW_confirmation_test") { }
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- player->GetSession()->SendListInventory(creature->GetGUID());
- return true;
- }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) override
- {
- OnGossipHello(player, creature);
- uint64 guid = player->GetGUID();
- ShoppingCart cart = sWorld->m_VW_shopping_cart;
- ShoppingCart::const_iterator itr;
- if (cart.size() > 100)
- {
- cart.clear();
- return false;
- }
- itr = cart.find(guid);
- if (itr != cart.end())
- {
- player->AddItem(itr->second, 1);
- ChatHandler(player->GetSession()).PSendSysMessage("you confirmed buying. map size = %u", cart.size());
- cart.erase(itr);
- return true;
- }
- return false;
- }
- };
- void AddSC_confirmation_test()
- {
- new VW_confirmation_test();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement