mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
auto equip upgrade
This commit is contained in:
@@ -155,8 +155,12 @@ AiPlayerbot.FreeMethodLoot = 0
|
||||
AiPlayerbot.AutoPickReward = no
|
||||
|
||||
# Bots equip upgrades (Bots will equip any item obtained from looting or a quest if they are upgrades)
|
||||
# Default: 0 (disabled)
|
||||
AiPlayerbot.AutoEquipUpgradeLoot = 0
|
||||
# Default: 1 (enable)
|
||||
AiPlayerbot.AutoEquipUpgradeLoot = 1
|
||||
|
||||
# Equip upgrade threshold for auto equip upgrade
|
||||
# Default: 1.1 (Equip when the equipment score is 1.1 times higher than the current)
|
||||
AiPlayerbot.EquipUpgradeThreshold = 1.1
|
||||
|
||||
# Sync quests with player (Bots will complete quests the moment you hand them in. Bots will ignore looting quest items.)
|
||||
# Default: 0 (disabled)
|
||||
|
||||
@@ -334,6 +334,7 @@ bool PlayerbotAIConfig::Initialize()
|
||||
freeMethodLoot = sConfigMgr->GetOption<bool>("AiPlayerbot.FreeMethodLoot", false);
|
||||
autoPickReward = sConfigMgr->GetOption<std::string>("AiPlayerbot.AutoPickReward", "yes");
|
||||
autoEquipUpgradeLoot = sConfigMgr->GetOption<bool>("AiPlayerbot.AutoEquipUpgradeLoot", true);
|
||||
equipUpgradeThreshold = sConfigMgr->GetOption<float>("AiPlayerbot.EquipUpgradeThreshold", 1.1f);
|
||||
syncQuestWithPlayer = sConfigMgr->GetOption<bool>("AiPlayerbot.SyncQuestWithPlayer", false);
|
||||
syncQuestForPlayer = sConfigMgr->GetOption<bool>("AiPlayerbot.SyncQuestForPlayer", false);
|
||||
autoTrainSpells = sConfigMgr->GetOption<std::string>("AiPlayerbot.AutoTrainSpells", "yes");
|
||||
|
||||
@@ -151,6 +151,7 @@ class PlayerbotAIConfig
|
||||
bool freeMethodLoot;
|
||||
std::string autoPickReward;
|
||||
bool autoEquipUpgradeLoot;
|
||||
float equipUpgradeThreshold;
|
||||
bool syncQuestWithPlayer;
|
||||
bool syncQuestForPlayer;
|
||||
std::string autoTrainSpells;
|
||||
|
||||
@@ -289,7 +289,7 @@ std::vector<Item*> InventoryAction::parseItems(std::string const text, IterateIt
|
||||
found.insert(visitor.GetResult().begin(), visitor.GetResult().end());
|
||||
}
|
||||
|
||||
FindUsableNamedItemVisitor visitor(bot, text);
|
||||
FindNamedItemVisitor visitor(bot, text);
|
||||
IterateItems(&visitor, ITERATE_ITEMS_IN_BAGS);
|
||||
found.insert(visitor.GetResult().begin(), visitor.GetResult().end());
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "AiFactory.h"
|
||||
#include "ChatHelper.h"
|
||||
#include "GuildTaskMgr.h"
|
||||
#include "PlayerbotAIConfig.h"
|
||||
#include "PlayerbotFactory.h"
|
||||
#include "Playerbots.h"
|
||||
#include "RandomItemMgr.h"
|
||||
@@ -208,7 +209,7 @@ ItemUsage ItemUsageValue::QueryItemUsageForEquip(ItemTemplate const* itemProto)
|
||||
// uint32 oldStatWeight = sRandomItemMgr->GetLiveStatWeight(bot, oldItemProto->ItemId);
|
||||
if (itemScore || oldScore)
|
||||
{
|
||||
shouldEquip = itemScore > oldScore * 1.1;
|
||||
shouldEquip = itemScore > oldScore * sPlayerbotAIConfig->equipUpgradeThreshold;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user