mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[Bots] Expanded Bot Spell Settings List. (#2606)
* [Bots] Expanded Bot Spell List Settings * [Bots] Expanded Bot Spell List Settings * Fixes/formatting * typo * Formatting & update SpellInfo Command * Spelling * Typo
This commit is contained in:
+25
-1
@@ -409,7 +409,8 @@ bool BotDatabase::LoadBot(const uint32 bot_id, Bot*& loaded_bot)
|
||||
" `show_helm`," // 25
|
||||
" `follow_distance`," // 26
|
||||
" `stop_melee_level`," // 27
|
||||
" `expansion_bitmask`" // 28
|
||||
" `expansion_bitmask`," // 28
|
||||
" `enforce_spell_settings`" // 29
|
||||
" FROM `bot_data`"
|
||||
" WHERE `bot_id` = {}"
|
||||
" LIMIT 1",
|
||||
@@ -508,6 +509,8 @@ bool BotDatabase::LoadBot(const uint32 bot_id, Bot*& loaded_bot)
|
||||
|
||||
auto eb = std::stoi(row[28]);
|
||||
loaded_bot->SetExpansionBitmask(eb, false);
|
||||
|
||||
loaded_bot->SetBotEnforceSpellSetting((std::stoi(row[29]) > 0 ? true : false));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -3278,6 +3281,27 @@ bool BotDatabase::SaveExpansionBitmask(const uint32 bot_id, const int expansion_
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BotDatabase::SaveEnforceSpellSetting(const uint32 bot_id, const bool enforce_spell_setting)
|
||||
{
|
||||
if (!bot_id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
query = fmt::format(
|
||||
"UPDATE `bot_data`"
|
||||
"SET `enforce_spell_settings` = {} "
|
||||
"WHERE `bot_id` = {}",
|
||||
(enforce_spell_setting ? 1 : 0),
|
||||
bot_id
|
||||
);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* fail::Bot functions */
|
||||
const char* BotDatabase::fail::LoadBotsList() { return "Failed to bots list"; }
|
||||
const char* BotDatabase::fail::LoadOwnerID() { return "Failed to load owner ID"; }
|
||||
|
||||
Reference in New Issue
Block a user