Quests Mod - Custom Quests (Data-Driven)
=================================

This mod supports custom quest categories loaded from JSON files.
All files are read from:
  config/quests/categories/*.json

Global config file:
  config/quests/quests.json
Fields:
  enableBuiltInCategories: true/false
  enableCustomCategories: true/false

Category file format
--------------------
{
  "id": "my_category",
  "title": "My Category Title",
  "order": 100,
  "quests": [ ... ]
}

Quest format
-----------
{
  "id": "quest_id",
  "label": "Text shown in the UI",
  "order": 0,
  "type": "COUNT_CAPTURES_WITH_BALL",
  "params": { ... },
  "target": 50,
  "reward": { ... }
}

Params
------
Depending on the quest type, params may include:
- ballId: string (example: cobblemon:ultra_ball)
- bracket: number (example: 10)
- seriesId: string (RCT series id)
- trainerId: string (RCT trainer id)
- distinct: boolean (true/false)

IDs rules
--------
- id must only contain: a-z 0-9 _ -
- rewardId generated by the mod is: reward_custom_<categoryId>_<questId>

Supported quest types (built-in)
-------------------------------
- COUNT_CAPTURES_WITH_BALL
    params: { "ballId": "cobblemon:ultra_ball" }
    current: captured count with that ballId
- COUNT_HOPLA_BRACKET
    params: { "bracket": 10 }
    current: hopla count for that bracket
- COUNT_SHOULDER_MOUNTS
    params: none
    current: number of unique species mounted on shoulder
- COUNT_RCT_TRAINER_VICTORIES
- COUNT_RCT_NO_FAINT_VICTORIES
- COUNT_RCT_NO_ITEM_VICTORIES
- COUNT_RCT_FAST_VICTORIES
    params: none
    current: counters tracked by the mod
- COUNT_EVOLUTIONS
    params: none
    current: number of evolutions tracked by the mod
- COUNT_POKEDEX_SPECIES
    params: none
    current: size of obtained Pokédex species

- COUNT_BERRY_HARVESTS
    params: none
    current: number of berry harvest actions
- COUNT_FOSSILS_REVIVED
    params: none
    current: number of fossils revived
- COUNT_TRADES
    params: none
    current: number of completed trades
- SUM_XP_GAINED
    params: none
    current: total experience points gained (sum)
- SUM_EV_GAINED
    params: none
    current: total EV points gained (sum)
- COUNT_POKEMON_HEALED
    params: none
    current: number of healing actions applied
- SUM_HEAL_AMOUNT
    params: none
    current: total heal amount applied (sum)
- COUNT_POKEMON_FAINTED
    params: none
    current: number of times your owned Pokémon fainted
- COUNT_POKEMON_SENT
    params: none
    current: number of times you sent out a Pokémon
- COUNT_POKEMON_RECALLED
    params: none
    current: number of times you recalled a Pokémon
- COUNT_LEVEL_UPS
    params: none
    current: number of level-up events
- COUNT_FRIENDSHIP_UPDATES
    params: none
    current: number of friendship update events

Additional Cobblemon integration quest types
------------------------------------------
These types are tracked using CobblemonEvents hooks.
- COUNT_APRICORN_HARVESTS
    params: none
    current: number of apricorn harvest actions
- COUNT_BATTLES_STARTED
    params: none
    current: number of battles started (post)
- COUNT_BATTLES_FLED
    params: none
    current: number of times you fled from a battle
- COUNT_BATTLES_WON
    params: none
    current: number of battles you won
- COUNT_SHINY_ROLLS
    params: none
    current: number of shiny chance calculations (rolls)
- COUNT_ASPECTS_CHANGED
    params: none
    current: number of Pokémon aspect changes
- COUNT_HELD_ITEM_SWAPS
    params: none
    current: number of held-item swap operations
- COUNT_COSMETIC_ITEM_SWAPS
    params: none
    current: number of cosmetic-item swap operations
- COUNT_EGGS_COLLECTED
    params: none
    current: number of eggs collected
- COUNT_EGGS_HATCHED
    params: none
    current: number of eggs hatched
- COUNT_FISHING_CASTS
    params: none
    current: number of PokéRod casts
- COUNT_FISHING_REELS
    params: none
    current: number of PokéRod reels
- COUNT_FISHING_BAIT_CONSUMED
    params: none
    current: number of fishing bobber spawns with a bait item (best-effort)
- COUNT_FISHING_BOBBER_SPAWNS
    params: none
    current: number of Pokémon spawned by the fishing bobber

RCT quest types (best-effort)
----------------------------
These types require Radical Cobblemon Trainers (RCT).
- RCT_DEFEAT_COUNT_TOTAL
    params: none
    current: total trainer defeats (sum)
- RCT_DEFEAT_COUNT_DISTINCT
    params: none
    current: distinct trainers defeated (count)
- RCT_DEFEATED_TRAINER_IDS
    params: none
    current: defeated trainer ids (distinct count)
- RCT_DEFEATS_FOR_TRAINER
    params: trainerId (string)
    current: defeats for trainerId
- RCT_SERIES_REMAINING
    params: seriesId (string)
    current: remaining trainers for a series (best-effort)
- RCT_SERIES_COMPLETED
    params: seriesId (string)
    current: completed trainers for a series (best-effort)

RCT-API quest types (best-effort)
-------------------------------
These types require rct-api and use its internal EventContext (reflection-based).
- RCT_API_BATTLES_STARTED
    params: none
    current: number of RCT-API battle started events
- RCT_API_BATTLES_ENDED
    params: none
    current: number of RCT-API battle ended events
- RCT_API_TRAINERS_REGISTERED
    params: none
    current: number of trainer registered events for player trainers
- RCT_API_TRAINERS_UNREGISTERED
    params: none
    current: number of trainer unregistered events for player trainers
- RCT_CURRENT_SERIES_IS
    params: { "seriesId": "series_id" }
    current: 1 if player's current series matches, else 0

Built-in quest overrides (config/quests/builtins.json)
-----------------------------------------------
You can enable/disable built-in quests and customize their rewards by rewardId.
Fields:
- enabled: if false, quest is hidden and reward cannot be claimed
- baseReward: if false, the mod's standard reward is not given
- replaceBaseReward: if true and reward is present, reward replaces base reward
  (otherwise reward is given in addition to base reward)
Format:
{
  "overrides": {
    "reward_id_here": {
      "enabled": true,
      "baseReward": true,
      "replaceBaseReward": false,
      "reward": { ... same format as below ... }
    }
  }
}

Rewards
-------
If reward is omitted, the mod will use its standard reward.

Reward format:
{
  "money": 2000,
  "items": [
    { "itemId": "cobblemon:ultra_ball", "count": 10 },
    { "itemId": "fwaystones:waystone", "count": 1 }
  ],
  "commands": [
    "say {player} completed a quest!",
    "balance {player} add 2000"
  ]
}

Commands
--------
- Commands are executed as SERVER CONSOLE (permission level 4).
- Placeholder: {player} is replaced with the player's name.
- WARNING: this is powerful. Only allow trusted admins to edit these files.
