randy336

[Trinity] Ingame Support NPC

Mar 16th, 2013
2,131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.93 KB | None | 0 0
  1. /*
  2. <--------------------------------------------------------------------------->
  3.  - Developer(s): Ghostcrawler336
  4.  - Complete: %100
  5.  - ScriptName: 'Ingame Support NPC(npc_info)'
  6.  - Comment: N/A
  7. <--------------------------------------------------------------------------->
  8. */
  9. #include "ScriptPCH.h"
  10.  
  11. class npc_info : public CreatureScript
  12. {
  13.     public:
  14.         npc_info() : CreatureScript("npc_info")
  15.         {
  16.         }
  17.  
  18.         bool OnGossipHello(Player * pPlayer, Creature * pCreature)
  19.         {
  20.             pPlayer->ADD_GOSSIP_ITEM(4, "How do I get gold?", GOSSIP_SENDER_MAIN, 0);
  21.             pPlayer->ADD_GOSSIP_ITEM(4, "How do I make a ticket?", GOSSIP_SENDER_MAIN, 1);
  22.             pPlayer->ADD_GOSSIP_ITEM(4, "How do I gear up?", GOSSIP_SENDER_MAIN, 2);
  23.             pPlayer->ADD_GOSSIP_ITEM(0, "Nevermind...", GOSSIP_SENDER_MAIN, 3);
  24.             pPlayer->PlayerTalkClass->SendGossipMenu(9425, pCreature->GetGUID());
  25.             return true;
  26.         }
  27.  
  28.         bool OnGossipSelect(Player * Player, Creature * Creature, uint32 /*uiSender*/, uint32 uiAction)
  29.         {
  30.             if(!Player)
  31.                 return true;
  32.            
  33.             switch(uiAction)
  34.             {
  35.                 case 0: // This case will send the support message for "How Do I get Gold?"
  36.                     {
  37.                         ChatHandler(Player->GetSession()).PSendSysMessage("Message Here", Player->GetName());
  38.                         Player->PlayerTalkClass->SendCloseGossip();
  39.                     }break;
  40.                 case 1: // This case will send the support message for "How Do I Make A Ticket?
  41.                     {
  42.  
  43.                         ChatHandler(Player->GetSession()).PSendSysMessage("Message Here", Player->GetName());
  44.                         Player->PlayerTalkClass->SendCloseGossip();
  45.                     }break;
  46.                 case 2: // This case will send the support message for "How Do I Gear Up?"
  47.                     {
  48.                         ChatHandler(Player->GetSession()).PSendSysMessage("Message Here", Player->GetName());
  49.                         Player->PlayerTalkClass->SendCloseGossip();
  50.                     }break;
  51.                 case 3:
  52.                     {
  53.                         Player->PlayerTalkClass->SendCloseGossip();
  54.                     }break;
  55.             }
  56.             return true;
  57.         }
  58.  
  59. };
  60.  
  61. void AddSC_npc_info()
  62. {
  63.     new npc_info();
  64. }
Advertisement
Add Comment
Please, Sign In to add comment