Variable Types
Skill variables (variables) define values that can change by skill level and can be referenced by scripts, costs, and display templates.
Types
| Type | Aliases | Description |
|---|---|---|
expression | — | Math expression using variables such as %level%. |
string | str, text | String value. |
random_text | random_lines, random_line, text_lines, random_text_lines | Randomly selects one line. |
random_char | random_chars, char_random, chars_random | Picks one candidate with equal probability. |
weighted_random_char | weighted_random_chars, weighted_char, weighted_chars, weighted_char_random | Picks one candidate by weight. |
conditional_char | condition_char, case_char, if_char | Picks one candidate by condition branch. |
boolean | bool, flag | Boolean value with expression support. |
constant | const, fixed | Fixed value. Unrecognized type values also fall back to this. |
range | — | Range value. |
uniform | — | Uniform random number. |
gaussian | normal | Gaussian random number. |
skew_normal | skewnormal | Skew-normal random number. |
triangle | — | Triangle distribution random number. |
string, random_text, random_char, weighted_random_char, conditional_char, and boolean are non-numeric types; min, max, and decimals do not apply to them.
Fields
| Field | Description |
|---|---|
type | Variable type. |
value | Value or expression. |
min | Lower clamp. |
max | Upper clamp. |
decimals | Decimal precision; 0 means integer-like output. |
default | Fallback value when parsing fails. |
Examples
variables:
damage:
type: expression
value: "10 + %level% * 5"
min: 10
max: 100
decimals: 0
bonus_damage:
type: uniform
value: "5~15"
decimals: 0
cast_message:
type: random_text
lines:
- "<red>Flame Burst!"
- "<red>Burn!"
is_aoe:
type: boolean
value: "%level% >= 5"The candidate list key is lines
random_text reads only lines. Writing values raises no error but leaves the candidate list empty. Conversely, providing lines without a type makes the type resolve to random_text automatically.
Using variables in scripts
Variables can be referenced in action lines, conditions, and text with %var.name% syntax:
script:
actions:
cast:
- 'trigger | damage amount=%var.damage%'
- 'trigger | where %var.is_aoe%==true | spawn_particle particle=EXPLOSION count=10'Variables resolve in declaration order, so a later variable may reference an earlier one:
variables:
damage:
type: expression
value: "10 + %level% * 5"
hit_message: "<red>Dealt %damage% damage"MythicMobs injection
Resolved variables are injected into MythicMobs skill metadata and can be read as <skill.var.name>. Five built-in variables are always injected: emaki_skill_id, emaki_skill_level, emaki_trigger_id, emaki_is_passive, and emaki_has_target.