mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
fix(Core/Spells): Implemented SPELL_HIT_TYPE_SPLIT hit type. Source: … (#13518)
fix(Core/Spells): Implemented SPELL_HIT_TYPE_SPLIT hit type. Source: TrinityCore. Fixes #13306
This commit is contained in:
@@ -915,7 +915,9 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage
|
||||
}
|
||||
|
||||
if (attacker && shareDamageTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
attacker->SendSpellNonMeleeDamageLog(shareDamageTarget, spell, shareDamage, damageSchoolMask, shareAbsorb, shareResist, damagetype == DIRECT_DAMAGE, 0, false);
|
||||
{
|
||||
attacker->SendSpellNonMeleeDamageLog(shareDamageTarget, spell, shareDamage, damageSchoolMask, shareAbsorb, shareResist, damagetype == DIRECT_DAMAGE, 0, false, true);
|
||||
}
|
||||
|
||||
Unit::DealDamage(attacker, shareDamageTarget, shareDamage, cleanDamage, NODAMAGE, damageSchoolMask, spellProto, false, false, damageSpell);
|
||||
}
|
||||
@@ -2359,7 +2361,9 @@ void Unit::CalcAbsorbResist(DamageInfo& dmgInfo, bool Splited)
|
||||
caster->ProcDamageAndSpellFor(true, attacker, procVictim, procEx, BASE_ATTACK, spellInfo, splitted, nullptr, -1, nullptr, &splittedDmgInfo);
|
||||
|
||||
if (attacker)
|
||||
attacker->SendSpellNonMeleeDamageLog(caster, (*itr)->GetSpellInfo(), splitted, schoolMask, splitted_absorb, splitted_resist, false, 0, false);
|
||||
{
|
||||
attacker->SendSpellNonMeleeDamageLog(caster, (*itr)->GetSpellInfo(), splitted, schoolMask, splitted_absorb, splitted_resist, false, 0, false, true);
|
||||
}
|
||||
|
||||
CleanDamage cleanDamage = CleanDamage(splitted, 0, BASE_ATTACK, MELEE_HIT_NORMAL);
|
||||
Unit::DealDamage(attacker, caster, splitted, &cleanDamage, DIRECT_DAMAGE, schoolMask, (*itr)->GetSpellInfo(), false);
|
||||
@@ -2430,7 +2434,9 @@ void Unit::CalcAbsorbResist(DamageInfo& dmgInfo, bool Splited)
|
||||
caster->ProcDamageAndSpellFor(true, attacker, procVictim, procEx, BASE_ATTACK, spellInfo, splitted);
|
||||
|
||||
if (attacker)
|
||||
attacker->SendSpellNonMeleeDamageLog(caster, splitSpellInfo, splitted, splitSchoolMask, splitted_absorb, splitted_resist, false, 0, false);
|
||||
{
|
||||
attacker->SendSpellNonMeleeDamageLog(caster, splitSpellInfo, splitted, splitSchoolMask, splitted_absorb, splitted_resist, false, 0, false, true);
|
||||
}
|
||||
|
||||
CleanDamage cleanDamage = CleanDamage(splitted, 0, BASE_ATTACK, MELEE_HIT_NORMAL);
|
||||
Unit::DealDamage(attacker, caster, splitted, &cleanDamage, DIRECT_DAMAGE, splitSchoolMask, splitSpellInfo, false);
|
||||
@@ -6219,11 +6225,31 @@ void Unit::SendSpellNonMeleeDamageLog(SpellNonMeleeDamage* log)
|
||||
data << uint8 (log->unused); // unused
|
||||
data << uint32(log->blocked); // blocked
|
||||
data << uint32(log->HitInfo);
|
||||
data << uint8 (0); // flag to use extend data
|
||||
data << uint32(log->HitInfo);
|
||||
data << uint8(log->HitInfo & (SPELL_HIT_TYPE_CRIT_DEBUG | SPELL_HIT_TYPE_HIT_DEBUG | SPELL_HIT_TYPE_ATTACK_TABLE_DEBUG));
|
||||
//if (log->HitInfo & SPELL_HIT_TYPE_CRIT_DEBUG)
|
||||
//{
|
||||
// data << float(log->CritRoll);
|
||||
// data << float(log->CritNeeded);
|
||||
//}
|
||||
//if (log->HitInfo & SPELL_HIT_TYPE_HIT_DEBUG)
|
||||
//{
|
||||
// data << float(log->HitRoll);
|
||||
// data << float(log->HitNeeded);
|
||||
//}
|
||||
//if (log->HitInfo & SPELL_HIT_TYPE_ATTACK_TABLE_DEBUG)
|
||||
//{
|
||||
// data << float(log->MissChance);
|
||||
// data << float(log->DodgeChance);
|
||||
// data << float(log->ParryChance);
|
||||
// data << float(log->BlockChance);
|
||||
// data << float(log->GlanceChance);
|
||||
// data << float(log->CrushChance);
|
||||
//}
|
||||
SendMessageToSet(&data, true);
|
||||
}
|
||||
|
||||
void Unit::SendSpellNonMeleeDamageLog(Unit* target, SpellInfo const* spellInfo, uint32 Damage, SpellSchoolMask damageSchoolMask, uint32 AbsorbedDamage, uint32 Resist, bool PhysicalDamage, uint32 Blocked, bool CriticalHit)
|
||||
void Unit::SendSpellNonMeleeDamageLog(Unit* target, SpellInfo const* spellInfo, uint32 Damage, SpellSchoolMask damageSchoolMask, uint32 AbsorbedDamage, uint32 Resist, bool PhysicalDamage, uint32 Blocked, bool CriticalHit /*= false*/, bool Split /*= false*/)
|
||||
{
|
||||
SpellNonMeleeDamage log(this, target, spellInfo, damageSchoolMask);
|
||||
log.damage = Damage;
|
||||
@@ -6231,9 +6257,15 @@ void Unit::SendSpellNonMeleeDamageLog(Unit* target, SpellInfo const* spellInfo,
|
||||
log.resist = Resist;
|
||||
log.physicalLog = PhysicalDamage;
|
||||
log.blocked = Blocked;
|
||||
log.HitInfo = SPELL_HIT_TYPE_UNK1 | SPELL_HIT_TYPE_UNK3 | SPELL_HIT_TYPE_UNK6;
|
||||
log.HitInfo = 0;
|
||||
if (CriticalHit)
|
||||
{
|
||||
log.HitInfo |= SPELL_HIT_TYPE_CRIT;
|
||||
}
|
||||
if (Split)
|
||||
{
|
||||
log.HitInfo |= SPELL_HIT_TYPE_SPLIT;
|
||||
}
|
||||
SendSpellNonMeleeDamageLog(&log);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user