mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01:00
*Fix usage of EffectValueMultiplier in spell code.
*Remove some obsolete code from spell class. *Rename some spellmod and dbc column names to be more accurate. --HG-- branch : trunk
This commit is contained in:
@@ -471,8 +471,6 @@ m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo))
|
||||
m_spellSchoolMask = SpellSchoolMask(1 << pItem->GetProto()->Damage[0].DamageType);
|
||||
}
|
||||
}
|
||||
// Set health leech amount to zero
|
||||
m_healthLeech = 0;
|
||||
|
||||
if (originalCasterGUID)
|
||||
m_originalCasterGUID = originalCasterGUID;
|
||||
@@ -2421,10 +2419,6 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
|
||||
|
||||
if (maxTargets > 1)
|
||||
{
|
||||
//otherwise, this multiplier is used for something else
|
||||
m_damageMultipliers[i] = 1.0f;
|
||||
m_applyMultiplierMask |= 1 << i;
|
||||
|
||||
float range;
|
||||
std::list<Unit*> unitList;
|
||||
|
||||
@@ -3727,10 +3721,6 @@ void Spell::finish(bool ok)
|
||||
if (IsSpellHaveEffect(m_spellInfo, SPELL_EFFECT_ADD_EXTRA_ATTACKS))
|
||||
m_caster->m_extraAttacks = 0;
|
||||
|
||||
// Heal caster for all health leech from all targets
|
||||
if (m_healthLeech)
|
||||
m_caster->DealHeal(m_caster, uint32(m_healthLeech), m_spellInfo);
|
||||
|
||||
if (IsMeleeAttackResetSpell())
|
||||
{
|
||||
bool found = false;
|
||||
@@ -6939,18 +6929,11 @@ bool Spell::IsValidSingleTargetSpell(Unit const* target) const
|
||||
|
||||
void Spell::CalculateDamageDoneForAllTargets()
|
||||
{
|
||||
float multiplier[3];
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
float multiplier[MAX_SPELL_EFFECTS];
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (m_applyMultiplierMask & (1 << i))
|
||||
{
|
||||
// Get multiplier
|
||||
multiplier[i] = m_spellInfo->DmgMultiplier[i];
|
||||
// Apply multiplier mods
|
||||
if (m_originalCaster)
|
||||
if (Player* modOwner = m_originalCaster->GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_EFFECT_PAST_FIRST, multiplier[i], this);
|
||||
}
|
||||
// Get multiplier
|
||||
multiplier[i] = SpellMgr::CalculateSpellEffectDamageMultiplier(m_spellInfo, i, m_originalCaster, this);
|
||||
}
|
||||
|
||||
bool usesAmmo = true;
|
||||
@@ -7054,11 +7037,6 @@ int32 Spell::CalculateDamageDone(Unit *unit, const uint32 effectMask, float *mul
|
||||
}
|
||||
}
|
||||
}
|
||||
if (m_applyMultiplierMask & (1 << i))
|
||||
{
|
||||
m_damage = int32(m_damage * m_damageMultipliers[i]);
|
||||
m_damageMultipliers[i] *= multiplier[i];
|
||||
}
|
||||
|
||||
damageDone += m_damage;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user