Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From a6244a116fc63409b178736fe291386c86565c83 Mon Sep 17 00:00:00 2001
- From: unknown <cristi@cristis-PC.(none)>
- Date: Tue, 24 Jul 2012 13:22:41 +0300
- Subject: [PATCH] Fix talents: Blood of North,Reaping,DeathRuneMastery-Dk
- Fix quest: Underground Economy
- ---
- src/server/game/Entities/Unit/Unit.cpp | 50 +++++++++++++++++++
- src/server/scripts/Maelstrom/deepholm.cpp | 76 +++++++++++++++++++++++++++++
- 2 files changed, 126 insertions(+)
- diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
- index f0c1c35..21e69b1 100644
- --- a/src/server/game/Entities/Unit/Unit.cpp
- +++ b/src/server/game/Entities/Unit/Unit.cpp
- @@ -8439,6 +8439,56 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp
- }
- case SPELLFAMILY_DEATHKNIGHT:
- {
- + //blood of north || reaping || death rune mastery
- + if (dummySpell->SpellIconID == 3041 || dummySpell->SpellIconID == 22 || dummySpell->SpellIconID == 2622)
- + {
- + *handled = true;
- + // Convert recently used Blood Rune to Death Rune
- + if (Player* player = ToPlayer())
- + {
- + if (player->getClass() != CLASS_DEATH_KNIGHT)
- + return false;
- +
- + RuneType rune = ToPlayer()->GetLastUsedRune();
- +
- + AuraEffect* aurEff = triggeredByAura->GetEffect(EFFECT_0);
- + if (!aurEff)
- + return false;
- +
- + aurEff->ResetPeriodic(true);
- + uint32 runesLeft;
- +
- + if (dummySpell->SpellIconID == 2622)
- + runesLeft = 2;
- + else
- + runesLeft = 1;
- +
- + for (uint8 i = 0; i < MAX_RUNES && runesLeft; ++i)
- + {
- + if (dummySpell->SpellIconID == 2622)
- + {
- + if (player->GetCurrentRune(i) == RUNE_DEATH ||
- + player->GetBaseRune(i) == RUNE_BLOOD)
- + continue;
- + }
- + else
- + {
- + if (player->GetCurrentRune(i) == RUNE_DEATH ||
- + player->GetBaseRune(i) != RUNE_BLOOD)
- + continue;
- + }
- + if (player->GetRuneCooldown(i) != player->GetRuneBaseCooldown(i))
- + continue;
- +
- + --runesLeft;
- + // Mark aura as used
- + player->AddRuneByAuraEffect(i, RUNE_DEATH, aurEff);
- + }
- + return true;
- + }
- + return false;
- + }
- +
- switch (dummySpell->Id)
- {
- // Bone Shield cooldown
- diff --git a/src/server/scripts/Maelstrom/deepholm.cpp b/src/server/scripts/Maelstrom/deepholm.cpp
- index 55c3260..0906093 100644
- --- a/src/server/scripts/Maelstrom/deepholm.cpp
- +++ b/src/server/scripts/Maelstrom/deepholm.cpp
- @@ -1382,6 +1382,81 @@ public:
- }
- };
- +/*####
- +## Support for quest Underground Ecomomy - 27048
- +########*/
- +
- +enum eRicketTicker
- +{
- + SPELL_RICKET_EXPLODE = 91981,
- +
- + NPC_DEEP_CELESTITE_BUNNY = 49865,
- + NPC_DEEP_AMETHYST_BUNNY = 49866,
- + NPC_DEEP_GRANAT_BUNNY = 49867,
- + NPC_DEEP_ALABASTER_BUNNY = 49824,
- +
- + ITEM_DEEP_CELESTITE_CRYSTAL = 65507,
- + ITEM_DEEP_AMETHYST_CRYSTAL = 65508,
- + ITEM_DEEP_GRANAT_CRYSTAL = 65510,
- + ITEM_DEEP_ALABASTER_CRYSTAL = 65504,
- +};
- +
- +class npc_ricket_ticker : public CreatureScript
- +{
- +public:
- + npc_ricket_ticker() : CreatureScript("npc_ricket_ticker") { }
- +
- + CreatureAI* GetAI(Creature* creature) const
- + {
- + return new npc_ricket_tickerAI (creature);
- + }
- +
- + struct npc_ricket_tickerAI : public ScriptedAI
- + {
- + npc_ricket_tickerAI(Creature* creature) : ScriptedAI(creature) { }
- +
- + uint32 uiExplode;
- + Player* player;
- +
- + void Reset()
- + {
- + uiExplode = 0;
- + }
- +
- + void IsSummonedBy(Unit* summoner)
- + {
- + uiExplode = 3500;
- + player = summoner->ToPlayer();
- + }
- +
- + void UpdateAI(const uint32 diff)
- + {
- + if (uiExplode == NULL)
- + return;
- +
- + if (uiExplode <= diff)
- + {
- + if (me->FindNearestCreature(NPC_DEEP_CELESTITE_BUNNY, 20.0f, true))
- + player->AddItem(ITEM_DEEP_CELESTITE_CRYSTAL, 1);
- +
- + if (me->FindNearestCreature(NPC_DEEP_AMETHYST_BUNNY, 20.0f, true))
- + player->AddItem(ITEM_DEEP_AMETHYST_CRYSTAL, 1);
- +
- + if (me->FindNearestCreature(NPC_DEEP_GRANAT_BUNNY, 20.0f, true))
- + player->AddItem(ITEM_DEEP_GRANAT_CRYSTAL, 1);
- +
- + if (me->FindNearestCreature(NPC_DEEP_ALABASTER_BUNNY, 20.0f, true))
- + player->AddItem(ITEM_DEEP_ALABASTER_CRYSTAL, 1);
- +
- + player->CastSpell(me,SPELL_RICKET_EXPLODE);
- + uiExplode = 0;
- + me->DespawnOrUnsummon(1000);
- +
- + } else uiExplode -= diff;
- + }
- + };
- +};
- +
- void AddSC_deepholm()
- {
- new npc_lodestone();
- @@ -1407,4 +1482,5 @@ void AddSC_deepholm()
- new npc_dormant_stonebound_elemental();
- new npc_boden_the_imposing();
- new spell_earthen_ring_proclamation();
- + new npc_ricket_ticker();
- }
- --
- 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment