mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 17:27:36 +01:00
Core/Creatures: Fixed crediting loot and quests for creatures using level scaling
Closes #26058
This commit is contained in:
@@ -854,7 +854,10 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
|
||||
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
victim->ToPlayer()->UpdateCriteria(CRITERIA_TYPE_HIGHEST_HIT_RECEIVED, damage);
|
||||
else if (!victim->IsControlledByPlayer() || victim->IsVehicle())
|
||||
|
||||
damage /= victim->GetHealthMultiplierForTarget(this);
|
||||
|
||||
if (victim->GetTypeId() != TYPEID_PLAYER && (!victim->IsControlledByPlayer() || victim->IsVehicle()))
|
||||
{
|
||||
if (!victim->ToCreature()->hasLootRecipient())
|
||||
victim->ToCreature()->SetLootRecipient(this);
|
||||
@@ -863,8 +866,6 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
|
||||
victim->ToCreature()->LowerPlayerDamageReq(health < damage ? health : damage);
|
||||
}
|
||||
|
||||
damage /= victim->GetHealthMultiplierForTarget(this);
|
||||
|
||||
if (health <= damage)
|
||||
{
|
||||
TC_LOG_DEBUG("entities.unit", "DealDamage: victim just died");
|
||||
|
||||
Reference in New Issue
Block a user