NPC Integration
The Achievement System integrates with the KyuubiSoft Citizens (NPC) system to provide two powerful features:
- Achievement Triggers -- unlock achievements when players interact with NPCs or complete dialogs
- Dialog Conditions -- show or hide dialog options based on a player's achievement progress
Achievement Trigger Types
npc_interact
Fires when a player interacts (right-clicks) with a citizen NPC. The target field matches the citizen's ID.
Use cases:
- "Talk to 5 different NPCs"
- "Visit the Blacksmith for the first time"
- "Interact with all town NPCs"
{
"id": "meet_the_blacksmith",
"category": "social",
"iconItem": "Tool_Hammer_Iron",
"difficulty": "normal",
"trigger": {
"type": "npc_interact",
"target": "blacksmith_gorn",
"count": 1
},
"title": {
"id": "smiths_friend",
"color": "#FF8C00"
}
}
To track interactions with any NPC (regardless of citizen ID), use "target": "any":
{
"id": "social_butterfly",
"category": "social",
"iconItem": "Decoration_Banner_Blue",
"difficulty": "hard",
"trigger": {
"type": "npc_interact",
"target": "any",
"count": 20
},
"title": {
"id": "social_butterfly",
"color": "#FF69B4"
}
}
Multi-Target
You can use comma-separated citizen IDs to match specific NPCs:
{ "type": "npc_interact", "target": "merchant_sol,smith_gorn,cook_mira", "count": 3 }
This counts one interaction per matching NPC towards the total.
dialog_complete
Fires when a player finishes a dialog tree with an NPC. The target field matches the dialog ID.
Use cases:
- "Complete the Elder's story"
- "Finish 10 NPC dialogs"
- "Hear the legend of the ancient ruins"
{
"id": "elders_wisdom",
"category": "social",
"iconItem": "Ingredient_Scroll",
"difficulty": "normal",
"trigger": {
"type": "dialog_complete",
"target": "elder_story_dialog",
"count": 1
},
"title": {
"id": "wise_listener",
"color": "#9370DB"
}
}
For tracking any dialog completion:
{
"id": "chatterbox_npc",
"category": "social",
"iconItem": "Ingredient_Scroll",
"difficulty": "hard",
"trigger": {
"type": "dialog_complete",
"target": "any",
"count": 10
},
"title": {
"id": "chatterbox",
"color": "#44AAFF"
}
}