MichaelCrow

[trinity] Innkeeper

Jun 8th, 2012
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.98 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2.  
  3. class Innkeep : public CreatureScript
  4.       {
  5.             public:
  6.             Innkeep() : CreatureScript("Innkeep") { }
  7.      
  8.             bool OnGossipHello(Player * pPlayer, Creature * pCreature)
  9.             {
  10.                 pPlayer->ADD_GOSSIP_ITEM(6, "Browse my goods", GOSSIP_SENDER_MAIN, 0);
  11.                 pPlayer->ADD_GOSSIP_ITEM(0, "Make this inn your home.", GOSSIP_SENDER_MAIN, 1);
  12.                 pPlayer->ADD_GOSSIP_ITEM(10, "Bye", GOSSIP_SENDER_MAIN, 2);
  13.                 pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID());
  14.             }
  15. }
  16.     bool OnGossipSelect(Player * player, Creature * creature, uint32 sender, uint32 uiAction)
  17.     {
  18.         if (sender == GOSSIP_SENDER_MAIN)
  19.         {
  20.             switch(uiAction)
  21.             {
  22.             case 0:
  23.                 player->GetSession()->SendListInventory(creature->GetGUID());
  24.                 break;
  25.             case 1:
  26.                 player->SetBindPoint(creature->GetGUID());
  27.                 break;
  28.             case 2:
  29.                 player->CLOSE_GOSSIP_MENU();
  30.                 break;
  31.             }
  32.         }
  33.     };
  34.  
  35. void AddSC_Innkeep()
  36. {
  37.     new Innkeep();
  38. }
Advertisement
Add Comment
Please, Sign In to add comment