* [Cleanup] Merge Client::Attack and Bot::Attack into Mob::Attack (#11)
* Remove #ifdef Bots to go along with KK fix
* Remove method in logging
* remove method from logging
* Fixes
* Rename
* [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 issue with Bot:;LoadAndSpawnAllZonedBots.
# Notes
- Bots could spawn beyond class/global limits due to being stuck in group limbo and spawning when you enter a zone properly.
* Debug messages.
* Remove unspawned bots from group.
* Update bot.cpp
* Update bot.cpp
* Update bot.cpp
* Update bot.cpp
* >= 0
# Perl
- Minor cleanup of variable types.
# Lua
- Add `bot:GetAugmentAt(slot_id, augment_index)`.
- Add `bot:GetItemAt(slot_id)`.
- Add `bot:SendSpellAnim(target_id, spell_id)`.
- Properly implemented `bot:GetItemIDAt(slot_id)`.
# Notes
- `bot:GetItemIDAt` existed in Lua, but didn't have a bind definition, so was non-functional.
- This makes Perl/Lua bot methods 1:1 as Perl had 75 and Lua had 72, they now both have 75.
# Perl
- Add `$client->CampAllBots()`.
- Add `$client->CampAllBots(class_id)`.
# Lua
- Add `client:CampAllBots()`.
- Add `client:CampAllBots(class_id)`.
# Notes
- Adds constants for `NO_CLASS` which is class `0` and uses `RACE_DOUG_0` for any spots that use race ID `0`.
- Cleans up magic number usage of race/class of `0`.
# Perl
- Add `$bot->Camp()`.
- Add `$bot->Camp(save_to_database)`.
# Lua
- Add `bot:Camp()`.
- Add `bot:Camp(save_to_database)`.
# Notes
- Saves to database by default, overload is for edge case where a user may not want bot to save to database.
* [Bug Fix] Fix NPC Reference in EVENT_SPAWN
# Notes
- Event parsing was too early and memory wasn't fully allocated, meaning that sometimes you could use the NPC reference and other times you couldn't.
- Most people worked around this by setting timers in `EVENT_SPAWN` then using `EVENT_TIMER` to handle the stuff they wanted to do on spawn.
# Example Code in Perl
```pl
sub EVENT_SPAWN {
quest::shout($npc->GetCleanName() . " just spawned with an ID of " . $npc->GetID() . " and an NPC Type ID of " . $npc->GetNPCTypeID() . ".");
}```
* Update bot.cpp
# Perl
- Add `$bot->GetBotID()`.
- Add `EVENT_DESPAWN`.
- Add `EVENT_DESPAWN_ZONE`.
# Lua
- Add `bot:GetBotID()`.
- Add `event_despawn`.
- Add `event_despawn_zone`.
# Notes
- Allows operators to determine when a Bot or an NPC has been despawned via Depop.
- Bots call NPC::Depop on ^camp so we just put the code there.
- Adds the ability to get a bot's ID using their reference in case you're looping a list and need that value.
- Moves `DispatchZoneControllerEvent` from NPC to Mob so it can be used by any type.
Trade check was not checking GetBaseRace and would fail if the bot's illusion couldn't equip the item.
Co-authored-by: toxin06 <53322305+toxin06@users.noreply.github.com>
* [Bot] Add Buff support for Bards under AI_IdleCastChecks
* Add InCombatBuffSong to Idle Bard cast Logic
* Fixes a number of Buffs that would fail to land on the Bot, causing casting loops
* Accidently removed If Statement added back.
* Update bot.cpp
Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com>
* [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 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.
* [Bots] Add support for Bot scripting.
# Perl
- Add support for `zone/bot.pl` and `zone/bot_v#.pl`.
- Add support for `global/global_bot.pl`.
- Add `$bot->SignalBot(signal_id)` to Perl.
- Add `$bot->OwnerMessage(message)` to Perl.
- Add `$entity_list->SignalAllBotsByOwnerCharacterID(character_id, signal_id)` to Perl.
- Add `$entity_list->SignalBotByBotID(bot_id, signal_id)` to Perl.
- Add `$entity_list->SignalBotByBotName(bot_name, signal_id)` to Perl.
- Add `EVENT_SPELL_EFFECT_BOT` to Perl.
- Add `EVENT_SPELL_EFFECT_BUFF_TIC_BOT` to Perl.
# Lua
- Add support for `zone/bot.lua` and `zone/bot_v#.lua`.
- Add support for `global/global_bot.lua`.
- Add `bot:SignalBot(signal_id)` to Lua.
- Add `bot:OwnerMessage(message)` to Lua.
- Add `entity_list:SignalAllBotsByOwnerCharacterID(character_id, signal_id)` to Lua.
- Add `entity_list:SignalBotByBotID(bot_id, signal_id)` to Lua.
- Add `entity_list:SignalBotByBotName(bot_name, signal_id)` to Lua.
- Add `EVENT_SPELL_EFFECT_BOT` to Lua.
- Add `EVENT_SPELL_EFFECT_BUFF_TIC_BOT` to Lua.
# Supported Bot Events
1. `EVENT_CAST`
2. `EVENT_CAST_BEGIN`
3. `EVENT_CAST_ON`
4. `EVENT_COMBAT`
5. `EVENT_DEATH`
6. `EVENT_DEATH_COMPLETE`
7. `EVENT_SAY`
8. `EVENT_SIGNAL`
9. `EVENT_SLAY`
10. `EVENT_SLAY_NPC`
11. `EVENT_SPAWN`
12. `EVENT_TARGET_CHANGE`
13. `EVENT_TIMER`
14. `EVENT_USE_SKILL`
# Common
- Convert NPC pointers in common events to Mob pointers so bots are supported.
- Convert signal IDs to `int` where it wasn't already, allowing negative signals to be sent properly.
* Add EVENT_POPUP_RESPONSE.
* Cleanup and fix EVENT_COMBAT/EVENT_SLAY/EVENT_NPC_SLAY.
* Fix DoNPCEmote calls.
* Update attack.cpp
* Update event_codes.h
* Update bot_command.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.
* [Bots] Initial Cleanup of Functions, moved Bot Casting out of mob_ai.cpp
* Moved Bots off NPC AI_Spells Struct, and AI_Spells private attribute.
* Formatting Fixes, fixed LogAI entries, Added LogAIModerate Alias
* Add Constants.
* Added Bot DB Struct, fixed some potential casting issues
* Formatting
* Formatting
* [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
* Delete EQApplicationPacket after use
* Correct issue where Creating EQApplicationPackets in zone/mob.cpp may not free pBuffer[]
* Handle freeing pBuffer[] if exists in zone/mob.cpp Create*Packet functions
* Handle freeing pBuffer[] in zone/object.cpp Create*Packet methods
* Delete leaked outapp variables in zone/trading.cpp
* Make CreateHorseSpawnPacket() safer by freeing pBuffer[] before replacing with new[]
* Prevent initial new ServerPacket from being leaked in command_reload
* Free pack after sending in command_setlsinfo
* Delete new NPC in command_viewnpctype after printing stats
* Fix compile error
* Delete EQApplicationPacket after sending in command_kick
* Remove unneeded safe_delete(outapp) after FastQueuePacket and fix minor whitespace issue
* Delete packet after sending in WorldServer::SendReloadTasks
* Cleanup logic and free leaked NPCType in Client::Doppelganger
* Free RespawnOption in Client::HandleRespawnFromHover in 'unexpected rez from hover request' branch
* Free EQApplicationPacket after sending in Bot::ProcessBotInspectionRequest
* Free Bot when returning from failed Bot::Save() in helper_bot_create()
* Initialize variable to nullptr to prevent garbage initial value
* Undo change in other PR
* Move delete of ItemInstance to avoid edge case leaking in ZoneDatabase::LoadWorldContainer()
* Delete ItemInstance after use in Client::Handle_OP_AdventureMerchantPurchase()
* Delete ItemInstance after use in NPC::GetEquipmentMaterial()
* Delete ItemInstance after use in Bot::AddBotItem()
* Delete GetItems_Struct in edge case when !TradeItemsValid in Client::Handle_OP_Trader()
* Move delete GetItems_Struct to handle edge case when Customer is not valid in Client::Trader_EndTrader()