casucristy

gqweqweasds

Jul 15th, 2012
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.86 KB | None | 0 0
  1. From 17a5e93513e74efa11c8cbfb83c6830099ac15d2 Mon Sep 17 00:00:00 2001
  2. From: unknown <cristi@cristis-PC.(none)>
  3. Date: Mon, 16 Jul 2012 01:52:45 +0300
  4. Subject: [PATCH] FixQuest Get Me Outta Here
  5.  
  6. ---
  7.  src/server/scripts/World/npcs_special.cpp |   78 +++++++++++++++++++++++++++++
  8.  1 file changed, 78 insertions(+)
  9.  
  10. diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
  11. index f6325aa..e7a849f 100644
  12. --- a/src/server/scripts/World/npcs_special.cpp
  13. +++ b/src/server/scripts/World/npcs_special.cpp
  14. @@ -3522,6 +3522,83 @@ public:
  15.      }
  16.  };
  17.  
  18. +/*######
  19. +## Support for quest Get Me Outta Here
  20. +##  NPC 39640
  21. +########*/
  22. +
  23. +enum GetMeOuttaHereEntries
  24. +{
  25. +   QUEST_GET_ME_OUTTA_HERE     =   25332,
  26. +  
  27. +   SAY_START                   =   -1559000,
  28. +   SAY_AGGRO                   =   -1559001,
  29. +   SAY_FINISH                  =   -1559002,
  30. +};
  31. +
  32. +class npc_kristoff_manheim : public CreatureScript
  33. +{
  34. +public:
  35. +    npc_kristoff_manheim() : CreatureScript("npc_kristoff_manheim") { }
  36. +
  37. +    bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
  38. +    {
  39. +        if (quest->GetQuestId() == QUEST_GET_ME_OUTTA_HERE)
  40. +        {
  41. +            if (npc_escortAI* pEscortAI = CAST_AI(npc_escortAI, creature->AI()))
  42. +            {
  43. +               pEscortAI->Start(true, false, player->GetGUID());
  44. +               DoScriptText(SAY_START,creature,player);
  45. +           }
  46. +       }
  47. +        return true;
  48. +    }
  49. +
  50. +    CreatureAI* GetAI(Creature* creature) const
  51. +    {
  52. +        return new npc_kristoff_manheimAI(creature);
  53. +    }
  54. +
  55. +    struct npc_kristoff_manheimAI : public npc_escortAI
  56. +    {
  57. +        npc_kristoff_manheimAI(Creature* creature) : npc_escortAI(creature) {}
  58. +
  59. +        void WaypointReached(uint32 waypointId)
  60. +        {
  61. +            if (Player* player = GetPlayerForEscort())
  62. +            {
  63. +                switch (waypointId)
  64. +                {
  65. +                    case 13:
  66. +                       me->SetFacingToObject(player);
  67. +                        DoScriptText(SAY_FINISH, me, player);
  68. +                       player->KilledMonsterCredit(39808,0);
  69. +                       me->DespawnOrUnsummon(15000);
  70. +                        break;
  71. +                }
  72. +            }
  73. +        }
  74. +
  75. +        void EnterCombat(Unit* who)
  76. +        {
  77. +           if(HasEscortState(STATE_ESCORT_ESCORTING))
  78. +               DoScriptText(SAY_AGGRO, me, who);
  79. +        }
  80. +
  81. +       void JustDied(Unit* killer)
  82. +        {
  83. +            if (HasEscortState(STATE_ESCORT_ESCORTING))
  84. +            {
  85. +                if (Player* player = GetPlayerForEscort())
  86. +                   player->SetQuestStatus(QUEST_GET_ME_OUTTA_HERE,QUEST_STATUS_FAILED);
  87. +            }
  88. +        }
  89. +
  90. +        void Reset() {}
  91. +    };
  92. +
  93. +};
  94. +
  95.  void AddSC_npcs_special()
  96.  {
  97.      new npc_air_force_bots;
  98. @@ -3560,4 +3637,5 @@ void AddSC_npcs_special()
  99.      new npc_power_word_barrier;
  100.      new npc_shadowy_apparition;
  101.     new npc_crucible_of();
  102. +   new npc_kristoff_manheim();
  103.  }
  104. --
  105. 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment