Advertisement
EmuDevs

EmuDevs: TrinityCore - Updated Script 2

Sep 7th, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.40 KB | None | 0 0
  1. class npc_trainerspawn : public CreatureScript
  2. {
  3. public:
  4.     npc_trainerspawn() : CreatureScript("npc_trainerspawn") { }
  5.  
  6.     bool OnGossipHello(Player* player, Creature* creature)
  7.     {
  8.         if (player->isInCombat())
  9.         {
  10.             player->PlayerTalkClass->SendCloseGossip();
  11.             creature->MonsterSay("You are in combat!", LANG_UNIVERSAL, NULL);
  12.             return true;
  13.         }
  14.  
  15.         if (player->GetMap()->IsBattlegroundOrArena())
  16.         {
  17.             player->PlayerTalkClass->SendCloseGossip();
  18.             creature->MonsterSay("You can't summon trainers while in battleground or Arena!", LANG_UNIVERSAL, NULL);
  19.             return true;
  20.         }
  21.  
  22.         creature->MonsterWhisper("Welcome dear player, please choose the trainer desired for your class.", player->GetGUID());
  23.  
  24.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Spawn your Class Trainer.", GOSSIP_SENDER_MAIN, 1);
  25.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Spawn Max Payne.", GOSSIP_SENDER_MAIN, 7);
  26.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Maybe later.", GOSSIP_SENDER_MAIN, 2);
  27.         player->PlayerTalkClass->SendGossipMenu(1, creature->GetGUID());
  28.         return true;
  29.     }
  30.  
  31.     bool OnGossipSelect(Player* player, Creature* creature, uint32 /* sender */, uint32 action)
  32.     {
  33.         player->PlayerTalkClass->ClearMenus();
  34.         switch(action)
  35.         {
  36.         case 1:
  37.             switch(player->getClass())
  38.             {
  39.             case CLASS_DEATH_KNIGHT:
  40.                 player->PlayerTalkClass->SendCloseGossip();
  41.                 player->SummonCreature(28474,player->GetPositionX() ,player->GetPositionY()+1, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,45000);
  42.                 creature->MonsterWhisper("You got your trainer, I must say farewell..", player->GetGUID());
  43.                 creature->DespawnOrUnsummon();
  44.                 break;
  45.  
  46.             case CLASS_DRUID:
  47.                 player->PlayerTalkClass->SendCloseGossip();
  48.                 player->SummonCreature(12042,player->GetPositionX() ,player->GetPositionY()+1, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,45000);
  49.                 creature->MonsterWhisper("You got your trainer, I must say farewell..", player->GetGUID());
  50.                 creature->DespawnOrUnsummon();
  51.                 break;
  52.  
  53.             case CLASS_HUNTER:
  54.                 player->PlayerTalkClass->SendCloseGossip();
  55.                 player->SummonCreature(3406,player->GetPositionX() ,player->GetPositionY()+1, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,45000);
  56.                 creature->MonsterWhisper("You got your trainer, I must say farewell..", player->GetGUID());
  57.                 creature->DespawnOrUnsummon();
  58.                 break;
  59.  
  60.             case CLASS_MAGE:
  61.                 player->PlayerTalkClass->SendCloseGossip();
  62.                 player->SummonCreature(5882,player->GetPositionX() ,player->GetPositionY()+1, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,45000);
  63.                 creature->MonsterWhisper("You got your trainer, I must say farewell..", player->GetGUID());
  64.                 creature->DespawnOrUnsummon();
  65.                 break;
  66.  
  67.             case CLASS_PALADIN:
  68.                 player->PlayerTalkClass->SendCloseGossip();
  69.                 player->SummonCreature(20406,player->GetPositionX() ,player->GetPositionY()+1, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,45000);
  70.                 creature->MonsterWhisper("You got your trainer, I must say farewell..", player->GetGUID());
  71.                 creature->DespawnOrUnsummon();
  72.                 break;
  73.  
  74.             case CLASS_PRIEST:
  75.                 player->PlayerTalkClass->SendCloseGossip();
  76.                 player->SummonCreature(6018,player->GetPositionX() ,player->GetPositionY()+1, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,45000);
  77.                 creature->MonsterWhisper("You got your trainer, I must say farewell..", player->GetGUID());
  78.                 creature->DespawnOrUnsummon();
  79.                 break;
  80.  
  81.             case CLASS_ROGUE:
  82.                 player->PlayerTalkClass->SendCloseGossip();
  83.                 player->SummonCreature(3327,player->GetPositionX() ,player->GetPositionY()+1, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,45000);
  84.                 creature->MonsterWhisper("You got your trainer, I must say farewell..", player->GetGUID());
  85.                 creature->DespawnOrUnsummon();
  86.                 break;
  87.  
  88.             case CLASS_SHAMAN:
  89.                 player->PlayerTalkClass->SendCloseGossip();
  90.                 player->SummonCreature(3344,player->GetPositionX() ,player->GetPositionY()+1, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,45000);
  91.                 creature->MonsterWhisper("You got your trainer, I must say farewell..", player->GetGUID());
  92.                 creature->DespawnOrUnsummon();
  93.                 break;
  94.  
  95.             case CLASS_WARLOCK:
  96.                 player->PlayerTalkClass->SendCloseGossip();
  97.                 player->SummonCreature(3325,player->GetPositionX() ,player->GetPositionY()+1, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,45000);
  98.                 creature->MonsterWhisper("You got your trainer, I must say farewell..", player->GetGUID());
  99.                 creature->DespawnOrUnsummon();
  100.                 break;
  101.  
  102.             case CLASS_WARRIOR:
  103.                 player->PlayerTalkClass->SendCloseGossip();
  104.                 player->SummonCreature(4593,player->GetPositionX() ,player->GetPositionY()+1, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,45000);
  105.                 creature->MonsterWhisper("You got your trainer, I must say farewell..", player->GetGUID());
  106.                 creature->DespawnOrUnsummon();
  107.                 break;
  108.             }
  109.         case 7:
  110.                 player->PlayerTalkClass->SendCloseGossip();
  111.                 player->SummonCreature(77777,player->GetPositionX() ,player->GetPositionY()+1, player->GetPositionZ(), 0,TEMPSUMMON_TIMED_DESPAWN,45000);
  112.                 creature->MonsterWhisper("Max Payne is here, I must say farewell..", player->GetGUID());
  113.                 creature->DespawnOrUnsummon();
  114.                 break;
  115.         case 2:
  116.             creature->MonsterWhisper("Please come again.", player->GetGUID());
  117.             player->PlayerTalkClass->SendCloseGossip();
  118.             creature->DespawnOrUnsummon();
  119.             break;
  120.         }
  121.         return true;
  122.     }
  123. };
  124.  
  125. void AddSC_npc_trainerspawn()
  126. {
  127.     new npc_trainerspawn();
  128. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement