mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[10606] Fix loot for victims being creature type critter
Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
4c5c6c46a1
commit
df4563e653
2 changed files with 17 additions and 5 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10605"
|
||||
#define REVISION_NR "10606"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue