How to use

Release the scroll near an owned Cup of Heaven network to attempt activation. Mana cost is calculated from the completed network.

Function

Building a network

Begin with at least three owned Cup of Heaven circles and stand within HEAVENS_CUP_START_DISTANCE of one of them.

A circle joins the network when its X and Z positions are each within HEAVENS_CUP_NETWORK_DISTANCE of a connected circle. Connections can chain beyond the starting distance at any vertical separation.

The spell reduces circles sharing the same X/Z coordinates to one point when calculating the outer hull, while every connected circle still contributes to the total node count.

Circle counts

The outermost unique X/Z points form a convex polygon. Its point count is the external count. Every connected circle not part of the outer hull contributes to the internal count.

All living entities horizontally inside that polygon at activation are affected across the dimension's full build height. This includes the caster, allies, contracted players, pets, and other entities that many combat spells normally protect.

Prime factor calculation

Entries in HEAVENS_CUP_EFFECTS correspond in order to the prime numbers 2, 3, 5, 7, 11, 13, and then later primes.

Find the prime factors of each of the inner and outer circle counts separately. For each prime, add its exponents from both counts. An exponent of 1 applies effect level I, 2 applies level II, and so on.

Effects

Effects last HEAVENS_CUP_DURATION ticks.

Mana cost

Mana cost = Σ(prime × combined exponent) × HEAVENS_CUP_MANA_COST × ⌈√(X/Z area)⌉

Insufficient mana preserves the scroll and reports the required amount; a successful activation consumes it.

Grail results

A network producing at least one but not every configured effect triggers the Lesser Grail advancement. Producing every configured effect triggers Greater Grail. A network with no mapped prime factors reports an imbalanced Lesser Grail but does not trigger that advancement.

Settings

Effect entries must be registered effect IDs. HEAVENS_CUP_CLIENT_CIRCLE controls the additional circle shown in the sky. HEAVENS_CUP_BATCH_SIZE controls how many nodes are checked at a time.

Configuration

SettingDefaultRangeEffect
HEAVENS_CUP_MANA_COSTmahoutsukai-server.tomlmysticcup of heaven20–100000000Base multiplier applied to Cup of Heaven's mana formula.
HEAVENS_CUP_START_DISTANCEmahoutsukai-server.tomlmysticcup of heaven200–100000000 blocksMaximum search distance for the owned Cup of Heaven circle used to begin network activation.
HEAVENS_CUP_DURATIONmahoutsukai-server.tomlmysticcup of heaven12000–100000000 ticksDuration of each status effect applied by Cup of Heaven; 1200 ticks is 60 seconds.
HEAVENS_CUP_NETWORK_DISTANCEmahoutsukai-server.tomlmysticcup of heaven300–100000000 blocks along X and ZExclusive horizontal distance on each axis used to connect owned Cup of Heaven circles.
HEAVENS_CUP_BATCH_SIZEmahoutsukai-server.tomlmysticcup of heaven101–100000000 network nodes per work stepNumber of Cup of Heaven network nodes processed during each traversal work step.
HEAVENS_CUP_EFFECTSmahoutsukai-server.tomlmysticcup of heaven["poison","weakness","blindness","slowness","wither","levitation"]Ordered registered effect IDs assigned to consecutive primes beginning with 2; the order also defines Lesser and Greater Grail coverage.
HEAVENS_CUP_CLIENT_CIRCLEmahoutsukai-client.tomlmysticcup of heaventrueControls the additional Cup of Heaven circle rendering in the sky above placed nodes.