Core/Creatures: implement CREATURE_STATIC_FLAG_NO_LOOT

This commit is contained in:
Ovahlord committed 2023-08-27 17:41:50 +02:00
1 parent ff575bcef0
commit 577bdd5ff4
2 files changed
+6 -3

No files matched your search

@@ -154,6 +154,9 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, 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);
+3 -3
View File
@@ -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();