use effectMask to calculate mechanicMask in ModSpellDuration
This commit is contained in:
@@ -13042,16 +13042,16 @@ int32 Unit::CalcSpellDuration(SpellInfo const* spellProto)
|
|||||||
return duration;
|
return duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 Unit::ModSpellDuration(SpellInfo const* spellProto, Unit const* target, int32 duration, bool positive)
|
int32 Unit::ModSpellDuration(SpellInfo const* spellProto, Unit const* target, int32 duration, bool positive, uint32 effectMask)
|
||||||
{
|
{
|
||||||
// don't mod permament auras duration
|
// don't mod permanent auras duration
|
||||||
if (duration < 0)
|
if (duration < 0)
|
||||||
return duration;
|
return duration;
|
||||||
|
|
||||||
// cut duration only of negative effects
|
// cut duration only of negative effects
|
||||||
if (!positive)
|
if (!positive)
|
||||||
{
|
{
|
||||||
int32 mechanic = spellProto->GetAllEffectsMechanicMask();
|
int32 mechanic = spellProto->GetSpellMechanicMaskByEffectMask(effectMask);
|
||||||
|
|
||||||
int32 durationMod;
|
int32 durationMod;
|
||||||
int32 durationMod_always = 0;
|
int32 durationMod_always = 0;
|
||||||
|
|||||||
@@ -2068,7 +2068,7 @@ class Unit : public WorldObject
|
|||||||
float ApplyEffectModifiers(SpellInfo const* spellProto, uint8 effect_index, float value) const;
|
float ApplyEffectModifiers(SpellInfo const* spellProto, uint8 effect_index, float value) const;
|
||||||
int32 CalculateSpellDamage(Unit const* target, SpellInfo const* spellProto, uint8 effect_index, int32 const* basePoints = NULL) const;
|
int32 CalculateSpellDamage(Unit const* target, SpellInfo const* spellProto, uint8 effect_index, int32 const* basePoints = NULL) const;
|
||||||
int32 CalcSpellDuration(SpellInfo const* spellProto);
|
int32 CalcSpellDuration(SpellInfo const* spellProto);
|
||||||
int32 ModSpellDuration(SpellInfo const* spellProto, Unit const* target, int32 duration, bool positive);
|
int32 ModSpellDuration(SpellInfo const* spellProto, Unit const* target, int32 duration, bool positive, uint32 effectMask);
|
||||||
void ModSpellCastTime(SpellInfo const* spellProto, int32 & castTime, Spell* spell=NULL);
|
void ModSpellCastTime(SpellInfo const* spellProto, int32 & castTime, Spell* spell=NULL);
|
||||||
float CalculateLevelPenalty(SpellInfo const* spellProto) const;
|
float CalculateLevelPenalty(SpellInfo const* spellProto) const;
|
||||||
|
|
||||||
|
|||||||
@@ -1537,7 +1537,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, const uint32 effectMask, bool
|
|||||||
if (AuraApplication* aurApp = m_spellAura->GetApplicationOfTarget(m_originalCaster->GetGUID()))
|
if (AuraApplication* aurApp = m_spellAura->GetApplicationOfTarget(m_originalCaster->GetGUID()))
|
||||||
positive = aurApp->IsPositive();
|
positive = aurApp->IsPositive();
|
||||||
|
|
||||||
duration = m_originalCaster->ModSpellDuration(aurSpellInfo, unit, duration, positive);
|
duration = m_originalCaster->ModSpellDuration(aurSpellInfo, unit, duration, positive, effectMask);
|
||||||
|
|
||||||
// Haste modifies duration of channeled spells
|
// Haste modifies duration of channeled spells
|
||||||
if (m_spellInfo->IsChanneled())
|
if (m_spellInfo->IsChanneled())
|
||||||
|
|||||||
@@ -4331,7 +4331,7 @@ void Spell::EffectInterruptCast(SpellEffIndex effIndex)
|
|||||||
{
|
{
|
||||||
if (m_originalCaster)
|
if (m_originalCaster)
|
||||||
{
|
{
|
||||||
int32 duration = m_originalCaster->ModSpellDuration(m_spellInfo, unitTarget, m_originalCaster->CalcSpellDuration(m_spellInfo), false);
|
int32 duration = m_originalCaster->ModSpellDuration(m_spellInfo, unitTarget, m_originalCaster->CalcSpellDuration(m_spellInfo), false, 1 << effIndex);
|
||||||
unitTarget->ProhibitSpellSchool(curSpellInfo->GetSchoolMask(), duration/*GetSpellDuration(m_spellInfo)*/);
|
unitTarget->ProhibitSpellSchool(curSpellInfo->GetSchoolMask(), duration/*GetSpellDuration(m_spellInfo)*/);
|
||||||
}
|
}
|
||||||
ExecuteLogEffectInterruptCast(effIndex, unitTarget, curSpellInfo->Id);
|
ExecuteLogEffectInterruptCast(effIndex, unitTarget, curSpellInfo->Id);
|
||||||
|
|||||||
@@ -1735,6 +1735,17 @@ uint32 SpellInfo::GetEffectMechanicMask(uint8 effIndex) const
|
|||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32 SpellInfo::GetSpellMechanicMaskByEffectMask(uint32 effectMask) const
|
||||||
|
{
|
||||||
|
uint32 mask = 0;
|
||||||
|
if (Mechanic)
|
||||||
|
mask |= 1<< Mechanic;
|
||||||
|
for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||||
|
if ((effectMask & (1 << i)) && Effects[i].Mechanic)
|
||||||
|
mask |= 1<< Effects[i].Mechanic;
|
||||||
|
return mask;
|
||||||
|
}
|
||||||
|
|
||||||
Mechanics SpellInfo::GetEffectMechanic(uint8 effIndex) const
|
Mechanics SpellInfo::GetEffectMechanic(uint8 effIndex) const
|
||||||
{
|
{
|
||||||
if (Effects[effIndex].IsEffect() && Effects[effIndex].Mechanic)
|
if (Effects[effIndex].IsEffect() && Effects[effIndex].Mechanic)
|
||||||
|
|||||||
@@ -444,6 +444,7 @@ public:
|
|||||||
SpellSchoolMask GetSchoolMask() const;
|
SpellSchoolMask GetSchoolMask() const;
|
||||||
uint32 GetAllEffectsMechanicMask() const;
|
uint32 GetAllEffectsMechanicMask() const;
|
||||||
uint32 GetEffectMechanicMask(uint8 effIndex) const;
|
uint32 GetEffectMechanicMask(uint8 effIndex) const;
|
||||||
|
uint32 GetSpellMechanicMaskByEffectMask(uint32 effectMask) const;
|
||||||
Mechanics GetEffectMechanic(uint8 effIndex) const;
|
Mechanics GetEffectMechanic(uint8 effIndex) const;
|
||||||
uint32 GetDispelMask() const;
|
uint32 GetDispelMask() const;
|
||||||
static uint32 GetDispelMask(DispelType type);
|
static uint32 GetDispelMask(DispelType type);
|
||||||
|
|||||||
Reference in New Issue
Block a user