diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index 5b011496b..d1efe5ed5 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -1270,6 +1270,10 @@ namespace Game.Entities public void SetTapList(HashSet tapList) { m_tapList = tapList; } public bool HasLootRecipient() { return !m_tapList.Empty(); } + public bool CanHaveLoot() { return !_staticFlags.HasFlag(CreatureStaticFlags.NoLoot); } + + public void SetCanHaveLoot(bool canHaveLoot) { _staticFlags.ApplyFlag(CreatureStaticFlags.NoLoot, !canHaveLoot); } + public void SaveToDB() { // this should only be used when the creature has already been loaded diff --git a/Source/Game/Entities/Unit/Unit.Combat.cs b/Source/Game/Entities/Unit/Unit.Combat.cs index fc5c28184..c01d5ab71 100644 --- a/Source/Game/Entities/Unit/Unit.Combat.cs +++ b/Source/Game/Entities/Unit/Unit.Combat.cs @@ -703,6 +703,9 @@ namespace Game.Entities if (tapper != null) tappers.Add(tapper); } + + if (!creature.CanHaveLoot()) + isRewardAllowed = false; } // Exploit fix @@ -900,7 +903,7 @@ namespace Game.Entities else creature.AllLootRemovedFromCorpse(); - if (LootStorage.Skinning.HaveLootFor(creature.GetCreatureTemplate().SkinLootId)) + if (creature.CanHaveLoot() && LootStorage.Skinning.HaveLootFor(creature.GetCreatureTemplate().SkinLootId)) { creature.SetDynamicFlag(UnitDynFlags.CanSkin); creature.SetUnitFlag(UnitFlags.Skinnable); diff --git a/Source/Game/Spells/SpellInfo.cs b/Source/Game/Spells/SpellInfo.cs index 861f7ee5e..d94cc099e 100644 --- a/Source/Game/Spells/SpellInfo.cs +++ b/Source/Game/Spells/SpellInfo.cs @@ -1034,7 +1034,7 @@ namespace Game.Spells if (targetCreature == null) return SpellCastResult.BadTargets; - if (!Loots.LootStorage.Pickpocketing.HaveLootFor(targetCreature.GetCreatureTemplate().PickPocketId)) + if (!targetCreature.CanHaveLoot() || !Loots.LootStorage.Pickpocketing.HaveLootFor(targetCreature.GetCreatureTemplate().PickPocketId)) return SpellCastResult.TargetNoPockets; }