aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp36
-rw-r--r--src/server/game/Spells/SpellEffects.cpp2
2 files changed, 25 insertions, 13 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index c1d57fed8a0..8241b88fedf 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -3565,7 +3565,14 @@ void Unit::_ApplyAura(AuraApplication * aurApp, uint8 effMask)
// Update target aura state flag
if (AuraStateType aState = aura->GetSpellInfo()->GetAuraState())
- ModifyAuraState(aState, true);
+ {
+ uint32 aStateMask = (1 << (aState - 1));
+ // force update so the new caster registers it
+ if ((aStateMask & PER_CASTER_AURA_STATE_MASK) && HasFlag(UNIT_FIELD_AURASTATE, aStateMask))
+ ForceValuesUpdateAtIndex(UNIT_FIELD_AURASTATE);
+ else
+ ModifyAuraState(aState, true);
+ }
if (aurApp->GetRemoveMode())
return;
@@ -3658,9 +3665,19 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo
ToTotem()->setDeathState(JUST_DIED);
}
- // Remove aurastates only if were not found
- if (!auraStateFound)
- ModifyAuraState(auraState, false);
+ // Remove aurastates only if needed and were not found
+ if (auraState)
+ {
+ if (!auraStateFound)
+ ModifyAuraState(auraState, false);
+ else
+ {
+ // update for casters, some shouldn't 'see' the aura state
+ uint32 aStateMask = (1 << (auraState - 1));
+ if ((aStateMask & PER_CASTER_AURA_STATE_MASK) != 0)
+ ForceValuesUpdateAtIndex(UNIT_FIELD_AURASTATE);
+ }
+ }
aura->HandleAuraSpecificMods(aurApp, caster, false, false);
@@ -7141,15 +7158,10 @@ float Unit::SpellDamagePctDone(Unit* victim, SpellInfo const* spellProto, Damage
// Fire and Brimstone
if (spellProto->SpellFamilyFlags[1] & 0x00020040)
{
- if (victim->HasAuraState(AURA_STATE_CONFLAGRATE))
+ if (victim->HasAuraState(AURA_STATE_CONFLAGRATE, nullptr, this))
{
- AuraEffectList const& mDumyAuras = GetAuraEffectsByType(SPELL_AURA_DUMMY);
- for (AuraEffectList::const_iterator i = mDumyAuras.begin(); i != mDumyAuras.end(); ++i)
- if ((*i)->GetSpellInfo()->SpellIconID == 3173)
- {
- AddPct(DoneTotalMod, (*i)->GetAmount());
- break;
- }
+ if (AuraEffect const* aurEFf = GetDummyAuraEffect(SPELLFAMILY_WARLOCK, 3173, EFFECT_0))
+ AddPct(DoneTotalMod, aurEFf->GetAmount());
}
}
// Shadow Bite (15% increase from each dot)
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index c8eae841a45..f1223eb39d3 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -394,7 +394,7 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
if (unitTarget->HasAuraState(AURA_STATE_CONFLAGRATE))
{
if (unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, 0x4, 0, 0))
- damage += damage/4;
+ damage += damage / 4;
}
}
// Conflagrate - consumes Immolate or Shadowflame