feat(diva): implement Diva Defense point accumulation (#168)

RE'd putAdd_ud_point (FUN_114fd490) and putAdd_ud_tactics_point
(FUN_114fe9c0) from the ZZ client DLL via Ghidra decompilation.

MsgMhfAddUdPoint fields: QuestPoints (sum of 11 category accumulators
earned per quest) and BonusPoints (kiju prayer song multiplier extra).
MsgMhfAddUdTacticsPoint fields: QuestID and TacticsPoints.

Adds diva_points table (migration 0009) for per-character per-event
point tracking, with UPSERT-based atomic accumulation in the handler.
This commit is contained in:
Houmgaor
2026-03-18 12:09:44 +01:00
parent 61d85e749f
commit 792dcd5d91
10 changed files with 217 additions and 18 deletions

View File

@@ -0,0 +1,10 @@
-- Track per-character Diva Defense (UD) point accumulation per event.
-- Each row records a character's total quest + bonus points for one event.
CREATE TABLE IF NOT EXISTS public.diva_points (
char_id integer NOT NULL REFERENCES public.characters(id) ON DELETE CASCADE,
event_id integer NOT NULL REFERENCES public.events(id) ON DELETE CASCADE,
quest_points bigint NOT NULL DEFAULT 0,
bonus_points bigint NOT NULL DEFAULT 0,
updated_at timestamp with time zone NOT NULL DEFAULT now(),
PRIMARY KEY (char_id, event_id)
);