mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Core/Spells: Added spell value duration to modify aura duration of a specific spell cast
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -305,6 +305,7 @@ struct SpellValue
|
||||
uint32 MaxAffectedTargets;
|
||||
float RadiusMod;
|
||||
int32 AuraStackAmount;
|
||||
float DurationMul;
|
||||
};
|
||||
|
||||
enum SpellState
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user