Core/Spells: replaced SPELLVALUE_AURA_DURATION implementation with master's SPELLVALUE_DURATION version
This commit is contained in:
1 parent
6989797014
commit
0166f84a1b
4 files changed
+12
-8
No files matched your search
@@ -538,7 +538,6 @@ SpellValue::SpellValue(SpellInfo const* proto)
|
||||
MaxAffectedTargets = proto->MaxAffectedTargets;
|
||||
RadiusMod = 1.0f;
|
||||
AuraStackAmount = 1;
|
||||
AuraDuration = 0;
|
||||
CriticalChance = 0.f;
|
||||
}
|
||||
|
||||
@@ -3071,7 +3070,7 @@ void Spell::DoSpellEffectHit(Unit* unit, uint8 effIndex, TargetInfo& hitInfo)
|
||||
|
||||
hitInfo.HitAura->SetDiminishGroup(hitInfo.DRGroup);
|
||||
|
||||
//if (!m_spellValue->Duration)
|
||||
if (!m_spellValue->Duration.has_value())
|
||||
{
|
||||
hitInfo.AuraDuration = caster->ModSpellDuration(hitInfo.AuraSpellInfo, unit, hitInfo.AuraDuration, hitInfo.Positive, hitInfo.HitAura->GetEffectMask());
|
||||
if (hitInfo.AuraDuration > 0)
|
||||
@@ -3098,6 +3097,8 @@ void Spell::DoSpellEffectHit(Unit* unit, uint8 effIndex, TargetInfo& hitInfo)
|
||||
hitInfo.AuraDuration += hitInfo.HitAura->GetRolledOverDuration();
|
||||
}
|
||||
}
|
||||
else
|
||||
hitInfo.AuraDuration = *m_spellValue->Duration;
|
||||
|
||||
if (hitInfo.AuraDuration != hitInfo.HitAura->GetMaxDuration())
|
||||
{
|
||||
@@ -3782,8 +3783,11 @@ void Spell::handle_immediate()
|
||||
if (m_spellInfo->IsChanneled())
|
||||
{
|
||||
int32 duration = Aura::CalcMaxDuration(m_spellInfo, m_caster);
|
||||
if (duration > 0)
|
||||
if (duration > 0 || m_spellValue->Duration)
|
||||
{
|
||||
if (m_spellValue->Duration)
|
||||
duration = *m_spellValue->Duration;
|
||||
|
||||
m_channeledDuration = duration;
|
||||
SendChannelStart(duration);
|
||||
}
|
||||
@@ -8162,8 +8166,8 @@ void Spell::SetSpellValue(SpellValueMod mod, int32 value)
|
||||
case SPELLVALUE_AURA_STACK:
|
||||
m_spellValue->AuraStackAmount = uint8(value);
|
||||
break;
|
||||
case SPELLVALUE_AURA_DURATION:
|
||||
m_spellValue->AuraDuration = int32(value);
|
||||
case SPELLVALUE_DURATION:
|
||||
m_spellValue->Duration = value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -241,8 +241,8 @@ struct SpellValue
|
||||
uint32 MaxAffectedTargets;
|
||||
float RadiusMod;
|
||||
uint8 AuraStackAmount;
|
||||
int32 AuraDuration;
|
||||
float CriticalChance;
|
||||
Optional<int32> Duration;
|
||||
};
|
||||
|
||||
enum SpellState
|
||||
|
||||
@@ -148,7 +148,7 @@ enum SpellValueMod : uint8
|
||||
SPELLVALUE_RADIUS_MOD,
|
||||
SPELLVALUE_MAX_TARGETS,
|
||||
SPELLVALUE_AURA_STACK,
|
||||
SPELLVALUE_AURA_DURATION
|
||||
SPELLVALUE_DURATION
|
||||
};
|
||||
|
||||
enum SpellFacingFlags
|
||||
|
||||
@@ -5287,7 +5287,7 @@ class spell_gen_flask_of_battle : public SpellScript
|
||||
int32 durationBonus = sSpellMgr->AssertSpellInfo(chugALugSpellId)->Effects[EFFECT_0].CalcValue();
|
||||
int32 duration = sSpellMgr->AssertSpellInfo(spellId)->GetMaxDuration();
|
||||
AddPct(duration, durationBonus);
|
||||
player->CastSpell(player, spellId, { SPELLVALUE_AURA_DURATION, duration });
|
||||
player->CastSpell(player, spellId, { SPELLVALUE_DURATION, duration });
|
||||
}
|
||||
else
|
||||
player->CastSpell(player, spellId);
|
||||
|
||||
Reference in new issue
Block a user