Update Learning authored by Taiyou06's avatar Taiyou06
Spells can be learned by players in a variety of ways, and not all ways need to be used on your server. # Leveling
Archetypes can be configured to be levelable using options under the `Leveling` section.
Any castable spells a player learns will appear in their [Spellbook](/Spells/Spellbook)
| Options | Description |
[[_TOC_]] |--------------------------|---------------------------------------------------------------------|
| MinLevel | The level the player starts at with this archetype |
| MaxLevel | The maximum level of this archetype |
# Learnable Spells | ExperienceCurve | The experience curve this archetype uses |
## Admin Commands | ExperienceSource | The experience source group this archetype can benefit from |
The most obvious way to learn spells is by using admin commands.
For example:
The admin command to teach someone a spell is: ```yaml
`/mythicrpg spells teach [name] [spell]` TestArchetype:
Leveling:
You can also use the `unlearn` command to remove a spell from someone. MinLevel: 1
MaxLevel: 50
## Archetypes ExperienceCurve: TEST_STATIC
### Leveling ExperienceSource: MOBS
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. ## Experience Curves
```yaml 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.
Pyromancer:
Group: CLASS There are two types of curves, `FORMULA` and `STATIC`:
Display: 'Pyromancer' - `FORMULA` - Uses math to determine the experience needed to level, where `x` is the next level
SpellUnlocks: - `STATIC` - You define the values for each level yourself
- Fireball
- RainOfFire 10 An experience curve file might look like this:
``` ```yaml
In this example: TEST_FORMULA:
- A player would learn `Fireball` immediately upon gaining the Pyromancer archetype Type: FORMULA
- The player would then learn `RainOfFire` upon reaching level 10 Formula: 'x * 100'
If a player loses an archetype, all spells learned from it will be lost. TEST_STATIC:
Type: STATIC
### Talent Trees Levels:
_coming soon_ 1: 100
2: 200
3: 500
## Mechanics ```
Players can be taught spells using the `teachSpell` mechanic (or have them removed via the `forgetspell` mechanic).
## Experience Sources
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. 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.
```yaml Each experience source group can contain sections of one or more types of sources.
Skills:
- teachSpell{spell=DoubleJump} @trigger An experience source called `MOBS` might look like this:
``` ```yaml
MOBS:
## Signs Sources:
Spell Signs can be used to create signs that will teach spells when right-clicked. - Type: killEntity
Conditions: []
To create one, you simply make a sign with the first line as `[Learn Spell]` and the 2nd line as the spell's ID. TriggerConditions: []
Values:
![image](uploads/d48450ed19e9af3f7ea3c0fd260b515c/image.png) - ZOMBIE 1to2
- HUSK 1to2
## Tomes - SKELETON 50
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. - Type: killmythic
Conditions: []
**You can obtain a tome using admin commands:** TriggerConditions: []
`/mythicrpg spells tome get [spell]` Values:
- TestingDummy2 100
Mobs can also drop a tome using the custom `spelltome{spell=X}` drop type. ```
### Conditions and Trigger Conditions
# Globally Available Spells 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 Spells and Global Mechanics are spells and mechanics you can have automatically apply to all players.
- **Conditions** evaluate against the player as the caster (their world, location, level, permissions, held item, etc.)
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. - **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.
## Global Spells For example, restricting mining XP to a designated mining world for players level 10 or higher:
Global Spells are spells that are automatically given to everyone. ```yaml
MINING:
To make a spell global, you simply put `Global: true` in the mythic skill's configuration. Sources:
```yaml - Type: blockBreak
SomeGlobalSkill: Conditions:
Spell: true - inworld{w=mining_world}
Global: true - level{l=10}
... Values:
``` - DIAMOND_ORE 50
This will cause the spell to be given to all players, and if it's a passive it will automatically trigger for all players. - IRON_ORE 10
```
## 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. ### Available Sources
The default config file comes with a single example that would be used to give people basic "mana regeneration": | Type | Aliases | Values | Description |
```yaml |-----------------|------------------------------------------------------|-------------------------|----------------------------------------------------------------------|
Configuration: | `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) |
GlobalSkills: | `BREWING` | `BREW`, `BREW_ITEM` | Potion types | Brewing potions |
# | `CAST_SPELL` | `SPELL_CAST`, `SPELL`, `CAST` | Spell internal names | Casting a spell. Awarded on cast |
# Example of using this to implement global mana regeneration | `CONSUME_ITEM` | `EATING`, `EAT`, `EAT_ITEM` | Item materials | Consuming/eating an item |
- modifyReagent{reagent=mana;amount=10} @self ~onTimer:20 | `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 |
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. | `ENCHANTING` | `ENCHANT`, `ENCHANT_ITEM` | Item materials | Enchanting items |
\ No newline at end of file | `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.