179 Commits

Author SHA1 Message Date
Aeadoin
cd63047e60
[Bug Fix] Fix Bot Group Loading (#2780)
* [Bots] Fix Bot Groups

* unsigned.
2023-01-22 12:06:13 -05:00
Alex King
3335cacac1
[Bots] Cleanup and remove preprocessors. (#2757)
* [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>
2023-01-20 12:35:33 -06:00
Aeadoin
090019cf83
[Bot] Restrict Bot Groups from spawning while Feigned. (#2761) 2023-01-19 16:52:20 -06:00
Alex King
f5523b40d2
[Quest API] Add CampAllBots() to Perl/Lua. (#2732)
# 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`.
2023-01-14 09:14:50 -06:00
Alex King
4c8b65ecc6
[Quest API] Add EVENT_BOT_CREATE to Perl/Lua (#2713)
* [Quest API] Add EVENT_BOT_CREATE to Perl/Lua

# Perl
- Add `EVENT_BOT_CREATE`.
- Exports `$bot_id`, `$bot_name`, `$bot_class`, `$bot_race`, and `$bot_gender`.

# Lua
- Add `event_bot_create`.
- Exports `e.bot_id`, `e.bot_name`, `e.bot_class`, `e.bot_race`, and `e.bot_gender`.
2023-01-08 21:46:40 -05:00
Aeadoin
0c9c78fbab
[Bot Commands] Toggle Enforce Spell Settings (#2682)
* [Bot Commands] Toggle enforcespellsettings

* Cleanup

* Update bot_command.cpp

Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com>
2022-12-30 17:18:05 -05:00
Aeadoin
e811cb1e85
[Hotfox] Compiling fails on FMT 9.1 with Bots (#2665) 2022-12-21 16:20:47 -05:00
Aeadoin
f12090d109
[Bots] Cleanup various Bot Spell Focus methods (#2649)
* [Bots] Cleanup GetFocusEffect & GetActSpellDamage

* Remove unused CalcBotFocusEffect

* Cleanup unneeded derived class methods

* compile error
2022-12-16 17:21:37 -05:00
Aeadoin
ede3ed4df3
[HotFix] Resolve issue with Bot Casting after zoning. (#2617) 2022-12-04 15:43:38 -06:00
Aeadoin
7e0fe93039
[Bots] Save Bot Toggle Archer Setting between Loads. (#2612)
* [Bots] Save Bot Toggle Archer Setting between Loads.

* [Bots] Save Bot Toggle Archer Setting between Loads.

* Typo
2022-12-04 13:23:25 -05:00
Aeadoin
80fffb57b1
[Bots] Cleanup Spell Settings Commands (#2607)
* [Bots] Cleanup Spell Settings Commands

* Update Bot DB version

* typo
2022-12-03 19:49:45 -05:00
Aeadoin
61b91d92c3
[Bots] Expanded Bot Spell Settings List. (#2606)
* [Bots] Expanded Bot Spell List Settings

* [Bots] Expanded Bot Spell List Settings

* Fixes/formatting

* typo

* Formatting & update SpellInfo Command

* Spelling

* Typo
2022-12-03 12:15:57 -05:00
Aeadoin
35d22913b9
[Bug Fix] Fix Bot ^spellsettingsadd command (#2603) 2022-12-01 14:25:23 -05:00
Aeadoin
e7704f00f3
[Bots] Melee Bot Support for Spell Settings Commands (#2599) 2022-11-30 19:35:17 -05:00
Alex King
2d364e2fd1
[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.
2022-11-27 14:46:36 -05:00
Kinglykrab
856aa51cb8
[Bots] Add support for Bot scripting. (#2515)
* [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
2022-11-16 21:02:16 -06:00
Kinglykrab
7ea77ee027
[Bots] Add Quest API Support for Limits. (#2522)
* [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.
2022-11-16 19:51:13 -05:00
Kinglykrab
b512447448
[Bots] Add give/remove saylinks to ^itemuse. (#2503)
Adds shortcut saylinks for giving items to bots or removing items from them.
2022-10-29 21:22:01 -04:00
Chris Miles
89fdd842e1
[Code Cleanup] Zone Data Loading Refactor (#2388)
* [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
2022-09-01 18:48:28 -05:00
Kinglykrab
6232a64cdb
[Bug Fix] Fix Bot Group Loading (#2366)
* [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.
2022-08-20 03:15:58 -05:00
Kinglykrab
216b6ef426
[Saylinks] Convert all GM Command Saylinks to Silent Saylinks. (#2373)
* [Saylinks] Convert all GM Command Saylinks to Silent Saylinks.
- This cleans up all non-silent GM Command Saylinks that we had before due to the way they worked before. All saylinks like this should be silent now.
- Add source short hand capability for say links with same link as text.

* Defaults to r anyway.

* Spacing.
2022-08-13 20:40:22 -04:00
Chris Miles
dfd8f84cac
[Strings] Refactor Strings Usage (#2305)
* Initial commit checkpoint

* More functions converted

* Commify

* More functions

* Fin

* Sort declarations

* Split functions between files

* Bots

* Update strings.h

* Split

* Revert find replaces

* Repository template

* Money

* Misc function

* Update CMakeLists.txt

* Saylink

* Update strings.cpp

* Swap Strings::Saylink for Saylink::Create since saylink is coupled to zone database

* API casings
2022-07-14 02:10:52 -05:00
Quintinon
b5c4357de2
[Bug Fix] Fix miscellaneous memory leaks related to EQApplicationPacket and it's pBuffer (#2262)
* 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
2022-07-02 22:10:51 -05:00
Kinglykrab
0c01872608
[Bots] Cleanup ^inventoryremove, ^inventorylist, and ^list Commands and bot groups. (#2273)
* [Bots] Cleanup ^inventoryremove, ^inventorylist, and ^list Commands.

* Bot group cleanup, bot group auto spawning.

* Compile fix.

* Require SQL.
2022-07-02 21:46:00 -05:00
Kinglykrab
7f12ad325a
[Bug Fix] Fix bot compile locking client on server enter. (#2210) 2022-05-26 14:10:19 -04:00
Kinglykrab
9ccdb9eb84
[Bot Commands] Use Account Status Constants. (#2201)
- Convert bot_command_add calls to use constants instead of magic numbers.
2022-05-23 19:56:56 -04:00
Kinglykrab
4eaf44fc33
[Commands] Remove unused #bestz and #pf Commands. (#2112)
- Remove unused commands.
2022-05-06 21:13:26 -04:00
Kinglykrab
b2b87ea4e0
[Quest API] Expand Bot quest API functionality. (#2096)
* [Quest API] Expand Bot quest API functionality.
- Add $bot->AddItem(slot_id, item_id, charges, attuned, augment_one, augment_two, augment_three, augment_four, augment_five, augment_six) to Perl.
- Add $bot->CountItem(item_id) to Perl.
- Add $bot->HasItem(item_id) to Perl.
- Add $bot->RemoveItem(item_id) to Perl.
- Add bot:AddItem(slot_id, item_id, charges, attuned, augment_one, augment_two, augment_three, augment_four, augment_five, augment_six) to Lua.
- Add bot:CountItem(item_id) to Lua.
- Add bot:GetOwner() to Lua.
- Add bot:HasItem(item_id) to Lua.
- Add bot:RemoveItem(item_id) to Lua.

* Fix possible crash.
2022-05-03 23:04:54 -04:00
Kinglykrab
9113508269
[Bots] Fix ^dyearmor command math. (#2081)
* [Bots] Fix ^dyearmor command math.

* Typo.
2022-04-30 10:57:22 -04:00
Kinglykrab
293361a1f7
[Cleanup] Make use of AccountStatus constants wherever status is checked or used. (#1764)
* [Cleanup] Make use of AccountStatus constants wherever status is checked or used.
- Cleanup all instances of SendEmoteMessage.
- Cleanup all instances of SendEmoteMessageRaw.
- Cleanup all instances of MessageStatus.
- Convert Quest API method defaults to use constants.

* Cleanup constant names.
2021-11-14 21:01:13 -06:00
Kinglykrab
17aaab1f9d
[Quest API] Add Spell methods to Perl. (#1631)
* [Quest API] Add Spell methods to Perl.
- Add quest::getspell(spell_id) to Perl.
- Add eq.get_spell(spell_id) to Lua.
These methods return a spell object.

Exports $spell object references to spell events.

* Formatting.

* Remove comment.

* Update spdat.cpp

* Amplication typo.

* Fix conflicts.

* Remove repository changes.

* Fix typing.

* Update spell_effects.cpp
2021-11-03 17:47:15 -04:00
Chris
97dcba70cf
[Bots] Fix for Bot Pets Taunting (#1519)
Currently bot pets will taunt and there's no way to turn it off. This makes it so pets follow their owner's taunt settings.
2021-09-12 22:37:39 -05:00
Alex
c3456ebea0
[Bots] Remove hardcoded race-class combinations from bots. (#1375)
* [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.
2021-06-11 13:30:56 -05:00
Akkadius
0c533071d4 Yet more cleanup 2021-02-07 15:00:16 -06:00
Akkadius
b7983d4c20 First pass 2021-02-06 00:45:13 -06:00
Akkadius
3f62da4573 Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-05-23 22:33:34 -05:00
KimLS
2fbd5aaccc Rename namespace EQEmu to namespace EQ (so we don't have two similar but different namespaces anymore) 2020-05-17 18:36:06 -07:00
Akkadius
373fb3f0e7 Decouple zone calls, cleanup logic 2020-04-19 04:36:39 -05:00
Akkadius
3a09197d77 Migrate zone [skip ci] 2020-03-11 03:55:44 -05:00
Uleat
7f6414d685 Some bot-related changes (Master Wu's Technique, Tiger Claw timer) 2020-03-02 12:09:55 -05:00
Uleat
852d951b65 Reworked EVENT_COMMAND handling and addressed script commands not present during help use 2020-01-06 15:41:05 -05:00
Uleat
7678a905c8 Modified bot command 'pull' to ignore engaged targets 2019-12-24 14:57:58 -05:00
Uleat
e050534378 Added BARD to available class Bot stop_melee_level criteria 2019-12-17 21:02:36 -05:00
Uleat
0cb425b6dd Tweaked bot title and suffix code a little 2019-12-13 20:59:10 -05:00
Uleat
bd6e06aadb Few tweaks to bot ai 2019-12-13 16:50:42 -05:00
Uleat
1196abfda8 Fix for bot classes having skills they shouldn't. Please report any abnormalities.
Tweaked bot command 'itemuse' to exclude invalid dual-wield reporting
2019-12-10 20:19:43 -05:00
Uleat
efd710855e Added bot command 'itemuse' 2019-12-10 02:02:42 -05:00
Uleat
ab35c3ed90 Tweaked a few bot things... 2019-12-09 22:01:50 -05:00
Uleat
e306e9ad0c Added bot command option 'follow chain' to allow linear assignment of follow ids to eligible bots 2019-12-08 23:54:51 -05:00
Uleat
35fe27eb5d Added bot commands 'applypoison' and 'applypotion' .. new bot owner option 'buffcounter' 2019-12-03 22:01:13 -05:00