[Bots] Move commanded spell map to zone (#4755)

- Moves the mapping of commanded spell min levels to zone rather than to each individual bot.
- Adds support for sub spell types.
This commit is contained in:
nytmyr
2025-03-06 16:05:36 -06:00
committed by GitHub
parent 94553501ba
commit 1d4ba082ad
7 changed files with 90 additions and 64 deletions
+5 -2
View File
@@ -57,6 +57,7 @@
#include "water_map.h"
#include "worldserver.h"
#include "mob.h"
#include "bot_database.h"
#include <fmt/format.h>
@@ -219,6 +220,8 @@ int bot_command_init(void)
std::vector<std::pair<std::string, uint8>> injected_bot_command_settings;
std::vector<std::string> orphaned_bot_command_settings;
database.botdb.MapCommandedSpellTypeMinLevels();
for (auto bcs_iter : bot_command_settings) {
auto bcl_iter = bot_command_list.find(bcs_iter.first);
@@ -796,10 +799,10 @@ void helper_send_usage_required_bots(Client *bot_owner, uint16 spell_type)
}
}
auto& spell_map = bot->GetCommandedSpellTypesMinLevels();
auto spell_map = database.botdb.GetCommandedSpellTypesMinLevels();
if (spell_map.empty()) {
bot_owner->Message(Chat::Yellow, "No bots are capable of casting this spell type");
bot_owner->Message(Chat::Yellow, "No bots are capable of casting this spell type.");
return;
}