diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e5f97459c..cef5fc3bd 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -572,18 +572,30 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa pVictim->RemoveSpellbyDamageTaken(SPELL_AURA_MOD_ROOT, damage); // no xp,health if type 8 /critters/ - if(pVictim->GetTypeId() != TYPEID_PLAYER && pVictim->GetCreatureType() == CREATURE_TYPE_CRITTER) + if (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->GetCreatureType() == CREATURE_TYPE_CRITTER) { + // TODO: fix this part + // Critter may not die of damage taken, instead expect it to run away (no fighting back) + // If (this) is TYPEID_PLAYER, (this) will enter combat w/victim, but after some time, automatically leave combat. + // It is unclear how it should work for other cases. + + ((Creature*)pVictim)->SetLootRecipient(this); + pVictim->setDeathState(JUST_DIED); pVictim->SetHealth(0); // allow loot only if has loot_id in creature_template ((Creature*)pVictim)->PrepareBodyLootState(); + ((Creature*)pVictim)->AllLootRemovedFromCorpse(); // some critters required for quests (need normal entry instead possible heroic in any cases) - if(GetTypeId() == TYPEID_PLAYER) - if(CreatureInfo const* normalInfo = ObjectMgr::GetCreatureTemplate(pVictim->GetEntry())) - ((Player*)this)->KilledMonster(normalInfo,pVictim->GetObjectGuid()); + if (GetTypeId() == TYPEID_PLAYER) + { + if (CreatureInfo const* normalInfo = ObjectMgr::GetCreatureTemplate(pVictim->GetEntry())) + ((Player*)this)->KilledMonster(normalInfo, pVictim->GetObjectGuid()); + } + + DEBUG_FILTER_LOG(LOG_FILTER_DAMAGE, "DealDamage critter, critter dies"); return damage; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index f14e98144..acf927e00 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10605" + #define REVISION_NR "10606" #endif // __REVISION_NR_H__