Add NPC system scaffold, loot-table gold drops, and remove stash VIP gate

This commit is contained in:
dingo
2026-02-14 00:37:56 -05:00
parent d4f467656d
commit b4affac203
19 changed files with 1448 additions and 89 deletions
+62 -17
View File
@@ -1,20 +1,65 @@
# Pending Client Changes
## HazardZone Tile Tinting (Ability Type 29)
## NPC Interactions
- `DUNGEON_STATE` now includes a top-level `hazards` array every tick.
- Each hazard item includes:
- `id`
- `sourceMobId`
- `x`, `y`, `radius` (world-space pixels)
- `duration` (seconds remaining)
- `tickInterval`, `nextTickIn`
- `damagePerTick`, `damageTypeKey`
- `visualKey`
- `tintColor` (hex from ability config, ex: `#ff5500`)
- `tintOpacity` (0..1 from ability config)
- Client behavior:
- Render tile tint overlay for the area covered by each active hazard in `hazards`.
- Keep overlays synchronized to the current `hazards` list from each state packet.
- Remove overlay when a hazard no longer exists in the list (expired/removed server-side).
- If multiple hazards overlap, blend/stack tints in a deterministic order (recommend by `id` ascending).
- New input opcodes:
- `DUNGEON_INPUT_NPC_INTERACT` (`406`)
- `DUNGEON_INPUT_NPC_DIALOG_SELECT` (`407`)
- `DUNGEON_INPUT_NPC_SHOP_ACTION` (`408`)
- New response opcodes:
- `NPC_INTERACT_STATE` (`620`)
- `NPC_DIALOG_STATE` (`621`)
- `NPC_DIALOG_RESULT` (`622`)
- `NPC_SHOP_STATE` (`623`)
- `NPC_SHOP_RESULT` (`624`)
### DUNGEON_STATE additions
- `npcs` array added to top-level dungeon state.
- NPC payload fields:
- `id`, `definitionId`, `name`
- `x`, `y`, `rotation`
- `level`, `health`, `maxHealth`, `isAlive`
- `isKillable`, `canShop`, `hasDialog`
- `behavior`, `onAttackBehavior`
- `currentAnimation`, `spriteConfig`, `tintColor`, `scale`
### Interaction payloads
- `DUNGEON_INPUT_NPC_INTERACT` request:
- `{ npcId }`
- `DUNGEON_INPUT_NPC_DIALOG_SELECT` request:
- `{ npcId, optionId }`
- `DUNGEON_INPUT_NPC_SHOP_ACTION` request:
- `{ npcId, action: "buy", slotIndex, quantity }`
### Dialog payloads
- `NPC_DIALOG_STATE`:
- `success`
- `npcId`
- `node`: `{ id, text, isTerminal, rewardGold, rewardXp, rewardItemDefinitionId, rewardItemQuantity, rewardQuestKey }`
- `options`: list of `{ id, text, nextNodeId }` that pass server-side conditions.
- `NPC_DIALOG_RESULT`:
- `success`, `npcId`, `nextNodeId`, `isTerminal`
- or `error` when blocked/invalid.
### Shop payloads
- `NPC_SHOP_STATE`:
- `success`
- `shop`: `{ id, name, items[] }`
- each item: `{ slotIndex, itemDefinitionId, itemName, quantity, priceGold, restocks, restockIntervalSeconds }`
- `NPC_SHOP_RESULT`:
- `success`, `npcId`, `action`, `itemDefinitionId`, `quantity`, `totalPrice`, `remainingGold`, `remainingStock`
- or `error` for failure states.
## Stash Access
- Stash is no longer VIP-gated on server.
- Existing stash opcodes are unchanged:
- `STASH_REQUEST` (`610`)
- `STASH_STATE` (`611`)
- `STASH_DEPOSIT` (`612`)
- `STASH_WITHDRAW` (`613`)
- `STASH_RESULT` (`614`)