Advertisement
Rochet2

tired

Aug 20th, 2012
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "ScriptPCH.h"
  2.  
  3. const uint32 TITLEID1 = 1;
  4. const uint32 TITLEID2 = 15;
  5.  
  6. class VIP_NPC : public CreatureScript
  7. {
  8. public:
  9.     VIP_NPC() : CreatureScript("VIP_NPC") {}
  10.  
  11.     bool OnGossipHello(Player* player, Creature* creature)
  12.     {
  13.         if(player->HasTitle(sCharTitlesStore.LookupEntry(TITLEID1)) || player->HasTitle(sCharTitlesStore.LookupEntry(TITLEID2)))
  14.             player->ADD_GOSSIP_ITEM(6, "Rank 1 Vendor", GOSSIP_SENDER_MAIN, GOSSIP_OPTION_VENDOR);
  15.         player->ADD_GOSSIP_ITEM(6, "Bye", GOSSIP_SENDER_MAIN, 1);
  16.         player->PlayerTalkClass->SendGossipMenu(9452, creature->GetGUID());
  17.         return true;
  18.     }
  19.  
  20.     bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action)
  21.     {
  22.         player->PlayerTalkClass->ClearMenus();
  23.         switch (action)
  24.         {
  25.         case GOSSIP_OPTION_VENDOR:
  26.             player->GetSession()->SendListInventory(creature->GetGUID());
  27.             break;
  28.         case 1:
  29.             if(player->HasTitle(sCharTitlesStore.LookupEntry(TITLEID1)) || player->HasTitle(sCharTitlesStore.LookupEntry(TITLEID2)))
  30.                 creature->MonsterWhisper("Have fun!", player->GetGUID());
  31.             else
  32.                 creature->MonsterWhisper("You do not have enough honorable kills!", player->GetGUID());
  33.             player->CLOSE_GOSSIP_MENU();
  34.             break;
  35.         }
  36.         return true;
  37.     }
  38. };
  39.  
  40. void AddSC_VIP_NPC()
  41. {
  42.     new VIP_NPC();
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement