Core/Loot: implemented a custom server config setting to enable or disable AE loot
Port From (https://github.com/TrinityCore/TrinityCore/commit/ccc083593af16f505263f889712f46f9382bb588)
This commit is contained in:
@@ -1611,6 +1611,7 @@ namespace Framework.Constants
|
||||
DieCommandMode,
|
||||
DisableBreathing,
|
||||
DurabilityLossInPvp,
|
||||
EnableAeLoot,
|
||||
EnableMmaps,
|
||||
EnableSinfoLogin,
|
||||
EventAnnounce,
|
||||
|
||||
@@ -217,8 +217,12 @@ namespace Game
|
||||
GetPlayer().RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags.Looting);
|
||||
|
||||
List<Creature> 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));
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
#
|
||||
###################################################################################################
|
||||
|
||||
|
||||
Reference in New Issue
Block a user