mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[8919] Implement telant 44394 and ranks.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
562e71ec3f
commit
6094d2368b
2 changed files with 32 additions and 1 deletions
|
|
@ -2005,6 +2005,37 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
|
|||
RemainingDamage -= currentAbsorb;
|
||||
}
|
||||
|
||||
// effects dependent from full absorb amount
|
||||
if (int32 full_absorb = damage - RemainingDamage - *resist)
|
||||
{
|
||||
Unit::AuraList const& auras = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
|
||||
for (Unit::AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||
{
|
||||
SpellEntry const* itr_spellProto = (*itr)->GetSpellProto();
|
||||
|
||||
// Incanter's Absorption
|
||||
if (itr_spellProto->SpellFamilyName == SPELLFAMILY_GENERIC &&
|
||||
itr_spellProto->SpellIconID == 2941)
|
||||
{
|
||||
|
||||
int32 amount = int32(full_absorb * (*itr)->GetModifier()->m_amount / 100);
|
||||
|
||||
// apply normalized part of already accumulated amount in aura
|
||||
if (Aura* spdAura = pVictim->GetAura(44413,0))
|
||||
amount += spdAura->GetModifier()->m_amount * spdAura->GetAuraDuration() / spdAura->GetAuraMaxDuration();
|
||||
|
||||
// limit 5 health percents
|
||||
int32 health_5percent = pVictim->GetMaxHealth()*5/100;
|
||||
if(amount > health_5percent)
|
||||
amount = health_5percent;
|
||||
|
||||
// Incanter's Absorption (triggered absorb based spell power, will replace existed if any)
|
||||
pVictim->CastCustomSpell(pVictim, 44413, &amount, NULL, NULL, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// only split damage if not damaging yourself
|
||||
if(pVictim != this)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8918"
|
||||
#define REVISION_NR "8919"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue