diff options
author | Matan Shukry <matanshukry@gmail.com> | 2021-04-21 22:05:03 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-04-21 23:14:02 +0200 |
commit | 2e2dc1afc94b5d6864cf7dc8ca5799c349bdca4d (patch) | |
tree | e1932b00418697f2109fbdb9f7a05833a5cd6e20 /src | |
parent | 90a47188af95fd86f805d5ea61065a4d83c4efe1 (diff) |
Core/Spells: Added spell value duration to modify aura duration of a specific spell cast
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Spells/Spell.cpp | 8 | ||||
-rw-r--r-- | src/server/game/Spells/Spell.h | 1 | ||||
-rw-r--r-- | src/server/game/Spells/SpellDefines.h | 3 |
3 files changed, 11 insertions, 1 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 5fd94978915..e4981010331 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -503,6 +503,7 @@ SpellValue::SpellValue(SpellInfo const* proto, Unit const* caster) MaxAffectedTargets = proto->MaxAffectedTargets; RadiusMod = 1.0f; AuraStackAmount = 1; + DurationMul = 1; } class TC_GAME_API SpellEvent : public BasicEvent @@ -2717,6 +2718,8 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask) if (duration > 0) { + duration *= m_spellValue->DurationMul; + // Haste modifies duration of channeled spells if (m_spellInfo->IsChanneled()) m_originalCaster->ModSpellDurationTime(m_spellInfo, duration, this); @@ -3433,6 +3436,8 @@ void Spell::handle_immediate() if (Player* modOwner = m_caster->GetSpellModOwner()) modOwner->ApplySpellMod(m_spellInfo, SpellModOp::Duration, duration); + duration *= m_spellValue->DurationMul; + // Apply haste mods m_caster->ModSpellDurationTime(m_spellInfo, duration, this); @@ -7555,6 +7560,9 @@ void Spell::SetSpellValue(SpellValueMod mod, int32 value) case SPELLVALUE_AURA_STACK: m_spellValue->AuraStackAmount = uint8(value); break; + case SPELLVALUE_DURATION_PCT: + m_spellValue->DurationMul = float(value) / 100.0f; + break; default: break; } diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 8253062a290..d625bd95f40 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -305,6 +305,7 @@ struct SpellValue uint32 MaxAffectedTargets; float RadiusMod; int32 AuraStackAmount; + float DurationMul; }; enum SpellState diff --git a/src/server/game/Spells/SpellDefines.h b/src/server/game/Spells/SpellDefines.h index 0b81f9ced5c..40d0944fc26 100644 --- a/src/server/game/Spells/SpellDefines.h +++ b/src/server/game/Spells/SpellDefines.h @@ -211,7 +211,8 @@ enum SpellValueMod : uint8 SPELLVALUE_BASE_POINT_END, SPELLVALUE_RADIUS_MOD, SPELLVALUE_MAX_TARGETS, - SPELLVALUE_AURA_STACK + SPELLVALUE_AURA_STACK, + SPELLVALUE_DURATION_PCT }; enum SpellFacingFlags |