Advertisement
EmuDevs

EmuDevs: TrinityCore - Item Gossip

Sep 1st, 2013
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.95 KB | None | 0 0
  1. /*
  2.  *╔═╦═╦═╦╦╦══╦═╦╗─╔╦══╗
  3.  *║╦╣║║║║║╠╗╗║╦╣╚╦╝║══╣
  4.  *║╩╣║║║║║╠╩╝║╩╬╗║╔╬══║
  5.  *╚═╩╩═╩╩═╩══╩═╝╚═╝╚══╝
  6.  *            http://emudevs.com
  7. */
  8. class item_gossip : public ItemScript
  9. {
  10. public:
  11.     item_gossip() : ItemScript("item_gossip") { }
  12.    
  13.     bool OnUse(Player* player, Item* item, SpellCastTargets const & /* targets */) OVERRIDE
  14.     {
  15.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Test", GOSSIP_SENDER_MAIN, 1);
  16.     player->SEND_GOSSIP_MENU(1, item->GetGUID());
  17.     return true;
  18.     }
  19.    
  20.     void OnGossipSelect(Player* player, Item* item, uint32 /* sender */, uint32 actions) OVERRIDE
  21.     {
  22.     player->PlayerTalkClass->ClearMenus();
  23.        
  24.     if (actions == 1)
  25.             player->GetSession()->SendNotification("MENU ONE");
  26.     return;
  27.     }
  28. };
  29.  
  30. void AddSC_gossip()
  31. {
  32.     new item_gossip;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement