[9516] Fixed talent 50391 and ranks in part apply rune cooldown expire speed.

* Apply rune cooldown buff only for spell 48265
* Implement SPELL_AURA_MOD_POWER_REGEN_PERCENT work for POWER_RUNE

Thanks to Laise for problem research.
This commit is contained in:
VladimirMangos 2010-03-04 14:45:15 +03:00
parent 9626d3333e
commit bc5092686e
3 changed files with 58 additions and 19 deletions

View file

@ -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:

View file

@ -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)
// if presence active: Frost Presence or Blood Presence
if (!apply || m_target->HasAura(48263) || m_target->HasAura(48266))
spellId1 = 49772;
else
return;
}
break;
}
break;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9515"
#define REVISION_NR "9516"
#endif // __REVISION_NR_H__