casucristy

ss

Jul 19th, 2012
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.23 KB | None | 0 0
  1. From 10c1eb8a1412e3f11f7d53bc45b6793c55ecbff6 Mon Sep 17 00:00:00 2001
  2. From: unknown <cristi@cristis-PC.(none)>
  3. Date: Thu, 19 Jul 2012 19:04:03 +0300
  4. Subject: [PATCH] This will fix quests:
  5.  
  6. Pebble & Clingy
  7. ---
  8.  src/server/scripts/Maelstrom/deepholm.cpp |  103 +++++++++++++++++++++++++++++
  9.  1 file changed, 103 insertions(+)
  10.  
  11. diff --git a/src/server/scripts/Maelstrom/deepholm.cpp b/src/server/scripts/Maelstrom/deepholm.cpp
  12. index 61918b2..d6e6487 100644
  13. --- a/src/server/scripts/Maelstrom/deepholm.cpp
  14. +++ b/src/server/scripts/Maelstrom/deepholm.cpp
  15. @@ -329,6 +329,107 @@ class npc_petrified_stone_bat : public CreatureScript
  16.         }
  17.  };
  18.  
  19. +/*###
  20. +## Kor the Immovable - Peeble spawn when player has quest Peeble incomplete or rewarded
  21. +## Peelbe will be used for a long chain of quests
  22. +## Player can take it by coming here (near Kor);
  23. +####*/
  24. +
  25. +enum eKorTheImmovableEntries
  26. +{
  27. +   QUEST_PEBBLE                    =   28869,
  28. +   SPELL_SUMMON_PEBBLE             =   80665,
  29. +   NPC_PEBBLE                      =   43116
  30. +};
  31. +
  32. +class npc_kor_the_immovable : public CreatureScript
  33. +{
  34. +    public:
  35. +        npc_kor_the_immovable() : CreatureScript("npc_kor_the_immovable") { }
  36. +
  37. +       struct npc_kor_the_immovableAI : public ScriptedAI
  38. +       {
  39. +           npc_kor_the_immovableAI(Creature* creature) : ScriptedAI(creature) { }
  40. +
  41. +           void MoveInLineOfSight(Unit* who)
  42. +           {
  43. +               Player* player = who->ToPlayer();
  44. +
  45. +               if(player && (player->GetQuestStatus(QUEST_PEBBLE)==QUEST_STATUS_COMPLETE || player->IsQuestRewarded(QUEST_PEBBLE))
  46. +                               && !HasPeebleCompanion(player))
  47. +               {
  48. +                   player->CastSpell(player,SPELL_SUMMON_PEBBLE);
  49. +               }
  50. +           }
  51. +
  52. +           bool HasPeebleCompanion(Player* player)
  53. +           {
  54. +               std::list<Creature*> lMinions;
  55. +               player->GetAllMinionsByEntry(lMinions,NPC_PEBBLE);
  56. +
  57. +               if(lMinions.size() == 1 && (*lMinions.begin())->isAlive())
  58. +               {
  59. +                   return true;
  60. +               }
  61. +
  62. +               return false;
  63. +           }
  64. +
  65. +       };
  66. +
  67. +       CreatureAI* GetAI(Creature *creature) const
  68. +       {
  69. +           return new npc_kor_the_immovableAI(creature);
  70. +       }
  71. +};
  72. +
  73. +/*###
  74. +## Pebble script - support for quest Clingy
  75. +####*/
  76. +
  77. +enum ePebbleEntries
  78. +{
  79. +   QUEST_CLINGY                    =   26440,
  80. +   SPELL_CHANNELING                =   74379,
  81. +   NPC_CREDIT_BUNNY                =   43172,
  82. +   NPC_FLAYER                      =   42606,
  83. +};
  84. +
  85. +class npc_pebble : public CreatureScript
  86. +{
  87. +    public:
  88. +        npc_pebble() : CreatureScript("npc_pebble") { }
  89. +
  90. +       struct npc_pebbleAI : public ScriptedAI
  91. +       {
  92. +           npc_pebbleAI(Creature* creature) : ScriptedAI(creature) { }
  93. +
  94. +           Player* Owner;
  95. +
  96. +           void Reset()
  97. +           {
  98. +               Owner = me->GetCharmerOrOwnerPlayerOrPlayerItself();
  99. +           }
  100. +
  101. +           void UpdateAI(uint32 const diff)
  102. +           {
  103. +               if(Owner && (Owner->GetQuestStatus(QUEST_CLINGY)==QUEST_STATUS_INCOMPLETE))
  104. +               {
  105. +                   if(me->FindNearestCreature(NPC_CREDIT_BUNNY,35.0f))
  106. +                   {  
  107. +                       Owner->KilledMonsterCredit(NPC_CREDIT_BUNNY,0);
  108. +                   }
  109. +               }
  110. +           }
  111. +
  112. +       };
  113. +
  114. +       CreatureAI* GetAI(Creature *creature) const
  115. +       {
  116. +           return new npc_pebbleAI(creature);
  117. +       }
  118. +};
  119. +
  120.  void AddSC_deepholm()
  121.  {
  122.      new npc_lodestone();
  123. @@ -337,4 +438,6 @@ void AddSC_deepholm()
  124.     new npc_clues_gunship_down();
  125.     new npc_violent_gale_credit_bunny();
  126.     new npc_petrified_stone_bat();
  127. +   new npc_kor_the_immovable();
  128. +   new npc_pebble();
  129.  }
  130. --
  131. 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment