Tips & Tricks – Enemy Thieves && Plugin Updates 115~

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.

Ever wanted to create an effect where enemy thieves can steal from the player party? Using this tips & tricks video tutorial, you can!

Copy and Paste version of the code along with explanations of what each line does~

Please wait while you are redirected...or Click Here if you do not want to wait.
<After Eval>
if (user.isEnemy()) {
  // Determine the success rate of stealing.
  var successRate = 0.5;
  // Check to see if the steal passes.
  if (Math.random() < successRate) {
    // Create an empty pool for what are valid items.
    var items = [];
    // Let's get the length of the all items in the player's party.
    var total = $gameParty.items().length;
    // A for-loop is used to check each of those items.
    for (var i = 0; i < total; ++i) {
      // Define each item for checking.
      var item = $gameParty.items()[i];
      // Check to see if the item is NOT a key item.
      if (item.itypeId !== 2) {
        // If it isn't a key item, add it to the legal pool.
        items.push(item);
      }
    }
    // Check if there are enough items.
    if (items.length > 0) {
      // Get a random number based on the size of the item pool.
      var random = Math.floor(Math.random() * items.length);
      // Get a random item by using that random number.
      var item = items[random];
      // Have the player party lose 1 of that item.
      $gameParty.loseItem(item, 1);
      // Create a message to let the player know what item was stolen.
      var text = user.name() + ' stole ' + item.name + ' from the party!';
      // Let's play a sound effect!
      SoundManager.playEquip();
    }
  } else {
    // The steal attempt has failed. Make a message to indicate it.
    var text = user.name() + ' failed to steal an item!';
    // Play a sound effect to indicate failure.
    SoundManager.playBuzzer();
  }
  // Get the battle log menu from the battle scene.
  var window = SceneManager._scene._logWindow;
  // Make that text show up in the battle log. Let's center it, too.
  window._lines.push(text + '<CENTER>');
  // And finally, let's refresh that battle log window to display it.
  window.refresh();
}
</After Eval>

Enjoy the effect!


Two updates tonight~ The Class Change Core gets a fix akin to that of the Equip Core bug. The Battle Engine Core gets an update to the anchor notetag for actors to affect more than just actors and it can be applied to classes, weapons, armors, and states.

Plugin Updates as of Launch Date to 2016.02.17~

To download all available plugins, click here.

View the changelog here.

To download all available plugins, click here.