casucristy

ss

Jul 24th, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.60 KB | None | 0 0
  1. From a6244a116fc63409b178736fe291386c86565c83 Mon Sep 17 00:00:00 2001
  2. From: unknown <cristi@cristis-PC.(none)>
  3. Date: Tue, 24 Jul 2012 13:22:41 +0300
  4. Subject: [PATCH] Fix talents: Blood of North,Reaping,DeathRuneMastery-Dk
  5.  
  6. Fix quest: Underground Economy
  7. ---
  8.  src/server/game/Entities/Unit/Unit.cpp    |   50 +++++++++++++++++++
  9.  src/server/scripts/Maelstrom/deepholm.cpp |   76 +++++++++++++++++++++++++++++
  10.  2 files changed, 126 insertions(+)
  11.  
  12. diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
  13. index f0c1c35..21e69b1 100644
  14. --- a/src/server/game/Entities/Unit/Unit.cpp
  15. +++ b/src/server/game/Entities/Unit/Unit.cpp
  16. @@ -8439,6 +8439,56 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp
  17.          }
  18.          case SPELLFAMILY_DEATHKNIGHT:
  19.          {
  20. +           //blood of north || reaping || death rune mastery
  21. +           if (dummySpell->SpellIconID == 3041 || dummySpell->SpellIconID == 22 || dummySpell->SpellIconID == 2622)
  22. +            {
  23. +                *handled = true;
  24. +                // Convert recently used Blood Rune to Death Rune
  25. +                if (Player* player = ToPlayer())
  26. +                {
  27. +                    if (player->getClass() != CLASS_DEATH_KNIGHT)
  28. +                        return false;
  29. +
  30. +                    RuneType rune = ToPlayer()->GetLastUsedRune();
  31. +
  32. +                    AuraEffect* aurEff = triggeredByAura->GetEffect(EFFECT_0);
  33. +                    if (!aurEff)
  34. +                        return false;
  35. +
  36. +                    aurEff->ResetPeriodic(true);
  37. +                    uint32 runesLeft;
  38. +
  39. +                    if (dummySpell->SpellIconID == 2622)
  40. +                        runesLeft = 2;
  41. +                    else
  42. +                        runesLeft = 1;
  43. +
  44. +                    for (uint8 i = 0; i < MAX_RUNES && runesLeft; ++i)
  45. +                    {
  46. +                        if (dummySpell->SpellIconID == 2622)
  47. +                        {
  48. +                            if (player->GetCurrentRune(i) == RUNE_DEATH ||
  49. +                                player->GetBaseRune(i) == RUNE_BLOOD)
  50. +                                continue;
  51. +                        }
  52. +                        else
  53. +                        {
  54. +                            if (player->GetCurrentRune(i) == RUNE_DEATH ||
  55. +                                player->GetBaseRune(i) != RUNE_BLOOD)
  56. +                                continue;
  57. +                        }
  58. +                        if (player->GetRuneCooldown(i) != player->GetRuneBaseCooldown(i))
  59. +                            continue;
  60. +
  61. +                        --runesLeft;
  62. +                        // Mark aura as used
  63. +                        player->AddRuneByAuraEffect(i, RUNE_DEATH, aurEff);
  64. +                    }
  65. +                    return true;
  66. +                }
  67. +                return false;
  68. +            }
  69. +
  70.              switch (dummySpell->Id)
  71.              {
  72.                  // Bone Shield cooldown
  73. diff --git a/src/server/scripts/Maelstrom/deepholm.cpp b/src/server/scripts/Maelstrom/deepholm.cpp
  74. index 55c3260..0906093 100644
  75. --- a/src/server/scripts/Maelstrom/deepholm.cpp
  76. +++ b/src/server/scripts/Maelstrom/deepholm.cpp
  77. @@ -1382,6 +1382,81 @@ public:
  78.      }
  79.  };
  80.  
  81. +/*####
  82. +## Support for quest Underground Ecomomy - 27048
  83. +########*/
  84. +
  85. +enum eRicketTicker
  86. +{
  87. +    SPELL_RICKET_EXPLODE = 91981,
  88. +
  89. +    NPC_DEEP_CELESTITE_BUNNY = 49865,
  90. +    NPC_DEEP_AMETHYST_BUNNY = 49866,
  91. +    NPC_DEEP_GRANAT_BUNNY = 49867,
  92. +    NPC_DEEP_ALABASTER_BUNNY = 49824,
  93. +
  94. +    ITEM_DEEP_CELESTITE_CRYSTAL = 65507,
  95. +    ITEM_DEEP_AMETHYST_CRYSTAL = 65508,
  96. +    ITEM_DEEP_GRANAT_CRYSTAL = 65510,
  97. +    ITEM_DEEP_ALABASTER_CRYSTAL = 65504,
  98. +};
  99. +
  100. +class npc_ricket_ticker : public CreatureScript
  101. +{
  102. +public:
  103. +    npc_ricket_ticker() : CreatureScript("npc_ricket_ticker") { }
  104. +
  105. +    CreatureAI* GetAI(Creature* creature) const
  106. +    {
  107. +        return new npc_ricket_tickerAI (creature);
  108. +    }
  109. +
  110. +    struct npc_ricket_tickerAI : public ScriptedAI
  111. +    {
  112. +        npc_ricket_tickerAI(Creature* creature) : ScriptedAI(creature) { }
  113. +
  114. +        uint32 uiExplode;
  115. +        Player* player;
  116. +
  117. +        void Reset()
  118. +        {
  119. +            uiExplode = 0;
  120. +        }
  121. +
  122. +        void IsSummonedBy(Unit* summoner)
  123. +        {
  124. +            uiExplode = 3500;
  125. +            player = summoner->ToPlayer();
  126. +        }
  127. +
  128. +        void UpdateAI(const uint32 diff)
  129. +        {
  130. +            if (uiExplode == NULL)
  131. +                return;
  132. +
  133. +            if (uiExplode <= diff)
  134. +            {
  135. +                if (me->FindNearestCreature(NPC_DEEP_CELESTITE_BUNNY, 20.0f, true))
  136. +                        player->AddItem(ITEM_DEEP_CELESTITE_CRYSTAL, 1);
  137. +
  138. +                if (me->FindNearestCreature(NPC_DEEP_AMETHYST_BUNNY, 20.0f, true))
  139. +                        player->AddItem(ITEM_DEEP_AMETHYST_CRYSTAL, 1);
  140. +
  141. +                if (me->FindNearestCreature(NPC_DEEP_GRANAT_BUNNY, 20.0f, true))
  142. +                        player->AddItem(ITEM_DEEP_GRANAT_CRYSTAL, 1);
  143. +
  144. +                if (me->FindNearestCreature(NPC_DEEP_ALABASTER_BUNNY, 20.0f, true))
  145. +                        player->AddItem(ITEM_DEEP_ALABASTER_CRYSTAL, 1);
  146. +
  147. +               player->CastSpell(me,SPELL_RICKET_EXPLODE);
  148. +               uiExplode = 0;
  149. +                me->DespawnOrUnsummon(1000);
  150. +
  151. +            } else uiExplode -= diff;
  152. +        }
  153. +    };
  154. +};
  155. +
  156.  void AddSC_deepholm()
  157.  {
  158.      new npc_lodestone();
  159. @@ -1407,4 +1482,5 @@ void AddSC_deepholm()
  160.     new npc_dormant_stonebound_elemental();
  161.     new npc_boden_the_imposing();
  162.     new spell_earthen_ring_proclamation();
  163. +   new npc_ricket_ticker();
  164.  }
  165. --
  166. 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment