Skip to content

Lifelike AH: per-item listing count override (Part B)#18

Merged
icemansparks merged 2 commits into
merkerhoodfrom
feat/item-count-override
Jul 2, 2026
Merged

Lifelike AH: per-item listing count override (Part B)#18
icemansparks merged 2 commits into
merkerhoodfrom
feat/item-count-override

Conversation

@icemansparks

Copy link
Copy Markdown
Collaborator

Implements Part B of the lifelike-AH plan: the bot lists per-item quantities that mirror ChromieCraft's real auction house instead of a uniform global DuplicatesCount.

Change

  • New table mod_auctionhousebot_countOverride (item, targetCount), loaded via AHBConfig::LoadCountOverrides() and shared across alliance/horde/neutral configs — mirrors the priceOverride plumbing exactly.
  • getElement takes the config and, when a per-item override exists, uses it as the max listing count for that item (max-cap semantics) instead of the global DuplicatesCount.
  • Data: targetCount = min(cc_item_count, 50) from the 10,601-item ChromieCraft count dataset (469 clamped at 50, 5,984 stay at 1).

Safety

  • Items with no override keep current behaviour.
  • If the table is missing/empty, GetCountOverrideForItem returns 0 and the bot falls back to DuplicatesCount — graceful degradation.
  • No new unused params/vars (scanned for the -Werror traps).

Validation

CI -Werror build is the compile gate. Behaviour must be verified on the TEST realm (apply the SQL, restart worldserver, confirm commodities list in bulk while rare items stay scarce) before LIVE.

New mod_auctionhousebot_countOverride table (item, targetCount), loaded and
shared across configs exactly like the price overrides. In getElement, a per-item
override caps how many of that item the bot lists, replacing the global
DuplicatesCount for that item (max-cap semantics). Data generated from the
ChromieCraft item-count dataset with targetCount = min(cc_item_count, 50);
10601 items. Items with no override keep current behaviour; a missing/empty
table degrades gracefully (GetCountOverrideForItem returns 0).
…ument behaviour

Per sonnet review: an empty count-override table is a normal optional state (LOG_INFO,
not ERROR); targetCount column is int UNSIGNED to match the uint32 read; README documents
that an override caps an item even when DuplicatesCount is 0 (unlimited).
@icemansparks
icemansparks merged commit 5af5f77 into merkerhood Jul 2, 2026
1 check passed
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.

1 participant