Advertisement
Kaev

CreatureScript Gossip Template

Jun 9th, 2015
617
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. /*
  2. CreatureScript Gossip Template by Kaev
  3. Made for MMONerds.com, Modcraft.io and MCore.cc
  4. */
  5.  
  6. class gossipTemplate : public CreatureScript
  7. {
  8. public:
  9.     gossipTemplate() : CreatureScript("gossipTemplate") { } // CreatureScript("gossipTemplate") = Name of database entry
  10.  
  11.     bool OnGossipHello(Player* player, Creature* creature) override
  12.     {
  13.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "First entry", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
  14.         player->SEND_GOSSIP_MENU(1, creature->GetGUID());
  15.         return true;
  16.     }
  17.  
  18.     bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 actions) override
  19.     {
  20.         if (actions == GOSSIP_ACTION_INFO_DEF+1)
  21.         {
  22.             player->CLOSE_GOSSIP_MENU();
  23.         }
  24.         return true;
  25.     }
  26. };
  27.  
  28. void AddSC_gossipTemplate() // Add this to the ScriptLoader
  29. {
  30.     new gossipTemplate();
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement