mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-16 21:20:01 -04:00
*Merge.
--HG-- branch : trunk
This commit is contained in:
@@ -868,6 +868,7 @@ void Spell::AddUnitTarget(Unit* pVictim, uint32 effIndex)
|
||||
target.processed = false; // Effects not apply on target
|
||||
target.alive = pVictim->isAlive();
|
||||
target.damage = 0;
|
||||
target.crit = false;
|
||||
|
||||
// Calculate hit result
|
||||
if(m_originalCaster)
|
||||
@@ -1094,7 +1095,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
||||
SpellNonMeleeDamage damageInfo(caster, unitTarget, m_spellInfo->Id, m_spellSchoolMask);
|
||||
|
||||
// Add bonuses and fill damageInfo struct
|
||||
caster->CalculateSpellDamageTaken(&damageInfo, m_damage, m_spellInfo);
|
||||
caster->CalculateSpellDamageTaken(&damageInfo, m_damage, m_spellInfo, m_attackType, target->crit);
|
||||
caster->DealDamageMods(damageInfo.target,damageInfo.damage,&damageInfo.absorb);
|
||||
|
||||
// Send log damage message to client
|
||||
@@ -6082,11 +6083,17 @@ void Spell::CalculateDamageDoneForAllTargets()
|
||||
}
|
||||
|
||||
if (target.missCondition==SPELL_MISS_NONE) // In case spell hit target, do all effect on that target
|
||||
target.damage += CalculateDamageDone(unit, mask, multiplier);
|
||||
{
|
||||
target.damage += CalculateDamageDone(unit, mask, multiplier);
|
||||
target.crit = m_caster->isSpellCrit(unit, m_spellInfo, m_spellSchoolMask, m_attackType);
|
||||
}
|
||||
else if (target.missCondition == SPELL_MISS_REFLECT) // In case spell reflect from target, do all effect on caster (if hit)
|
||||
{
|
||||
if (target.reflectResult == SPELL_MISS_NONE) // If reflected spell hit caster -> do all effect on him
|
||||
{
|
||||
target.damage += CalculateDamageDone(m_caster, mask, multiplier);
|
||||
target.crit = m_caster->isSpellCrit(m_caster, m_spellInfo, m_spellSchoolMask, m_attackType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -564,6 +564,7 @@ class Spell
|
||||
bool processed:1;
|
||||
bool alive:1;
|
||||
int32 damage;
|
||||
bool crit;
|
||||
};
|
||||
std::list<TargetInfo> m_UniqueTargetInfo;
|
||||
uint8 m_needAliveTargetMask; // Mask req. alive targets
|
||||
|
||||
@@ -1271,7 +1271,7 @@ uint32 Unit::SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage
|
||||
return damageInfo.damage;
|
||||
}
|
||||
|
||||
void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellEntry const *spellInfo, WeaponAttackType attackType)
|
||||
void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellEntry const *spellInfo, WeaponAttackType attackType, bool crit)
|
||||
{
|
||||
if (damage < 0)
|
||||
return;
|
||||
@@ -1283,7 +1283,7 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 dama
|
||||
SpellSchoolMask damageSchoolMask = SpellSchoolMask(damageInfo->schoolMask);
|
||||
uint32 crTypeMask = pVictim->GetCreatureTypeMask();
|
||||
// Check spell crit chance
|
||||
bool crit = isSpellCrit(pVictim, spellInfo, damageSchoolMask, attackType);
|
||||
//bool crit = isSpellCrit(pVictim, spellInfo, damageSchoolMask, attackType);
|
||||
bool blocked = false;
|
||||
// Per-school calc
|
||||
switch (spellInfo->DmgClass)
|
||||
|
||||
@@ -1194,7 +1194,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
void CalculateMeleeDamage(Unit *pVictim, uint32 damage, CalcDamageInfo *damageInfo, WeaponAttackType attackType = BASE_ATTACK);
|
||||
void DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss);
|
||||
|
||||
void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellEntry const *spellInfo, WeaponAttackType attackType = BASE_ATTACK);
|
||||
void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellEntry const *spellInfo, WeaponAttackType attackType = BASE_ATTACK, bool crit = false);
|
||||
int32 GetIgnoredArmorMultiplier(SpellEntry const *spellInfo, WeaponAttackType attackType);
|
||||
void DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user