Ritual Spell - TheComputerGeek2/MagicSpells GitHub Wiki

Source Code

spell-class: ".instant.RitualSpell"
  • delayed - Plays the effect at the caster's location when the channel is complete.

Description:

The ritual spell allows you to create spells that must be cast by more than one person. It works well for spells that might be normally too powerful. A person casts the spell to begin the ritual, and then anyone nearby can right-click on the caster to join the ritual. Movement by any participant will interrupt the ritual. Once the ritual is complete, if there are enough participants the spell will be activated. This spell does nothing on its own, it just casts another spell upon completion.

Configuration:

Since 4.0 Beta 13 all options except spell support dynamic values through numeric or string expressions.

Option Description Type Default
ritual-duration The duration of the ritual, in server ticks. Integer 200
tick-interval How often the ritual updates, in server ticks. This affects how often the experience bar updates and how often it checks for player movement. Integer 5
effect-interval Defines the interval of playing effects. Note that this interval is every tick-interval * effect-interval ticks. Integer 20
req-participants The number of ritual participants required for the ritual to be successful. Integer 3
set-cooldown-for-all If this is true, all players who participate in the ritual will have their cooldown set for the ritual spell as well. Boolean true
show-progress-on-exp-bar Whether to show the ritual's progress on the experience bar. Boolean true
set-cooldown-immediately If this is true, the cooldown for the spell will begin at the beginning of the ritual. If this is false, the cooldown will not start until the end of the ritual, and only if the spell is successful. Boolean true
need-spell-to-participate Whether a participant needs to know the spell to participate in the ritual. Boolean false
charge-reagents-immediately If this is true, the reagents for the spell will be removed from the caster at the beginning of the ritual. If this is false, they will be removed at the end, and only if the spell was successful. Boolean true
spell The internal name of the spell to cast when the ritual is complete. String
str-ritual-left Message sent to someone who leaves an already-started ritual. Rich Text
str-ritual-joined Message sent to someone who joins an already-started ritual. Rich Text
str-ritual-success Message sent to all participants when the ritual is successful. Rich Text
str-ritual-interrupted Message sent to all participants when the ritual is interrupted by movement. Rich Text
str-ritual-failed Message sent to all participants when the ritual completes but fails (not enough participants). Rich Text

Example:

summon_helper:
    spell-class: ".targeted.SummonSpell"
    can-cast-with-item: false
    can-cast-by-command: false
    require-exact-name: false
    require-acceptance: true
    max-accept-delay: 90
    accept-command: accept
    str-usage: |
        Usage: /cast summon <playername>, or /cast summon 
        while looking at a sign with a player's name on the first line.
    str-no-target: Target player not found.
    str-summon-pending: You are being summoned! Type /accept to teleport.
    str-summon-accepted: You have been summoned.
    str-summon-expired: The summon has expired.
summon:
    spell-class: ".instant.RitualSpell"
    description: Summon another player to your position. This ritual requires 3 participants.
    cast-item: stick
    cooldown: 300
    ritual-duration: 200
    req-participants: 3
    charge-reagents-immediately: true
    set-cooldown-immediately: true
    set-cooldown-for-all: true
    spell: summon_helper
    tick-interval: 5
    effect-interval: 20
    cost:
        - mana 75
        - redstone 3
        - iron_ingot 3
    str-cost: 75 mana, 3 redstone, and 3 iron bars
    str-cast-self: You begin a summoning ritual.
    str-cast-others: "%a has begun a summoning ritual. Right-click to participate."
    str-ritual-joined: You have joined the summoning ritual.
    str-ritual-success: The summoning ritual is a success!
    str-ritual-interrupted: The summoning ritual has been interrupted.
    str-ritual-failed: The summoning ritual has failed.
⚠️ **GitHub.com Fallback** ⚠️