* [Languages] Cleanup languages constants
# Notes
- Cleanup formatting and logic where necessary.
- Cleaned up constants to use a namespace with `constexpr` instead.
- Changed `LoadCharacterLanguages` to use a repository instead.
* Lua GroupMessage uint8/language_id
* Lua More uint8/language_id
* [Cleanup] Gender constants cleanup
# Notes
- Convert to a `Gender` namespace using `constexpr`.
- Cleanup spots where we were using magic numbers for gender values.
* Cleanup
Previously bots were only scanning for nearby clients so any AE spells or procs didn't have mobs to hit.
This changes that to scan for mobs instead of clients so their close entity list supports AEs with mobs to hit.
* [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>
* [Quest API] Add EVENT_LEVEL_UP and EVENT_LEVEL_DOWN to bots
# Notes
- Bots did not have these events, this will allow operators to perform events on bot level up/down.
* Update bot.cpp
Bots and especially their pets could get in a loop where they try to attack an invalid target. This would result in their pets spamming "That is not a legal target" messages.
Adds the rule **Bots, AutosaveIntervalSeconds** to control the frequency of the autosave of bots. Currently they only fully save on camp/zone.
Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com>
* [Feature] Add Bot Starting Items
# Notes
- This table is similar to the player starting items table, however it uses bitmasks.
- Allows operators to give bots gear on creation.
- `races` of `0` for all races.
- `classes` of `0` for all classes.
* Update bot.cpp
* Update database_update_manifest_bots.cpp
# Notes
- Bots were having a hard time keeping up with players.
- Part of this was due to using walk until a certain distance.
- Another part was their ctor only having `0.7f` run speed versus our Mob sanity check of `1.25f`.
- We check movement stuff now before idle checks so bots are more likely to start moving earlier.
* [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
* [Bug Fix] Fix Appearance Issues
# Notes
- Changing race, gender, or texture of a Mob could result in it changing sizes due to use not sending the size as part of the appearance packet.
- Also converts the parameterized method to a struct parameter so that we can optionally send things without back-filling multiple arguments.
* Gender cleanup.
* Fix.
* Formatting.
* [Data Buckets] Zone-Based Data Bucket Caching
# Notes
- Adds a data bucket cache so we're not needlessly hitting the database every time we need to read a data bucket value.
* Cleanup and unify GetData access patterns
* Cache work
* Push
* Add to cache when we fetch and do a db hit
* Handle bucket misses in cache
* Formatting
* Logging
* [Data Buckets] Zone-Based Data Bucket Caching
- Adds a data bucket cache so we're not needlessly hitting the database every time we need to read a data bucket value.
* Cleanup and unify GetData access patterns
* Cache work
* Push
* Add to cache when we fetch and do a db hit
* Handle bucket misses in cache
* Formatting
* Remove redundant fetches from cache since GetData does the same thing
* Push progress
* Distributed cache work
* Logging
* Fix issue with scoping where same named keys could return overlapping results
* Misses cache tweak, logging, comments
* Add bot, client, and NPC bucket methods to Lua.
---------
Co-authored-by: Akkadius <akkadius1@gmail.com>
* [Cleanup] Remove always true/false conditions from bot.cpp
# Notes
- Some of these conditions were always true or false based on previous conditions.
* Update bot.cpp
* [Crash] Add Checks for out of bounds/nullptr dereferences
* formatting
* formatting
* formatting
* Update bot.cpp
---------
Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com>