Advertisement
Faded

Untitled

Jul 13th, 2012
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.48 KB | None | 0 0
  1. /*
  2.     For: Criticism
  3.     By: Faded
  4. */
  5.  
  6. #include "ScriptPCH.h"
  7.  
  8. class crit_npc : public CreatureScript
  9. {
  10.     public:
  11.         crit_npc()
  12.             : CreatureScript("crit_npc"){}
  13.            
  14.             bool OnGossipHello(Player* player, Creature* creature)
  15.             {
  16.                 player->ADD_GOSSIP_ITEM(9, "Level 1", GOSSIP_SENDER_MAIN, 2);
  17.                 player->ADD_GOSSIP_ITEM(9, "Level 10", GOSSIP_SENDER_MAIN, 3);
  18.                 player->ADD_GOSSIP_ITEM(9, "Level 19", GOSSIP_SENDER_MAIN, 4);
  19.                 player->PlayerTalkClass->SendGossipMenu(1, creature->GetGUID());
  20.                 return true;
  21.             }
  22.            
  23.             bool OnGossipSelect(Player* player, Creature* creature, uint32 Sender, uint32 Actions)
  24.             {
  25.                  player->PlayerTalkClass->ClearMenus();
  26.  
  27.                 if (player->isInCombat())
  28.                 {
  29.                     creature->MonsterWhisper("You're in combat.",   player->GetGUID());
  30.                     return false;
  31.                 }
  32.                
  33.                 if(Sender == GOSSIP_SENDER_MAIN)
  34.                 {
  35.                     switch(Actions)
  36.                     {  
  37.                         case 2:
  38.                             player->TeleportTo(map, xf, yf, zf, of);
  39.                             player->PlayerTalkClass->SendCloseGossip();
  40.                         break;
  41.                        
  42.                         case 3:
  43.                             player->TeleportTo(map, xf, yf, zf, of);
  44.                             player->SetLevel(10);
  45.                             player->SaveToDB();
  46.                             player->PlayerTalkClass->SendCloseGossip();
  47.                         break;
  48.                        
  49.                         case 4:
  50.                             player->TeleportTo(map, xf, yf, zf, of);
  51.                             player->SetLevel(19);
  52.                             player->SaveToDB();
  53.                             player->PlayerTalkClass->SendCloseGossip();
  54.                         break;
  55.                     }
  56.                 }
  57.             return true;
  58. };
  59.  
  60. void AddSC_crit_npc()
  61. {
  62.     new crit_npc();
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement