[9482] Implement 48266, and 50365, 50384, 50391 and ranks.

Original patch provided by laise.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
VladimirMangos 2010-02-28 12:02:47 +03:00
parent ae7f6de936
commit 4dc85260c7
8 changed files with 172 additions and 28 deletions

View file

@ -6295,9 +6295,148 @@ void Aura::HandleSpellSpecificBoosts(bool apply)
switch (GetId())
{
case 49039: spellId1 = 50397; break; // Lichborne
case 48263: spellId1 = 61261; break; // Frost Presence
case 48265: spellId1 = 49772; break; // Unholy Presence move speed
default: return;
case 48263: // Frost Presence
case 48265: // Unholy Presence
case 48266: // Blood Presence
{
// else part one per 3 pair
if (GetId()==48263 || GetId()==48265) // Frost Presence or Unholy Presence
{
// Improved Blood Presence
int32 heal_pct = 0;
if (apply)
{
Unit::AuraList const& bloodAuras = m_target->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator itr = bloodAuras.begin(); itr != bloodAuras.end(); ++itr)
{
// skip same icon
if ((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT &&
(*itr)->GetSpellProto()->SpellIconID == 2636)
{
heal_pct = (*itr)->GetModifier()->m_amount;
break;
}
}
}
if (heal_pct)
m_target->CastCustomSpell(m_target, 63611, &heal_pct, NULL, NULL, true, NULL, this);
else
m_target->RemoveAurasDueToSpell(63611);
}
else
spellId1 = 63611; // Improved Blood Presence, trigger for heal
if (GetId()==48263 || GetId()==48266) // Frost Presence or Blood 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)
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
}
else
spellId1 = 49772; // Unholy Presence move speed
if (GetId()==48265 || GetId()==48266) // Unholy Presence or Blood Presence
{
// Improved Frost Presence
int32 stamina_pct = 0;
if (apply)
{
Unit::AuraList const& frostAuras = m_target->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator itr = frostAuras.begin(); itr != frostAuras.end(); ++itr)
{
// skip same icon
if ((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT &&
(*itr)->GetSpellProto()->SpellIconID == 2632)
{
stamina_pct = (*itr)->GetModifier()->m_amount;
break;
}
}
}
if (stamina_pct)
m_target->CastCustomSpell(m_target, 61261, &stamina_pct, NULL, NULL, true, NULL, this);
else
m_target->RemoveAurasDueToSpell(61261);
}
else
spellId1 = 61261; // Frost Presence, stamina
break;
}
}
// Improved Blood Presence
if (GetSpellProto()->SpellIconID == 2632 && GetModifier()->m_auraname==SPELL_AURA_DUMMY)
{
// if presence active: Frost Presence or Unholy Presence
if (apply && (m_target->HasAura(48263) || m_target->HasAura(48265)))
{
int32 bp = GetModifier()->m_amount;
m_target->CastCustomSpell(m_target, 63611, &bp, NULL, NULL, true, NULL, this);
}
else
m_target->RemoveAurasDueToSpell(63611);
return;
}
// Improved Frost Presence
if (GetSpellProto()->SpellIconID == 2636 && GetModifier()->m_auraname==SPELL_AURA_DUMMY)
{
// if presence active: Unholy Presence or Blood Presence
if (apply && (m_target->HasAura(48265) || m_target->HasAura(48266)))
{
int32 bp = GetModifier()->m_amount;
m_target->CastCustomSpell(m_target, 61261, &bp, NULL, NULL, true, NULL, this);
}
else
m_target->RemoveAurasDueToSpell(61261);
return;
}
// 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)))
{
int32 bp = GetModifier()->m_amount;
m_target->CastCustomSpell(m_target, 61261, &bp, NULL, NULL, true, NULL, this);
spellId1 = 49772;
}
else
{
m_target->RemoveAurasDueToSpell(61261);
if (!apply)
spellId1 = 49772;
else
return;
}
break;
}
break;
}