Skip to content

Inlay Success Rate

Gem inlay can use a success-rate system so high-level gems or high-value equipment can carry more risk. The global configuration is under inlay_success in config.yml.

Global configuration

yaml
inlay_success:
  enabled: true
  default_chance: 100.0
  rate_formula: "%default_chance% - (%level% - 1) * 5"
  failure_action: "destroy_gem"

Fields

FieldTypeDescription
enabledbooleanWhether the inlay chance system is enabled. If false, inlay always succeeds.
default_chancedoubleDefault success rate in percent.
rate_formulastringFormula used to calculate final success rate.
failure_actionstringWhat happens when inlay fails.

Formula variables

rate_formula can use these variables:

VariableDescription
%default_chance%Global default chance.
%level_chance%Chance resolved from level-specific configuration, usually falling back to default if missing.
%configured_chance%Chance configured by gem or level data.
%level%Current gem level.

Example:

yaml
rate_formula: "%default_chance% - (%level% - 1) * 5"

With a default chance of 100%, a level 5 gem has a theoretical 80% success rate.

Failure actions

ValueBehavior
return_gemDo not consume the gem and do not charge the inlay cost.
destroy_gemConsume the gem and charge the inlay cost before the roll.
destroy_bothConsume the gem but do not charge the inlay cost.

Relationship with inlay cost

Inlay cost is still configured by inlay_cost in the gem definition. The success-rate system only decides whether the gem state and effects are written. Whether costs are charged on failure is controlled by failure_action.

yaml
inlay_cost:
  currencies:
    - provider: "vault"
      base_cost: 1000
      cost_formula: "%base_cost% * %level%"
      display_name: "<gold>Coins</gold>"

Troubleshooting

  • Chance is always 100%: check inlay_success.enabled.
  • High-level chance is wrong: check that the formula uses %level%.
  • Failure consumption is unexpected: check failure_action.
  • Players report unexpected charges: check both inlay_cost and the failure action.