Tips & Tricks – Chain Lightning – RPG Maker MV

Yanfly Engine Plugins is a plugin library made for RPG Maker MV, a wonderful piece of software to help you make that role playing game of your dreams. You can find out more about RPG Maker MV here.

Chain Lightning is a skill seen across many games that utilize RPG elements. They typically fall under the rule of each hit dealing less damage and no enemy can be struck more than once within the same cast. This Tips & Tricks video will show you how to recreate this skill effect in RPG Maker MV!

Copy and paste this into your skill’s notebox:

<Damage Formula>
// Set the chain multiplier to a value if it doesn't exist.
this._chainmultiplier = this._chainmultiplier || 1.0;
// This is the damage formula.
value = user.mat + 1000;
// Apply the chain multiplier to the damage formula.
value *= this._chainmultiplier;
// Reduce the chain multiplier per target.
this._chainmultiplier -= 0.2;
</Damage Formula>

<Custom Target Eval>
// Adds the selected target to the target list.
targets.push(target);
// Grab the group of alive foes as candidates.
var members = foes.aliveMembers();
// Remove the target from the group of candidates.
members.splice(members.indexOf(target), 1);
// This is the number of extra targets to select with Chain Lightning.
var extraTargets = 3;
// Loop the extra targets.
while (extraTargets--) {
  // Grab a random foe from the alive foes.
  var member = members[Math.floor(Math.random() * members.length)];
  // Check to see if the member exists.
  if (member) {
    // Add the member to the group of targets.
    targets.push(member);
    // Remove the member as a viable candidate.
    members.splice(members.indexOf(member), 1);
  }
}
</Custom Target Eval>

<Enemy or Actor Select>

Happy lightning chaining!

Please wait while you are redirected...or Click Here if you do not want to wait.