Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.37 KB | None | 0 0
  1. /* npc_ranshalla Escort quest by Joseph*/
  2.  
  3. #include "precompiled.h"
  4. #include "escort_ai.h"
  5.  
  6. enum
  7. {
  8.     QUEST_GUARDIANS     = 5,
  9.     SAY_ASD             = -1999958
  10. };
  11.  
  12. struct MANGOS_DLL_DECL npc_ranshallaAI : public npc_escortAI
  13. {
  14.         npc_ranshallaAI(Creature* pCreature) : npc_escortAI(pCreature) {Reset();}
  15.  
  16.             void WaypointReached(uint32 uiPointId)
  17.     {
  18.         Player* pPlayer = GetPlayerForEscort();
  19.  
  20.         if (!pPlayer)
  21.             return;
  22.  
  23.         void WaypointReached(uint32 uiPointId)
  24.     {
  25.         switch(uiPointId)
  26.         {
  27.                     case 100: DoScriptText(SAY_ASD, m_creature, pPlayer); break;
  28.         }
  29.         }
  30. };
  31.  
  32. bool QuestAccept_npc_ranshalla(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
  33. {
  34.     if (pQuest->GetQuestId() == QUEST_GUARDIANS)
  35.     {
  36.         pCreature->setFaction(FACTION_ESCORT_N_NEUTRAL_PASSIVE);
  37.  
  38.         if (npc_ranshallaAI* pEscortAI = dynamic_cast<npc_ranshallaAI*>(pCreature->AI()))
  39.             pEscortAI->Start(false, pPlayer->GetGUID(), pQuest, true);
  40.     }
  41.     return true;
  42. }
  43.  
  44. CreatureAI* GetAI_npc_ranshalla(Creature* pCreature)
  45. {
  46.     return new npc_ranshallaAI(pCreature);
  47. }
  48.  
  49. void AddSC_npc_ranshalla()
  50. {
  51.     Script * newscript;
  52.  
  53.     newscript = new Script;
  54.     newscript->Name = "npc_ranshalla";
  55.     newscript->GetAI = &GetAI_npc_ranshalla;
  56.     newscript->pQuestAccept = &QuestAccept_npc_ranshalla;
  57.     newscript->RegisterSelf();
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement