* [Bots] Fix creation limit, spawn limit, level requirement checks
- Previously if buckets were being used to control any of these values and the appropriate rule was set to 0, unset class specific buckets would override the main limit buckets.
- For example, if `Bots:SpawnLimit` is set to `0` and a player has their `bot_spawn_limit` set to `5` but they don't have a class bucket set for the class they're attempting to spawn a Cleric, the unset `bot_spawn_limit_Cleric` would return 0 and prevent Clerics from being spawned.
- This affected spawn limits, creation limits and level requirements to use bots if controlled by buckets.
- `#gm on` is required to be on for those beyond the ruled min status requirements to bypass the limits.
Rewrote checks and tested every scenario of set unset rules/buckets.
* Cleanup, fix bot count
- Fixes QueryBotCount to not account for soft deleted bots (`-deleted-`)
- Casters could endlessly flee a mob if they had target reflection and were too close.
- Prevents all bots that aren't taunting from adjusting if they're too close and have target reflection. This is safer than limiting it to just casters and ranged bots to prevent situations where melee bots might not be able to outrun the mob to get to their melee range and continually flee.
- WE'LL GET THIS RIGHT EVENTUALLY /sigh
* [Bots] Positioning rewrite
- Fixes positioning issues where bots could run back and forth or stay at the target's feet.
- Adds checks to ensure bots don't spam positioning updates and complete their initial positioning.
- Cleans up logic and makes it easier to read.
* Cleanup
- [#4756](https://github.com/EQEmu/Server/pull/4756) changed the way overwriting worked for buffs. It allowed stronger spells to overwrite lesser spells if they were already on the target.
- However, this is a positive change but has its drawbacks with spells of similar value. It could cause an endless buff loop where they constantly replaced one another.
Overall, the con of endless buffing outweighs the benefit of automatic overwriting lesser spells and the control should be left to only spell lists via `^spells` for bot owners as it was before to determine which buffs bots will cast.
- Certain resist spells have a DS bonus on them and can be casted as a resist rather than a damage shield. This forces anything with a damage shield as a damage shield buff.
* [Bots] Line of Sight and Mez optimizations and cleanup
- Renames `Map:CheckForLoSCheat` to `Map:CheckForDoorLoSCheat` to better reflect what it does.
- Renames `Map:RangeCheckForLoSCheat` to `Map:RangeCheckForDoorLoSCheat` to better reflect what it does.
- Adds the rule `Pets:PetsRequireLoS` to determine whether or not commanded pet attacks require an addition layer of LoS checks for edge-cases.
- Adds the rule `Bots:BotsRequireLoS` to determine whether or not bots require LoS to `^attack`, `^pull` and `^precombat`.
- Adds the rule `Map:ZonesToCheckDoorCheat` to control what if any zones will be checked..
- Corrects, removes and adds LoS checks where necessary.
- Improves door checking logic for locked or triggered doors that could be blocking LoS.
- Cleans up false positives for door cheat checks.
- Adds `drawbox` option to `#door` command. This will spawn points at the center and each corner of the door's "box". It will also spawn points at your and your target's location.
- Improves Mez and AE Mez logic
- Adds more details to the rule `Bots:EpicPetSpellName`
* Remove leftover debugging
* Change return to continue for GetFirstIncomingMobToMez checks
* Move mez chance fail to beginning of cast process
- Non-taunting melee bots will now properly go behind their target when it is enraged.
- Reduces how often taunting bots adjust their positioning by removing unnecessary rules.
- Cleans up CombatPositioning a bit
- When bots would charm a pet, once they zoned or camped the pet would poof and not trigger a respawn so the NPC which was charmed would never respawn until the zone was shut down or server restarted.
* [Bots] Fix taunting bots positioning
- Fixes taunting bots liking to hug their target on certain models or chosen positions.
- Makes bots have a more realistic combat range in comparison to players.
- Removed unnecessary rules and checks for melee distance.
* Update ruletypes.h
- Something between the latest release caused this crash to appear, unsure of this exact cause.
- Prevents bots from being sent a spawn packet for Auras.
- Removes the bot's auras on Depop
- Prevent bots not set to ^behindmob from finding positions behind their target.
- Backs up a bot if they're too close and have target reflection, not just taunting bots.
- Backs up bots if the target is rooting and they are not taunting to the appropriate position.
- This will particularly help with casters running around.
- Previously this only checked the bots target to med. It will now check the hatelist of the bot to ensure no mobs have the bot targeted before medding.
- Certain AE types weren't properly calculating their AE range and would base off the actual AE range for targeted types rather than the spells range itself
- Moved stance check to function
- Added check for Efficient and Assist stances.
- Sets aggressive to ignore aggrochecks by default
- Adds more types to default aggrocheck list
- Sets Assist to hold CCs
- Prevents casting on ineligible targets due to target type, stacking, etc.
- Adjust the rules Bots, MezChance, Bots, MezSuccessDelay and Bots, MezFailDelay
- Fix ^discipline saying no bots were selected
- Adds more information to certain commands to explain how they function.
- Rewrote ^copysettings and ^defaultsettings to not be so bloated and accept arguments properly.
- Added long names for setting categories
- Add Spell ID output to ^spells
- Add pre-death checks and early returns
- Cleanup pointers for GetUltimateSpellType checks
- Rename IsBotSpellTypeOtherBeneficial to BotSpellTypeUsesTargetSettings
- Rename GetUltimateSpellTypeDelayCheck to GetUltimateSpellTypeRecastCheck
-Add entity validation to GetNumberNeedingHealedInGroup
- Fix priority value check in spellpriority commands
- Fix list option
- Remove unnecessary temp vector on list grab
- Will move getter to cache in future PR
_tempSpellType was not getting defined during bot spawn process which could lead to a potential crash in RaidGroupSay.
Auto archery toggle was what triggered the crash as it announces their status on spawn.
Also moved this toggle for Rangers further down the proccess line.
* Implement spell AI pulling, fix throw stone
* more pull tweaks
* holding check at start of ai process
* fully implement ^pull logic to always return, can still be overidden by ^attack
* Rewrite ^pull logic and handling. **MORE**
Add ^setassistee command to set who your bots will assist. Bots will always assist you first before anyone else.
If the rule Bots, AllowCrossGroupRaidAssist is enabled bots will assist the group or raid main assists.
Rewrites logic in handling of pull and returning to ensure bots make it back to their location.
* Move HateLine to a better ID
* cleanup ST_Self logic in CastChecks
* Removed unused BotSpellTypeRequiresLoS
* Move fizzle message to define
* add timer checks to Idle/Engaged/Pursue CastCheck to early terminate
* Add back !IsBotNonSpellFighter() check to the different CastCheck
* Correct IsValidSpellRange
* Implement AAs and harmtouch/layonhands to ^cast --- fix IsValidSpellRange
* Add PetDamageShields and PetResistBuffs to IsPetBotSpellType()
* Add priorities to HateLine inserts for db update
* Remove SpellTypeRequiresCastChecks
* Add bot check to DetermineSpellTargets for IsIllusionSpell
* merge with previous
* Correct bot checks for ST_GroupClientAndPet
* Remove misc target_type checks
* Add lull/aelull to ^cast
* Add more checks for CommandedSubTypes::AETarget
* remove unneeded checks on IsValidSpellTypeBySpellID
* add to aelull
* rewrite GetCorrectSpellType
* Add IsBlockedBuff to CastChecks
* Add spellid option to ^cast to allow casting of a specific spell by ID
* ^cast adjustments for spellid casts
* Add missing alert round for ranged attacks
* More castcheck improvements
* CanUseBotSpell for ^cast
* remove ht/loh from attack ai
* remove SetCombatRoundForAlerts that triggered every engagement
* Add RangedAttackImmunity checks before trying to ranged attack
* move bot backstab to mob
* fix MinStatusToBypassCreateLimit
* more backstab to mob cleanup
* add bot checks to tryheadshot / tryassassinate
* adjust version number for bots
* add back m_mob_check_moving_timer, necessary?
* add sanity checks for classattacks
* Get rid of Bots:BotGroupXP and change logic to support Bots:SameRaidGroupForXP
Bots won't do anything if not in the same group so this should more accurately control only when in the same raid group.
* add "confirm" check to ^delete
* Update bot.cpp
* Remove `id` from bot_settings, correct types
* Implement blocked_buffs and blocked_pet_buffs
* more blocked buff tweaks
* add beneficial check to ^blockedbuffs
* command grammar
* missing )
* Move getnames for categories and settings to mob, rename hptomed/manatomed
* add GetBotSpellCategoryIDByShortName and CopyBotBlockedPetBuffs, update ^defaultsettings command
* cls cleanup
* Allow bots to clear HasProjectIllusion flag
* Add PercentChanceToCastGroupCure
* Implmenet PetCures, add some missing types for defaults/chance to cast
* Change GetRaidByBotName to GetRaidByBot
* Typo on PetBuffs implement
* Change GetSpellListSpellType to GetParentSpellType
* missing from GetChanceToCastBySpellType
* Fix performance in IsValidSpellRange by flipping HasProjectIllusion
* merge with prev
* merge with cls cleanup
* Reorder IsTargetAlreadyReceivingSpell/CheckSpellLevelRestriction/IsBlockedBuff
* Combine GatherGroupSpellTargets and GatherSpellTargets
* Cleanup IsTargetAlreadyReceivingSpell
* Fix ^petsettype to account for usable levels of spells and remove hardcoded level limits.
* Remove Bot_AICheckCloseBeneficialSpells and use AttemptCloseBeneficialSpells for better performance
* remove default hold for resist buffa
* move IsValidSpellRange further down castchecks
* raid optimizations
* correct name checking to match players
* more name checks and add proper soft deletes to bots
* organize some checks in IsImmuneToBotSpell
* Fix GetRaidByBotName and GetRaidByBot checks to not loop unnecessarily
* Move GatherSpellTargets to mob
* Change GetPrioritizedBotSpellsBySpellType to vector
Some slipped through in "organize some checks in IsImmuneToBotSpell"
* Move GatherSpellTargets and Raid to stored variables.
Missing some in "organize some checks in IsImmuneToBotSpell"
* comment out precheck, delays, thresholds, etc logging
missed some in "organize some checks in IsImmuneToBotSpell"
* Missing IsInGroupOrRaid cleanup
* Implement AIBot_spells_by_type to reduce looping when searching for spells
* Add _tempSpellType as placeholder for any future passthru
* todo
* Move bot_list from std::list to std::unordered_map like other entities
* Fix missing raid assignment for GetStoredRaid in IsInGroupOrRaid
* TempPet owned by bots that get the kill will now give exp like a client would
* Remove unnecessary checks in bot process (closescanmoving timer, verify raid, send hp/mana/end packet
* Fix client spell commands from saving the wrong setting
* Cleanup ^copysettings command and add new commands
* Add pet option to ^taunt
No longer has toggle, required on/off option and an optional "pet" option to control pets' taunting state
* Allow pet types to ^cast, prevent failure spam, add cure check
* more raid optimizations, should be final.
10 clients, 710 bots, 10 raids, ~250 pets sits around 3.5% CPU idle
* Move spell range check to proper location
* Implement ^discipline
* remove ^aggressive/^defensive
* remove this for a separate PR
* cleanup
* Add BotGroupSay method
* todo list
* Add missing bot_blocked_buffs to schema
* Remove plural on ^spelltypeidsand ^spelltypenames
* Move spelltype names, spell subtypes, category names and setting names to maps.
* move los checks to mob.cpp
* Bot CampAll fix
* Bots special_attacks.cpp fix
* Add zero check for bot spawn limits
If the spawn limit rule is set to 0 and spawn limit is set by bucket, if no class buckets are set, it defaults to the rule of 0 and renders the player unable to spawn bots.
This adds a check where if the rule and class bucket are 0, it will check for the spawn limit bucket
* Add HasSkill checks to bot special abilities (kick/bash/etc)
* code cleanup 1
* code cleanup 2
* code cleanup 3
* code cleanup 4
* fix ^cast wirh commanded types
* Remove bcspells, fix helper_send_usage_required_bots
* linux build fix
* remove completed todo
* Allow inventory give to specific ID slots
* Update TODO
* Correct slot ranges for inventorygive
* Add zone specific spawn limits and zone specific forced spawn limits
* remove bd. from update queries where it doesn't exist
* Rename _spellSettings to m_bot_spell_settings
* Add IsPetOwnerOfClientBot(), add Lua and Perl methods
* Make botOwnerCharacterID snakecase
* Throw bot_camp_timer behind Bots:Enabled rule
* Move various Bot<>Checks logging to BotSpellChecks
* Remove from LogCategoryName
* Consolidate IsInGroupOrRaid
* Consolidate GatherSpellTargets
* Add missing Bot Spell Type Checks to log
* Add GetParentSpellType when checking spelltypes for idle, engaged, pursue CastChecks.
* Consolidate AttemptForcedCastSpell
* Consolidate SetBotBlockedBuff/SetBotBlockedPetBuff
* Add list option to ^spellpriority commands.
* Move client functions to client_bot
* Move mob functions to mob_bot
* Move bot spdat functions to spdat_bot
* Move SendCommandHelpWindow to SendBotCommandHelpWindow and simplify
* Change char_id to character_id for bot_settings
* update todo
* Fix typo on merge conflict
* Cleanup command format changes, remove hardcoded class IDs in examples.
* Set #illusionblock for players to guide access
* Move client commands for bot spells from gm commands to existing bot commands
* Fix alignment issues
* More alignment fixes
* More cleanup 1
* More cleanup 2
* Fix BotMeditate to med at proper percentages
* Correct GetStopMeleeLevel checks for some buff checks
* Add back hpmanaend update to bot raid, force timer update to prevent spamming
* Remove log
* Cleanup ranged and ammo calculations - Adds throwing check for match
* Add check in distance calculations to stay at range if set even if no ammo or ranged
* Move melee distance calculations to better function
* Add GetBuffTargets helper
* Missing p_item, s_item in CombatRangeInput
* Linux test?
* Reduce GetCorrectBotSpellType branching slightly
This is still an ugly ass function but my brain is melted
* Line fixes
* Make bot pets only do half damage in pvp
* Add bot pet pvp damage to tune
* Add bot pet check for AIYellForHelp
* Add bots to UseSpellImpliedTargeting
* Move toggleranged, togglehelm and illusionblock to new help window. Add actionable support
* Add bot and bot pet checks to various spells, auras and targeting checks that were missing.
* update todo
* New lines
* Correct DoLosChecks
* Remove Log TestDebug
* Remove _Struct from struct declarations
* Add bot check to IsAttackAllowed for GetUltimateOwner to skip entity list where possible
* Wrap SaveBotSettings in Bots Enabled check
* Remove comment
* Wrap bot setting loading for clients in bots enabled rule
* Cleanup BlockedBuffs logic in SpellOnTarget
* Rename BotSpells_Struct/BotSpells_Struct_wIndex
* Rename spawn/create status bypass rules, fix return for spawn limit
* Remove unnecessary return in CanBuffStack, cleanup
* Enable recastdelay support for clients
* Remove unused variables
* Rename _assistee to bot_assistee
* hardcode BotCommandHelpWindow colors
* todo
* Fix ^cast summoncorpse
* todo
* Reimplement secondary colors to BotSendCommandHelpWindow
* Give ^copysettings/^defaultsettings more options, cleanup.
* Cleanup some commands
* Add comment to CheckLosCheat/CheckLosCheatExempt
* Make struct BotSpellSettings snake case
* Allow duplicate casts of same spell on target for heals and cures
* Add default delay to cures
* Remove unused methods
* Implement missing ^spellresistlimits/^resistlimits command
* Move functions out of mob.h and cleanup
* Return for GetRawBotList
This checks offline bots too
* Rename BotGroupSay to RaidGroupSay
* Prevent bots from forming their own group if a bot that is a group leader is removed from the raid
* Linux fix?
* IsPetOwner fixes
* Add remove option to list for ^blockedbuffs / ^blockedpetbuffs
* Implement ^spellannouncecasts to toggle announcing casts of spell types
* Remove rule Bots:BardsAnnounceCasts
* Update bot.h
* Remove unused no_pets option from GatherSpellTargets
* Move ^attack response back to normal chat window (other)
* Set lower limit of spell delays to 100 rather than 1
* Correct pet checks on GetUltimateSpell functions
* Add rules (Bots, AICastSpellTypeDelay, Bots, AICastSpellTypeHeldDelay) to prevent spamming of failed spell type AI casts
* Correct pet buff type logic to catch DS/Resists with other spell effects in them
* Fix defaults for clients
* Add more logic for necros/shaman for default heal thresholds due to lich and canni
* Rename SpellHold, SpellDelay, SpellMinThreshold, SpellMaxThreshold, SpellRecastDelay to fit SpellType style naming
* Use GetTempSpellType() for announce check in RaidGroupSay
* Make all spell shortnames plural where applicable
* Update bot.cpp
* Bots:BotsUseLiveBlockedMessage filter to spell failure
* Move GetSpellTargetList to only get called when necessary to reduce overhead
* formatting
* Formatting
* Simplify case SE_Illusion and SE_IllusionCopy for GetIllusionBlock
* Clean up InterruptSpell
* Cleanup IsBot() checks for DetermineSpellTargets->ST_GroupClientAndPet
* Cleanup range/aoe_range check in SpellFinished
* Cleanup DetermineSpellTargets->ST_GroupNoPets
* Cleanup DetermineSpellTargets->ST_Self for bot summon corpse
* Cleanup DetermineSpellTargets->ST_Pet
* Cleanup bot logic in TryBackstab
* Cleanup IsAttackAllowed checks for bots and their pets
* Cleanup StopMoving for bots
* Cleanup CanThisClassTripleAttack
* Fix casting for GetIllusionBlock checks
* Formatting
* Fix DetermineSpellTargets for group spells (this also wasn't properly checking the rule Character:EnableTGB in master)
* Cleanup spelltarget grabbing logic, consolidate group heals in to GetNumberNeedingHealedInGroup
* Throw added client los pet checks behind LoS cheat rule for bots
* CLeanup give_exp on npc death logic and ensure client pets always pass.
* Undo unintended rename from previous refactor
* Remove pointless Bots, SameRaidGroupForXP rule
* Revision to 0690783a9d1e99005d6bee0824597ea920e26df9
---------
Co-authored-by: Akkadius <akkadius1@gmail.com>
* Zone optimizations
* More changes
* More
* Update entity.cpp
* Beautiful
* Amazing
* Feature flag all logic
* Broadcast to group
* Update mob.cpp
* Updates
* Update client.cpp
* Update client.cpp
* Add rule Zone:EnableEntityClipping
* Little bit of cleanup
* Don't send update to self while in group
* Remove visibility work and feature flags
* Cleanup
* Logging
* Improve CheckSendBulkNpcPositions
* No need to cast
* Field cleanup
* Build initial list on zone-in
Previously level requirement was only being checked on the initial rank of an AA. If passed, bots would gain all ranks for that AA regardless of level, this will now check for the level requirement for each rank before granting the AA
* [Performance] Minor improvements to ScanCloseMobs
* Remove timer checks one level up to reduce branching
* Reserve memory in m_close_mobs to avoid frequent re-allocations if not already reserved.
This adds a flag to mobs that are told to attack by their owner to prevent unintended attacks.
Previously, if you were to send your bots to attack a target and then switch targets: before casters land their spell or if melee (especially anyone with pets) hasn't engaged before the target switch, they could switch to your new target and attack.
This adds a flag upon attack and bots will only attack flagged targets.
* Allow SPA69 to work on worn effects.
Update to allow SPA69 to work on worn effects which the client accepts and calculates properly.
Updated spell effect related Max HP change variables. 1) We had stat bonuses defined that did same function. Without updating would have had to create another variable for above to work. 2) Negate bonuses spell effect end up negating item HPs. which is not intended since using same variable for items and spells.
* HP variable updates
fixes
* HP variable updates
fixes
* HP variable updates
fixes
* Update mob.cpp