Lightning Rod (MV Plugin Tips & Tricks)
VisuStella, Caz Wolf, Fallen Angel Olivia, Atelier Irina, and other affiliated content creators.
Lightning Rod is an ability in Pokémon that will draw thunder attacks towards a unit. This time, we’ll make it draw those attacks and nullify it, too, using the power of auras! Required PluginsThe 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. AboutThis 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 PluginsThis 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. Warning for RPG Maker MZ UsersIf you are using RPG Maker MZ and VisuStella MZ, the following code may or MAY NOT work as this Tips & Tricks is made for RPG Maker MV. VisuStella MZ is NOT responsible if this Tips & Trick does not work because the code base for RPG Maker MV and RPG Maker MZ are different and the code base between Yanfly Engine Plugins and VisuStella MZ is even more drastically different. InstructionsFollow video instructions. You can grab the copy/paste code here:
<Custom React Effect> // Check if HP damage is dealt if (this.isHpEffect() && value > 0) { // Get the lightning element's ID var lightningId = 9; // Get the action's current elements var elements = this.getItemElements(); // Check if the elements contains lightning if (elements.contains(lightningId)) { // Set damage dealt to 0 value = 0; // Get the parameter to alter var paramId = 4; // Set how long the buff will last var turns = 5; // Apply the buff to the target target.addBuff(paramId, turns); // Play an animation on the target target.startAnimation(51); } } </Custom React Effect>
<Custom Action Start Effect> // Get the current action. var action = user.currentAction(); // Check if the action exists and targets an opponent. if (action && action.isForOpponent()) { // Get the lightning element ID. var lightningId = 9; // Get the Lightning Rod origin state ID. var lightningRod = 229; // Get the action's elements. var elements = action.getItemElements(); // Check if the elements contain Lightning. if (elements.contains(lightningId)) { // If the do, create a new pool. var pool = []; // Get the opponent's unit's alive members. var group = user.opponentsUnit().aliveMembers(); // Loop through each one. for (var i = 0; i < group.length; ++i) { // Get the currently looped member. var member = group[i]; // Check if the member exists and is a Lightning Rod origin. if (member && member.isStateAffected(lightningRod)) { // Add that member to the pool. pool.push(member); } } // Check if the pool's size is larger than 0. if (pool.length > 0) { // Get a random Lightning Rod origin from the pool. var rod = pool[Math.floor(Math.random()* pool.length)] // Set the action's target to the Lightning Rod origin. action.setTarget(rod.index()); } } } </Custom Action Start Effect>
<Null Physical Taunt> <Null Magical Taunt> <Null Certain Taunt> Enjoy! |