aboutsummaryrefslogtreecommitdiff
path: root/src/server/game
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2018-01-20 21:00:53 -0300
committerariel- <ariel-@users.noreply.github.com>2018-01-20 21:09:22 -0300
commit9f5d1e2b10013e5fecf35fdd5af70921c96d07d1 (patch)
tree4c932a91ff0b5d512121b4cbc65b7d4983232ef6 /src/server/game
parentcb75105434f5002ae53aef2c9c2e6417eaf8f5f0 (diff)
Core/Scripts: fix wrong uses of SetHitDamage hook.
This hook modifies damage AFTER it has been reduced by target auras/armor/resistances etc, it's useful if you want to scale damage by a factor, but not to add flat bonuses. We're fixing those by moving calculation to Launch phase, where target taken bonuses haven't been used yet. - Bronjahm: Magic's Bane - BPC: Shadow Prison - Oculus: Shock Lance - Ymiron: Dark Slash (extra fix, it was wrongly damaging half of total health, it's supposed to be half of CURRENT health!) - DK: Raise Ally Thrash spell (also extra fix: corrected formula) - Warrior: Bloodthirst (shouldn't matter much as it's damage class none and those don't get bonuses by default) - Warrior: Concussion Blow - Warlock: extra fix for Haunt, healing part shouldn't scale with spell power Closes #9560
Diffstat (limited to 'src/server/game')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 28f966a77ca..e135dd940ac 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -4811,29 +4811,28 @@ uint32 Unit::GetDiseasesByCaster(ObjectGuid casterGUID, bool remove)
static const AuraType diseaseAuraTypes[] =
{
SPELL_AURA_PERIODIC_DAMAGE, // Frost Fever and Blood Plague
- SPELL_AURA_LINKED, // Crypt Fever and Ebon Plague
- SPELL_AURA_NONE
+ SPELL_AURA_LINKED // Crypt Fever and Ebon Plague
};
uint32 diseases = 0;
- for (AuraType const* itr = diseaseAuraTypes; *itr != SPELL_AURA_NONE; ++itr)
+ for (AuraType aType : diseaseAuraTypes)
{
- for (AuraEffectList::iterator i = m_modAuras[*itr].begin(); i != m_modAuras[*itr].end();)
+ for (auto itr = m_modAuras[aType].begin(); itr != m_modAuras[aType].end();)
{
// Get auras with disease dispel type by caster
- if ((*i)->GetSpellInfo()->Dispel == DISPEL_DISEASE
- && (*i)->GetCasterGUID() == casterGUID)
+ if ((*itr)->GetSpellInfo()->Dispel == DISPEL_DISEASE
+ && (*itr)->GetCasterGUID() == casterGUID)
{
++diseases;
if (remove)
{
- RemoveAura((*i)->GetId(), (*i)->GetCasterGUID());
- i = m_modAuras[*itr].begin();
+ RemoveAura((*itr)->GetId(), (*itr)->GetCasterGUID());
+ itr = m_modAuras[aType].begin();
continue;
}
}
- ++i;
+ ++itr;
}
}
return diseases;