Skip to content
JasperLorelai edited this page May 19, 2024 · 11 revisions

Source Code

This spell extends its options from Instant Spell.

spell-class: ".RandomSpell"

Description:

Casts a random spell from the specified options.

Configuration:

Since 4.0 Beta 13 some of these options support dynamic values through numeric or string expressions.

OptionDescriptionTypeDefaultSupports expressions
pseudo-randomWhen enabled, the same option won't be picked in sequence.Booleantruefalse
spellsList of sub-spells to be picked. Must include probability weight (int) greater than 0 separated by a space.String Listfalse
check-individual-cooldownsBooleantruetrue
check-individual-modifiersBooleantruetrue

Examples:

Realistic dice with options that can be picked in sequence.

dice:
spell-class: ".RandomSpell"pseudo-random: falsespells:
- say1 1
- say2 1
- say3 1
- say4 1
- say5 1
- say6 1

Example with pseudo randomness.

notSoRandom:
spell-class: ".RandomSpell"pseudo-random: truespells:
- say1 1
- say2 1
- say3 1

Despite chance being 10 on one option, this spell will switch between the two options due to pseudo-random being enabled.

switch:
spell-class: ".RandomSpell"pseudo-random: truespells:
- say1 1
- say2 10

Clone this wiki locally