Advertisement
Rochet2

Eatos Gossip Exmaple

Oct 3rd, 2012
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class LoveBoat_Gossip : public CreatureScript
  2. {
  3. public:
  4.     LoveBoat_Gossip() : CreatureScript("LoveBoat_Gossip") { }
  5.  
  6.     bool OnGossipHello(Player* player, Creature* creature)
  7.     {
  8.         player->ADD_GOSSIP_ITEM(0, "Fly to the Chimaera spot", GOSSIP_SENDER_MAIN, 1); // See http://www.trinitycore.org/f/topic/6320-single-gossip-item/#entry46494 on how to make single gossip menu item work
  9.         player->ADD_GOSSIP_ITEM(0, "asd", GOSSIP_SENDER_MAIN, 0); // using 2 for now.
  10.         player->SEND_GOSSIP_MENU(40002, creature->GetGUID()); // 40002 was textID right?
  11.  
  12.         return true;
  13.     }
  14.  
  15.     bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action)
  16.     {
  17.         player->PlayerTalkClass->ClearMenus();
  18.         switch(action)
  19.         {
  20.         case 0:
  21.             player->CLOSE_GOSSIP_MENU(); break;
  22.         case 1:
  23.             {
  24.                 if (player->getClass() != CLASS_WARRIOR)  // Gets the class WARRIOR
  25.                     player->ADD_GOSSIP_ITEM(2, "You must be a Warrior to learn Warrior spells.", GOSSIP_SENDER_MAIN, 0);
  26.                 else
  27.                     player->ADD_GOSSIP_ITEM(0, "Teach me my spells!", GOSSIP_SENDER_MAIN, 2); // Warrior Spells Only
  28.                 player->ADD_GOSSIP_ITEM(0, "asd", GOSSIP_SENDER_MAIN, 0); // using 2 for now.
  29.                 player->SEND_GOSSIP_MENU(1, creature->GetGUID());
  30.             }break;
  31.  
  32.         }
  33.     return true;
  34.     }
  35. };
  36.  
  37. void AddSC_YourScript()
  38. {
  39.     new LoveBoat_Gossip();
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement