Core/Spells: renamed SPELL_ATTR5_HASTE_AFFECT_DURATION to SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC and renamed SPELL_ATTR8_UNK17 to SPELL_ATTR8_HASTE_AFFECTS_DURATION

This commit is contained in:
Ovahlord committed 2021-04-16 16:12:58 +02:00
1 parent c41fe84b8c
commit b82943eab0
3 files changed
+9 -9

No files matched your search

+1 -1
View File
@@ -9334,7 +9334,7 @@ void Unit::ModSpellDurationTime(SpellInfo const* spellInfo, int32 & duration, Sp
if (!spellInfo || duration < 0)
return;
if (spellInfo->IsChanneled() && !spellInfo->HasAttribute(SPELL_ATTR5_HASTE_AFFECT_DURATION))
if (spellInfo->IsChanneled() && !spellInfo->HasAttribute(SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC))
return;
// called from caster
@@ -546,7 +546,7 @@ enum SpellAttr5
SPELL_ATTR5_HIDE_DURATION = 0x00000400, // 10 do not send duration to client
SPELL_ATTR5_ALLOW_TARGET_OF_TARGET_AS_TARGET = 0x00000800, // 11 (NYI) uses target's target as target if original target not valid (intervene for example)
SPELL_ATTR5_UNK12 = 0x00001000, // 12 Cleave related?
SPELL_ATTR5_HASTE_AFFECT_DURATION = 0x00002000, // 13 haste effects decrease duration of this
SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC = 0x00002000, // 13 Spell Haste Affects Periodic
SPELL_ATTR5_NOT_USABLE_WHILE_CHARMED = 0x00004000, // 14 Charmed units cannot cast this spell
SPELL_ATTR5_INCLUDE_MELEE_RANGE = 0x00008000, // 15 Area target selection includes the combat reach of caster and potential target
SPELL_ATTR5_UNK16 = 0x00010000, // 16
@@ -658,7 +658,7 @@ enum SpellAttr8
SPELL_ATTR8_UNK14 = 0x00004000, // 14
SPELL_ATTR8_WATER_MOUNT = 0x00008000, // 15 only one River Boat used in Thousand Needles
SPELL_ATTR8_UNK16 = 0x00010000, // 16
SPELL_ATTR8_UNK17 = 0x00020000, // 17
SPELL_ATTR8_HASTE_AFFECTS_DURATION = 0x00020000, // 17 Haste Affects Duration
SPELL_ATTR8_REMEMBER_SPELLS = 0x00040000, // 18 at some point in time, these auras remember spells and allow to cast them later
SPELL_ATTR8_USE_COMBO_POINTS_ON_ANY_TARGET = 0x00080000, // 19 allows to consume combo points from dead targets
SPELL_ATTR8_ARMOR_SPECIALIZATION = 0x00100000, // 20
+6 -6
View File
@@ -446,7 +446,7 @@ uint32 SpellEffectInfo::CalcPeriod(Unit* caster, Spell* spell /* = nullptr */) c
if (Player* modOwner = caster->GetSpellModOwner())
modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_ACTIVATION_TIME, period, spell);
if (_spellInfo->HasAttribute(SPELL_ATTR5_HASTE_AFFECT_DURATION) && !_spellInfo->HasAttribute(SPELL_ATTR3_NO_DONE_BONUS))
if (_spellInfo->HasAttribute(SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC) && !_spellInfo->HasAttribute(SPELL_ATTR3_NO_DONE_BONUS))
period = int32(period * caster->GetFloatValue(UNIT_MOD_CAST_HASTE));
}
@@ -3374,12 +3374,12 @@ int32 SpellInfo::CalcDuration(Unit* caster, Spell* spell) const
if (Player* modOwner = caster->GetSpellModOwner())
modOwner->ApplySpellMod(Id, SPELLMOD_DURATION, duration, spell);
bool hasUnk17 = HasAttribute(SPELL_ATTR8_UNK17);
bool hasAffectDuration = HasAttribute(SPELL_ATTR5_HASTE_AFFECT_DURATION);
bool hasteAffectsDuration = HasAttribute(SPELL_ATTR8_HASTE_AFFECTS_DURATION);
bool spellHasteAffectsPeriodic = HasAttribute(SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC);
// That aura is not used as of 4.3.4, but just include it, as it still is technically supported by the client, and so should we.
bool hasPeriodicHasteAuras = caster != nullptr && caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, this);
if (hasAffectDuration || hasUnk17)
if (spellHasteAffectsPeriodic || hasteAffectsDuration)
{
// This is just a stupid way to find the first periodic effect.
int32 periodicEffectIndex = 0;
@@ -3390,12 +3390,12 @@ int32 SpellInfo::CalcDuration(Unit* caster, Spell* spell) const
return duration;
}
if ((hasAffectDuration || hasPeriodicHasteAuras) && !HasAttribute(SPELL_ATTR3_NO_DONE_BONUS))
if ((spellHasteAffectsPeriodic || hasPeriodicHasteAuras) && !HasAttribute(SPELL_ATTR3_NO_DONE_BONUS))
{
float hasteValue = caster ? caster->GetFloatValue(UNIT_MOD_CAST_HASTE) : 0.0f;
if (hasteValue > 0.0f)
{
if (hasUnk17)
if (hasteAffectsDuration)
return int32(duration * hasteValue);
int32 effectPeriod = Effects[periodicEffectIndex].CalcPeriod(caster, spell);