Update Learning authored by Taiyou06's avatar Taiyou06
# Leveling Spells can be learned by players in a variety of ways, and not all ways need to be used on your server.
Archetypes can be configured to be levelable using options under the `Leveling` section.
| Options | Description | Any castable spells a player learns will appear in their [Spellbook](/Spells/Spellbook)
|--------------------------|---------------------------------------------------------------------|
| MinLevel | The level the player starts at with this archetype |
| MaxLevel | The maximum level of this archetype |
| ExperienceCurve | The experience curve this archetype uses |
| ExperienceSource | The experience source group this archetype can benefit from |
For example: [[_TOC_]]
# Learnable Spells
## Admin Commands
The most obvious way to learn spells is by using admin commands.
The admin command to teach someone a spell is:
`/mythicrpg spells teach [name] [spell]`
You can also use the `unlearn` command to remove a spell from someone.
## Archetypes
### Leveling
Spells can be configured to automatically be given by an archetype upon reaching a certain level.
This is configured in an archetype's `SpellUnlocks` section.
```yaml ```yaml
TestArchetype: Pyromancer:
Leveling: Group: CLASS
MinLevel: 1 Display: 'Pyromancer'
MaxLevel: 50 SpellUnlocks:
ExperienceCurve: TEST_STATIC - Fireball
ExperienceSource: MOBS - RainOfFire 10
``` ```
In this example:
- A player would learn `Fireball` immediately upon gaining the Pyromancer archetype
- The player would then learn `RainOfFire` upon reaching level 10
If a player loses an archetype, all spells learned from it will be lost.
### Talent Trees
_coming soon_
## Experience Curves
Experience Curves determine how much experience is needed to reach each level, and are defined in `experience-curves.yml` inside any Mythic pack folder. Inside this file, you can define as many custom experience curves as you want.
There are two types of curves, `FORMULA` and `STATIC`: ## Mechanics
- `FORMULA` - Uses math to determine the experience needed to level, where `x` is the next level Players can be taught spells using the `teachSpell` mechanic (or have them removed via the `forgetspell` mechanic).
- `STATIC` - You define the values for each level yourself
You can use this to create NPCs or [Custom Menus](/../../../MythicMobs/-/wikis/Custom-Menus) that teach spells, have a boss that teaches a spell upon being defeated, or to use with Crucible to create your own custom tome-type items.
An experience curve file might look like this:
```yaml ```yaml
TEST_FORMULA: Skills:
Type: FORMULA - teachSpell{spell=DoubleJump} @trigger
Formula: 'x * 100'
TEST_STATIC:
Type: STATIC
Levels:
1: 100
2: 200
3: 500
``` ```
## Experience Sources ## Signs
Experience Sources are a group of different things that experience can be earned from. They are defined inside an `experience-sources.yml` file in any Mythic pack folder, and each file can contain any number of source groups. Spell Signs can be used to create signs that will teach spells when right-clicked.
To create one, you simply make a sign with the first line as `[Learn Spell]` and the 2nd line as the spell's ID.
Each experience source group can contain sections of one or more types of sources. ![image](uploads/d48450ed19e9af3f7ea3c0fd260b515c/image.png)
An experience source called `MOBS` might look like this: ## Tomes
Tomes are special items that can teach you a spell. These can be given to players directly or (more likely) put in loot chests, dropped by mobs, etc.
**You can obtain a tome using admin commands:**
`/mythicrpg spells tome get [spell]`
Mobs can also drop a tome using the custom `spelltome{spell=X}` drop type.
# Globally Available Spells
Global Spells and Global Mechanics are spells and mechanics you can have automatically apply to all players.
These included both active and passive spells, as well as special mechanics you can define to run on all players in the `config-spells.yml` config file.
## Global Spells
Global Spells are spells that are automatically given to everyone.
To make a spell global, you simply put `Global: true` in the mythic skill's configuration.
```yaml ```yaml
MOBS: SomeGlobalSkill:
Sources: Spell: true
- Type: killEntity Global: true
Conditions: [] ...
TriggerConditions: []
Values:
- ZOMBIE 1to2
- HUSK 1to2
- SKELETON 50
- Type: killmythic
Conditions: []
TriggerConditions: []
Values:
- TestingDummy2 100
``` ```
This will cause the spell to be given to all players, and if it's a passive it will automatically trigger for all players.
### Conditions and Trigger Conditions ## Global Mechanics
Every source in a group can be filtered using `Conditions` and `TriggerConditions`. Both lists use the same condition syntax as Mythic [Skill Conditions](../Skills/Conditions.md), and if any condition fails the source grants no experience for that event. Global Mechanics are defined in the `config-spells.yml` file, at the bottom under the `GlobalSkills` section. These are defined exactly like your typical mob skills, and will apply to all players.
- **Conditions** evaluate against the player as the caster (their world, location, level, permissions, held item, etc.) The default config file comes with a single example that would be used to give people basic "mana regeneration":
- **TriggerConditions** evaluate against the player as the trigger entity. Useful for the same kinds of self-checks; entity-target filtering (e.g. "only zombies") is not yet routed through these.
For example, restricting mining XP to a designated mining world for players level 10 or higher:
```yaml ```yaml
MINING: Configuration:
Sources:
- Type: blockBreak GlobalSkills:
Conditions: #
- inworld{w=mining_world} # Example of using this to implement global mana regeneration
- level{l=10} - modifyReagent{reagent=mana;amount=10} @self ~onTimer:20
Values: #
- DIAMOND_ORE 50
- IRON_ORE 10
``` ```
### Available Sources However, you are able to use pretty much any mechanics or mythic triggers that apply to players here, and call any other mythic skills, allowing you to use the mythic skill system to trigger all sorts of other random things you may want.
\ No newline at end of file
| Type | Aliases | Values | Description |
|-----------------|------------------------------------------------------|-------------------------|----------------------------------------------------------------------|
| `BLOCK_BREAK` | `BREAK_BLOCK`, `MINE`, `MINING` | Block types | Breaking blocks (including custom blocks) |
| `BLOCK_PLACE` | `PLACE_BLOCK`, `BUILD`, `BUILDING` | Block types | Placing blocks (including custom blocks) |
| `BREWING` | `BREW`, `BREW_ITEM` | Potion types | Brewing potions |
| `CAST_SPELL` | `SPELL_CAST`, `SPELL`, `CAST` | Spell internal names | Casting a spell. Awarded on cast |
| `CONSUME_ITEM` | `EATING`, `EAT`, `EAT_ITEM` | Item materials | Consuming/eating an item |
| `CRAFT_ITEM` | `CRAFT`, `CRAFTING` | Item materials | Crafting items (counts batches in shift-click crafts) |
| `CUSTOM` | | | Granted programmatically by skill mechanics; no event listener |
| `DAMAGED` | `TAKE_DAMAGE` | | Taking damage from any source |
| `DAMAGING` | `DEAL_DAMAGE` | | Dealing damage to entities |
| `ENCHANTING` | `ENCHANT`, `ENCHANT_ITEM` | Item materials | Enchanting items |
| `FARMING` | `HARVEST`, `HARVEST_CROP` | Crop blocks | Breaking a crop block that is fully grown |
| `FISHING` | `FISH`, `CATCH_FISH` | Item materials | Catching items while fishing |
| `JUMPING` | `JUMP` | | Jumping |
| `KILL_ENTITY` | `KILL_MOB`, `KILL_MOBS`, `KILL_ENTITIES` | Entity types | Killing an entity of a given type |
| `KILL_MYTHIC` | `KILL_MYTHIC_MOB`, `KILL_MYTHIC_ENTITIES` | Mythic mob types | Killing a Mythic mob of a given type |
| `MOVING` | `MOVE`, `WALK` | | Moving on the ground (per distance traveled) |
| `REPAIR_ITEM` | `REPAIR`, `MEND` | Item materials | Repairing items |
| `SMELT` | `SMELTING`, `FURNACE` | Item materials | Smelting items in a furnace |
| `USE_RESOURCE` | `RESOURCE_USE`, `SPEND_RESOURCE` | Resource names | Granted when a player spends a defined skill resource |
| `VANILLA` | | | Collecting vanilla experience orbs. Supports a `Multiplier` option |
> Per-source config options (such as `PlayerPlaced` on `BLOCK_BREAK`, `Multiplier` on `VANILLA`, `Amount` / `PerDamage` / `MinimumDamage` on `DAMAGING`, distance tuning on `MOVING`, etc.) are not yet documented here.