Skip to content

Commit

Permalink
[9516] Fixed talent 50391 and ranks in part apply rune cooldown expir…
Browse files Browse the repository at this point in the history
…e 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.
  • Loading branch information
VladimirMangos committed Mar 4, 2010
1 parent f74f339 commit d7af64a
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 19 deletions.
14 changes: 11 additions & 3 deletions src/game/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
61 changes: 46 additions & 15 deletions src/game/SpellAuras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9515"
#define REVISION_NR "9516"
#endif // __REVISION_NR_H__

2 comments on commit d7af64a

@Wowka321
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this Frost Presence don't give stamina.

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must be fixed in [9531]. Thank you for pointing.

Please sign in to comment.