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