mirror of
https://github.com/mangosfour/server.git
synced 2025-12-22 13:37:08 +00:00
[7184] Implement more generic work for some SPELL_AURA_OVERRIDE_CLASS_SCRIPTS auras
Fix warlock 17804 and ranks Implement druid 643 set bonus Shaman 23199, 28248, 32330 item (totems) DK 49202 and ranks, 49024 and ranks Priest 47573 and ranks Hunter 53241 and ranks Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
parent
9e52b0f748
commit
7ee5dd6387
3 changed files with 127 additions and 60 deletions
|
|
@ -5748,59 +5748,6 @@ void Aura::PeriodicTick()
|
|||
|
||||
pdamage = pCaster->SpellDamageBonus(m_target,GetSpellProto(),pdamage,DOT);
|
||||
|
||||
// talent Soul Siphon add bonus to Drain Life spells
|
||||
if( GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellProto()->SpellFamilyFlags & 0x8) )
|
||||
{
|
||||
// find talent max bonus percentage
|
||||
Unit::AuraList const& mClassScriptAuras = pCaster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
|
||||
for(Unit::AuraList::const_iterator i = mClassScriptAuras.begin(); i != mClassScriptAuras.end(); ++i)
|
||||
{
|
||||
if ((*i)->GetModifier()->m_miscvalue == 4992 || (*i)->GetModifier()->m_miscvalue == 4993)
|
||||
{
|
||||
if((*i)->GetEffIndex()!=1)
|
||||
{
|
||||
sLog.outError("Expected spell %u structure change, need code update",(*i)->GetId());
|
||||
break;
|
||||
}
|
||||
|
||||
// effect 1 m_amount
|
||||
int32 maxPercent = (*i)->GetModifier()->m_amount;
|
||||
// effect 0 m_amount
|
||||
int32 stepPercent = pCaster->CalculateSpellDamage((*i)->GetSpellProto(),0,(*i)->GetSpellProto()->EffectBasePoints[0],pCaster);
|
||||
|
||||
// count affliction effects and calc additional damage in percentage
|
||||
int32 modPercent = 0;
|
||||
Unit::AuraMap const& victimAuras = m_target->GetAuras();
|
||||
for (Unit::AuraMap::const_iterator itr = victimAuras.begin(); itr != victimAuras.end(); ++itr)
|
||||
{
|
||||
Aura* aura = itr->second;
|
||||
if (aura->IsPositive())continue;
|
||||
SpellEntry const* m_spell = aura->GetSpellProto();
|
||||
if (m_spell->SpellFamilyName != SPELLFAMILY_WARLOCK)
|
||||
continue;
|
||||
|
||||
SkillLineAbilityMap::const_iterator lower = spellmgr.GetBeginSkillLineAbilityMap(m_spell->Id);
|
||||
SkillLineAbilityMap::const_iterator upper = spellmgr.GetEndSkillLineAbilityMap(m_spell->Id);
|
||||
|
||||
for(SkillLineAbilityMap::const_iterator _spell_idx = lower; _spell_idx != upper; ++_spell_idx)
|
||||
{
|
||||
if(_spell_idx->second->skillId == SKILL_AFFLICTION)
|
||||
{
|
||||
modPercent += stepPercent;
|
||||
if (modPercent >= maxPercent)
|
||||
{
|
||||
modPercent = maxPercent;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
pdamage += (pdamage*modPercent/100);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//As of 2.2 resilience reduces damage from DoT ticks as much as the chance to not be critically hit
|
||||
// Reduce dot damage from resilience for players
|
||||
if (m_target->GetTypeId()==TYPEID_PLAYER)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue