mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[8428] Implement proper amount absorbed damage for spell 62600.
Other change jus move code under "if(apply) else"
This commit is contained in:
parent
beae3fe00f
commit
a3207da3d9
2 changed files with 105 additions and 95 deletions
|
|
@ -5981,93 +5981,102 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real)
|
||||||
if(!caster)
|
if(!caster)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// prevent double apply bonuses
|
if (apply)
|
||||||
if(apply && (m_target->GetTypeId()!=TYPEID_PLAYER || !((Player*)m_target)->GetSession()->PlayerLoading()))
|
|
||||||
{
|
{
|
||||||
float DoneActualBenefit = 0.0f;
|
// prevent double apply bonuses
|
||||||
switch(m_spellProto->SpellFamilyName)
|
if (m_target->GetTypeId()!=TYPEID_PLAYER || !((Player*)m_target)->GetSession()->PlayerLoading())
|
||||||
{
|
{
|
||||||
case SPELLFAMILY_PRIEST:
|
float DoneActualBenefit = 0.0f;
|
||||||
// Power Word: Shield
|
switch(m_spellProto->SpellFamilyName)
|
||||||
if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000001))
|
|
||||||
//+80.68% from +spell bonus
|
|
||||||
DoneActualBenefit = caster->SpellBaseHealingBonus(GetSpellSchoolMask(m_spellProto)) * 0.8068f;
|
|
||||||
break;
|
|
||||||
case SPELLFAMILY_MAGE:
|
|
||||||
// Frost Ward, Fire Ward
|
|
||||||
if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000108))
|
|
||||||
//+10% from +spell bonus
|
|
||||||
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.1f;
|
|
||||||
// Ice Barrier
|
|
||||||
else if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000100000000))
|
|
||||||
//+80.67% from +spell bonus
|
|
||||||
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.8067f;
|
|
||||||
break;
|
|
||||||
case SPELLFAMILY_WARLOCK:
|
|
||||||
// Shadow Ward
|
|
||||||
if (m_spellProto->SpellFamilyFlags2 & 0x00000040)
|
|
||||||
//+30% from +spell bonus
|
|
||||||
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.30f;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
DoneActualBenefit *= caster->CalculateLevelPenalty(GetSpellProto());
|
|
||||||
|
|
||||||
m_modifier.m_amount += (int32)DoneActualBenefit;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ice Barrier (remove effect from Shattered Barrier)
|
|
||||||
if(!apply && m_spellProto->SpellIconID == 32 && m_spellProto->SpellFamilyName == SPELLFAMILY_MAGE)
|
|
||||||
{
|
|
||||||
if (!((m_removeMode == AURA_REMOVE_BY_DEFAULT && !m_modifier.m_amount) || m_removeMode == AURA_REMOVE_BY_DISPEL))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (m_target->HasAura(44745,0)) // Shattered Barrier, rank 1
|
|
||||||
{
|
|
||||||
if(roll_chance_i(50))
|
|
||||||
m_target->CastSpell(m_target, 55080, true, NULL, this);
|
|
||||||
}
|
|
||||||
else if (m_target->HasAura(54787,0)) // Shattered Barrier, rank 2
|
|
||||||
{
|
|
||||||
m_target->CastSpell(m_target, 55080, true, NULL, this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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])
|
|
||||||
{
|
{
|
||||||
switch((*itr)->GetEffIndex())
|
case SPELLFAMILY_PRIEST:
|
||||||
{
|
// Power Word: Shield
|
||||||
case 0:
|
if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000001))
|
||||||
{
|
//+80.68% from +spell bonus
|
||||||
// energize caster
|
DoneActualBenefit = caster->SpellBaseHealingBonus(GetSpellSchoolMask(m_spellProto)) * 0.8068f;
|
||||||
int32 manapct1000 = 5 * ((*itr)->GetModifier()->m_amount + spellmgr.GetSpellRank(vSpell->Id));
|
break;
|
||||||
int32 basepoints0 = caster->GetMaxPower(POWER_MANA) * manapct1000 / 1000;
|
case SPELLFAMILY_MAGE:
|
||||||
caster->CastCustomSpell(caster, 47755, &basepoints0, NULL, NULL, true);
|
// Frost Ward, Fire Ward
|
||||||
break;
|
if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000108))
|
||||||
}
|
//+10% from +spell bonus
|
||||||
case 1:
|
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.1f;
|
||||||
{
|
// Ice Barrier
|
||||||
// energize target
|
else if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000100000000))
|
||||||
if (!roll_chance_i((*itr)->GetModifier()->m_amount) || caster->HasAura(63853))
|
//+80.67% from +spell bonus
|
||||||
break;
|
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.8067f;
|
||||||
|
break;
|
||||||
|
case SPELLFAMILY_WARLOCK:
|
||||||
|
// Shadow Ward
|
||||||
|
if (m_spellProto->SpellFamilyFlags2 & 0x00000040)
|
||||||
|
//+30% from +spell bonus
|
||||||
|
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.30f;
|
||||||
|
break;
|
||||||
|
case SPELLFAMILY_DRUID:
|
||||||
|
// Savage Defense (amount store original percent of attack power applied)
|
||||||
|
if (m_spellProto->SpellIconID == 50) // only spell with this aura fit
|
||||||
|
m_modifier.m_amount = int32(m_modifier.m_amount * m_target->GetTotalAttackPowerValue(BASE_ATTACK) / 100);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
switch(m_target->getPowerType())
|
DoneActualBenefit *= caster->CalculateLevelPenalty(GetSpellProto());
|
||||||
|
|
||||||
|
m_modifier.m_amount += (int32)DoneActualBenefit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Ice Barrier (remove effect from Shattered Barrier)
|
||||||
|
if (m_spellProto->SpellIconID == 32 && m_spellProto->SpellFamilyName == SPELLFAMILY_MAGE)
|
||||||
|
{
|
||||||
|
if (!((m_removeMode == AURA_REMOVE_BY_DEFAULT && !m_modifier.m_amount) || m_removeMode == AURA_REMOVE_BY_DISPEL))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (m_target->HasAura(44745,0)) // Shattered Barrier, rank 1
|
||||||
|
{
|
||||||
|
if(roll_chance_i(50))
|
||||||
|
m_target->CastSpell(m_target, 55080, true, NULL, this);
|
||||||
|
}
|
||||||
|
else if (m_target->HasAura(54787,0)) // Shattered Barrier, rank 2
|
||||||
|
{
|
||||||
|
m_target->CastSpell(m_target, 55080, true, NULL, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (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])
|
||||||
|
{
|
||||||
|
switch((*itr)->GetEffIndex())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
{
|
{
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
// energize target
|
||||||
|
if (!roll_chance_i((*itr)->GetModifier()->m_amount) || caster->HasAura(63853))
|
||||||
|
break;
|
||||||
|
|
||||||
|
switch(m_target->getPowerType())
|
||||||
|
{
|
||||||
case POWER_RUNIC_POWER:
|
case POWER_RUNIC_POWER:
|
||||||
m_target->CastSpell(m_target, 63652, true, NULL, NULL, m_caster_guid);
|
m_target->CastSpell(m_target, 63652, true, NULL, NULL, m_caster_guid);
|
||||||
break;
|
break;
|
||||||
|
|
@ -6075,25 +6084,26 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real)
|
||||||
m_target->CastSpell(m_target, 63653, true, NULL, NULL, m_caster_guid);
|
m_target->CastSpell(m_target, 63653, true, NULL, NULL, m_caster_guid);
|
||||||
break;
|
break;
|
||||||
case POWER_MANA:
|
case POWER_MANA:
|
||||||
{
|
{
|
||||||
int32 basepoints0 = m_target->GetMaxPower(POWER_MANA) * 2 / 100;
|
int32 basepoints0 = m_target->GetMaxPower(POWER_MANA) * 2 / 100;
|
||||||
m_target->CastCustomSpell(m_target, 63654, &basepoints0, NULL, NULL, true);
|
m_target->CastCustomSpell(m_target, 63654, &basepoints0, NULL, NULL, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case POWER_ENERGY:
|
case POWER_ENERGY:
|
||||||
m_target->CastSpell(m_target, 63655, true, NULL, NULL, m_caster_guid);
|
m_target->CastSpell(m_target, 63655, true, NULL, NULL, m_caster_guid);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//cooldwon aura
|
//cooldwon aura
|
||||||
caster->CastSpell(caster, 63853, true);
|
caster->CastSpell(caster, 63853, true);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
sLog.outError("Changes in R-dummy spell???: effect 3");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
sLog.outError("Changes in R-dummy spell???: effect 3");
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8427"
|
#define REVISION_NR "8428"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue