Fix SpecialSpells to be correctly applied (#1044)

This commit is contained in:
SaW
2025-03-01 22:42:58 +01:00
committed by GitHub
parent 9fbf60d812
commit 098950ceea

View File

@@ -240,13 +240,11 @@ void PlayerbotFactory::Randomize(bool incremental)
if (pmo) if (pmo)
pmo->finish(); pmo->finish();
/* // pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Immersive");
pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Immersive"); // LOG_INFO("playerbots", "Initializing immersive...");
LOG_INFO("playerbots", "Initializing immersive..."); // InitImmersive();
InitImmersive(); // if (pmo)
if (pmo) // pmo->finish();
pmo->finish();
*/
if (sPlayerbotAIConfig->randomBotPreQuests) if (sPlayerbotAIConfig->randomBotPreQuests)
{ {
@@ -266,7 +264,6 @@ void PlayerbotFactory::Randomize(bool incremental)
pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Spells1"); pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Spells1");
LOG_DEBUG("playerbots", "Initializing spells (step 1)..."); LOG_DEBUG("playerbots", "Initializing spells (step 1)...");
// bot->LearnDefaultSkills();
bot->LearnDefaultSkills(); bot->LearnDefaultSkills();
InitClassSpells(); InitClassSpells();
InitAvailableSpells(); InitAvailableSpells();
@@ -276,8 +273,6 @@ void PlayerbotFactory::Randomize(bool incremental)
LOG_DEBUG("playerbots", "Initializing skills (step 1)..."); LOG_DEBUG("playerbots", "Initializing skills (step 1)...");
pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Skills1"); pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Skills1");
InitSkills(); InitSkills();
InitSpecialSpells();
// InitTradeSkills(); // InitTradeSkills();
if (pmo) if (pmo)
pmo->finish(); pmo->finish();
@@ -311,6 +306,12 @@ void PlayerbotFactory::Randomize(bool incremental)
if (pmo) if (pmo)
pmo->finish(); pmo->finish();
LOG_DEBUG("playerbots", "Initializing special spells...");
pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Spells3");
InitSpecialSpells();
if (pmo)
pmo->finish();
pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Mounts"); pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Mounts");
LOG_DEBUG("playerbots", "Initializing mounts..."); LOG_DEBUG("playerbots", "Initializing mounts...");
InitMounts(); InitMounts();
@@ -318,11 +319,11 @@ void PlayerbotFactory::Randomize(bool incremental)
if (pmo) if (pmo)
pmo->finish(); pmo->finish();
pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Skills2"); // pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Skills2");
// LOG_INFO("playerbots", "Initializing skills (step 2)..."); // LOG_INFO("playerbots", "Initializing skills (step 2)...");
// UpdateTradeSkills(); // UpdateTradeSkills();
if (pmo) // if (pmo)
pmo->finish(); // pmo->finish();
pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Equip"); pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Equip");
LOG_DEBUG("playerbots", "Initializing equipmemt..."); LOG_DEBUG("playerbots", "Initializing equipmemt...");
@@ -381,11 +382,11 @@ void PlayerbotFactory::Randomize(bool incremental)
if (pmo) if (pmo)
pmo->finish(); pmo->finish();
pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_EqSets"); // pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_EqSets");
LOG_DEBUG("playerbots", "Initializing second equipment set..."); // LOG_DEBUG("playerbots", "Initializing second equipment set...");
// InitSecondEquipmentSet(); // InitSecondEquipmentSet();
if (pmo) // if (pmo)
pmo->finish(); // pmo->finish();
if (bot->GetLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel) if (bot->GetLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel)
{ {
@@ -415,7 +416,7 @@ void PlayerbotFactory::Randomize(bool incremental)
InitGlyphs(); InitGlyphs();
// bot->SaveToDB(false, false); // bot->SaveToDB(false, false);
// pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Guilds"); pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Guilds");
// bot->SaveToDB(false, false); // bot->SaveToDB(false, false);
if (sPlayerbotAIConfig->randomBotGuildCount > 0) if (sPlayerbotAIConfig->randomBotGuildCount > 0)
{ {
@@ -423,8 +424,8 @@ void PlayerbotFactory::Randomize(bool incremental)
InitGuild(); InitGuild();
} }
// bot->SaveToDB(false, false); // bot->SaveToDB(false, false);
// if (pmo) if (pmo)
// pmo->finish(); pmo->finish();
if (bot->GetLevel() >= 70) if (bot->GetLevel() >= 70)
{ {
@@ -458,7 +459,7 @@ void PlayerbotFactory::Randomize(bool incremental)
bot->SetHealth(bot->GetMaxHealth()); bot->SetHealth(bot->GetMaxHealth());
bot->SetPower(POWER_MANA, bot->GetMaxPower(POWER_MANA)); bot->SetPower(POWER_MANA, bot->GetMaxPower(POWER_MANA));
bot->SaveToDB(false, false); bot->SaveToDB(false, false);
// LOG_INFO("playerbots", "Initialization Done."); LOG_DEBUG("playerbots", "Initialization Done.");
if (pmo) if (pmo)
pmo->finish(); pmo->finish();
} }
@@ -486,6 +487,7 @@ void PlayerbotFactory::Refresh()
InitAvailableSpells(); InitAvailableSpells();
InitSkills(); InitSkills();
InitReputation(); InitReputation();
InitSpecialSpells();
InitMounts(); InitMounts();
InitKeyring(); InitKeyring();
if (bot->GetLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel) if (bot->GetLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel)
@@ -4400,4 +4402,3 @@ void PlayerbotFactory::InitAttunementQuests()
bot->GiveLevel(level); bot->GiveLevel(level);
bot->SetUInt32Value(PLAYER_XP, currentXP); bot->SetUInt32Value(PLAYER_XP, currentXP);
} }