* [Bots][Quest API] Add ^clickitem, ^timer, revamp bot timers, fix GetBestBotSpellForCure
This adds the command **^clickitem** for bots.
Bots can click items they are wearing with the provided slot ID, players can use **^invlist** on their bots to see items and slot IDs.
This supports actionables.
**^itemclick 13 byclass 11** would command all Necromancer bots to attempt to click their Primary item.
This adds and supports charges for items to bots, when an item is used, it will lose a charge and cannot be clicked once no charges remain.
This adds the following rules:
**Bots, BotsClickItemsMinLvl** - Minimum level bots can use **^clickitem**.
**Bots, BotsCanClickItems** - Whether or not **^clickitem** is allowed for bots.
**Bots, CanClickMageEpicV1** - Whether or not players are allowed to command their bots to use the Magician Epic 1.0
This adds quest methods to Perl/Lua for:
ClearDisciplineReuseTimer, ClearItemReuseTimer, ClearSpellRecastTimer
GetDisciplineReuseTimer, GetItemReuseTimer, GetSpellRecastTimer
SetDisciplineReuseTimer, SetItemReuseTimer, SetSpellRecastTimer
Discipline and Spell methods use the spell_id to check, get and set. Item uses the item_id.
Clear and Get support wildcards (no spell/item id) to clear all timers of the type or get the first timer of the type.
Get will return the remaining time on the chosen timer, if any.
Set supports a wildcard (no recast/reuse provided) to use the default of the provided type, you can also specify a recast/reuse timer to set that timer to the chosen value.
**^timer** has been added as a bot command, defaulted for GM access.
This can be used to set, get and clear timers of different types. Use **^timer help** for info.
This revamps the way timers are set, stored, loaded for bots.
**GetBestBotSpellForCure** was previously checking only the first spell found and not properly iterating through the checks.
This requires modifications to the **bot_timers** table and is included in this commit.
* Rebase Conflicts
* Update queries to use repositories
* Minor adjustment
* Formatting
* Handle delete as well
* Cleanup.
* Adjust primary keys to prevent conflicts
---------
Co-authored-by: Akkadius <akkadius1@gmail.com>
Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
* [Bug Fix] Bots will now load AAs properly when spawned.
* formatting
* formatting
* formatting
* formatting
* formatting (for real this time)
* formatting (for real this time)
* Formatting
* Convert ZoneDb::LoadCharacterCorpseData to use a cleaner api that has a better layout.
* Update corpse save methods to use a new cleaner api.
* Add item to corpse will use a few new fields that don't yet save.
* Fix for some issues moving data to corpses.
* Make CreateItem more explicit to avoid overlooking places it's used and add more arguments.
* DB changes
* Revert of the changes to the database.CreateItem api change.
* Missed one.
* Fixes for mr Krab
* Small formatting
---------
Co-authored-by: KimLS <KimLS@peqtgc.com>
Co-authored-by: Akkadius <akkadius1@gmail.com>
* [Strings] Add more number formatters
# Notes
- Adds `Strings::ToUnsignedInt` for `uint32` support.
- Adds `Strings::ToBigInt` for `int64` support.
- Adds `Strings::ToUnsignedBigInt` for `uint64` support.
- Adds `Strings::ToFloat` for `float` support.
- Replaces all `std::stoi` references with `Strings::ToInt`.
- Replaces all `atoi` references with `Strings::ToInt`.
- Replaces all `std::stoul` references with `Strings::ToUnsignedInt`.
- Replaces all `atoul` references with `Strings::ToUnsignedInt`.
- Replaces all `std::stoll` references with `Strings::ToBigInt`.
- Replaces all `atoll` references with `Strings::ToBigInt`.
- Replaces all `std::stoull` references with `Strings::ToUnsignedBigInt`.
- Replaces all `atoull` references with `Strings::ToUnsignedBigInt`.
- Replaces all `std::stof` references with `Strings::ToFloat`.
* [Strings] Add more number formatters
- Adds `Strings::ToUnsignedInt` for `uint32` support.
- Adds `Strings::ToBigInt` for `int64` support.
- Adds `Strings::ToUnsignedBigInt` for `uint64` support.
- Adds `Strings::ToFloat` for `float` support.
- Replaces all `std::stoi` references with `Strings::ToInt`.
- Replaces all `atoi` references with `Strings::ToInt`.
- Replaces all `std::stoul` references with `Strings::ToUnsignedInt`.
- Replaces all `atoul` references with `Strings::ToUnsignedInt`.
- Replaces all `std::stoll` references with `Strings::ToBigInt`.
- Replaces all `atoll` references with `Strings::ToBigInt`.
- Replaces all `std::stoull` references with `Strings::ToUnsignedBigInt`.
- Replaces all `atoull` references with `Strings::ToUnsignedBigInt`.
- Replaces all `std::stof` references with `Strings::ToFloat`.
* Rebase cleanup
* Changes/benchmarks/tests
---------
Co-authored-by: Akkadius <akkadius1@gmail.com>
* [Bots] Cleanup and remove preprocessors.
- Removes every `#ifdef BOTS` we have and locks bots behind `Bots:AllowBots` rule.
- Bot updates are now done by default similar to regular database updates.
- Modify `CMakeLists.txt`, `.drone.yml`, and `BUILD.md` to match the removal of `EQEMU_ENABLE_BOTS`.
* Cleanup
- Add SQL for enabling bots for servers with bots.
- Add message that tells players/operators bots are disabled.
* Suggested changes.
* Bot injection stuff
* Change SQL to bot SQL.
* Tweaks
* Remove `is_bot`
* Update version.h
* Update main.cpp
* Update database.cpp
* Fix name availability crash
* Remove bots from update script
Co-authored-by: Akkadius <akkadius1@gmail.com>
* [Bug Fix] Fix Bot "Failed to Load" Messages.
# Notes
- Bots were producing error messages for "failing to load" spells and inventory when the bot had no spells, like a Warrior, or when the bot was naked, like a newly created bot.
* Update botspellsai.cpp
Bots were not saving their Base Gender when saving. This could result in bots with illusions saving as gender 2 and becoming a male human model upon illusion fade.
Co-authored-by: toxin06 <53322305+toxin06@users.noreply.github.com>
* [Bots] Convert Load, Save, SaveNew, and Delete to Repositories.
# Notes
- General code cleanup, as manually adding to these queries doesn't scale very well.
* FindOne.
* Update base_bot_data_repository.h
* Update template.
* [Bots] Optimize inventory loading.
# Notes
- Bots previously were running 23 individual queries to load their inventory versus grabbing their inventory all at once and referencing it in memory.
* Typo.
* Update bot_database.cpp
* Update bot_database.cpp
* Update bot.cpp
* [Bots] Add Quest API Support for Limits.
# Perl
- Add `$client->GetBotCreationLimit()` to Perl.
- Add `$client->GetBotCreationLimit(class_id)` to Perl.
- Add `$client->GetBotRequiredLevel()` to Perl.
- Add `$client->GetBotRequiredLevel(class_id)` to Perl.
- Add `$client->GetBotSpawnLimit()` to Perl.
- Add `$client->GetBotSpawnLimit(class_id)` to Perl.
- Add `$client->SetBotCreationLimit(creation_limit)` to Perl.
- Add `$client->SetBotCreationLimit(creation_limit, class_id)` to Perl.
- Add `$client->SetBotRequiredLevel(required_level)` to Perl.
- Add `$client->SetBotRequiredLevel(required_level, class_id)` to Perl.
- Add `$client->SetBotSpawnLimit(spawn_limit)` to Perl.
- Add `$client->SetBotSpawnLimit(spawn_limit, class_id)` to Perl.
- Add `$entity_list->GetBotListByCharacterID(character_id, class_id)` to Perl.
# Lua
- Add `client:GetBotCreationLimit()` to Lua.
- Add `client:GetBotCreationLimit(class_id)` to Lua.
- Add `client:GetBotRequiredLevel()` to Lua.
- Add `client:GetBotRequiredLevel(class_id)` to Lua.
- Add `client:GetBotSpawnLimit()` to Lua.
- Add `client:GetBotSpawnLimit(class_id)` to Lua.
- Add `client:SetBotCreationLimit(creation_limit)` to Lua.
- Add `client:SetBotCreationLimit(creation_limit, class_id)` to Lua.
- Add `client:SetBotRequiredLevel(required_level)` to Lua.
- Add `client:SetBotRequiredLevel(required_level, class_id)` to Lua.
- Add `client:SetBotSpawnLimit(spawn_limit)` to Lua.
- Add `client:SetBotSpawnLimit(spawn_limit, class_id)` to Lua.
- Add `entity_list:GetBotListByCharacterID(character_id, class_id)` to Lua.
# Notes
- Allows operators to set creation and spawn limits based on class, as well as required level.
- Using the class-inspecific methods sets the global limit or required level.
- Global limits are checked prior to class-specific limits and if they are not met, creation or spawn is disallowed.
- Modified preexisting Quest API to make use of this new stuff under the hood.
* Update bot_command.cpp
* Add client bot file.
* [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.
* [Code Cleanup] Zone data loading refactor
* Update client_packet.cpp
* strcpy adjustments
* Ensure safe points get reloaded properly
* Simplify GetPEQZone and getZoneShutDownDelay
* Bring in zone_store where needed
* Update client.cpp
* Signature
* Signature
* Convert helpers to using pointers
* PR comment
* Update worlddb.cpp
* Fix loading for instances
* Fix zoning with fallback as well
* Another place for instance fallback
* [Bug Fix] Fix Bot Group Loading
There were some weird cases where this code would falsely say a bot group did not exist and this would disallow summoning this botgroup as well as deleting it.
* Typo.
- Add quest::checknamefilter(name) to Perl.
- Add eq.check_name_filter(name) to Lua.
- Allows operators to check strings against the name filter for stuff like setting custom pet names, titles, suffixes, etc in scripts.
* Fix for GENERIC_9_STRINGS
* Update .gitignore
* Fixed query for use case when char_id of owner equals a bot_id
* Update BotDatabase::LoadGroupedBotsByGroupID to not use a view though correct edge case where botid=charid
* [Bots] Remove hardcoded race-class combinations from bots.
- Allows server operators to directly influence via a database table the classes a specific bot race can be.
- Previously this was hardcoded and required a source modification to do.
- Allowed races, classes, and genders have been removed due to redundancy at this point.
* Remove const cast and modify saylink definition.