aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp78
1 files changed, 44 insertions, 34 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 839a466f0f0..3d0cfa44534 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -606,57 +606,67 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
case SPELLFAMILY_ROGUE:
{
// Envenom
- if (m_caster->GetTypeId() == TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags[1] & 0x8))
+ if (m_spellInfo->SpellFamilyFlags[1] & 0x00000008)
{
- // consume from stack dozes not more that have combo-points
- if (uint32 combo = m_caster->ToPlayer()->GetComboPoints())
+ if (Player* player = m_caster->ToPlayer())
{
- // Lookup for Deadly poison (only attacker applied)
- if (AuraEffect const* aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x10000, 0, 0, m_caster->GetGUID()))
+ // consume from stack dozes not more that have combo-points
+ if (uint32 combo = player->GetComboPoints())
{
- // count consumed deadly poison doses at target
- bool needConsume = true;
- uint32 spellId = aurEff->GetId();
- uint32 doses = aurEff->GetBase()->GetStackAmount();
- if (doses > combo)
- doses = combo;
- // Master Poisoner
- Unit::AuraEffectList const& auraList = m_caster->ToPlayer()->GetAuraEffectsByType(SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK);
- for (Unit::AuraEffectList::const_iterator iter = auraList.begin(); iter != auraList.end(); ++iter)
+ // Lookup for Deadly poison (only attacker applied)
+ if (AuraEffect const* aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x00010000, 0, 0, m_caster->GetGUID()))
{
- if ((*iter)->GetSpellInfo()->SpellFamilyName == SPELLFAMILY_ROGUE && (*iter)->GetSpellInfo()->SpellIconID == 1960)
+ // count consumed deadly poison doses at target
+ bool needConsume = true;
+ uint32 spellId = aurEff->GetId();
+
+ uint32 doses = aurEff->GetBase()->GetStackAmount();
+ if (doses > combo)
+ doses = combo;
+
+ // Master Poisoner
+ Unit::AuraEffectList const& auraList = player->GetAuraEffectsByType(SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK);
+ for (Unit::AuraEffectList::const_iterator iter = auraList.begin(); iter != auraList.end(); ++iter)
{
- uint32 chance = (*iter)->GetSpellInfo()->Effects[EFFECT_2].CalcValue(m_caster);
+ if ((*iter)->GetSpellInfo()->SpellFamilyName == SPELLFAMILY_ROGUE && (*iter)->GetSpellInfo()->SpellIconID == 1960)
+ {
+ uint32 chance = (*iter)->GetSpellInfo()->Effects[EFFECT_2].CalcValue(m_caster);
- if (chance && roll_chance_i(chance))
- needConsume = false;
+ if (chance && roll_chance_i(chance))
+ needConsume = false;
- break;
+ break;
+ }
}
+
+ if (needConsume)
+ for (uint32 i = 0; i < doses; ++i)
+ unitTarget->RemoveAuraFromStack(spellId);
+
+ damage *= doses;
+ damage += int32(player->GetTotalAttackPowerValue(BASE_ATTACK) * 0.09f * combo);
}
- if (needConsume)
- for (uint32 i = 0; i < doses; ++i)
- unitTarget->RemoveAuraFromStack(spellId);
- damage *= doses;
- damage += int32(((Player*)m_caster)->GetTotalAttackPowerValue(BASE_ATTACK) * 0.09f * doses);
+ // Eviscerate and Envenom Bonus Damage (item set effect)
+ if (m_caster->HasAura(37169))
+ damage += combo * 40;
}
- // Eviscerate and Envenom Bonus Damage (item set effect)
- if (m_caster->HasAura(37169))
- damage += ((Player*)m_caster)->GetComboPoints()*40;
}
}
// Eviscerate
- else if ((m_spellInfo->SpellFamilyFlags[0] & 0x00020000) && m_caster->GetTypeId() == TYPEID_PLAYER)
+ else if (m_spellInfo->SpellFamilyFlags[0] & 0x00020000)
{
- if (uint32 combo = ((Player*)m_caster)->GetComboPoints())
+ if (m_caster->GetTypeId() == TYPEID_PLAYER)
{
- float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
- damage += irand(int32(ap * combo * 0.03f), int32(ap * combo * 0.07f));
+ if (uint32 combo = ((Player*)m_caster)->GetComboPoints())
+ {
+ float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
+ damage += irand(int32(ap * combo * 0.03f), int32(ap * combo * 0.07f));
- // Eviscerate and Envenom Bonus Damage (item set effect)
- if (m_caster->HasAura(37169))
- damage += combo*40;
+ // Eviscerate and Envenom Bonus Damage (item set effect)
+ if (m_caster->HasAura(37169))
+ damage += combo*40;
+ }
}
}
break;