mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 07:37:03 +00:00
[9792] Fix wrong damage dealing from commit [9784]
This commit is contained in:
parent
065a6732e1
commit
5902f6cf77
3 changed files with 40 additions and 25 deletions
|
|
@ -1238,6 +1238,8 @@ void Spell::HandleDelayedSpellLaunch(TargetInfo *target)
|
|||
// Fill base damage struct (unitTarget - is real spell target)
|
||||
SpellNonMeleeDamage damageInfo(caster, unitTarget, m_spellInfo->Id, m_spellSchoolMask);
|
||||
|
||||
if (missInfo == SPELL_MISS_NONE)
|
||||
{
|
||||
for (int32 effectNumber = 0; effectNumber < MAX_EFFECT_INDEX; ++effectNumber)
|
||||
{
|
||||
if (mask & (1 << effectNumber) && IsEffectHandledOnDelayedSpellLaunch(m_spellInfo, SpellEffectIndex(effectNumber)))
|
||||
|
|
@ -1256,12 +1258,33 @@ void Spell::HandleDelayedSpellLaunch(TargetInfo *target)
|
|||
}
|
||||
}
|
||||
|
||||
if (m_damage > 0)
|
||||
caster->CalculateSpellDamage(&damageInfo, m_damage, m_spellInfo, m_attackType);
|
||||
}
|
||||
|
||||
target->damage = damageInfo.damage;
|
||||
target->HitInfo = damageInfo.HitInfo;
|
||||
}
|
||||
|
||||
void Spell::InitializeDamageMultipliers()
|
||||
{
|
||||
for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i)
|
||||
{
|
||||
if (m_spellInfo->Effect[i] == 0)
|
||||
continue;
|
||||
|
||||
uint32 EffectChainTarget = m_spellInfo->EffectChainTarget[i];
|
||||
if (Unit* realCaster = GetAffectiveCaster())
|
||||
if(Player* modOwner = realCaster->GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, EffectChainTarget, this);
|
||||
|
||||
m_damageMultipliers[i] = 1.0f;
|
||||
if( (m_spellInfo->EffectImplicitTargetA[i] == TARGET_CHAIN_DAMAGE || m_spellInfo->EffectImplicitTargetA[i] == TARGET_CHAIN_HEAL) &&
|
||||
(EffectChainTarget > 1) )
|
||||
m_applyMultiplierMask |= (1 << i);
|
||||
}
|
||||
}
|
||||
|
||||
bool Spell::IsAliveUnitPresentInTargetList()
|
||||
{
|
||||
// Not need check return true
|
||||
|
|
@ -2728,6 +2751,8 @@ void Spell::cast(bool skipCheck)
|
|||
SendCastResult(castResult);
|
||||
SendSpellGo(); // we must send smsg_spell_go packet before m_castItem delete in TakeCastItem()...
|
||||
|
||||
InitializeDamageMultipliers();
|
||||
|
||||
// Okay, everything is prepared. Now we need to distinguish between immediate and evented delayed spells
|
||||
if (m_spellInfo->speed > 0.0f)
|
||||
{
|
||||
|
|
@ -2862,17 +2887,6 @@ void Spell::_handle_immediate_phase()
|
|||
// Don't do spell log, if is school damage spell
|
||||
if(m_spellInfo->Effect[j] == SPELL_EFFECT_SCHOOL_DAMAGE || m_spellInfo->Effect[j] == 0)
|
||||
m_needSpellLog = false;
|
||||
|
||||
uint32 EffectChainTarget = m_spellInfo->EffectChainTarget[j];
|
||||
if (Unit* realCaster = GetAffectiveCaster())
|
||||
if(Player* modOwner = realCaster->GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, EffectChainTarget, this);
|
||||
|
||||
// initialize multipliers
|
||||
m_damageMultipliers[j] = 1.0f;
|
||||
if( (m_spellInfo->EffectImplicitTargetA[j] == TARGET_CHAIN_DAMAGE || m_spellInfo->EffectImplicitTargetA[j] == TARGET_CHAIN_HEAL) &&
|
||||
(EffectChainTarget > 1) )
|
||||
m_applyMultiplierMask |= (1 << j);
|
||||
}
|
||||
|
||||
// initialize Diminishing Returns Data
|
||||
|
|
|
|||
|
|
@ -606,6 +606,7 @@ class Spell
|
|||
void AddItemTarget(Item* target, SpellEffectIndex effIndex);
|
||||
void DoAllEffectOnTarget(TargetInfo *target);
|
||||
void HandleDelayedSpellLaunch(TargetInfo *target);
|
||||
void InitializeDamageMultipliers();
|
||||
void DoSpellHitOnUnit(Unit *unit, uint32 effectMask);
|
||||
void DoAllEffectOnTarget(GOTargetInfo *target);
|
||||
void DoAllEffectOnTarget(ItemTargetInfo *target);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9791"
|
||||
#define REVISION_NR "9792"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue