Modifiers: One of the best things in MagicSpells
Mar 19, 2017 0:52:13 GMT -5
thecomputergeek2, niblexis, and 1 more like this
Post by MidnightChipmunk on Mar 19, 2017 0:52:13 GMT -5
Introduction
Hello, MidnightChipmunk here! I'm going to show you guys some great uses for Modifiers since they are essential to becoming an advanced MagicSpells user. If you don't know how to use modifiers then you won't be able to succeed in advanced spell configurations. There are A LOT of modifiers and I cannot document them all here, but most of them are located here. Some additional modifiers were added in the future and are not documented on this page. The additional modifiers are:
Setting Up Modifiers
Most modifiers are pretty straight forward when setting them up just be sure to check the parameters carefully if you do not know what they are; be sure to click the link above and look through the list of additional ones above. If you want to invert a modifier you can add an exclamtion point (!) right in front of the condition to invert it's effects. To setup a modifier you need to define it under a spell just like this:
Self Modifiers
Target Modifiers
This is the general setup of all modifiers. If you want to check a target's modifiers it is the same except instead of defining "modifiers:" you define "target-modifiers:" just like this:
Inverse Modifiers (Applies to target modifiers too)
to setup an inverse modifier it is just about the same except for the addition of the exclamation points (!) and you MUST put quotations around it it:
Useful Modifiers and Actions
Modifiers
Here are configurations of some very useful modifiers. If you need to, use this as a reference for these, because these modifiers are EXTREMELY useful in creating spells (These are just how to set some up not the descriptions):
buffactive
variablemorethan
variablelessthan
variableequals
inregion
incuboid
innomagiczone
permission
chance
Now these are just a few of the many many modifiers be sure to check them all out in the links above! Now lets cover some of the most used actions that you will use in your spells.
Actions
These are some of the most used actions when you are creating spells with modifiers:
required
If the condition does not pass, the spell will fail (or mana will not regenerate).
denied
If the condition passes, the spell will fail (or mana will not regenerate).
stop
If the condition passes, no other modifiers for the current spell cast will be processed. This is especially useful when combined with the chance condition.
continue
If the condition does not pass, no other modifiers for the current spell cast will be processed. This is the opposite of the stop modifier.
cast <internal spell name>
If the condition passes then the action variable (the internal spell name) will be cast as well as the spell running this modifier.
castinstead <internal spell name>
If the condition passes then the action variable (the internal spell name) will be cast instead of the spell that ran this modifier.
variable <variable name> <mod>
If the condition passes it modifies the variable of the player by the mod.
Notifying of Failures
If your spell were to fail due to modifiers you should probably let the player know! To do this you would just add the following parameter to your spells:
If you have multiple modifiers you can add a message for each individual one too! To do this you append the following to each modifier line:
Applying to the actual format:
Conditionals
Modifiers can be used in conjunction with variables or buff spells to determine whether something has been applied to a player. Typically variables are for long term effects while buff spells are used for short term effects. If you don't know much about variables check out Niblexis' tutorial here When it comes to spells like this typically you have something that we will call an "Independent" spell and a "Dependent" spell. It is pretty self-explanatory about what they do, but I will explain it.
An Independent spell is a spell that can be cast with no restrictions in terms of the target having something applied to them that would cause it to otherwise fail.
A Dependent spell is the opposite; it relies on an Independent spell to tell it whether it can be cast or not.
If this doesn't make sense right away no worries, hopefully this example of a conditional spell will help. The Independent spell's function in this example is to just apply a buff spell, in this case a dummy spell, to the player and disguise them as a giant. The Dependent spell will check whether or not if this buff is applied to the player and if it is then the spell can be cast otherwise it will send a message to the player saying "You are not big enough to cause such a rampage!".
Independent Spell:
Dependent Spell:
This is just about the simplest way of handling spells that need conditions. If you want to do something similar to a target you would just need to make the buff targeted by adding the targeted parameter to your buff spell and setting it to "true", and don't forget to change the modifier definition to "target-modifiers:"!
Just as a side note I would also like to stress this fact: The independent spell and the dependent spell can be apart of the same larger spell! They do not have to be two different spells the player casts; they can both be sub-spells and this still work. A good use of this is if you are casting a spell more than once then you would cast the dependent spell in the casting order first and then the independent spell. This will cause the dependent spell to not be cancelled the first time around, but then the second time it is ticked it will cancel. This is good for spell that let's say tick damage over and over in an area, but you only want the spell to damage each creature once you could use this idea to achieve that effect.
Modifier Collections
Modifier collections are a collection of modifiers (duh!) and they are very useful if you find yourself using the same modifiers over and over in spells. They can be defined in the general.yml just like this:
they can also be defined in your spell files as well just like this:
to reference the collection in spells the format is:
If you want to disallow something if this collection passes it is highly recommend to use the action "stop" rather than "deny"!
Closing Out
Wrapping up we have talked about how to setup modifiers and their uses, but to really understand them more in-depth you will need to use them! There are a lot of modifiers and they are very useful in most complex spells. I won't cover it too deeply in this tutorial, but in the future when we talk about Passive spells, modifiers are used a lot in those as they work hand in hand very well. Play around with modifiers and see if you can't make any new discoveries or come up with any new tricks for the community. If you have any questions about specific spells post in the Help Desk thread or just shoot a message in the Skype group. If you have questions about modifiers in general or some wording stuff in this tutorial just post down below!
Links you might have missed
Introduction to Variables Tutorial
Original Documentation to Modifiers
Hello, MidnightChipmunk here! I'm going to show you guys some great uses for Modifiers since they are essential to becoming an advanced MagicSpells user. If you don't know how to use modifiers then you won't be able to succeed in advanced spell configurations. There are A LOT of modifiers and I cannot document them all here, but most of them are located here. Some additional modifiers were added in the future and are not documented on this page. The additional modifiers are:
Name | Description | Variable |
saturationabove/saturationbelow | Checks whether the saturation level of the player is above or below respectively the variable. | level of saturation |
moneymorethan/moneylessthan | Checks to see whether the player's current money is above or below the variable. | amount of money |
OxygenAbove/OxygenBelow/OxygenEquals | Checks to whether the player's oxygen level is above, below, or equal to the variable. | Oxygen level (Half of a bubble equals one) |
YawAbove/YawBelow | Check to see whether the yaw of the player is above or below the variable. | Yaw value |
worldguardbooleanflag | If the choosen flag is set to true in that region, the modifier check passes. | The condition var should be the name of one of the worldguard flags as specified in the DefaultFlag class in worldguard. The condition var determines which flag to check for the highest priority region that the player is currently in. |
worldguardstateflag | If the flag's value is allow in the top priority region applicable to the player, then the modifier check passes. | The condition var should be the name of one of the worldguard flags as specified in the DefaultFlag class in worldguard. |
targetmaxhealthgreaterthan/targetmaxhealthlessthan | Checks to see if the player's max health is greater than or less than the variable. | The number of hearts reamaining (Half of a heart equals one) |
Setting Up Modifiers
Most modifiers are pretty straight forward when setting them up just be sure to check the parameters carefully if you do not know what they are; be sure to click the link above and look through the list of additional ones above. If you want to invert a modifier you can add an exclamtion point (!) right in front of the condition to invert it's effects. To setup a modifier you need to define it under a spell just like this:
Self Modifiers
modifiers:
- [modifier name] [parameters] [action]
Target Modifiers
This is the general setup of all modifiers. If you want to check a target's modifiers it is the same except instead of defining "modifiers:" you define "target-modifiers:" just like this:
target-modifiers:
- [modifier name] [parameters] [action]
Inverse Modifiers (Applies to target modifiers too)
to setup an inverse modifier it is just about the same except for the addition of the exclamation points (!) and you MUST put quotations around it it:
modifiers:
- "![modifier name] [parameters] [action]"
Useful Modifiers and Actions
Modifiers
Here are configurations of some very useful modifiers. If you need to, use this as a reference for these, because these modifiers are EXTREMELY useful in creating spells (These are just how to set some up not the descriptions):
buffactive
modifiers:
- buffactive <internal buff spell name> [action]
variablemorethan
modifiers:
- variablemorethan <variable name>:<amount to check for> [action]
variablelessthan
modifiers:
- variablelessthan <variable name>:[i]amount to check for> [action]
variableequals
modifiers:
- variableequals<variable name>:<amount to check for> [action]
inregion
modifiers:
- inregion <world name>:<World Guard region name> [action]
incuboid
modifiers:
- incuboid <world name>,x1,y1,z1,x2,y2,z2 [action]
innomagiczone
modifiers:
- innomagiczone <no magic zone name> [action]
permission
modifiers:
- permission <permission node> [action]
chance
modifiers:
- chance <number from 1 to 100> [action]
Now these are just a few of the many many modifiers be sure to check them all out in the links above! Now lets cover some of the most used actions that you will use in your spells.
Actions
These are some of the most used actions when you are creating spells with modifiers:
required
If the condition does not pass, the spell will fail (or mana will not regenerate).
denied
If the condition passes, the spell will fail (or mana will not regenerate).
stop
If the condition passes, no other modifiers for the current spell cast will be processed. This is especially useful when combined with the chance condition.
continue
If the condition does not pass, no other modifiers for the current spell cast will be processed. This is the opposite of the stop modifier.
cast <internal spell name>
If the condition passes then the action variable (the internal spell name) will be cast as well as the spell running this modifier.
castinstead <internal spell name>
If the condition passes then the action variable (the internal spell name) will be cast instead of the spell that ran this modifier.
variable <variable name> <mod>
If the condition passes it modifies the variable of the player by the mod.
Notifying of Failures
If your spell were to fail due to modifiers you should probably let the player know! To do this you would just add the following parameter to your spells:
str-cast-fail: <text>
If you have multiple modifiers you can add a message for each individual one too! To do this you append the following to each modifier line:
$$<text>
Applying to the actual format:
modifiers:
- buffactive <internal buff spell name> [action]$$<text>
Conditionals
Modifiers can be used in conjunction with variables or buff spells to determine whether something has been applied to a player. Typically variables are for long term effects while buff spells are used for short term effects. If you don't know much about variables check out Niblexis' tutorial here When it comes to spells like this typically you have something that we will call an "Independent" spell and a "Dependent" spell. It is pretty self-explanatory about what they do, but I will explain it.
An Independent spell is a spell that can be cast with no restrictions in terms of the target having something applied to them that would cause it to otherwise fail.
A Dependent spell is the opposite; it relies on an Independent spell to tell it whether it can be cast or not.
If this doesn't make sense right away no worries, hopefully this example of a conditional spell will help. The Independent spell's function in this example is to just apply a buff spell, in this case a dummy spell, to the player and disguise them as a giant. The Dependent spell will check whether or not if this buff is applied to the player and if it is then the spell can be cast otherwise it will send a message to the player saying "You are not big enough to cause such a rampage!".
Independent Spell:
Titan:
spell-class: ".MultiSpell"
cooldown: 15
cast-item: 388
check-individual-cooldowns: false
spells:
- BUFF_Titan //Casting the buff spell
BUFF_Titan: //The buff spell is a dummy spell! So it has no other effects other than to exist for us in this use
spell-class: ".buff.DummySpell"
duration: 18 //It lasts 18 seconds before being disabled
Dependent Spell:
GiantWrath:
spell-class: ".MultiSpell"
cooldown: 10
cast-item: 388
check-individual-cooldowns: false
modifiers:
- buffactive BUFF_Titan required //Checking to see if the buff spell that we named is active on us or not
str-modifier-failed: You are not big enough to cause such a rampage! //If it isn't the str-modifier-failed will show the message to the player
spells:
/*irrelavent past here*/
This is just about the simplest way of handling spells that need conditions. If you want to do something similar to a target you would just need to make the buff targeted by adding the targeted parameter to your buff spell and setting it to "true", and don't forget to change the modifier definition to "target-modifiers:"!
Just as a side note I would also like to stress this fact: The independent spell and the dependent spell can be apart of the same larger spell! They do not have to be two different spells the player casts; they can both be sub-spells and this still work. A good use of this is if you are casting a spell more than once then you would cast the dependent spell in the casting order first and then the independent spell. This will cause the dependent spell to not be cancelled the first time around, but then the second time it is ticked it will cancel. This is good for spell that let's say tick damage over and over in an area, but you only want the spell to damage each creature once you could use this idea to achieve that effect.
Modifier Collections
Modifier collections are a collection of modifiers (duh!) and they are very useful if you find yourself using the same modifiers over and over in spells. They can be defined in the general.yml just like this:
general:
modifiers:
modifier_name:
checks:
- condition condition_var action action_var
- condition condition_var action action_var
- etc.
pass-condition: [Any, All, One]
they can also be defined in your spell files as well just like this:
modifiers:
modifier_name:
checks:
- condition condition_var action action_var
- condition condition_var action action_var
- etc.
pass-condition: [Any, All, One]
to reference the collection in spells the format is:
- collection <collection_name> action action_var
If you want to disallow something if this collection passes it is highly recommend to use the action "stop" rather than "deny"!
Closing Out
Wrapping up we have talked about how to setup modifiers and their uses, but to really understand them more in-depth you will need to use them! There are a lot of modifiers and they are very useful in most complex spells. I won't cover it too deeply in this tutorial, but in the future when we talk about Passive spells, modifiers are used a lot in those as they work hand in hand very well. Play around with modifiers and see if you can't make any new discoveries or come up with any new tricks for the community. If you have any questions about specific spells post in the Help Desk thread or just shoot a message in the Skype group. If you have questions about modifiers in general or some wording stuff in this tutorial just post down below!
Links you might have missed
Introduction to Variables Tutorial
Original Documentation to Modifiers