mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
@@ -174,10 +174,6 @@ AiPlayerbot.SummonWhenGroup = 1
|
|||||||
# Selfbot permission level (0 = disabled, 1 = GM only (default), 2 = all players, 3 = activate on login)
|
# Selfbot permission level (0 = disabled, 1 = GM only (default), 2 = all players, 3 = activate on login)
|
||||||
AiPlayerbot.SelfBotLevel = 1
|
AiPlayerbot.SelfBotLevel = 1
|
||||||
|
|
||||||
# Give free food to bots
|
|
||||||
# Default: 1 (enabled)
|
|
||||||
AiPlayerbot.FreeFood = 1
|
|
||||||
|
|
||||||
# Non-GM player can only use init=auto to initialize bots based on their own level and gearscore
|
# Non-GM player can only use init=auto to initialize bots based on their own level and gearscore
|
||||||
# Default: 0 (non-GM player can use any intialization commands)
|
# Default: 0 (non-GM player can use any intialization commands)
|
||||||
AiPlayerbot.AutoInitOnly = 0
|
AiPlayerbot.AutoInitOnly = 0
|
||||||
@@ -496,6 +492,7 @@ AiPlayerbot.AutoGearQualityLimit = 3
|
|||||||
AiPlayerbot.AutoGearScoreLimit = 0
|
AiPlayerbot.AutoGearScoreLimit = 0
|
||||||
|
|
||||||
# Enable/Disable cheats for bots
|
# Enable/Disable cheats for bots
|
||||||
|
# "food" (bots use cheat when eat or drink)
|
||||||
# "gold" (bots have infinite gold)
|
# "gold" (bots have infinite gold)
|
||||||
# "health" (bots have infinite health)
|
# "health" (bots have infinite health)
|
||||||
# "mana" (bots have infinite mana)
|
# "mana" (bots have infinite mana)
|
||||||
@@ -504,7 +501,7 @@ AiPlayerbot.AutoGearScoreLimit = 0
|
|||||||
# "raid" (bots use cheats implemented into raid strategies)
|
# "raid" (bots use cheats implemented into raid strategies)
|
||||||
# To use multiple cheats, separate them by commas below (e.g., to enable all, use "gold,health,mana,power,raid,taxi")
|
# To use multiple cheats, separate them by commas below (e.g., to enable all, use "gold,health,mana,power,raid,taxi")
|
||||||
# Default: taxi and raid are enabled
|
# Default: taxi and raid are enabled
|
||||||
AiPlayerbot.BotCheats = "taxi,raid"
|
AiPlayerbot.BotCheats = "food,taxi,raid"
|
||||||
|
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -462,11 +462,13 @@ bool PlayerbotAIConfig::Initialize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
botCheats.clear();
|
botCheats.clear();
|
||||||
LoadListString<std::vector<std::string>>(sConfigMgr->GetOption<std::string>("AiPlayerbot.BotCheats", "taxi,raid"),
|
LoadListString<std::vector<std::string>>(sConfigMgr->GetOption<std::string>("AiPlayerbot.BotCheats", "food,taxi,raid"),
|
||||||
botCheats);
|
botCheats);
|
||||||
|
|
||||||
botCheatMask = 0;
|
botCheatMask = 0;
|
||||||
|
|
||||||
|
if (std::find(botCheats.begin(), botCheats.end(), "food") != botCheats.end())
|
||||||
|
botCheatMask |= (uint32)BotCheatMask::food;
|
||||||
if (std::find(botCheats.begin(), botCheats.end(), "taxi") != botCheats.end())
|
if (std::find(botCheats.begin(), botCheats.end(), "taxi") != botCheats.end())
|
||||||
botCheatMask |= (uint32)BotCheatMask::taxi;
|
botCheatMask |= (uint32)BotCheatMask::taxi;
|
||||||
if (std::find(botCheats.begin(), botCheats.end(), "gold") != botCheats.end())
|
if (std::find(botCheats.begin(), botCheats.end(), "gold") != botCheats.end())
|
||||||
@@ -598,7 +600,6 @@ bool PlayerbotAIConfig::Initialize()
|
|||||||
RpgStatusProbWeight[RPG_REST] = sConfigMgr->GetOption<int32>("AiPlayerbot.RpgStatusProbWeight.Rest", 5);
|
RpgStatusProbWeight[RPG_REST] = sConfigMgr->GetOption<int32>("AiPlayerbot.RpgStatusProbWeight.Rest", 5);
|
||||||
|
|
||||||
syncLevelWithPlayers = sConfigMgr->GetOption<bool>("AiPlayerbot.SyncLevelWithPlayers", false);
|
syncLevelWithPlayers = sConfigMgr->GetOption<bool>("AiPlayerbot.SyncLevelWithPlayers", false);
|
||||||
freeFood = sConfigMgr->GetOption<bool>("AiPlayerbot.FreeFood", true);
|
|
||||||
randomBotGroupNearby = sConfigMgr->GetOption<bool>("AiPlayerbot.RandomBotGroupNearby", true);
|
randomBotGroupNearby = sConfigMgr->GetOption<bool>("AiPlayerbot.RandomBotGroupNearby", true);
|
||||||
|
|
||||||
// arena
|
// arena
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ enum class BotCheatMask : uint32
|
|||||||
mana = 8,
|
mana = 8,
|
||||||
power = 16,
|
power = 16,
|
||||||
raid = 32,
|
raid = 32,
|
||||||
maxMask = 64
|
food = 64,
|
||||||
|
maxMask = 128
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class HealingManaEfficiency : uint8
|
enum class HealingManaEfficiency : uint8
|
||||||
@@ -340,7 +341,6 @@ public:
|
|||||||
bool enableNewRpgStrategy;
|
bool enableNewRpgStrategy;
|
||||||
std::unordered_map<NewRpgStatus, uint32> RpgStatusProbWeight;
|
std::unordered_map<NewRpgStatus, uint32> RpgStatusProbWeight;
|
||||||
bool syncLevelWithPlayers;
|
bool syncLevelWithPlayers;
|
||||||
bool freeFood;
|
|
||||||
bool autoLearnQuestSpells;
|
bool autoLearnQuestSpells;
|
||||||
bool autoTeleportForLevel;
|
bool autoTeleportForLevel;
|
||||||
bool randomBotGroupNearby;
|
bool randomBotGroupNearby;
|
||||||
|
|||||||
@@ -3244,7 +3244,7 @@ std::vector<uint32> PlayerbotFactory::GetCurrentGemsCount()
|
|||||||
|
|
||||||
void PlayerbotFactory::InitFood()
|
void PlayerbotFactory::InitFood()
|
||||||
{
|
{
|
||||||
if (sPlayerbotAIConfig->freeFood)
|
if (!botAI->HasCheat(BotCheatMask::food))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ bool GiveFoodAction::isUseful()
|
|||||||
|
|
||||||
bool isRandomBot = GetTarget()->IsPlayer() && sRandomPlayerbotMgr->IsRandomBot((Player*)GetTarget());
|
bool isRandomBot = GetTarget()->IsPlayer() && sRandomPlayerbotMgr->IsRandomBot((Player*)GetTarget());
|
||||||
|
|
||||||
return !isRandomBot || (isRandomBot && !sPlayerbotAIConfig->freeFood);
|
return !isRandomBot || (isRandomBot && !botAI->HasCheat(BotCheatMask::food));
|
||||||
}
|
}
|
||||||
|
|
||||||
Unit* GiveWaterAction::GetTarget() { return AI_VALUE(Unit*, "party member without water"); }
|
Unit* GiveWaterAction::GetTarget() { return AI_VALUE(Unit*, "party member without water"); }
|
||||||
@@ -88,5 +88,5 @@ bool GiveWaterAction::isUseful()
|
|||||||
|
|
||||||
bool isRandomBot = GetTarget()->IsPlayer() && sRandomPlayerbotMgr->IsRandomBot((Player*)GetTarget());
|
bool isRandomBot = GetTarget()->IsPlayer() && sRandomPlayerbotMgr->IsRandomBot((Player*)GetTarget());
|
||||||
|
|
||||||
return !isRandomBot || (isRandomBot && !sPlayerbotAIConfig->freeFood);
|
return !isRandomBot || (isRandomBot && !botAI->HasCheat(BotCheatMask::food));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ bool DrinkAction::Execute(Event event)
|
|||||||
if (!hasMana)
|
if (!hasMana)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (sPlayerbotAIConfig->freeFood)
|
if (botAI->HasCheat(BotCheatMask::food))
|
||||||
{
|
{
|
||||||
// if (bot->IsNonMeleeSpellCast(true))
|
// if (bot->IsNonMeleeSpellCast(true))
|
||||||
// return false;
|
// return false;
|
||||||
@@ -54,11 +54,11 @@ bool DrinkAction::Execute(Event event)
|
|||||||
return UseItemAction::Execute(event);
|
return UseItemAction::Execute(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DrinkAction::isUseful() { return UseItemAction::isUseful() && AI_VALUE2(uint8, "mana", "self target") < 85; }
|
bool DrinkAction::isUseful() { return UseItemAction::isUseful() && AI_VALUE2(uint8, "mana", "self target") < 100; }
|
||||||
|
|
||||||
bool DrinkAction::isPossible()
|
bool DrinkAction::isPossible()
|
||||||
{
|
{
|
||||||
return !bot->IsInCombat() && (sPlayerbotAIConfig->freeFood || UseItemAction::isPossible());
|
return !bot->IsInCombat() && (botAI->HasCheat(BotCheatMask::food) || UseItemAction::isPossible());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EatAction::Execute(Event event)
|
bool EatAction::Execute(Event event)
|
||||||
@@ -66,7 +66,7 @@ bool EatAction::Execute(Event event)
|
|||||||
if (bot->IsInCombat())
|
if (bot->IsInCombat())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (sPlayerbotAIConfig->freeFood)
|
if (botAI->HasCheat(BotCheatMask::food))
|
||||||
{
|
{
|
||||||
// if (bot->IsNonMeleeSpellCast(true))
|
// if (bot->IsNonMeleeSpellCast(true))
|
||||||
// return false;
|
// return false;
|
||||||
@@ -107,5 +107,5 @@ bool EatAction::isUseful() { return UseItemAction::isUseful() && AI_VALUE2(uint8
|
|||||||
|
|
||||||
bool EatAction::isPossible()
|
bool EatAction::isPossible()
|
||||||
{
|
{
|
||||||
return !bot->IsInCombat() && (sPlayerbotAIConfig->freeFood || UseItemAction::isPossible());
|
return !bot->IsInCombat() && (botAI->HasCheat(BotCheatMask::food) || UseItemAction::isPossible());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,13 +11,14 @@
|
|||||||
void UseFoodStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
void UseFoodStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||||
{
|
{
|
||||||
Strategy::InitTriggers(triggers);
|
Strategy::InitTriggers(triggers);
|
||||||
if (sPlayerbotAIConfig->freeFood)
|
if (botAI->HasCheat(BotCheatMask::food))
|
||||||
|
{
|
||||||
triggers.push_back(new TriggerNode("medium health", NextAction::array(0, new NextAction("food", 3.0f), nullptr)));
|
triggers.push_back(new TriggerNode("medium health", NextAction::array(0, new NextAction("food", 3.0f), nullptr)));
|
||||||
else
|
|
||||||
triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("food", 3.0f), nullptr)));
|
|
||||||
|
|
||||||
if (sPlayerbotAIConfig->freeFood)
|
|
||||||
triggers.push_back(new TriggerNode("high mana", NextAction::array(0, new NextAction("drink", 3.0f), nullptr)));
|
triggers.push_back(new TriggerNode("high mana", NextAction::array(0, new NextAction("drink", 3.0f), nullptr)));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("food", 3.0f), nullptr)));
|
||||||
triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("drink", 3.0f), nullptr)));
|
triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("drink", 3.0f), nullptr)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ bool AoeTrigger::IsActive()
|
|||||||
bool NoFoodTrigger::IsActive()
|
bool NoFoodTrigger::IsActive()
|
||||||
{
|
{
|
||||||
bool isRandomBot = sRandomPlayerbotMgr->IsRandomBot(bot);
|
bool isRandomBot = sRandomPlayerbotMgr->IsRandomBot(bot);
|
||||||
if (isRandomBot && sPlayerbotAIConfig->freeFood)
|
if (isRandomBot && botAI->HasCheat(BotCheatMask::food))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return AI_VALUE2(std::vector<Item*>, "inventory items", "conjured food").empty();
|
return AI_VALUE2(std::vector<Item*>, "inventory items", "conjured food").empty();
|
||||||
@@ -258,7 +258,7 @@ bool NoFoodTrigger::IsActive()
|
|||||||
bool NoDrinkTrigger::IsActive()
|
bool NoDrinkTrigger::IsActive()
|
||||||
{
|
{
|
||||||
bool isRandomBot = sRandomPlayerbotMgr->IsRandomBot(bot);
|
bool isRandomBot = sRandomPlayerbotMgr->IsRandomBot(bot);
|
||||||
if (isRandomBot && sPlayerbotAIConfig->freeFood)
|
if (isRandomBot && botAI->HasCheat(BotCheatMask::food))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return AI_VALUE2(std::vector<Item*>, "inventory items", "conjured water").empty();
|
return AI_VALUE2(std::vector<Item*>, "inventory items", "conjured water").empty();
|
||||||
|
|||||||
Reference in New Issue
Block a user