From c3b480ce81be61f86404dad9cc30fe56d91e3eae Mon Sep 17 00:00:00 2001 From: Liberate Date: Wed, 26 May 2010 22:47:47 +0200 Subject: Fixes the Deathbringer's Will Trinket. This needs DB support so you don't change into a pig instead of a vrykul/taunka. Based on c.j.b's patch. Fixes issue 1933 Fixes issue 1843 --HG-- branch : trunk --- src/game/Unit.cpp | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) (limited to 'src') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 0b3b075b2b6..c8a00d1afe4 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -5641,6 +5641,97 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger triggered_spell_id = 63321; // Life Tap break; } + case 71519: // Deathbringer's Will Normal + { + if (GetTypeId() != TYPEID_PLAYER) + return false; + + std::vector RandomSpells; + switch (getClass()) + { + case CLASS_WARRIOR: + case CLASS_PALADIN: + case CLASS_DEATH_KNIGHT: + RandomSpells.push_back(71484); + RandomSpells.push_back(71491); + RandomSpells.push_back(71492); + break; + case CLASS_SHAMAN: + case CLASS_ROGUE: + RandomSpells.push_back(71486); + RandomSpells.push_back(71485); + RandomSpells.push_back(71492); + break; + case CLASS_DRUID: + RandomSpells.push_back(71484); + RandomSpells.push_back(71485); + RandomSpells.push_back(71486); + break; + case CLASS_HUNTER: + RandomSpells.push_back(71486); + RandomSpells.push_back(71491); + RandomSpells.push_back(71485); + break; + default: + return false; + } + if (RandomSpells.empty()) //shouldn't happen + return false; + + uint8 rand_spell = irand(0,(RandomSpells.size() - 1)); + CastSpell(target,RandomSpells[rand_spell],true,castItem,triggeredByAura, originalCaster); + for (std::vector::iterator itr = RandomSpells.begin(); itr != RandomSpells.end(); ++itr) + { + if (!ToPlayer()->HasSpellCooldown(*itr)) + ToPlayer()->AddSpellCooldown(*itr,0,time(NULL) + cooldown); + } + break; + } + case 71562: // Deahtbringer's Will Heroic + { + if (GetTypeId() != TYPEID_PLAYER) + return false; + + std::vector RandomSpells; + switch (getClass()) + { + case CLASS_WARRIOR: + case CLASS_PALADIN: + case CLASS_DEATH_KNIGHT: + RandomSpells.push_back(71561); + RandomSpells.push_back(71559); + RandomSpells.push_back(71560); + break; + case CLASS_SHAMAN: + case CLASS_ROGUE: + RandomSpells.push_back(71558); + RandomSpells.push_back(71556); + RandomSpells.push_back(71560); + break; + case CLASS_DRUID: + RandomSpells.push_back(71561); + RandomSpells.push_back(71556); + RandomSpells.push_back(71558); + break; + case CLASS_HUNTER: + RandomSpells.push_back(71558); + RandomSpells.push_back(71559); + RandomSpells.push_back(71556); + break; + default: + return false; + } + if (RandomSpells.empty()) //shouldn't happen + return false; + + uint8 rand_spell = irand(0,(RandomSpells.size() - 1)); + CastSpell(target,RandomSpells[rand_spell],true,castItem,triggeredByAura, originalCaster); + for (std::vector::iterator itr = RandomSpells.begin(); itr != RandomSpells.end(); ++itr) + { + ToPlayer()->AddSpellCooldown(*itr,0,time(NULL) + cooldown); + } + break; + } } break; } -- cgit v1.2.3