[8064] Implemented dummy procs for spell 47535 and ranks

(cherry picked from commit 80d0367959b110cb3daa0c6dd65022f5ecf84ac5)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
pasdVn 2009-05-25 21:43:51 +02:00 committed by VladimirMangos
parent d49d7e74f9
commit 14700e9918
6 changed files with 133 additions and 46 deletions

View file

@ -5656,49 +5656,114 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real)
if(!Real)
return;
Unit* caster = GetCaster();
if(!caster)
return;
// prevent double apply bonuses
if(apply && (m_target->GetTypeId()!=TYPEID_PLAYER || !((Player*)m_target)->GetSession()->PlayerLoading()))
{
if(Unit* caster = GetCaster())
float DoneActualBenefit = 0.0f;
switch(m_spellProto->SpellFamilyName)
{
float DoneActualBenefit = 0.0f;
switch(m_spellProto->SpellFamilyName)
case SPELLFAMILY_PRIEST:
if(m_spellProto->SpellFamilyFlags == 0x1) //PW:S
{
//+30% from +healing bonus
DoneActualBenefit = caster->SpellBaseHealingBonus(GetSpellSchoolMask(m_spellProto)) * 0.3f;
break;
}
break;
case SPELLFAMILY_MAGE:
if (m_spellProto->SpellFamilyFlags == UI64LIT(0x80100) ||
m_spellProto->SpellFamilyFlags == UI64LIT(0x8) ||
m_spellProto->SpellFamilyFlags == UI64LIT(0x100000000))
{
//frost ward, fire ward, ice barrier
//+10% from +spd bonus
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.1f;
break;
}
break;
case SPELLFAMILY_WARLOCK:
if(m_spellProto->SpellFamilyFlags == 0x00)
{
//shadow ward
//+10% from +spd bonus
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.1f;
break;
}
break;
default:
break;
}
DoneActualBenefit *= caster->CalculateLevelPenalty(GetSpellProto());
m_modifier.m_amount += (int32)DoneActualBenefit;
}
if (!apply && caster &&
// Power Word: Shield
m_spellProto->SpellFamilyName == SPELLFAMILY_PRIEST && m_spellProto->Mechanic == MECHANIC_SHIELD &&
(m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000001)) &&
// completely absorbed or dispelled
((m_removeMode == AURA_REMOVE_BY_DEFAULT && !m_modifier.m_amount) || m_removeMode == AURA_REMOVE_BY_DISPEL))
{
Unit::AuraList const& vDummyAuras = caster->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator itr = vDummyAuras.begin(); itr != vDummyAuras.end(); itr++)
{
SpellEntry const* vSpell = (*itr)->GetSpellProto();
// Rapture (main spell)
if(vSpell->SpellFamilyName == SPELLFAMILY_PRIEST && vSpell->SpellIconID == 2894 && vSpell->Effect[1])
{
case SPELLFAMILY_PRIEST:
if(m_spellProto->SpellFamilyFlags == 0x1) //PW:S
switch((*itr)->GetEffIndex())
{
case 0:
{
//+30% from +healing bonus
DoneActualBenefit = caster->SpellBaseHealingBonus(GetSpellSchoolMask(m_spellProto)) * 0.3f;
// energize caster
int32 manapct1000 = 5 * ((*itr)->GetModifier()->m_amount + spellmgr.GetSpellRank(vSpell->Id));
int32 basepoints0 = caster->GetMaxPower(POWER_MANA) * manapct1000 / 1000;
caster->CastCustomSpell(caster, 47755, &basepoints0, NULL, NULL, true);
break;
}
break;
case SPELLFAMILY_MAGE:
if (m_spellProto->SpellFamilyFlags == UI64LIT(0x80100) ||
m_spellProto->SpellFamilyFlags == UI64LIT(0x8) ||
m_spellProto->SpellFamilyFlags == UI64LIT(0x100000000))
case 1:
{
//frost ward, fire ward, ice barrier
//+10% from +spd bonus
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.1f;
// energize target
if (!roll_chance_i((*itr)->GetModifier()->m_amount) || caster->HasAura(63853))
break;
switch(m_target->getPowerType())
{
case POWER_RUNIC_POWER:
m_target->CastSpell(m_target, 63652, true, NULL, NULL, m_caster_guid);
break;
case POWER_RAGE:
m_target->CastSpell(m_target, 63653, true, NULL, NULL, m_caster_guid);
break;
case POWER_MANA:
{
int32 basepoints0 = m_target->GetMaxPower(POWER_MANA) * 2 / 100;
m_target->CastCustomSpell(m_target, 63654, &basepoints0, NULL, NULL, true);
break;
}
case POWER_ENERGY:
m_target->CastSpell(m_target, 63655, true, NULL, NULL, m_caster_guid);
break;
default:
break;
}
//cooldwon aura
caster->CastSpell(caster, 63853, true);
break;
}
break;
case SPELLFAMILY_WARLOCK:
if(m_spellProto->SpellFamilyFlags == 0x00)
{
//shadow ward
//+10% from +spd bonus
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.1f;
default:
sLog.outError("Changes in R-dummy spell???: effect 3");
break;
}
break;
default:
break;
}
}
DoneActualBenefit *= caster->CalculateLevelPenalty(GetSpellProto());
m_modifier.m_amount += (int32)DoneActualBenefit;
}
}
}