Skip to content

Commit

Permalink
Merge branch 'liyunfan1223:master' into ASP
Browse files Browse the repository at this point in the history
  • Loading branch information
kadeshar authored Feb 9, 2025
2 parents 1eef552 + 08008a3 commit 0024397
Show file tree
Hide file tree
Showing 20 changed files with 691 additions and 461 deletions.
20 changes: 10 additions & 10 deletions conf/playerbots.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,9 @@ AiPlayerbot.DeleteRandomBotAccounts = 0
#
#

# Maximum number of bots added by one account
# The maximum number of bots that a player can control simultaneously
AiPlayerbot.MaxAddedBots = 40

# Maximum number of bots per class added by one account
AiPlayerbot.MaxAddedBotsPerClass = 40

# Enable/Disable create bot by addclass command (0 = GM only, 1 = enable)
# default: 1 (enable)
AiPlayerbot.AddClassCommand = 1
Expand All @@ -128,11 +125,10 @@ AiPlayerbot.GroupInvitationPermission = 1
# auto-login all player alts as bots on player login
AiPlayerbot.BotAutologin = 0

# Allow login other players' characters as bots
# Default: 0 (disabled)
AiPlayerbot.AllowPlayerBots = 0
# Allow/deny bots from the player's account
AiPlayerbot.AllowAccountBots = 1

# Allow/deny bots from your guild
# Allow/deny bots in the player's guild
AiPlayerbot.AllowGuildBots = 1

# Randombots will invite nearby bots to guilds
Expand Down Expand Up @@ -860,8 +856,8 @@ AiPlayerbot.FastReactInBG = 1
AiPlayerbot.RandomBotUpdateInterval = 20
AiPlayerbot.RandomBotCountChangeMinInterval = 1800
AiPlayerbot.RandomBotCountChangeMaxInterval = 7200
AiPlayerbot.MinRandomBotInWorldTime = 3600
AiPlayerbot.MaxRandomBotInWorldTime = 1209600
AiPlayerbot.MinRandomBotInWorldTime = 600
AiPlayerbot.MaxRandomBotInWorldTime = 28800
AiPlayerbot.MinRandomBotRandomizeTime = 7200
AiPlayerbot.MaxRandomBotRandomizeTime = 1209600
AiPlayerbot.RandomBotsPerInterval = 60
Expand Down Expand Up @@ -1093,6 +1089,10 @@ AiPlayerbot.PremadeSpecName.8.2 = frost pve
AiPlayerbot.PremadeSpecGlyph.8.2 = 42742,43339,50045,43364,43361,42751
AiPlayerbot.PremadeSpecLink.8.2.60 = --0533030313203100030152231151
AiPlayerbot.PremadeSpecLink.8.2.80 = 23002303110003--0533030313203100030152231351
AiPlayerbot.PremadeSpecName.8.3 = frostfire pve
AiPlayerbot.PremadeSpecGlyph.8.3 = 44684,44920,42751,43339,43364,45737
AiPlayerbot.PremadeSpecLink.8.3.60 = -2305032012303331053120300051
AiPlayerbot.PremadeSpecLink.8.3.80 = -2305032012303331053120311351-023303031

#
#
Expand Down
11 changes: 10 additions & 1 deletion src/AiFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,16 @@ void AiFactory::AddDefaultCombatStrategies(Player* player, PlayerbotAI* const fa
if (tab == 0)
engine->addStrategiesNoInit("arcane", "arcane aoe", nullptr);
else if (tab == 1)
engine->addStrategiesNoInit("fire", "fire aoe", nullptr);
{
if (player->HasSpell(44614) /*Frostfire Bolt*/ && player->HasAura(15047) /*Ice Shards*/)
{
engine->addStrategiesNoInit("frostfire", "frostfire aoe", nullptr);
}
else
{
engine->addStrategiesNoInit("fire", "fire aoe", nullptr);
}
}
else
engine->addStrategiesNoInit("frost", "frost aoe", nullptr);

Expand Down
18 changes: 8 additions & 10 deletions src/PlayerbotAIConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ bool PlayerbotAIConfig::Initialize()

iterationsPerTick = sConfigMgr->GetOption<int32>("AiPlayerbot.IterationsPerTick", 100);

allowAccountBots = sConfigMgr->GetOption<bool>("AiPlayerbot.AllowAccountBots", true);
allowGuildBots = sConfigMgr->GetOption<bool>("AiPlayerbot.AllowGuildBots", true);
randomBotGuildNearby = sConfigMgr->GetOption<bool>("AiPlayerbot.RandomBotGuildNearby", false);
randomBotInvitePlayer = sConfigMgr->GetOption<bool>("AiPlayerbot.RandomBotInvitePlayer", false);
inviteChat = sConfigMgr->GetOption<bool>("AiPlayerbot.InviteChat", false);
allowPlayerBots = sConfigMgr->GetOption<bool>("AiPlayerbot.AllowPlayerBots", false);

randomBotMapsAsString = sConfigMgr->GetOption<std::string>("AiPlayerbot.RandomBotMaps", "0,1,530,571");
LoadList<std::vector<uint32>>(randomBotMapsAsString, randomBotMaps);
Expand Down Expand Up @@ -329,9 +329,7 @@ bool PlayerbotAIConfig::Initialize()
useFlyMountAtMinLevel = sConfigMgr->GetOption<int32>("AiPlayerbot.UseFlyMountAtMinLevel", 60);
useFastFlyMountAtMinLevel = sConfigMgr->GetOption<int32>("AiPlayerbot.UseFastFlyMountAtMinLevel", 70);

LOG_INFO("server.loading", "---------------------------------------");
LOG_INFO("server.loading", " Loading TalentSpecs ");
LOG_INFO("server.loading", "---------------------------------------");
LOG_INFO("server.loading", "Loading TalentSpecs...");

for (uint32 cls = 1; cls < MAX_CLASSES; ++cls)
{
Expand Down Expand Up @@ -421,14 +419,15 @@ bool PlayerbotAIConfig::Initialize()
{
for (uint32 classId = 0; classId < MAX_CLASSES; classId++)
{
for (uint32 specId = 0; specId < MAX_SPECNO; specId++)
for (uint32 specId = 0; specId <= MAX_WORLDBUFF_SPECNO; specId++)
{
for (uint32 minLevel = 0; minLevel < MAX_LEVEL; minLevel++)
for (uint32 minLevel = 0; minLevel <= randomBotMaxLevel; minLevel++)
{
for (uint32 maxLevel = 0; maxLevel < MAX_LEVEL; maxLevel++)
for (uint32 maxLevel = minLevel; maxLevel <= randomBotMaxLevel; maxLevel++)
{
loadWorldBuf(factionId, classId, specId, minLevel, maxLevel);
loadWorldBuff(factionId, classId, specId, minLevel, maxLevel);
}
loadWorldBuff(factionId, classId, specId, minLevel, 0);
}
}
}
Expand Down Expand Up @@ -474,7 +473,6 @@ bool PlayerbotAIConfig::Initialize()
autoInitEquipLevelLimitRatio = sConfigMgr->GetOption<float>("AiPlayerbot.AutoInitEquipLevelLimitRatio", 1.0);

maxAddedBots = sConfigMgr->GetOption<int32>("AiPlayerbot.MaxAddedBots", 40);
maxAddedBotsPerClass = sConfigMgr->GetOption<int32>("AiPlayerbot.MaxAddedBotsPerClass", 10);
addClassCommand = sConfigMgr->GetOption<int32>("AiPlayerbot.AddClassCommand", 1);
addClassAccountPoolSize = sConfigMgr->GetOption<int32>("AiPlayerbot.AddClassAccountPoolSize", 50);
maintenanceCommand = sConfigMgr->GetOption<int32>("AiPlayerbot.MaintenanceCommand", 1);
Expand Down Expand Up @@ -676,7 +674,7 @@ void PlayerbotAIConfig::log(std::string const fileName, char const* str, ...)
fflush(stdout);
}

void PlayerbotAIConfig::loadWorldBuf(uint32 factionId1, uint32 classId1, uint32 specId1, uint32 minLevel1, uint32 maxLevel1)
void PlayerbotAIConfig::loadWorldBuff(uint32 factionId1, uint32 classId1, uint32 specId1, uint32 minLevel1, uint32 maxLevel1)
{
std::vector<uint32> buffs;

Expand Down
7 changes: 4 additions & 3 deletions src/PlayerbotAIConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ enum class HealingManaEfficiency : uint8
};

#define MAX_SPECNO 20
#define MAX_WORLDBUFF_SPECNO 3

class PlayerbotAIConfig
{
Expand All @@ -54,7 +55,7 @@ class PlayerbotAIConfig
bool IsInPvpProhibitedArea(uint32 id);

bool enabled;
bool allowGuildBots, allowPlayerBots;
bool allowAccountBots, allowGuildBots;
bool randomBotGuildNearby, randomBotInvitePlayer, inviteChat;
uint32 globalCoolDown, reactDelay, maxWaitForMove, disableMoveSplinePath, maxMovementSearchTime, expireActionTime,
dispelAuraDuration, passiveDelay, repeatDelay, errorDelay, rpgDelay, sitDelay, returnDelay, lootDelay;
Expand Down Expand Up @@ -334,7 +335,7 @@ class PlayerbotAIConfig
bool botRepairWhenSummon;
bool autoInitOnly;
float autoInitEquipLevelLimitRatio;
int32 maxAddedBots, maxAddedBotsPerClass;
int32 maxAddedBots;
int32 addClassCommand;
int32 addClassAccountPoolSize;
int32 maintenanceCommand;
Expand All @@ -358,7 +359,7 @@ class PlayerbotAIConfig
}
void log(std::string const fileName, const char* str, ...);

void loadWorldBuf(uint32 factionId, uint32 classId, uint32 specId, uint32 minLevel, uint32 maxLevel);
void loadWorldBuff(uint32 factionId, uint32 classId, uint32 specId, uint32 minLevel, uint32 maxLevel);
static std::vector<std::vector<uint32>> ParseTempTalentsOrder(uint32 cls, std::string temp_talents_order);
static std::vector<std::vector<uint32>> ParseTempPetTalentsOrder(uint32 spec, std::string temp_talents_order);
};
Expand Down
Loading

0 comments on commit 0024397

Please sign in to comment.