fix(Core/Creature): Fix kill credit for some mobs after UpdateEntry (#5746)
Co-authored-by: Yehonal <yehonal.azeroth@gmail.com
This commit is contained in:
@@ -454,13 +454,22 @@ bool Creature::UpdateEntry(uint32 Entry, const CreatureData* data, bool changele
|
|||||||
SetAttackTime(RANGED_ATTACK, cInfo->RangeAttackTime);
|
SetAttackTime(RANGED_ATTACK, cInfo->RangeAttackTime);
|
||||||
|
|
||||||
uint32 previousHealth = GetHealth();
|
uint32 previousHealth = GetHealth();
|
||||||
|
uint32 previousMaxHealth = GetMaxHealth();
|
||||||
uint32 previousPlayerDamageReq = m_PlayerDamageReq;
|
uint32 previousPlayerDamageReq = m_PlayerDamageReq;
|
||||||
|
|
||||||
SelectLevel(changelevel);
|
SelectLevel(changelevel);
|
||||||
if (previousHealth > 0)
|
if (previousHealth > 0)
|
||||||
{
|
{
|
||||||
SetHealth(previousHealth);
|
SetHealth(previousHealth);
|
||||||
m_PlayerDamageReq = previousPlayerDamageReq;
|
|
||||||
|
if (previousMaxHealth && previousMaxHealth > GetMaxHealth())
|
||||||
|
{
|
||||||
|
m_PlayerDamageReq = (uint32)(previousPlayerDamageReq * GetMaxHealth() / previousMaxHealth);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_PlayerDamageReq = previousPlayerDamageReq;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetMeleeDamageSchool(SpellSchools(cInfo->dmgschool));
|
SetMeleeDamageSchool(SpellSchools(cInfo->dmgschool));
|
||||||
|
|||||||
Reference in New Issue
Block a user