Core/Creature: Implemented sparring with max health percent thresholds

Port From (https://github.com/TrinityCore/TrinityCore/commit/0750b7f8455df39a64462636ca296c6f2aa2b048)
This commit is contained in:
hondacrx
2023-04-25 08:38:55 -04:00
parent 9d4be0003b
commit bd2eb5baab
9 changed files with 138 additions and 3 deletions
+9
View File
@@ -564,6 +564,15 @@ namespace Game.Entities
CalculateMeleeDamage(victim, out damageInfo, attType);
// Send log damage message to client
DealDamageMods(damageInfo.Attacker, victim, ref damageInfo.Damage, ref damageInfo.Absorb);
// sparring
Creature victimCreature = victim.ToCreature();
if (victimCreature != null)
{
if (victimCreature.ShouldFakeDamageFrom(damageInfo.Attacker))
damageInfo.HitInfo |= HitInfo.FakeDamage;
}
SendAttackStateUpdate(damageInfo);
_lastDamagedTargetGuid = victim.GetGUID();