mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +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);
|
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
|
//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
|
// Reduce dot damage from resilience for players
|
||||||
if (m_target->GetTypeId()==TYPEID_PLAYER)
|
if (m_target->GetTypeId()==TYPEID_PLAYER)
|
||||||
|
|
|
||||||
|
|
@ -7477,19 +7477,139 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
|
||||||
if( (*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spellProto) )
|
if( (*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spellProto) )
|
||||||
TakenTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
|
TakenTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
|
||||||
|
|
||||||
// .. taken pct: scripted (increases damage of * against targets *)
|
// done scripted mod
|
||||||
AuraList const& mOverrideClassScript = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
|
AuraList const& mOverrideClassScript = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
|
||||||
for(AuraList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
|
for(AuraList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
|
||||||
{
|
{
|
||||||
|
if (!(*i)->isAffectedOnSpell(spellProto))
|
||||||
|
continue;
|
||||||
switch((*i)->GetModifier()->m_miscvalue)
|
switch((*i)->GetModifier()->m_miscvalue)
|
||||||
{
|
{
|
||||||
//Molten Fury
|
// Molten Fury
|
||||||
case 4920: case 4919:
|
case 4920:
|
||||||
|
case 4919:
|
||||||
|
{
|
||||||
if(pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT))
|
if(pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT))
|
||||||
TakenTotalMod *= (100.0f+(*i)->GetModifier()->m_amount)/100.0f; break;
|
TakenTotalMod *= (100.0f+(*i)->GetModifier()->m_amount)/100.0f;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Soul Siphon
|
||||||
|
case 4992:
|
||||||
|
case 4993:
|
||||||
|
{
|
||||||
|
// effect 1 m_amount
|
||||||
|
int32 maxPercent = (*i)->GetModifier()->m_amount;
|
||||||
|
// effect 0 m_amount
|
||||||
|
int32 stepPercent = CalculateSpellDamage((*i)->GetSpellProto(), 0, (*i)->GetSpellProto()->EffectBasePoints[0], this);
|
||||||
|
// count affliction effects and calc additional damage in percentage
|
||||||
|
int32 modPercent = 0;
|
||||||
|
Unit::AuraMap const& victimAuras = pVictim->GetAuras();
|
||||||
|
for (Unit::AuraMap::const_iterator itr = victimAuras.begin(); itr != victimAuras.end(); ++itr)
|
||||||
|
{
|
||||||
|
SpellEntry const* m_spell = itr->second->GetSpellProto();
|
||||||
|
if (m_spell->SpellFamilyName != SPELLFAMILY_WARLOCK || !(m_spell->SpellFamilyFlags & 0x0004071B8044C402LL))
|
||||||
|
continue;
|
||||||
|
modPercent += stepPercent;
|
||||||
|
if (modPercent >= maxPercent)
|
||||||
|
{
|
||||||
|
modPercent = maxPercent;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DoneTotalMod *= (modPercent+100.0f)/100.0f;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Starfire Bonus
|
||||||
|
case 5481:
|
||||||
|
{
|
||||||
|
AuraList const& auras = pVictim->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
|
||||||
|
for(AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||||
|
{
|
||||||
|
SpellEntry const* m_spell = (*itr)->GetSpellProto();
|
||||||
|
if (m_spell->SpellFamilyName == SPELLFAMILY_DRUID &&
|
||||||
|
m_spell->SpellFamilyFlags & 0x0000000000200002LL)
|
||||||
|
{
|
||||||
|
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Increased Lightning Damage
|
||||||
|
case 4554:
|
||||||
|
case 5142:
|
||||||
|
case 6008:
|
||||||
|
{
|
||||||
|
pdamage+=(*i)->GetModifier()->m_amount;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Tundra Stalker
|
||||||
|
// Merciless Combat
|
||||||
|
case 7277:
|
||||||
|
{
|
||||||
|
// Merciless Combat
|
||||||
|
if ((*i)->GetSpellProto()->SpellIconID == 2656)
|
||||||
|
{
|
||||||
|
if(pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT))
|
||||||
|
TakenTotalMod *= (100.0f+(*i)->GetModifier()->m_amount)/100.0f;
|
||||||
|
}
|
||||||
|
else // Tundra Stalker
|
||||||
|
{
|
||||||
|
AuraList const& auras = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
|
||||||
|
for(AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||||
|
{
|
||||||
|
SpellEntry const* m_spell = (*itr)->GetSpellProto();
|
||||||
|
if (m_spell->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT &&
|
||||||
|
m_spell->SpellFamilyFlags & 0x0400000000000000LL)
|
||||||
|
{
|
||||||
|
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Twisted Faith
|
||||||
|
case 7377:
|
||||||
|
{
|
||||||
|
AuraList const& auras = pVictim->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
|
||||||
|
for(AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||||
|
{
|
||||||
|
SpellEntry const* m_spell = (*itr)->GetSpellProto();
|
||||||
|
if (m_spell->SpellFamilyName == SPELLFAMILY_PRIEST &&
|
||||||
|
m_spell->SpellFamilyFlags & 0x0000000000008000LL &&
|
||||||
|
(*itr)->GetCasterGUID()==GetGUID())
|
||||||
|
{
|
||||||
|
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// taken scripted mod
|
||||||
|
AuraList const& mOverrideClassScriptTaken = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
|
||||||
|
for(AuraList::const_iterator i = mOverrideClassScriptTaken.begin(); i != mOverrideClassScriptTaken.end(); ++i)
|
||||||
|
{
|
||||||
|
if (!(*i)->isAffectedOnSpell(spellProto))
|
||||||
|
continue;
|
||||||
|
switch((*i)->GetModifier()->m_miscvalue)
|
||||||
|
{
|
||||||
|
// Marked for Death
|
||||||
|
case 7598:
|
||||||
|
case 7599:
|
||||||
|
case 7600:
|
||||||
|
case 7601:
|
||||||
|
case 7602:
|
||||||
|
{
|
||||||
|
if ((*i)->GetCasterGUID()==GetGUID() || // Self
|
||||||
|
(*i)->GetCasterGUID()==GetOwnerGUID()) // Owner
|
||||||
|
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// .. taken pct: dummy auras
|
// .. taken pct: dummy auras
|
||||||
AuraList const& mDummyAuras = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
|
AuraList const& mDummyAuras = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
|
||||||
for(AuraList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
|
for(AuraList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
|
||||||
|
|
@ -7508,7 +7628,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
|
||||||
TakenTotalMod *= (mod+100.0f)/100.0f;
|
TakenTotalMod *= (mod+100.0f)/100.0f;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
//Mangle
|
// Mangle
|
||||||
case 2312:
|
case 2312:
|
||||||
for(int j=0;j<3;j++)
|
for(int j=0;j<3;j++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7183"
|
#define REVISION_NR "7184"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue