Files
Code_of_Conquest/api/app/data/quests/easy/cellar_rats.yaml
Phillip Tarrant df26abd207 feat: Implement Phase 5 Quest System (100% complete)
Add YAML-driven quest system with context-aware offering:

Core Implementation:
- Quest data models (Quest, QuestObjective, QuestReward, QuestTriggers)
- QuestService for YAML loading and caching
- QuestEligibilityService with level, location, and probability filtering
- LoreService stub (MockLoreService) ready for Phase 6 Weaviate integration

Quest Content:
- 5 example quests across difficulty tiers (2 easy, 2 medium, 1 hard)
- Quest-centric design: quests define their NPC givers
- Location-based probability weights for natural quest offering

AI Integration:
- Quest offering section in npc_dialogue.j2 template
- Response parser extracts [QUEST_OFFER:quest_id] markers
- AI naturally weaves quest offers into NPC conversations

API Endpoints:
- POST /api/v1/quests/accept - Accept quest offer
- POST /api/v1/quests/decline - Decline quest offer
- POST /api/v1/quests/progress - Update objective progress
- POST /api/v1/quests/complete - Complete quest, claim rewards
- POST /api/v1/quests/abandon - Abandon active quest
- GET /api/v1/characters/{id}/quests - List character quests
- GET /api/v1/quests/{quest_id} - Get quest details

Frontend:
- Quest tracker sidebar with HTMX integration
- Quest offer modal for accept/decline flow
- Quest detail modal for viewing progress
- Combat service integration for kill objective tracking

Testing:
- Unit tests for Quest models and serialization
- Integration tests for full quest lifecycle
- Comprehensive test coverage for eligibility service

Documentation:
- Reorganized docs into /docs/phases/ structure
- Added Phase 5-12 planning documents
- Updated ROADMAP.md with new structure

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 15:42:55 -06:00

110 lines
3.4 KiB
YAML

# Cellar Rats - Entry level quest for new players
quest_id: quest_cellar_rats
name: "Rat Problem in the Cellar"
description: |
Giant rats have infested the Rusty Anchor's cellar, threatening
the tavern's food supplies and scaring away customers. Grom the
bartender needs someone to clear them out.
difficulty: easy
# NPC Quest Givers (quest-centric design)
quest_giver_npc_ids:
- npc_grom_ironbeard
quest_giver_name: "Grom Ironbeard"
# Location context
location_id: crossville_tavern
region_id: crossville
# Offering conditions
offering_triggers:
location_types: ["tavern"]
specific_locations: ["crossville_tavern"]
min_character_level: 1
max_character_level: 5
required_quests_completed: []
probability_weights:
tavern: 0.35
town: 0.15
# NPC-specific offer dialogue
npc_offer_dialogues:
npc_grom_ironbeard:
dialogue: |
*leans in conspiratorially* Got a problem, friend. Giant rats
in me cellar. Been scaring off the paying customers and getting
into the ale stores. 50 gold for whoever clears 'em out.
conditions:
min_relationship: 30
required_flags: []
forbidden_flags: ["refused_rat_quest"]
# What NPCs know about this quest
npc_quest_knowledge:
npc_grom_ironbeard:
- "The rats started appearing about a week ago"
- "They seem bigger than normal rats - something's not right"
- "Old smuggling tunnels under the cellar might be where they're coming from"
- "Lost three kegs of dwarven stout to the vermin already"
# Embedded lore for AI context
lore_context:
backstory: |
The cellar of the Rusty Anchor connects to old smuggling tunnels
from Captain Morgath's days, sealed decades ago. Recent earthquakes
may have reopened them, allowing creatures to emerge.
world_connections:
- "The earthquakes that opened the tunnels also disturbed the Old Mines"
- "Giant rats are unnatural - possibly corrupted by dark magic from below"
regional_hints:
- "Smuggling was common 50 years ago in Crossville"
- "Captain Morgath was a notorious smuggler who disappeared mysteriously"
# Narrative hooks for natural dialogue
dialogue_templates:
narrative_hooks:
- "mentions unusual scratching sounds from below"
- "complains about spoiled food supplies"
- "nervously glances toward the cellar door"
- "asks if you've ever dealt with vermin before"
ambient_hints:
- "You notice scratch marks near the cellar door"
- "A faint squeaking echoes from somewhere below"
- "The air carries a musty, unpleasant odor"
# Objectives
objectives:
- objective_id: kill_rats
description: "Clear out the giant rats"
objective_type: kill
required_progress: 10
target_enemy_type: giant_rat
- objective_id: find_source
description: "Discover where the rats are coming from"
objective_type: discover
required_progress: 1
target_location_id: smuggler_tunnel_entrance
# Rewards
rewards:
gold: 50
experience: 100
items: []
relationship_bonuses:
npc_grom_ironbeard: 10
unlocks_quests: ["quest_tunnel_mystery"]
reveals_locations: ["crossville_tunnels"]
# Completion dialogue
completion_dialogue:
npc_grom_ironbeard: |
*actually smiles* Well done, friend! Rats are gone, cellar's safe.
Here's your coin, well earned. Drink's on the house tonight.
*pauses* You say you found old tunnels down there? Interesting...
tags:
- starter
- combat
- exploration