Advertisement
Guest User

Untitled

a guest
Oct 17th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. #include "ScriptMgr.h"
  2. #include "World.h"
  3. #include "Player.h"
  4. #include "Item.h"
  5. #include "ScriptedGossip.h"
  6. #include "WorldSession.h"
  7. #include "GossipDef.h"
  8.  
  9.  
  10. class GossipItem : public ItemScript
  11. {
  12. public:
  13. GossipItem() : ItemScript("GossipItem") { }
  14.  
  15. bool OnUse(Player* player, Item* item, SpellCastTargets const& targets)
  16. {
  17. player->ADD_GOSSIP_ITEM(0, "|TInterface/ICONS/Ability_Marksmanship:25:25:-20|t Reset My Talents", GOSSIP_SENDER_MAIN, 1);
  18. player->PlayerTalkClass->SendGossipMenu(907, item->GetGUID());
  19. return true;
  20. }
  21.  
  22. void OnGossipSelect(Player* player, Item* item, uint32 /*sender*/, uint32 action)
  23. {
  24. player->PlayerTalkClass->ClearMenus();
  25. switch (action)
  26. case 1:
  27. {
  28. player->ResetTalents();
  29. player->CastSpell(player, 15341);
  30. player->GetSession()->SendAreaTriggerMessage("Your Talents Reseted");
  31. player->CLOSE_GOSSIP_MENU();
  32. break;
  33.  
  34. }
  35.  
  36. }
  37.  
  38. };
  39.  
  40.  
  41. void AddSC_GossipItem()
  42. {
  43. new GossipItem();
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement