| 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 |
Any castable spells a player learns will appear in their [Spellbook](/Spells/Spellbook)
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
TestArchetype:
Leveling:
MinLevel:1
MaxLevel:50
ExperienceCurve:TEST_STATIC
ExperienceSource:MOBS
Pyromancer:
Group:CLASS
Display:'Pyromancer'
SpellUnlocks:
-Fireball
-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`:
-`FORMULA` - Uses math to determine the experience needed to level, where `x` is the next level
-`STATIC` - You define the values for each level yourself
## Mechanics
Players can be taught spells using the `teachSpell` mechanic (or have them removed via the `forgetspell` mechanic).
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
TEST_FORMULA:
Type:FORMULA
Formula:'x*100'
TEST_STATIC:
Type:STATIC
Levels:
1:100
2:200
3:500
Skills:
-teachSpell{spell=DoubleJump} @trigger
```
## Experience Sources
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.
## Signs
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.
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
MOBS:
Sources:
-Type:killEntity
Conditions:[]
TriggerConditions:[]
Values:
-ZOMBIE 1to2
-HUSK 1to2
-SKELETON 50
-Type:killmythic
Conditions:[]
TriggerConditions:[]
Values:
-TestingDummy2 100
SomeGlobalSkill:
Spell:true
Global:true
...
```
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
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
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.)
-**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:
The default config file comes with a single example that would be used to give people basic "mana regeneration":
```yaml
MINING:
Sources:
-Type:blockBreak
Conditions:
-inworld{w=mining_world}
-level{l=10}
Values:
-DIAMOND_ORE 50
-IRON_ORE 10
Configuration:
GlobalSkills:
#
# Example of using this to implement global mana regeneration
> 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.
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.