Advertisement
Guest User

Untitled

a guest
Aug 19th, 2012
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  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) ||
  14. player->HasTitle(sCharTitlesStore.LookupEntry(TITLEID2)))
  15. player->ADD_GOSSIP_ITEM(6, "Rank 1 Vendor", GOSSIP_SENDER_MAIN, GOSSIP_OPTION_VENDOR);
  16. player->ADD_GOSSIP_ITEM(6, "Bye", GOSSIP_SENDER_MAIN, 1);
  17. player->PlayerTalkClass->SendGossipMenu(9452, creature->GetGUID());
  18. return true;
  19. }
  20.  
  21. bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action)
  22. {
  23. player->PlayerTalkClass->ClearMenus();
  24. switch (action)
  25. {
  26. case GOSSIP_OPTION_VENDOR:
  27. player->GetSession()->SendListInventory(creature->GetGUID());
  28. break;
  29. case 1:
  30. if(player->HasTitle(sCharTitlesStore.LookupEntry(TITLEID)))
  31. creature->MonsterWhisper("Have fun!", player->GetGUID());
  32. else
  33. creature->MonsterWhisper("You do not have enough honorable kills!", player->GetGUID());
  34. player->CLOSE_GOSSIP_MENU();
  35. break;
  36. }
  37. return true;
  38. }
  39. };
  40.  
  41. void AddSC_VIP_NPC()
  42. {
  43. new VIP_NPC();
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement