Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- class Innkeep : public CreatureScript
- {
- public:
- Innkeep() : CreatureScript("Innkeep") { }
- bool OnGossipHello(Player * pPlayer, Creature * pCreature)
- {
- pPlayer->ADD_GOSSIP_ITEM(6, "Purchase Goods.", GOSSIP_SENDER_MAIN, 0);
- pPlayer->ADD_GOSSIP_ITEM(10, "Nevermind.", GOSSIP_SENDER_MAIN, 2);
- pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID());
- }
- }
- bool OnGossipSelect(Player * player, Creature * creature, uint32 sender, uint32 uiAction)
- {
- int random;
- random = rand() % 100 + 1;
- if (sender == GOSSIP_SENDER_MAIN)
- {
- switch(uiAction)
- {
- case 0:
- if (random < 26)
- {
- player->GetSession()->SendListInventory(creature->GetGUID());
- }
- else
- {
- player->CLOSE_GOSSIP_MENU();
- creature->setFaction(14);
- creature->Attack(player, true);
- }
- break;
- case 2:
- player->CLOSE_GOSSIP_MENU();
- break;
- }
- }
- };
- void AddSC_Innkeep()
- {
- new Innkeep();
- }
Advertisement
Add Comment
Please, Sign In to add comment