Skip to content

[Bots] Fix creation limit, spawn limit, level requirement checks#4868

Merged
Akkadius merged 2 commits intoEQEmu:masterfrom
nytmyr:bot-class-spawn-fix
May 15, 2025
Merged

[Bots] Fix creation limit, spawn limit, level requirement checks#4868
Akkadius merged 2 commits intoEQEmu:masterfrom
nytmyr:bot-class-spawn-fix

Conversation

@nytmyr
Copy link
Copy Markdown
Contributor

@nytmyr nytmyr commented Apr 22, 2025

Description

  • 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.
  • This also fixes QueryBotCount to not account for soft deleted bots (-deleted-)
  • #gm on is required to be on for those beyond the ruled min status requirements to bypass the limits.

Fixes Bot Spawn Limitation.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Testing

Tested every scenario of set unset rules/buckets.

Rules

rules

  • Bots:BotCharacterLevel - All players must be level 5 to create and spawn bots
  • Bots:CreationLimit - All players can only create 3 bots
  • Bots:SpawnLimit - All players can only spawn 3 bots
  • Bots:MinStatusToBypassBotLevelRequirement - Those beyond status 100 can create/spawn bots at any level with #gm on
  • Bots:MinStatusToBypassCreateLimit - Those beyond status 100 can create up to Bots:MinStatusBypassCreateLimit (120) bots with #gm on
  • Bots:MinStatusToBypassSpawnLimit - Those beyond status 100 can spawn up to Bots:MinStatusBypassSpawnLimit (120) bots with #gm on

Data Buckets

data_buckets
The following apply to character_id = 1:

  • bot_required_level - Can create and spawn bots at level 2
  • bot_required_level_Cleric - Cannot create or spawn Cleric bots until level 5
  • bot_creation_limit - Can create 10 bots
  • bot_creation_limit_Cleric - Can only create 2 Cleric bots
  • bot_spawn_limit - Can spawn up to 5 bots
  • bot_spawn_limit_Cleric - Can only create 1 Cleric bot

Clients tested: RoF2

Checklist

  • I have tested my changes
  • I have performed a self-review of my code. Ensuring variables, functions and methods are named in a human-readable way, comments are added only where naming of variables, functions and methods can't give enough context.
  • I own the changes of my code and take responsibility for the potential issues that occur

nytmyr added 2 commits April 21, 2025 23:42
- 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.
- Fixes QueryBotCount to not account for soft deleted bots (`-deleted-`)
Copy link
Copy Markdown
Contributor

@Akkadius Akkadius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic job, great PR description, code quality is tightening up. 🫡

@Akkadius Akkadius merged commit 4de8fbb into EQEmu:master May 15, 2025
1 check passed
@Akkadius Akkadius mentioned this pull request May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants