Tips & Tricks – Elemental Exposure (Diablo 3) – 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

The Wizard, from Diablo 3, has an ability that causes whatever target it deals elemental damage to, to gain an exposed weakness taking more damage from anyone (not just elemental damage). This effect can stack multiple times. Here’s how you can recreate this effect in RPG Maker MV!

Get the copy/paste code here: 

Place this into your Elemental Exposure state. Change the values in red to fit your game.

<Custom Establish Effect>
// Check if this action damages HP.
if (this.isHpEffect() && value > 0) {
  // Get the elements used by the action.
  var actionElements = this.getItemElements();
  // These are the target elements to match.
  var matchingElements = [7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
  // Set the initial condition value to being unmet.
  var condition = false;
  // Loop through each of the action's elements.
  for (var i = 0; i < actionElements.length; ++i) {
    // If the target elements match the currently looped element...
    if (matchingElements.contains(actionElements[i])) {
      // Then set the condition to being met.
      condition = true;
      // Break the loop.
      break;
    }
  }
  // If the condition is met...
  if (condition) {
    // Then get the Exposed Weakness state ID.
    var exposedState = 82;
    // Add that state to the target.
    target.addState(exposedState);
  }
}
</Custom Establish Effect>

Place this into your Exposed Weakness state. Change the values in red to fit your game.

<Custom Apply Effect>
// Default the number of Exposed Weakness stacks on the target to 0.
target._exposedWeakness = target._exposedWeakness || 0;
// Increase the target's Exposed Weakness stacks by cap it at 4.
target._exposedWeakness = Math.min(4, target._exposedWeakness + 1);
// Get the multiplier used by the effect.
var counterText = '+' + (target._exposedWeakness * 5) + '%';
// Apply that to the counter displayed on the target.
target.setStateCounter(stateId, counterText);
</Custom Apply Effect>

<Custom Remove Effect>
// Upon removal, remove the number of Exposed Weakness stacks.
target._exposedWeakness = undefined;
// Remove the state counter associated with Exposed Weakness.
target.removeStateCounter(stateId);
</Custom Remove Effect>

<Custom React Effect>
// Check if this is an HP damage effect.
if (this.isHpEffect() && value > 0) {
  // Default the number of Exposed Weakness stacks on the target to 0.
  target._exposedWeakness = target._exposedWeakness || 0;
  // Start the initial multiplier with 100%.
  var multiplier = 1;
  // Increase the multiplier by 5% per weakness.
  multiplier += target._exposedWeakness * 0.05;
  // Apply the multiplier to the dealt damage.
  value *= multiplier;
  // Round the damage upward.
  value = Math.ceil(value);
}
</Custom React Effect>

Happy exposing!

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