Statikk Shiv (MV Plugin Tips & Tricks)

From Yanfly.moe Wiki
Jump to navigation Jump to search

Welcome to the wiki! This is where you can find resources from Yanfly.moe, Ækashics.moe,
VisuStella, Caz Wolf, Fallen Angel Olivia, Atelier Irina, and other affiliated content creators.


The Statikk Shiv is a weapon from League of Legends. As time passes, it increases in charge counter. From basic attacks, the charge counter also increases. Once the weapon reaches 100 statikk charge, the next basic attack will proc a statikk shock across 5 random enemies!

Required Plugins

The following plugin(s) is required to create this Tips & Tricks effect:

For help on how to install plugins, click here.

For help on how to update plugins, click here.

About

This is a Tips & Tricks effect created for RPG Maker MV. Tips & Tricks are not to be confused with plugins. Instead, they are usually customized code created for the sake of producing unique features/effects that do not require an entire plugin to do.

Yanfly Engine Plugins

This Tips & Tricks effect is made possible due to the Yanfly Engine Plugins library.

Click here if you want to help support Team Yanfly on Patreon.

Warning for RPG Maker MZ Users

Warning.jpg

If you are using RPG Maker MZ and VisuStella MZ, the following code may or MAY NOT work as this Tips & Tricks is made for RPG Maker MV. VisuStella MZ is NOT responsible if this Tips & Trick does not work because the code base for RPG Maker MV and RPG Maker MZ are different and the code base between Yanfly Engine Plugins and VisuStella MZ is even more drastically different.

Instructions

Follow video instructions.

Copy and paste this into your Statikk Shiv passive state!

<Custom Regenerate Effect>
// Increase the state counter by 6.
user.addStateCounter(stateId, 6);
// Set the minimum and maximum counter to 0 - 100.
user.clampStateCounter(stateId, 0, 100);
</Custom Regenerate Effect>

<Custom Confirm Effect>
// Check if this is a basic attack and that the user and target are on different teams.
if (this.isAttack() && target.isActor() !== user.isActor()) {
  // Increase the state counter by 6.
  user.addStateCounter(stateId, 12);
  // Set the minimum and maximum counter to 0 - 100.
  user.clampStateCounter(stateId, 0, 100);
  // Check if the counter is full (at 100).
  if (user.getStateCounter(stateId) >= 100) {
    // Clear the state counter.
    user.removeStateCounter(stateId);
    // Determine the thunder element ID used for shock.
    var elementId = 5;
    // Damage formula used for the shock effect.
    var damage = user.mat * 2;
    // Check if a critical hit landed.
    if (target.result().critical) {
      // Apply critical damage.
      damage = this.applyCritical(damage);
    }
    // Get all of the alive members from the opponent's unit.
    var members = this.opponentsUnit().aliveMembers();
    // Remove the main target from the member list.
    members.splice(members.indexOf(target), 1);
    // Play the shock animation on the target.
    target.startAnimation(77);
    // Increase the damage received by the shock damage with the thunder multiplier.
    value += Math.ceil(damage * target.elementRate(elementId));
    // 4 other members of the opposite team need to be shocked.
    var extraTargets = 4;
    // Loop each of these 4 members.
    while (extraTargets--) {
      // Get a random member from the opponent's team.
      var member = members[Math.floor(Math.random() * members.length)];
      // Check if the member exists.
      if (member) {
        // Play the shock animation on the random member.
        member.startAnimation(77);
        // Make the random member take damage with the thunder multiplier.
        member.gainHp(-Math.ceil(damage * member.elementRate(elementId)));
        // Start the damage popup on the random member.
        member.startDamagePopup();
        // Clear the random member's results.
        member.clearResult();
        // Remove the random member from the list of valid targets.
        members.splice(members.indexOf(member), 1);
        // Check if the member is dead.
        if (member.isDead()) {
          // If the member is dead, have it collapse.
          member.performCollapse();
        }
      }
    }
  }
}
</Custom Confirm Effect>

Happy shocking!