casucristy

ss

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