diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 00c2cef04..f178bb3c7 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -2033,10 +2033,18 @@ void Player::Regenerate(Powers power, uint32 diff) if (getClass() != CLASS_DEATH_KNIGHT) break; - for(uint32 i = 0; i < MAX_RUNES; ++i) + for(uint32 rune = 0; rune < MAX_RUNES; ++rune) { - if(uint16 cd = GetRuneCooldown(i)) // if we have cooldown, reduce it... - SetRuneCooldown(i, (cd < diff) ? 0 : cd - diff); + if(uint16 cd = GetRuneCooldown(rune)) // if we have cooldown, reduce it... + { + uint32 cd_diff = diff; + AuraList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT); + for(AuraList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i) + if ((*i)->GetModifier()->m_miscvalue == power && (*i)->GetMiscBValue()==GetCurrentRune(rune)) + cd_diff = cd_diff * ((*i)->GetModifier()->m_amount + 100) / 100.0f; + + SetRuneCooldown(rune, (cd < cd_diff) ? 0 : cd - cd_diff); + } } } break; case POWER_FOCUS: diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 48ff9dc0a..e591ecaf8 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -6389,11 +6389,6 @@ void Aura::HandleSpellSpecificBoosts(bool apply) } } - if (power_pct) - m_target->CastCustomSpell(m_target, 65095, &power_pct, NULL, NULL, true, NULL, this); - else - m_target->RemoveAurasDueToSpell(65095); - if (power_pct || !apply) spellId2 = 49772; // Unholy Presence, speed part } @@ -6426,6 +6421,41 @@ void Aura::HandleSpellSpecificBoosts(bool apply) } else spellId1 = 61261; // Frost Presence, stamina + + if (GetId()==48265) // Unholy Presence + { + // Improved Unholy Presence + int32 power_pct = 0; + if (apply) + { + Unit::AuraList const& unholyAuras = m_target->GetAurasByType(SPELL_AURA_DUMMY); + for(Unit::AuraList::const_iterator itr = unholyAuras.begin(); itr != unholyAuras.end(); ++itr) + { + // skip same icon + if ((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && + (*itr)->GetSpellProto()->SpellIconID == 2633) + { + power_pct = (*itr)->GetModifier()->m_amount; + break; + } + } + } + + if (power_pct) + { + int32 bp = 5; + m_target->CastCustomSpell(m_target, 63622, &bp, &bp, &bp, true, NULL, this); + m_target->CastCustomSpell(m_target, 65095, &bp, NULL, NULL, true, NULL, this); + } + else + { + m_target->RemoveAurasDueToSpell(63622); + m_target->RemoveAurasDueToSpell(65095); + } + } + else + spellId1 = 63611; // Improved Blood Presence, trigger for heal + break; } } @@ -6461,23 +6491,24 @@ void Aura::HandleSpellSpecificBoosts(bool apply) // Improved Unholy Presence if (GetSpellProto()->SpellIconID == 2633 && GetModifier()->m_auraname==SPELL_AURA_DUMMY) { - // if presence active: Frost Presence or Blood Presence - if (apply && (m_target->HasAura(48263) || m_target->HasAura(48266))) + // if presence active: Unholy Presence + if (apply && m_target->HasAura(48265)) { - int32 bp = GetModifier()->m_amount; + int32 bp = 5; + m_target->CastCustomSpell(m_target, 63622, &bp, &bp, &bp, true, NULL, this); m_target->CastCustomSpell(m_target, 65095, &bp, NULL, NULL, true, NULL, this); - - spellId1 = 49772; } else { + m_target->RemoveAurasDueToSpell(63622); m_target->RemoveAurasDueToSpell(65095); - - if (!apply) - spellId1 = 49772; - else - return; } + + // if presence active: Frost Presence or Blood Presence + if (!apply || m_target->HasAura(48263) || m_target->HasAura(48266)) + spellId1 = 49772; + else + return; break; } break; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 38dbd2734..affaf4eda 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9515" + #define REVISION_NR "9516" #endif // __REVISION_NR_H__