Aura of Sacrifice (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 Aura of Sacrifice is an aura effect that comes from the Paladin class in the World of WarCraft. In WoW’s case, the Paladin will take a percentage of the damage nearby allies receive. However, this time, we’ll be doing a spin on this effect and move 100% of the damage over to the paladin and then reduce the amount of damage the Paladin receives! Here’s how to recreate it!

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/paste code here:

Place the following Lunatic Mode code into your Aura Effect State’s notebox. Change the values to reflect your game’s settings.
<Custom React Effect>
// Check if the action dealt HP damage
if (this.isHpEffect() && value > 0) {
  // Get the target's allies
  var members = target.friendsUnit().aliveMembers();
  // Get the Aura's Origin State ID
  var auraOriginId = 246;
  // Make the origin user undefined
  var auraOriginUser = undefined;
  // Loop through each member
  for (var i = 0; i < members.length; ++i) {
    // Get the currently looped member
    var member = members[i];
    // Check if the member exists, isn't the target, and is the aura holder
    if (member && member !== target && member.isStateAffected(auraOriginId)) {
      // Set the origin user to that member
      auraOriginUser = member;
      // Break the loop
      break;
    }
  }
  // Check if the origin user exists
  if (auraOriginUser) {
    // Calculate the amount of reduction
    var reduction = Math.ceil(0.50 * value);
    // Set the damage to the target to 0.
    value = 0;
    // Make the origin user take damage instead.
    auraOriginUser.gainHp(-reduction);
    // Display an animation on the origin user.
    auraOriginUser.startAnimation(2);
    // Make the origin user display a damage popup.
    auraOriginUser.startDamagePopup();
    // Check if the origin user is dead
    if (auraOriginUser.isDead()) {
      // Collapse the origin user if dead
      auraOriginUser.performCollapse();
    }
    // Clear the origin user's results
    auraOriginUser.clearResult();
  }
}
</Custom React Effect>

Enjoy!