fix(Core/Spells): Shadow Word: Death vs critters. (#15594)

Fixes #14299
This commit is contained in:
UltraNix
2023-03-29 06:27:17 +02:00
committed by GitHub
parent 7f711c0f3f
commit 7035e87543
2 changed files with 9 additions and 4 deletions

View File

@@ -12566,15 +12566,18 @@ bool Player::isHonorOrXPTarget(Unit* victim) const
// Victim level less gray level
if (v_level <= k_grey)
{
return false;
}
if (victim->GetTypeId() == TYPEID_UNIT)
{
if (victim->IsTotem() ||
victim->IsPet() ||
victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP)
if (victim->IsTotem() || victim->IsCritter() || victim->IsPet() || (victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP))
{
return false;
}
}
return true;
}

View File

@@ -17980,8 +17980,10 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
sScriptMgr->OnCreatureKilledByPet( killer->GetCharmerOrOwnerPlayerOrPlayerItself(), victim->ToCreature());
}
if (killer != victim && !victim->IsCritter())
if (killer != victim)
{
Unit::ProcDamageAndSpell(killer, victim, killer ? PROC_FLAG_KILL : 0, PROC_FLAG_KILLED, PROC_EX_NONE, 0, attackType, spellProto, nullptr, -1, spell);
}
// Proc auras on death - must be before aura/combat remove
Unit::ProcDamageAndSpell(victim, nullptr, PROC_FLAG_DEATH, PROC_FLAG_NONE, PROC_EX_NONE, 0, attackType, spellProto, nullptr, -1, spell);