Unstable Affliction (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.


Unstable Affliction is a status effect from the World of Warcraft. The affected unit takes shadow damage over time. However, if it was dispelled, the dispeller takes shadow damage and is silenced. Here’s how to recreate that effect in RPG Maker MV!

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.

Instructions

Follow video instructions.

You can grab the copy and paste version of the code here:

<Custom Regenerate Effect>
// Get the Darkness element.
var elementId = 10;
// Damage set to equal the origin's MAT.
var damage = origin.mat;
// Damage multiplier for weakness/resistance to Darkness element.
damage *= user.elementRate(elementId);
// Round down the damage.
damage = Math.floor(damage);
// Inflict damage to the user.
user.gainHp(-damage);
</Custom Regenerate Effect>

<Custom Remove Effect>
// Declare the dispeller.
var dispeller = BattleManager._subject;
// Check to see if the effect is a leave effect or removal.
var notLeaveEffect = !$gameTemp._customLeaveEffectEval;
// Check the conditions to see if they're met.
if (dispeller && notLeaveEffect) {
  // Get the Silence status effect.
  var stateId = 6;
  // Get the Darkness element.
  var elementId = 10;
  // Damage set to equal the origin's MAT.
  var damage = origin.mat;
  // Multiply by 3 to give it the damage of a critical hit.
  damage *= 3;
  // Damage multiplier for weakness/resistance to Darkness element.
  damage *= dispeller.elementRate(elementId);
  // Play an animation on the dispeller.
  dispeller.startAnimation(102);
  // Add the Silence status effect to the dispeller.
  dispeller.addState(stateId);
  // Deal damage to the dispeller.
  dispeller.gainHp(-damage);
  // Start the damage popup for the dispeller.
  dispeller.startDamagePopup();
  // Check to see if the dispeller is dead.
  if (dispeller.isDead()) {
    // If the dispeller is dead, perform its collapse.
    dispeller.performCollapse();
  }
  // Clear the dispeller's damage popup.
  dispeller.clearResult();
}
</Custom Remove Effect>

Have fun!