ktoxktox docs

Configuration

Configuration reference for ktx_cases.

Configuration

All configuration lives in static/config.json.

General Settings

{
  "OpenCaseCommand": {
    "enabled": true,
    "name": "cases"
  },
  "Locale": "en",
  "Debug": {
    "enabled": false,
    "logLevel": "info",
    "modules": {
      "client": true,
      "server": true,
      "ui": true,
      "common": true
    }
  },
  "RewardTypes": {
    "coinsEnabled": false
  },
  "Database": {
    "logOpenings": true
  }
}
  • OpenCaseCommand.enabled - toggle the /cases command
  • OpenCaseCommand.name - command name (without /)
  • Locale - language code matching a file in locales/
  • Debug.enabled - toggle debug output
  • Debug.logLevel - verbosity: "info", "warn", "error", "debug"
  • Debug.modules - per-module toggles for client, server, ui, and common logs
  • RewardTypes.coinsEnabled - enable coin rewards (requires sky_coinsystem)
  • Database.logOpenings - log every case opening to the database (requires install.sql)

Cases

Object where each key is a unique case ID.

{
  "Cases": {
    "starter_case": {
      "name": "Starter Case",
      "description": "A basic case with common rewards.",
      "item": "case_starter",
      "icon": "starter.png",
      "disabled": false,
      "rewards": [
        { "name": "Cash", "type": "money", "amount": 5000, "weight": 20, "rarity": "common", "icon": "" },
        { "name": "Gold Bar", "type": "item", "item": "gold", "amount": 1, "weight": 15, "rarity": "rare", "icon": "" },
        { "name": "Pistol", "type": "weapon", "weapon": "weapon_pistol", "ammo": 50, "weight": 10, "rarity": "epic", "icon": "" },
        { "name": "Adder", "type": "vehicle", "model": "adder", "weight": 5, "rarity": "legendary", "icon": "" },
        { "name": "Coins", "type": "coins", "amount": 100, "weight": 3, "rarity": "mythical", "icon": "" }
      ]
    }
  }
}
  • name - display name in the UI
  • description - short description shown on the case card
  • item - inventory item name that triggers this case when used
  • icon - filename in custom/icons/cases/ (falls back to default.png)
  • disabled - hide this case from the UI
  • rewards - array of possible rewards. Each reward accepts an optional name (display label) and icon (filename in custom/icons/rewards/)

Reward Types

Money

{ "type": "money", "amount": 5000, "weight": 20, "rarity": "common" }

Gives cash to the player.

Item

{ "type": "item", "item": "gold", "amount": 1, "weight": 15, "rarity": "rare" }

Gives an inventory item. The item field must match your framework's item registry.

Weapon

{ "type": "weapon", "weapon": "weapon_pistol", "ammo": 50, "weight": 10, "rarity": "epic" }

Gives a weapon with the specified ammo count.

Vehicle

{ "type": "vehicle", "model": "adder", "weight": 5, "rarity": "legendary" }

Gives a vehicle. Stored in the player's garage via the framework.

Coins

{ "type": "coins", "amount": 100, "weight": 3, "rarity": "mythical" }

Gives coins. Requires coinsEnabled: true and sky_coinsystem running.

Shared Reward Fields

Every reward has these fields:

  • weight - base drop chance. Higher weight = more likely to drop.
  • rarity - one of: common, rare, epic, legendary, mythical

The effective drop chance is calculated as: reward.weight * rarity.modifier.

Rarities

{
  "Rarities": {
    "common": { "color": "#B0BEC5", "name": "Common", "modifier": 1.0 },
    "rare": { "color": "#2196F3", "name": "Rare", "modifier": 0.8 },
    "epic": { "color": "#9C27B0", "name": "Epic", "modifier": 0.6 },
    "legendary": { "color": "#FF9800", "name": "Legendary", "modifier": 0.4 },
    "mythical": { "color": "#E91E63", "name": "Mythical", "modifier": 0.2 }
  }
}
  • color - hex color for the rarity label in the UI
  • name - display name
  • modifier - multiplied against the reward's weight to compute effective drop chance. Lower modifier = rarer drop.

Icons

  • Case icons go in custom/icons/cases/. If a case's icon is missing or not found, default.png is used.
  • Reward icons go in custom/icons/rewards/. Each reward can set an optional icon field. If it's empty or invalid, the type-based fallback is used: money.png, item.png, weapon.png, vehicle.png, or coins.png.