"LEVEL" SPELLS

How to make spells based on levels, such as Level 5 Death

  • Xenomic
  • 04/18/2013 03:45 AM
  • 2477 views
Hello and welcome! Today's tutorial will be about how to make "Level" spells, such as the infamous Level 5 Death spell, often see as a Blue Magic spell in the Final Fantasy series, or other spells such as Level 3 Confuse, Level 2 Sleep, so on and so forth! This tutorial will be short and sweet to the point. Once you figure out how to handle this, you can set up various Level spells yourself, even going so far as setting up special versions of each!

I. The Basics

You will need the following for this:

1) A common event for each Level spell you intend to have in the game. For this example, name the common event "Level 5 Death".
2) A switch for each Level spell you intend to have in the game. For this exercise, have at least one switch named "Level 5 Death".
3) A variable for each hero's Level. For this example, have at least one variable named "Reimu Lv".
4) Knowledge of how the Modulus function works in Variable Operations.
5) Having one skill. Name it Level 5 Death.
6) At least one free battle event.
7) A monster that can use the skill and turns on the switch "Level 5 Death" when using it.


II. The Common Event

The coding is rather straightforward. Let us begin in the Level 5 Death common event. Set the Trigger to Call first off, so that it doesn't activate unintentionally. We'll be using this in a battle event later.

Now, in the Event Commands box, the very first thing you should do is set the "Reimu Lv" variable to Reimu's Level (you'll need to do this for each and every party member in your game. So if you have Reimu, Cloud, Chrono, Serge, and Adol as your playable characters, you'll need a "Reimu Lv", "Cloud Lv", "Chrono Lv", "Serge Lv", and "Adol Lv" variable for each). Next, underneath each Lv variable, you will need to use the Modulus function (for this exercise, since we're doing Level 5 Death, set the Modulus to 5.

What this effectively does is count from 1 to 4, and then once it hits any number multiple of 5, it will then roll over to 0. So if you had Modulus 10, it would start at 1 and go up to the number right before 10 (9), and then once it hits 10, it would roll back over to 0. Then it will count back up until it hits 20 (starting at 1, working up to 9), and roll back over to 0. This is effectively how we make the Level spells right here is through these two variables alone.

The next thing we'll want to do is make a conditional branch to check if each character is in the party (for this, we'll be checking to see if Reimu is in the party). Next, we'll be checking to see if the character is equipped with anything that prevents instant death (for this example, I checked to see if Reimu is equipped with the Hakurei Amulet, Resist Charm, Netherworld Ribbon, Mortal Soul, and Divine Ying-Yang Orb). If you so choose, you can even set a Random variable within each of these branches, if they don't protect from Instant Death 100%, for the hitrate of the character being hit by Death. You will need to make sure that each Conditional Branch has "Execute Custom Handler" checked as well. At the very end of the branches, in the last Else Handler created from the last equipment check, check to see if variable "Reimu Lv" is equal to 0, and then in this branch, use the Change Character Condition function to inflict Death to the character. And there you go! You have your own Level 5 Death spell! However, as it is, we cannot do anything with it just yet, so we have a couple additional steps to go!


Recap:

1) Set a variable for the character to that character's Level.
2) Set that character's Level variable to Modulus 5.
3) Set a Conditional Branch to check if character is in the party.
4) Set Conditional Branches with "Execute Custom Handler" checked for pieces of equipment that may prevent instant death, or would increase resistance to instant death. Adjust accordingly.
5) In the final equipment check's Else Handler, check to see if the character's Level variable is equal to 0.
6) Set that character's status to Death.
7) Rinse and repeat for every playable character in the game.





III. The Battle Event

The next half will involve actually making use of the newly made Level 5 Death common event. First off, head on over to the Skills tab and set up a new skill. For this exercise, we will name it Level 5 Death, and give it an appropriate animation. Leave everything else unchecked, but set the Success Rate to 100%. It's best to make the Target "All Enemies". Or, if you so prefer, you can make the skill a switch and have it turn on the Level 5 Death switch (however, you will not get any notification of the skill misses or not in-battle).

Now, head on over to your Monster tab, and select Level 5 Death as skill for your monster. In the Action Turns Switch ON, choose the switch "Level 5 Death" (do not do this if you already have the skill set as a switch! Otherwise, it will trigger the skill twice). You can set the Behavior Trigger and Priority as you see fit. Finally, let us head over to Monster Groups, and go to any group that has the monster with the Level 5 Death spell. Make sure you have at least ONE free battle event available, and set the trigger to be if the "Level 5 Death" switch is on. In the code area, the first thing to do is to use the Show Battle Animation command and call the animation for Level 5 Death (only if you left the Level 5 Death skill as a switch). Call Common Event command and call the Level 5 Death common event. Finally, just use Switch Operations to turn the switch off, and viola! You have a working Level 5 Death spell! Simple as that. You can mess around with this to get other neat Level spells, such as Level 3 Break, Level 4 Disable, Level 3 Flare, Level 4 Graviga, or even more elaborate spells such as Level ? Holy and Level ? Shadow Flare! Experiment and have some fun with it! Do keep in mind that if you try to make "elemental" spells (something like Level 3 Holy), you'll have to "fake" the element, as you cannot give switch skills elements.

If you have any comments or criticisms about how I should be doing my tutorials, or for future tutorials, feel free to comment.

You can find this and more in one tutorial here: http://rpgmaker.net/media/content/users/18498/locker/RPG_Maker_2k3_Tutorials.txt