Anytime an attacker is inflicted with a "Spike" state and attacks it'll take a part of the damage it dealt to the target. Kind of like in pokemon games.Example: You set damage rate to 40 percent. Attacker will take 40 percent of the damage dealt to him.Features

#===============================================================================# Spike States# Author game_guy# Version 1.1#-------------------------------------------------------------------------------# Intro:# Anytime an attacker is inflicted with a "Spike" state and attacks it'll take# a part of the damage it dealt to the target. Kind of like in pokemon games.## Features:# Deals some damage to attacker# Set how much damage in percent# Different percents for different states## Instructions:# SpikeStates ~ Add any state ID that will be considered a Spike state.# DmgPercent ~ Any number. It'll the damage dealt to the target, and get the# percent and deal it back to the attacker.## Credits:# game_guy ~ For making it# Pokemon ~ For inspiring me to make it/the idea#===============================================================================module GameGuy SpikeStates = [17, 18] DmgPercent = 40 def self.statesdmg(id) case id # Setup State Damage #=================================== # Use # when state_id then return percent_damage # when 17 then return 40 #=================================== when 17 then return 40 when 18 then return 20 end return 0 endendclass Game_Battler alias gg_spike_attack_effect_lat attack_effect def attack_effect(attacker) temphp = self.hp result = gg_spike_attack_effect_lat(attacker) state = 0 GameGuy::SpikeStates.any? {|i| if attacker.states.include?(i) state = i end} if GameGuy::SpikeStates.any? {|i| attacker.states.include?(i)} && result temphp -= self.hp dmg = temphp.to_f / 100 * GameGuy.statesdmg(state) dmg = dmg.floor attacker.hp -= dmg end endend

Instructions

In the script.Compatibility

Not tested with SDK.Tested with Blizz-Abs/Side View Battle SystemCredits and Thanks

This a great script! I have one question though. You say this works if the actor has the state inflicted. Well if I wanted to make a skill do this, how would I make it so that the skill adds the state to the actor? btw, the Demo link isn't working for me.

You can do this in the database. Go to the Skills tab. Then select the skill and go to the right side where it says State Change. Check the box next to the Spike state and make sure its a + sign in the box.

Hi, great script as always.I'm making a spell called Masochist that uses your Spike Damage, when cast on an enemy it does damage equal to percentage specified to the enemy when it attacks with a basic physical attack.As a test I put the percentage of damage at 5000%. It works, and testing it out on some enemies that do a few hundred physical damage with about 500 hps, as expected it kills them when they hit the character.But - the enemy dies first, and then the animation and attack damage are shown on the character. So it's like - enemy turns into red vapor and disappears (death), then sword strike animation and damage dealt to character it was attacking.Is there a way to make it so it does the attack animation and damage dealt to the character the monster is attacking first, and then the damage % from the Spike Damage spell is done to the monster?

Also, is there a way to show the damage on the monster the spell inflicts?Thanks!