[Bots] Add Expansion Bitmask Quest APIs. (#2523)

* [Bots] Add Expansion Bitmask Quest APIs.

- Add `$bot->GetExpansionBitmask()` to Perl.
- Add `$bot->SetExpansionBitmask(expansion_bitmask)` to Perl.

- Add `bot:GetExpansionBitmask()` to Lua.
- Add `bot:SetExpansionBitmask(expansion_bitmask)` to Lua.

- Adds `expansion_bitmask` column to `bot_data` table.
- Allows server operators to limit expansion settings on a bot-by-bot basis.
- Allows limiting or allowing of AAs in `Bot::LoadAAs()` based on expansion bitmask.
- Default value is `-1` which just defaults to the `Bots:BotExpansionSettings` rule value.
- Setting bitmask saves to database and reloads AAs so bots automatically recalculate bonuses.

* Add save parameter.

* Typo.
This commit is contained in:
Kinglykrab
2022-11-16 08:29:50 -05:00
committed by GitHub
parent bb58a9cd20
commit 730cd3f28a
11 changed files with 540 additions and 348 deletions
+7 -5
View File
@@ -97,11 +97,13 @@ public:
bool LoadEquipmentColor(const uint32 bot_id, const uint8 material_slot_id, uint32& rgb);
bool SaveEquipmentColor(const uint32 bot_id, const int16 slot_id, const uint32 rgb);
bool SaveExpansionBitmask(const uint32 bot_id, const int expansion_bitmask);
/* Bot pet functions */
bool LoadPetIndex(const uint32 bot_id, uint32& pet_index);
bool LoadPetSpellID(const uint32 bot_id, uint32& pet_spell_id);
bool LoadPetStats(const uint32 bot_id, std::string& pet_name, uint32& pet_mana, uint32& pet_hp, uint32& pet_spell_id);
bool SavePetStats(const uint32 bot_id, const std::string& pet_name, const uint32 pet_mana, const uint32 pet_hp, const uint32 pet_spell_id);
bool DeletePetStats(const uint32 bot_id);
@@ -119,7 +121,7 @@ public:
bool LoadInspectMessage(const uint32 bot_id, InspectMessage_Struct& inspect_message);
bool SaveInspectMessage(const uint32 bot_id, const InspectMessage_Struct& inspect_message);
bool DeleteInspectMessage(const uint32 bot_id);
bool SaveAllInspectMessages(const uint32 owner_id, const InspectMessage_Struct& inspect_message);
bool DeleteAllInspectMessages(const uint32 owner_id);
@@ -143,7 +145,7 @@ public:
bool LoadOwnerOptions(Client *owner);
bool SaveOwnerOption(const uint32 owner_id, size_t type, const bool flag);
bool SaveOwnerOption(const uint32 owner_id, const std::pair<size_t, size_t> type, const std::pair<bool, bool> flag);
/* Bot bot-group functions */
bool QueryBotGroupExistence(const std::string& botgroup_name);
@@ -156,7 +158,7 @@ public:
bool LoadBotGroupNameByBotGroupID(const uint32 botgroup_id, std::string& botgroup_name);
bool LoadBotGroupNameByLeaderID(const uint32 leader_id, std::string& botgroup_name);
bool CreateBotGroup(const std::string& botgroup_name, const uint32 leader_id);
bool DeleteBotGroup(const uint32 leader_id);
bool AddMemberToBotGroup(const uint32 leader_id, const uint32 member_id);
@@ -164,7 +166,7 @@ public:
bool LoadBotGroupIDForLoadBotGroup(const uint32 owner_id, const std::string& botgroup_name, uint32& botgroup_id);
bool LoadBotGroup(const std::string& botgroup_name, std::map<uint32, std::list<uint32>>& member_list);
bool LoadBotGroupsListByOwnerID(const uint32 owner_id, std::list<std::pair<std::string, std::string>>& botgroups_list);