feat(Core/Loot): add configurable option to specify ilv restriction for items below player class in NeedBeforeGreed loot mode in DF (#7701)

This commit is contained in:
UltraNix
2021-09-06 18:24:41 +02:00
committed by GitHub
parent 02b0b29ffa
commit 066d2ef85b
4 changed files with 12 additions and 1 deletions

View File

@@ -2423,7 +2423,7 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje
{ {
return EQUIP_ERR_CANT_DO_RIGHT_NOW; return EQUIP_ERR_CANT_DO_RIGHT_NOW;
} }
else if (proto->ItemLevel > 70) else if (sWorld->getIntConfig(CONFIG_LOOT_NEED_BEFORE_GREED_ILVL_RESTRICTION) && proto->ItemLevel > sWorld->getIntConfig(CONFIG_LOOT_NEED_BEFORE_GREED_ILVL_RESTRICTION))
{ {
if (proto->SubClass < subclassToCompare) if (proto->SubClass < subclassToCompare)
{ {

View File

@@ -381,6 +381,7 @@ enum WorldIntConfigs
CONFIG_NPC_EVADE_IF_NOT_REACHABLE, CONFIG_NPC_EVADE_IF_NOT_REACHABLE,
CONFIG_NPC_REGEN_TIME_IF_NOT_REACHABLE_IN_RAID, CONFIG_NPC_REGEN_TIME_IF_NOT_REACHABLE_IN_RAID,
CONFIG_FFA_PVP_TIMER, CONFIG_FFA_PVP_TIMER,
CONFIG_LOOT_NEED_BEFORE_GREED_ILVL_RESTRICTION,
INT_CONFIG_VALUE_COUNT INT_CONFIG_VALUE_COUNT
}; };

View File

@@ -1233,6 +1233,8 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_FFA_PVP_TIMER] = sConfigMgr->GetOption<int32>("FFAPvPTimer", 30); m_int_configs[CONFIG_FFA_PVP_TIMER] = sConfigMgr->GetOption<int32>("FFAPvPTimer", 30);
m_int_configs[CONFIG_LOOT_NEED_BEFORE_GREED_ILVL_RESTRICTION] = sConfigMgr->GetOption<int32>("LootNeedBeforeGreedILvlRestriction", 70);
///- Read the "Data" directory from the config file ///- Read the "Data" directory from the config file
std::string dataPath = sConfigMgr->GetOption<std::string>("DataDir", "./"); std::string dataPath = sConfigMgr->GetOption<std::string>("DataDir", "./");
if (dataPath.empty() || (dataPath.at(dataPath.length() - 1) != '/' && dataPath.at(dataPath.length() - 1) != '\\')) if (dataPath.empty() || (dataPath.at(dataPath.length() - 1) != '/' && dataPath.at(dataPath.length() - 1) != '\\'))

View File

@@ -3541,6 +3541,14 @@ Item.SetItemTradeable = 1
FFAPvPTimer = 30 FFAPvPTimer = 30
#
# LootNeedBeforeGreedILvlRestriction
# Description: Specify level restriction for items below player's subclass in Need Before Greed loot mode in DF groups
# Default: 70
# 0 - Disabled
LootNeedBeforeGreedILvlRestriction = 70
# #
################################################################################################### ###################################################################################################