Tips & Tricks – Unstable Affliction

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.

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!

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!

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