diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 927dfdbbfe..cf634ff9cb 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -154,6 +154,9 @@ class TC_GAME_API Creature : public Unit, public GridObject, public Ma void SetCanMelee(bool canMelee) { _staticFlags.ApplyFlag(CREATURE_STATIC_FLAG_NO_MELEE, !canMelee); } bool CanIgnoreLineOfSightWhenCastingOnMe() const { return _staticFlags.HasFlag(CREATURE_STATIC_FLAG_4_IGNORE_LOS_WHEN_CASTING_ON_ME); } + void DisableLoot(bool disable) { _staticFlags.ApplyFlag(CREATURE_STATIC_FLAG_NO_LOOT, !disable); } + bool IsLootDisabled() const { return _staticFlags.HasFlag(CREATURE_STATIC_FLAG_NO_LOOT); } + bool HasSpell(uint32 spellID) const override; bool UpdateEntry(uint32 entry, CreatureData const* data = nullptr, bool updateLevel = true); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index d854c86761..f53e024ee6 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11030,7 +11030,7 @@ void Unit::PlayOneShotAnimKitId(uint16 animKitId) { group->BroadcastPacket(&data, group->GetMemberGroup(player->GetGUID()) != 0); - if (creature) + if (creature && !creature->IsLootDisabled()) { group->UpdateLooterGuid(creature, true); if (group->GetLooterGuid()) @@ -11048,7 +11048,7 @@ void Unit::PlayOneShotAnimKitId(uint16 animKitId) { player->SendDirectMessage(&data); - if (creature) + if (creature && !creature->IsLootDisabled()) { WorldPackets::Loot::LootList lootList; lootList.Owner = creature->GetGUID(); @@ -11059,7 +11059,7 @@ void Unit::PlayOneShotAnimKitId(uint16 animKitId) } // Generate loot before updating looter - if (creature) + if (creature && !creature->IsLootDisabled()) { Loot* loot = &creature->loot; loot->clear();