diff --git a/Source/Framework/Constants/SharedConst.cs b/Source/Framework/Constants/SharedConst.cs index be6f1a467..0f59ad47b 100644 --- a/Source/Framework/Constants/SharedConst.cs +++ b/Source/Framework/Constants/SharedConst.cs @@ -1611,6 +1611,7 @@ namespace Framework.Constants DieCommandMode, DisableBreathing, DurabilityLossInPvp, + EnableAeLoot, EnableMmaps, EnableSinfoLogin, EventAnnounce, diff --git a/Source/Game/Handlers/LootHandler.cs b/Source/Game/Handlers/LootHandler.cs index 9590b13f9..81000cd63 100644 --- a/Source/Game/Handlers/LootHandler.cs +++ b/Source/Game/Handlers/LootHandler.cs @@ -217,8 +217,12 @@ namespace Game GetPlayer().RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags.Looting); List corpses = new(); - CreatureListSearcher searcher = new(_player, corpses, check); - Cell.VisitGridObjects(_player, searcher, AELootCreatureCheck.LootDistance); + bool aeLootEnabled = WorldConfig.GetBoolValue(WorldCfg.EnableAeLoot); + if (aeLootEnabled) + { + CreatureListSearcher searcher = new(_player, corpses, check); + Cell.VisitGridObjects(_player, searcher, AELootCreatureCheck.LootDistance); + } if (!corpses.Empty()) SendPacket(new AELootTargets((uint)corpses.Count + 1)); diff --git a/Source/Game/Server/WorldConfig.cs b/Source/Game/Server/WorldConfig.cs index f854582d9..8f353cad8 100644 --- a/Source/Game/Server/WorldConfig.cs +++ b/Source/Game/Server/WorldConfig.cs @@ -1011,6 +1011,9 @@ namespace Game // Specifies if IP addresses can be logged to the database Values[WorldCfg.AllowLogginIpAddressesInDatabase] = GetDefaultValue("AllowLoggingIPAddressesInDatabase", true); + // Enable AE loot + Values[WorldCfg.EnableAeLoot] = GetDefaultValue("Loot.EnableAELoot", true); + // call ScriptMgr if we're reloading the configuration if (reload) Global.ScriptMgr.OnConfigLoad(reload); diff --git a/Source/WorldServer/WorldServer.conf.dist b/Source/WorldServer/WorldServer.conf.dist index c48e9fa42..171b7ce87 100644 --- a/Source/WorldServer/WorldServer.conf.dist +++ b/Source/WorldServer/WorldServer.conf.dist @@ -3404,6 +3404,14 @@ Creature.CheckInvalidPosition = 0 GameObject.CheckInvalidPosition = 0 +# +# Loot.EnableAELoot +# Description: Enables AE loot which will allow looting all creatures within a 30 yards radius at once +# Default: 1 - (AE loot enabled) +# 0 - (AE loot disabled) + +Loot.EnableAELoot = 1 + # ###################################################################################################