mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Convert PlayerbotsXPRate to RandomBotXPRate (#1313)
This commit is contained in:
@@ -375,11 +375,6 @@ AiPlayerbot.AggroDistance = 22
|
||||
#
|
||||
#
|
||||
|
||||
# Set XP rate for bots
|
||||
# Default: 1.0
|
||||
# Actual XP Rate will be = Server XP Rate * AiPlayerbot.PlayerbotsXPRate
|
||||
AiPlayerbot.PlayerbotsXPRate = 1.0
|
||||
|
||||
# Health/Mana levels
|
||||
AiPlayerbot.CriticalHealth = 25
|
||||
AiPlayerbot.LowHealth = 45
|
||||
@@ -605,6 +600,10 @@ AiPlayerbot.RandomBotFixedLevel = 0
|
||||
# Default: 0 (disabled)
|
||||
AiPlayerbot.DowngradeMaxLevelBot = 0
|
||||
|
||||
# Set XP rate for random bots (Default: 1.0)
|
||||
# Server XP Rate * AiPlayerbot.RandomBotXPRate
|
||||
AiPlayerbot.RandomBotXPRate = 1.0
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
@@ -524,7 +524,7 @@ bool PlayerbotAIConfig::Initialize()
|
||||
autoGearQualityLimit = sConfigMgr->GetOption<int32>("AiPlayerbot.AutoGearQualityLimit", 3);
|
||||
autoGearScoreLimit = sConfigMgr->GetOption<int32>("AiPlayerbot.AutoGearScoreLimit", 0);
|
||||
|
||||
playerbotsXPrate = sConfigMgr->GetOption<float>("AiPlayerbot.PlayerbotsXPRate", 1.0);
|
||||
randomBotXPRate = sConfigMgr->GetOption<float>("AiPlayerbot.RandomBotXPRate", 1.0);
|
||||
randomBotAllianceRatio = sConfigMgr->GetOption<int32>("AiPlayerbot.RandomBotAllianceRatio", 50);
|
||||
randomBotHordeRatio = sConfigMgr->GetOption<int32>("AiPlayerbot.RandomBotHordeRatio", 50);
|
||||
disableDeathKnightLogin = sConfigMgr->GetOption<bool>("AiPlayerbot.DisableDeathKnightLogin", 0);
|
||||
|
||||
@@ -276,7 +276,7 @@ public:
|
||||
bool randomBotShowCloak;
|
||||
bool randomBotFixedLevel;
|
||||
bool disableRandomLevels;
|
||||
float playerbotsXPrate;
|
||||
float randomBotXPRate;
|
||||
uint32 randomBotAllianceRatio;
|
||||
uint32 randomBotHordeRatio;
|
||||
bool disableDeathKnightLogin;
|
||||
|
||||
@@ -219,9 +219,12 @@ public:
|
||||
if (!player->GetSession()->IsBot())
|
||||
return;
|
||||
|
||||
if (sPlayerbotAIConfig->playerbotsXPrate != 1.0)
|
||||
if (!sRandomPlayerbotMgr->IsRandomBot(player))
|
||||
return;
|
||||
|
||||
if (sPlayerbotAIConfig->randomBotXPRate != 1.0)
|
||||
{
|
||||
amount = static_cast<uint32>(std::round(static_cast<float>(amount) * sPlayerbotAIConfig->playerbotsXPrate));
|
||||
amount = static_cast<uint32>(std::round(static_cast<float>(amount) * sPlayerbotAIConfig->randomBotXPRate));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -40,15 +40,15 @@ bool XpGainAction::Execute(Event event)
|
||||
BroadcastHelper::BroadcastKill(botAI, bot, creature);
|
||||
}
|
||||
|
||||
// playerbotsXPrate is now implemented in OnPlayerGiveXP script
|
||||
// if (!sRandomPlayerbotMgr->IsRandomBot(bot) || sPlayerbotAIConfig->playerbotsXPrate == 1)
|
||||
// randomBotXPRate is now implemented in OnPlayerGiveXP script
|
||||
// if (!sRandomPlayerbotMgr->IsRandomBot(bot) || sPlayerbotAIConfig->randomBotXPRate == 1)
|
||||
// return true;
|
||||
|
||||
// Unit* victim = nullptr;
|
||||
// if (guid)
|
||||
// victim = botAI->GetUnit(guid);
|
||||
|
||||
// xpgain = xpgain * (sPlayerbotAIConfig->playerbotsXPrate - 1);
|
||||
// xpgain = xpgain * (sPlayerbotAIConfig->randomBotXPRate - 1);
|
||||
// GiveXP(xpgain, victim);
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user