Tips & Tricks – Earth Shield (World of WarCraft) – 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.

Earth Shield is a skill from World of WarCraft that does a number of things. When used, it will have 9 charges. If the unit takes damage or receives healing, a charge will be consumed. Upon taking damage, the user then receives healing equal to 50% of the caster’s MAT. If the unit is healed, then the healing done is increased by 20%. What a flexible status effect! This video will show you how to recreate this effect in RPG Maker MV!

For the copy/paste version of the code, look here: 

Place this code inside of your Earth Shield’s notebox. Replace the code in red to fit your game’s settings.

<Custom Apply Effect>
// Get the current 50% value of the caster's MAT upon the state being applied as the Earth Shield Heal value.
target._earthShieldHeal = Math.floor(origin.mat * 0.50);
// Set the number of charges on the state to 9.
target.setStateCounter(stateId, 9);
</Custom Apply Effect>

<Custom Remove Effect>
// When removed, clear the stored heal value.
target._earthShieldHeal = undefined;
// When removed, clear the number of charges on the state.
target.removeStateCounter(stateId);
</Custom Remove Effect>

<Custom React Effect>
// If the received action is an HP effect and if it's a Heal...
if (this.isHpEffect() && value < 0) {
  // ...then increase the heal by 20%.
  value = Math.floor(value * 1.20);
  // Then reduce the state's charges by -1.
  target.addStateCounter(stateId, -1);
  // If the state's charges reach 0 or less...
  if (target.getStateCounter(stateId) <= 0) {
    // ...then remove the state.
    target.removeState(stateId);
  }
}
</Custom React Effect>

<Custom Deselect Effect>
// Make a copy of the target's results.
var result = JsonEx.makeDeepCopy(target.result());
// Check if the target is alive and if the amount of damage received is above 0.
if (target.isAlive() && result.hpDamage > 0) {
  // Set the amount of HP to heal equal to the stored Earth Shield Heal value.
  var hpHealed = target._earthShieldHeal || 0;
  // Make the target gain that much HP.
  target.gainHp(hpHealed);
  // Show the damage popup on the target.
  target.startDamagePopup();
  // Clear the target's results.
  target.clearResult();
  // Reduce the state's charges.
  target.addStateCounter(stateId, -1);
  // If the state's charges reach 0 or less...
  if (target.getStateCounter(stateId) <= 0) {
    // ...then remove the state.
    target.removeState(stateId);
  }
  // Reset the target's results back to what they were before.
  target._result = result;
}
</Custom Deselect Effect>

Happy shielding!

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