Guest User

Untitled

a guest
Feb 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2. #include <cstring>
  3.  
  4. class example_gossip_codebox : public CreatureScript
  5. {
  6. public:
  7.  
  8. example_gossip_codebox()
  9. : CreatureScript("example_gossip_codebox")
  10. {
  11. }
  12.  
  13. bool OnGossipHello(Player* player, Creature* creature)
  14. {
  15. player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport me to GM Island" , GOSSIP_SENDER_MAIN, 1001);
  16. player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport me to Nagrand Arena" , GOSSIP_SENDER_MAIN, 1002);
  17.  
  18. player->PlayerTalkClass->SendGossipMenu(907, creature->GetGUID());
  19.  
  20. return true;
  21. }
  22.  
  23. bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
  24. {
  25. player->PlayerTalkClass->ClearMenus();
  26. if(player->IsInCombat())
  27. return;
  28.  
  29. switch(uiAction)
  30. {
  31. case 1001:
  32. player->TeleportTo(571, 5769.364544, 2034.640015, -345.756989, 5.276150, 0);
  33. break;
  34. case 1002:
  35. player->TeleportTo(530, -2044.446289, 6652.702148, 13.053578, 2.011447, 0);
  36. break;
  37. }
  38.  
  39. return true;
  40. }
  41. };
  42.  
  43. void AddSC_example_gossip_codebox()
  44. {
  45. new example_gossip_codebox();
  46. }
Add Comment
Please, Sign In to add comment