Commit graph

6 commits

Author SHA1 Message Date
Kelsi
6b06bd07f9 feat(quest): detect orphan quests + speed up chain validation
validateChains now also flags quests with no questgiver and no
turn-in NPC — those are unreachable in-game and a common authoring
mistake. Also replaced the O(n²) inner lookup with an O(1)
unordered_map of id → nextId so circular detection scales.
2026-05-06 07:33:31 -07:00
Kelsi
280fe1e6e8 fix(quest): truncate over-long title/desc/completion to SQL limits
quest_template.LogTitle is varchar(200) in AzerothCore. Edited
quest JSON could carry longer strings that would either fail the
INSERT or silently truncate at the server. Cap title at 200 chars
and the longer text fields at 8KB on load.
2026-05-06 07:01:00 -07:00
Kelsi
f5fc23e003 fix(editor): quest level + reward sanity bounds + item slot cap
Rounds out the quest load guards:
  - requiredLevel: 0 -> 1 (no level-0 quests), >255 -> 80 (typo guard)
  - reward.xp: cap 1M
  - reward.gold: cap 10000
  - reward.silver/copper: cap 99 (server overflows otherwise)
  - reward.itemRewards: cap 6 entries (matches WoW quest_template
    RewardItemId[1..6] slot capacity)
2026-05-06 05:59:05 -07:00
Kelsi
c4c8d9e7ed fix(editor): quest objective load clamps type, count, and per-quest size
Three guards on quest objective loading from JSON:
  - type out of QuestObjectiveType range (0..5) -> defaults to 0 (Kill)
  - targetCount of 0 -> 1 (no-op objectives are nonsense)
  - targetCount > 1000 -> 1000 (typo guard, biggest legit WoW quest is ~100)
  - >10 objectives per quest -> dropped (matches SQL slot capacity, also
    bounds per-quest memory)
2026-05-06 05:56:11 -07:00
Kelsi
2eec089ef5 fix(editor): harden JSON handling, quest loading, and content validation
- Quest editor: add loadFromFile() with nlohmann/json, chain validation
  with circular reference detection, wire into ADT load and save pipeline
- Project: replace naive substring JSON parsing with nlohmann/json for
  both save() and load(), fix shell injection in gitCommit()
- Content pack: replace manual JSON with nlohmann/json, validate binary
  format magic numbers (WHM1/WOM1/WOB1), add WOB to openFormatScore
  (now scores 0-6), mark invalid files with (!) in summary
2026-05-05 12:48:50 -07:00
Kelsi
f59d79537a feat(editor): quest editor with objectives, rewards, and quest chains
- New Quest mode (key 6) with full quest creation panel:
  - Title, description, required level
  - Quest giver / turn-in NPC ID linkage
  - Up to 4 objectives: Kill, Collect, Talk, Explore, Escort, Use Object
  - Rewards: XP and gold
  - Quest chain support via nextQuestId linking
- Quest list showing all created quests with level and objective count
- Save quests to JSON (included in Export Zone package)
- Foundation for campaign system: create quest chains across NPCs,
  link objectives to placed creatures, build storylines
2026-05-05 06:10:14 -07:00