Merge branch 'master' into rewrite-equip-score2

This commit is contained in:
Yunfan Li
2024-08-11 23:47:25 +08:00
14 changed files with 622 additions and 547 deletions

View File

@@ -53,6 +53,15 @@ PlayerbotFactory::PlayerbotFactory(Player* bot, uint32 level, uint32 itemQuality
: level(level), itemQuality(itemQuality), gearScoreLimit(gearScoreLimit), bot(bot)
{
botAI = GET_PLAYERBOT_AI(bot);
if (!this->itemQuality)
{
uint32 gs = sPlayerbotAIConfig->randomGearScoreLimit == 0
? 0
: PlayerbotFactory::CalcMixedGearScore(sPlayerbotAIConfig->randomGearScoreLimit,
sPlayerbotAIConfig->randomGearQualityLimit);
this->itemQuality = sPlayerbotAIConfig->randomGearQualityLimit;
this->gearScoreLimit = gs;
}
}
void PlayerbotFactory::Init()
@@ -147,16 +156,6 @@ void PlayerbotFactory::Init()
void PlayerbotFactory::Prepare()
{
if (!itemQuality)
{
uint32 gs = sPlayerbotAIConfig->randomGearScoreLimit == 0
? 0
: PlayerbotFactory::CalcMixedGearScore(sPlayerbotAIConfig->randomGearScoreLimit,
sPlayerbotAIConfig->randomGearQualityLimit);
itemQuality = sPlayerbotAIConfig->randomGearQualityLimit;
gearScoreLimit = gs;
}
if (bot->isDead())
bot->ResurrectPlayer(1.0f, false);