Tips & Tricks – Plague Touch (Guild Wars) – 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.

Plague Touch is a skill from Guild Wars used by the Necromancer class. When used, the user transfers status ailments from the user to the target foe and its remaining turns!

You can get the copy/paste version of the code here: Be sure to change the marked code in red to fit your game!

// Skill Core

<Custom Requirement>
// Check state count for state category the user is affected by.
var count = user.getStateCategoryAffectedCount('Ailment');
// Set the requirement condition to be dependent on the count.
value = count > 0;
</Custom Requirement>

// Skill Core

<After Eval>
// Get the states the user is currently affected by.
var states = user.states();
// This is the category we want to transfer.
var category = 'Ailment';
// Create a loop that goes through each state.
while (states.length > 0) {
  // Get the currently looped state.
  var state = states.shift();
  // Check if the state's categories has the one we want.
  if (state.category.contains(category.toUpperCase())) {
    // Get the number of turns left on the user for the state.
    var turns = user.stateTurns(state.id);
    // Remove the state from the user.
    user.removeState(state.id);
    // Add the state to the target.
    target.addState(state.id);
    // Check if the addition of the state went through.
    if (target.isStateAffected(state.id)) {
      // Set the number of turns for that state for the target.
      target.setStateTurns(state.id, turns);
    }
  }
}
</After Eval>

// Action Sequence

// Sets up the action.
<setup action>
display action
immortal: targets, true
</setup action>

// Moves the user in front of the target.
<whole action>
move user: targets, front, 20
motion standby: user
wait for movement
</whole action>

// User removes ailments from self and applies it to target.
<target action>
face user: target
animation 58: user
wait for animation
motion thrust: user, no weapon
wait: 10
action animation: target
wait for animation
action effect
</target action>

Happy touching!

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