feature/pity-instability #10

Merged
denise merged 18 commits from feature/pity-instability into develop 2026-07-08 18:03:12 +00:00
Owner
No description provided.
Per-tier affix pity on mutated loot, group cache pity integration, combat damage scaling from aura intensity, character DB persistence, and GM pity commands.

Co-authored-by: Cursor <cursoragent@cursor.com>
Include Define.h in shared illidari_pity.h so uint8/uint32 resolve when built as a static module.

Co-authored-by: Cursor <cursoragent@cursor.com>
AzerothCore stores a reference to nested ChatCommandTable vectors; the inline pity initializer was destroyed before Initialize Commands ran.

Co-authored-by: Cursor <cursoragent@cursor.com>
Show all tier counters in .affix pity, clarify gate cap vs fail count, and ensure a successful pity gate always yields at least one affix line instead of re-rolling a 25% zero-line outcome.

Co-authored-by: Cursor <cursoragent@cursor.com>
Centralize per-kill cache gate recording in RollAndRecordCachePity so cache counters tick when corpse loot is processed, not only from the kill hook.

Co-authored-by: Cursor <cursoragent@cursor.com>
Pity gates run once per mutated kill (not per loot item or corpse open); chat broadcasts to the group; loot open only applies stored affix rolls to gear.

Co-authored-by: Cursor <cursoragent@cursor.com>
Affix_T1..T5 pity uses the same group pool as cache pity so kill-tagging does not divide pity buildup by party size; jackpots stay personal.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Mutation state is cleared on death, so loot was skipping the stored kill gate and crediting pity success to the wrong tier.

Co-authored-by: Cursor <cursoragent@cursor.com>
Empty corpse pre-roll slots now consume without re-rolling via legacy rollPossibleEnchant.

Co-authored-by: Cursor <cursoragent@cursor.com>
Author
Owner

References issue #7

References issue #7
Wire ApplyAuraSpell to a stacked buff spell (901210) so pity buildup shows
on the WotLK buff bar with 1-5 stacks, extend the client Spell.dbc patch tool
to install the aura spell, and default Pity.Aura.SpellId to 901210. Closes the
remaining instability-aura acceptance item on issue #7.

Co-authored-by: Cursor <cursoragent@cursor.com>
Force the pity aura to permanent duration server-side (nothing re-applies it
between kills, so a finite DBC duration would silently expire), and map any
contributing intensity to at least one stack so the buff appears as soon as
pity starts accumulating instead of only after ~3 failed gates.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use CumulativeAura and EffectAura_1 (the real column names) instead of
StackAmount/EffectApplyAuraName_1, which made the auto-applied update error
out so spell 901210 was never created. Drop the passive attribute bit so the
buff shows on the buff bar. Validated against the live world schema.

Co-authored-by: Cursor <cursoragent@cursor.com>
Passing an affix or cache pity gate no longer risks yielding nothing.
Affix delivery is guaranteed on exactly one (highest-ilvl) eligible item,
carried forward via a persisted owed-reward when a corpse has no eligible
item. All pity resets (affix gate, affix jackpot, cache gate, cache
jackpot) are deferred until the reward is confirmed on corpse loot.

- Add owed affix/cache reward state to PlayerPityRuntime with persisted
  player_owed_reward table and Set/Get/Consume/Has APIs.
- Retry ForceOneAffix fallback so a guaranteed roll is never empty.
- Rework CacheLootAffixes: single-item guarantee, carry-forward, and
  reset-on-delivery; roll jackpot once per kill rather than per item.
- Expose TryGetRecordedCachePityRoll / OnCachePityDelivered for the
  difficulty module and add RandomEnchants.Pity.Jackpot.Cache.GrantTier.
- Show affix/cache owed state in .affix pity and document semantics.

Co-authored-by: Cursor <cursoragent@cursor.com>
Pity fail counters, jackpot progress, and the derived instability aura
were in-memory only (group pity never saved; player pity flushed just on
logout), so a server restart wiped all buildup. Store them in a new
zone/map-scoped player_zone_pity table written on every change.

- Key state by (playerGuid, scopeType, scopeId, category): open world uses
  zone id, dungeons/raids use map id. Party-shared affix and cache pity
  rows live on the party leader's guid.
- Load the active scope on login and on zone/map change, flushing the
  previous scope first, then refresh the aura so it returns in-zone.
- Purge rows older than RandomEnchants.Pity.Persist.TtlDays (default 7) on
  worldserver startup and per-player login to avoid bloat.
- Migrate existing player_affix_pity rows into player_zone_pity and drop
  the old flat table; .affix pity now shows the active zone/map scope.

Co-authored-by: Cursor <cursoragent@cursor.com>
The Aura.ZoneBound guard compared runtime.auraScope* against the current
scope, but those fields are only set in RefreshInstabilityAura once
intensity > 0 -- a chicken-and-egg that pinned intensity at 0, so the
aura never ticked up and the buff never cast. Gate on runtime.activeScope
instead, which EnsureScopeLoaded already keeps in sync with the player's
current scope.

Co-authored-by: Cursor <cursoragent@cursor.com>
FillLoot runs OnAfterLootTemplateProcess before OnPlayerCreatureKill
records the pity gate, so CacheLootAffixes ran without guaranteeActive and
never called SetPlayerOwedAffixReward even though the kill message showed
a gate pass. Defer the premature mutated-kill pre-roll and re-invoke
CacheLootAffixes right after ProcessMutatedKillPity once the gate exists.

Co-authored-by: Cursor <cursoragent@cursor.com>
Profession-created gear now uses AffixCount.Craft weights instead of the
generic T0 fallback (~15% any-line), with rollCraftAffix wired through
OnPlayerCreateItem when Craft.Enable is on. Successful craft affixes show
an immersive SMSG_NOTIFICATION banner to the crafter plus the usual chat
breakdown; pity and kill gates are unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
denise merged commit 1b22a75357 into develop 2026-07-08 18:03:12 +00:00
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
denise/mod-random-enchants!10
No description provided.