casucristy

ss

Jul 26th, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.36 KB | None | 0 0
  1. From 7b31ff39481e47517efdfaedde29603ad22c2ddd Mon Sep 17 00:00:00 2001
  2. From: unknown <cristi@cristis-PC.(none)>
  3. Date: Fri, 27 Jul 2012 01:57:34 +0300
  4. Subject: [PATCH] Fix quest Lost in Deeps
  5.  
  6. ---
  7.  src/server/scripts/Maelstrom/deepholm.cpp |   97 +++++++++++++++++++++++++++++
  8.  1 file changed, 97 insertions(+)
  9.  
  10. diff --git a/src/server/scripts/Maelstrom/deepholm.cpp b/src/server/scripts/Maelstrom/deepholm.cpp
  11. index f87ae1c..9957d20 100644
  12. --- a/src/server/scripts/Maelstrom/deepholm.cpp
  13. +++ b/src/server/scripts/Maelstrom/deepholm.cpp
  14. @@ -1511,6 +1511,102 @@ public:
  15.         }
  16.  };
  17.  
  18. +/*####
  19. +## Support for quest Lot in the Deeps
  20. +##########*/
  21. +
  22. +enum eLostInTheDeeps
  23. +{
  24. +   QUEST_LOST_IN_THE_DEEPS             =   26710,
  25. +   NPC_FOLLOWER_PEBBLE                 =   49956,
  26. +   SPELL_BIG_BLUE_ARROW_MARK           =   87864,
  27. +   NPC_CRUMBLING_DEPTHS_ENTRANCE_01    =   44282
  28. +};
  29. +
  30. +#define PEBBLE_FOLLOWER_GOSSIP     "Let's get out of here. Follow me!"
  31. +
  32. +class npc_pebble_follower : public CreatureScript
  33. +{
  34. +    public:
  35. +        npc_pebble_follower() : CreatureScript("npc_pebble_follower") { }
  36. +
  37. +       bool OnGossipHello(Player* player, Creature* creature)
  38. +       {
  39. +           if(player->GetQuestStatus(QUEST_LOST_IN_THE_DEEPS)==QUEST_STATUS_INCOMPLETE)
  40. +               player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, PEBBLE_FOLLOWER_GOSSIP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
  41. +      
  42. +           player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
  43. +           return true;
  44. +       }
  45. +
  46. +       bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
  47. +       {
  48. +           player->PlayerTalkClass->ClearMenus();
  49. +           player->CLOSE_GOSSIP_MENU();
  50. +
  51. +           if (npc_pebble_follower::npc_pebble_followerAI* pPebble = CAST_AI(npc_pebble_follower::npc_pebble_followerAI, creature->AI()))
  52. +               pPebble->StartFollow(player);
  53. +
  54. +           return true;
  55. +       }
  56. +
  57. +       struct npc_pebble_followerAI : public FollowerAI
  58. +       {
  59. +           npc_pebble_followerAI(Creature* creature) : FollowerAI(creature) { }
  60. +          
  61. +           void Reset()
  62. +           {
  63. +               me->SetFlag(UNIT_NPC_FLAGS,UNIT_NPC_FLAG_GOSSIP);
  64. +               me->CastSpell(me,SPELL_BIG_BLUE_ARROW_MARK);
  65. +           }
  66. +           void MoveInLineOfSight(Unit* who)
  67. +           {
  68. +               FollowerAI::MoveInLineOfSight(who);
  69. +
  70. +               if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_CRUMBLING_DEPTHS_ENTRANCE_01)
  71. +               {
  72. +                   if (me->IsWithinDistInMap(who, 25.0f))
  73. +                   {
  74. +                       DoComplete();
  75. +                   }
  76. +               }
  77. +           }
  78. +
  79. +           void DoComplete()
  80. +           {
  81. +               if (Player* player = GetLeaderForFollower())
  82. +               {
  83. +                   if (player->GetQuestStatus(QUEST_LOST_IN_THE_DEEPS) == QUEST_STATUS_INCOMPLETE)
  84. +                       player->KilledMonsterCredit(NPC_FOLLOWER_PEBBLE,0);
  85. +               }
  86. +
  87. +               SetFollowComplete();
  88. +           }
  89. +
  90. +           void UpdateFollowerAI(const uint32 uiDiff)
  91. +           {
  92. +               if(Player* player = GetLeaderForFollower())
  93. +               {
  94. +                   if(me->GetDistance(player) > 75.0f)
  95. +                   {
  96. +                       me->DespawnOrUnsummon();
  97. +                       return;
  98. +                   }
  99. +               }
  100. +
  101. +               if (!UpdateVictim())
  102. +                   return;
  103. +
  104. +               DoMeleeAttackIfReady();
  105. +           }
  106. +       };
  107. +
  108. +       CreatureAI* GetAI(Creature* creature) const
  109. +       {
  110. +           return new npc_pebble_followerAI(creature);
  111. +       }
  112. +};
  113. +
  114.  void AddSC_deepholm()
  115.  {
  116.      new npc_lodestone();
  117. @@ -1538,4 +1634,5 @@ void AddSC_deepholm()
  118.     new spell_earthen_ring_proclamation();
  119.     new npc_ricket_ticker();
  120.     new npc_earthen_ring_shaman();
  121. +   new npc_pebble_follower();
  122.  }
  123. --
  124. 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment