diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/SpellEffects.cpp | 4 | ||||
-rw-r--r-- | src/game/Unit.cpp | 26 |
2 files changed, 22 insertions, 8 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index dcc7273691d..725da3ee565 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2135,7 +2135,7 @@ void Spell::EffectTriggerSpell(uint32 i) } // Remove spell cooldown (not category) if spell triggering spell with cooldown and same category - // Needed by freezing trap and few other spells + // Needed by freezing arrow and few other spells if (m_caster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->CategoryRecoveryTime && spellInfo->CategoryRecoveryTime && m_spellInfo->Category == spellInfo->Category) ((Player*)m_caster)->RemoveSpellCooldown(spellInfo->Id); @@ -2179,7 +2179,7 @@ void Spell::EffectTriggerMissileSpell(uint32 effect_idx) DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id); // Remove spell cooldown (not category) if spell triggering spell with cooldown and same category - // Needed by freezing trap and few other spells + // Needed by freezing arrow and few other spells if (m_caster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->CategoryRecoveryTime && spellInfo->CategoryRecoveryTime && m_spellInfo->Category == spellInfo->Category) ((Player*)m_caster)->RemoveSpellCooldown(spellInfo->Id); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index b9ba6dbe2c5..d614b743b7b 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -11039,13 +11039,27 @@ int32 Unit::ModSpellDuration(SpellEntry const* spellProto, Unit const* target, i //cut duration only of negative effects if (!positive) { - int32 mechanic = spellProto->Mechanic; + int32 mechanic = GetAllSpellMechanicMask(spellProto); + + int32 durationMod; + int32 durationMod_always = 0; + int32 durationMod_not_stack = 0; + + for (uint8 i = 1;i<=MECHANIC_ENRAGED;++i) + { + if (!(mechanic & 1<<i)) + continue; + // Find total mod value (negative bonus) + int32 new_durationMod_always = target->GetTotalAuraModifierByMiscValue(SPELL_AURA_MECHANIC_DURATION_MOD, i); + // Find max mod (negative bonus) + int32 new_durationMod_not_stack = target->GetMaxNegativeAuraModifierByMiscValue(SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK, i); + // Check if mods applied before were weaker + if (new_durationMod_always < durationMod_always) + durationMod_always = new_durationMod_always; + if (new_durationMod_not_stack < durationMod_not_stack) + durationMod_not_stack = new_durationMod_not_stack; + } - // Find total mod value (negative bonus) - int32 durationMod_always = target->GetTotalAuraModifierByMiscValue(SPELL_AURA_MECHANIC_DURATION_MOD, mechanic); - // Find max mod (negative bonus) - int32 durationMod_not_stack = target->GetMaxNegativeAuraModifierByMiscValue(SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK, mechanic); - int32 durationMod = 0; // Select strongest negative mod if (durationMod_always > durationMod_not_stack) durationMod = durationMod_not_stack; |