Commit graph

23 commits

Author SHA1 Message Date
Erik
c4856dc701 feat: compute base item values by reversing active spell buffs
Extract spell effect mappings from Dictionaries.cs into spell_effects.json.
During item ingestion, compute_base_values() reverses active enchantment
effects to get true base stats:
- base_armor_level: armor without Impenetrability buffs
- base_max_damage: damage without Blood Drinker buffs
- base_attack_bonus: attack without Heart Seeker buffs
- base_melee_defense_bonus: defense without Defender buffs
- base_elemental_damage_vs_monsters: elemental without Spirit Drinker
- base_mana_conversion_bonus: mana conv without Hermetic Link

New columns in ItemCombatStats, exposed in search CTEs.
Frontend: Base Armor and Base Dmg columns (hidden by default, toggle on).
Requires ALTER TABLE migration before deploy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 12:31:39 +02:00
Erik
84d651ac44 fix: filter garbage weapon_time values (67108882 is flag data, not speed)
Some unidentified items have IntValues[218103835] = 67108882 which is
a bitmask/flags value, not weapon speed. Cap at 100 in extraction and
filter >100 in frontend display. AC weapon speed is typically 0-50.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 11:18:00 +02:00
Erik
5b706d45e0 feat: add weapon speed, attack bonus, melee defense columns
Backend: add weapon_time and melee_defense_bonus to search CTE.
Frontend: show Speed, Attack Bonus (+%), Melee Def (+%) columns
visible by default. Material/Workmanship hidden by default.
Attack bonus and melee defense shown as percentage offset from 1.0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 18:24:32 +02:00
Erik
7f7595b5b6 fix: weapon_type filter uses subquery instead of rd table reference
The rd table is only available inside the CTE, not in the outer WHERE.
Use EXISTS subquery against item_raw_data for skill-based weapon type
filtering (same pattern as spell_contains fix).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 17:43:13 +02:00
Erik
9749eafde4 feat: add weapon type filter (heavy, light, finesse, 2H, bow, crossbow, thrown, caster)
Backend: new weapon_type query parameter on /search/items.
Uses skill ID from IntValues[218103840] for melee types (Heavy=44,
Light=45, Finesse=46, TwoHanded=41) and name matching for missile
sub-types (bow, crossbow, thrown). Caster = ObjectClass 31.

Frontend: dropdown appears when "Weapons" radio selected, hidden otherwise.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 17:41:07 +02:00
Erik
35a11d0cf1 fix: correct weapon ObjectClass IDs (1, 9, 31 not 6, 7, 8)
DECAL ObjectClass enum: MeleeWeapon=1, MissileWeapon=9, WandStaffOrb=31.
The weapon_only filter was using Food=6, Money=7, Misc=8 — completely
wrong classes. Also removed max_damage>0 requirement so weapons show
even before combat stats are populated.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 17:35:09 +02:00
Erik
1e9dffb65b fix: weapon combat stats extraction + spell_contains SQL bug
Bug 1: Weapon stats (max_damage, attack_bonus, variance, damage_type,
weapon_time, weapon_skill) were read from top-level MyWorldObject fields
which are -1 by default. Now extracted from IntValues/DoubleValues keys
where the plugin actually stores them (218103842, 167772170, etc.).

Bug 2: spell_contains and has_spell filters used direct sp.spell_id
reference which fails in the count query CTE (sp table not available
in outer SELECT). Changed to EXISTS subqueries matching the pattern
already used by legendary_cantrips filter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 17:24:48 +02:00
Erik
84da2a8752 fix: refine mana panel layout and state display
Widen the inventory layout so the backpack column no longer crowds the paperdoll, and base mana active/inactive display on the live data currently available from inventory payloads.
2026-03-13 07:32:57 +01:00
Erik
dc7b26676d fix: tighten mana panel layout and icon sizing
Adjust the inventory mana panel to fit beside the backpack column without overlap, prevent the panel from scrolling, shrink composite icons correctly, and refine mana-state derivation using existing item spell data.
2026-03-12 07:54:56 +01:00
Erik
0e8186b8e5 feat: add mana tracker panel to inventory
Derive equipped item mana state and time-remaining data in inventory-service, then render a Mana panel inside the inventory window with live icon, state, mana, and countdown display.
2026-03-11 20:02:52 +01:00
erik
fc557ab1d5 feat: update inventory frontend and services to current production state 2026-03-07 08:37:32 +00:00
erik
973c3722bc fix: address code review findings for inventory delta feature
- Fix remaining f-string SQL injection in process_inventory (same pattern
  as single-item endpoints: parameterized ANY(:ids) queries)
- Add null guard for item_id in backend delta remove handler
- Add response status logging for inventory service HTTP calls
- Fix frontend ID fallback consistency in updateInventoryLive
- Replace debug print() with logger.debug()
- Add comment for Decal Slot_Decal magic number

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 15:58:10 +00:00
erik
f145e6e131 feat: fix inventory service SQL injection, add slot population, and live frontend updates
- Replace f-string SQL interpolation with parameterized ANY(:ids) queries
- Populate slot column from IntValues[231735296] (Decal Slot key)
- Add startup migration to add container_id/slot columns to existing DB
- Extract createInventorySlot() for reuse by initial load and live deltas
- Add updateInventoryLive() handler for WebSocket inventory_delta messages
- Add inventory_delta case to browser WebSocket message dispatcher

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 15:51:20 +00:00
erik
749652d534 feat: add single-item upsert/delete endpoints and container/slot columns
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 15:43:58 +00:00
erik
e0265e261c Add suitbuilder backend improvements and SSE streaming fix
- Add dedicated streaming proxy endpoint for real-time suitbuilder SSE updates
- Implement stable sorting with character_name and name tiebreakers for deterministic results
- Refactor locked items to locked slots supporting set_id and spell constraints
- Add Mag-SuitBuilder style branch pruning tracking variables
- Enhance search with phase updates and detailed progress logging
- Update design document with SSE streaming proxy fix details

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 19:14:07 +00:00
erik
8cae94d87d Add client-side spell column sorting and improve inventory search
- Implement client-side sorting for all columns including spell_names
- Add computed_spell_names CTE for server-side sort fallback
- Add resizable columns with localStorage persistence
- Add Cloak slot detection by name pattern
- Increase items limit to 50000 for full inventory loading
- Increase proxy timeout to 60s for large queries
- Remove pagination (all items loaded at once for sorting)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 15:32:54 +00:00
erik
6c646719dd reduced duplicate insert errors of portals, still present because of two players disovering the same portal at the same time, other changes to inventory 2025-09-22 18:21:04 +00:00
erik
4d19e29847 major fixes for inventory 2025-07-02 10:29:36 +00:00
erik
dffd295091 added portals, quest tracking, discord monitor etc etc 2025-06-23 19:26:44 +00:00
erik
80a0a16bab Debug and inventory 2025-06-19 17:46:19 +00:00
erik
1febf6e918 Fix suit building constraint satisfaction logic
- Rewrite armor and accessory filtering to only include items that contribute to constraints
- Update jewelry and clothing scoring to reject items that don't meet constraints
- Modify suit completion to leave slots empty instead of filling with non-contributing items
- Update scoring to heavily penalize suits that don't meet specified requirements
- Items must now meet set, spell, or stat constraints to be considered for suits
- Empty slots are now preferred over items that don't help with constraints

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-15 08:25:22 +00:00
erik
57a2384511 added inventory service for armor and jewelry 2025-06-12 23:05:33 +00:00
erik
10c51f6825 added inventory, updated DB 2025-06-10 19:21:21 +00:00