[Bots] Add Bot-specific Spell Settings. (#2553)

* [Bots] Add Bot-specific Spell Settings.

# Notes
- Allows players to set `priority`, `min_level`, `max_level`, `min_hp`, `max_hp`, and `is_enabled` settings per spell based on targeted bot.
- Lets players disable spells they don't want their bots casting or change the criteria they cast them at if they want.

* Update botspellsai.cpp

* Update 2022_11_19_bot_spell_settings.sql

* Typo.

* Update botspellsai.cpp

* Cleanup and add Reload Methods to Perl/Lua.
This commit is contained in:
Alex King
2022-11-27 14:46:36 -05:00
committed by GitHub
parent f6c5560e9c
commit 2d364e2fd1
16 changed files with 1583 additions and 122 deletions
+17 -1
View File
@@ -307,7 +307,7 @@ public:
void DoEnduranceRegen(); //This Regenerates endurance
void DoEnduranceUpkeep(); //does the endurance upkeep
bool AI_AddBotSpells(uint32 iDBSpellsID);
bool AI_AddBotSpells(uint32 bot_spell_id);
void AddSpellToBotList(
int16 iPriority,
uint16 iSpellID,
@@ -470,6 +470,7 @@ public:
//static void UpdateRaidCastingRoles(const Raid* raid, bool disband = false);
bool IsBotCaster() { return IsCasterClass(GetClass()); }
bool IsBotHybrid() { return IsHybridClass(GetClass()); }
bool IsBotINTCaster() { return IsINTCasterClass(GetClass()); }
bool IsBotWISCaster() { return IsWISCasterClass(GetClass()); }
bool IsBotSpellFighter() { return IsSpellFighterClass(GetClass()); }
@@ -596,6 +597,18 @@ public:
int GetExpansionBitmask();
void SetExpansionBitmask(int expansion_bitmask, bool save = true);
void ListBotSpells();
std::string GetLevelString(uint8 min_level, uint8 max_level);
std::string GetHPString(int8 min_hp, int8 max_hp);
bool AddBotSpellSetting(uint16 spell_id, BotSpellSetting* bs);
bool DeleteBotSpellSetting(uint16 spell_id);
BotSpellSetting* GetBotSpellSetting(uint16 spell_id);
void ListBotSpellSettings();
void LoadBotSpellSettings();
bool UpdateBotSpellSetting(uint16 spell_id, BotSpellSetting* bs);
static void SpawnBotGroupByName(Client* c, std::string botgroup_name, uint32 leader_id);
std::string CreateSayLink(Client* botOwner, const char* message, const char* name);
@@ -762,6 +775,9 @@ private:
BotCastingRoles m_CastingRoles;
std::map<std::string,std::string> bot_data_buckets;
std::map<std::string,std::string> bot_owner_data_buckets;
std::map<uint16, BotSpellSetting> bot_spell_settings;
std::shared_ptr<HealRotation> m_member_of_heal_rotation;