Is there a script to change an enemy's Counterattack to another skill?

I have a bit of a problem. My enemies don't use the default attack command because I have the default attack command factoring level into the equation, which is good for my party members, but causes enemies to only deal 1 damage (they would deal 0, but I have a script to make 1 the minimum). Problem is, I can't make enemies counterattack because of this, since CNT calls for Skill #1 (Attack).

I need a script that will allow me to call another skill for an enemy's counterattack, specifically, the one I use to calculate an enemy's normal attack. Potentially, this could also be used to make enemies counter with other things, like spells.
Try this one out.

http://victorscripts.wordpress.com/rpg-maker-vx-ace/gameplay-scripts/counter-options/
Is there an alternative to Victor's scripts? He has a policy that having a donation button on your blog is considered a "commercial game", even if your game is free to download, and I don't really agree with that, so I do not use his scripts.
Wow....that sounds really, REALLY dumb. By legal standards that's not considered Commercial at all. It's sort of like Kickstarter, you can donate but it's still non-commercial if the released product is free.

I'll see if I can find one by another scripter somewhere on google. I honestly don't like Victor myself lol. His scripts are cool and all but....his personality? Nuh-uh.
Do you use one particular skill for the default monster attack, or does each monster use a different skill?
Well I thought of this, not sure if it works when it comes to @subject.id    If anyone can point out and fix this up then feel free to do so.

Code:
class Game_BattlerBase  def counter_skill_id    if @subject.id == 1    #set specific actor id check      return 10           #returns this skill id    elsif @subject.id == 2      return 11    elsif @subject.id == 3      return 12    else @subject.id == 4      return 13    end  endendclass Scene_Battle < Scene_Base  def invoke_counter_attack(target, item)    @log_window.display_counter(target, item)    attack_skill = $data_skills[target.counter_skill_id]    @subject.item_apply(target, attack_skill)    refresh_status    @log_window.display_action_results(@subject, attack_skill)  endend
Do you use one particular skill for the default monster attack, or does each monster use a different skill?
Different. For example, if the enemy uses a bludgeoning attack, I use one with a "hit" animation, but if they use a slashing attack, I use one with a "slash" animation.

Well I thought of this, not sure if it works when it comes to @subject.id    If anyone can point out and fix this up then feel free to do so.

class Game_BattlerBase def counter_skill_id if @subject.id == 1 #set specific actor id check return 10 #returns this skill id elsif @subject.id == 2 return 11 elsif @subject.id == 3 return 12 else @subject.id == 4 return 13 end endendclass Scene_Battle < Scene_Base def invoke_counter_attack(target, item) @log_window.display_counter(target, item) attack_skill = $data_skills[target.counter_skill_id] @subject.item_apply(target, attack_skill) refresh_status @log_window.display_action_results(@subject, attack_skill) endend
Can anyone confirm that this works? I have a lot of scripts installed and if something were to be wrong, it would be very hard for me to pinpoint the problem.
Can anyone confirm that this works? I have a lot of scripts installed and if something were to be wrong, it would be very hard for me to pinpoint the problem.
As long as no other custom scripts involve those two definitions, it should be fine. You can check using Ctrl+Shift+F

def counter_skill_id I made up myself so I doubt that was used already.
As long as no other custom scripts involve those two definitions, it should be fine. You can check using Ctrl+Shift+F

def counter_skill_id I made up myself so I doubt that was used already.
I see. Wait, what am I supposed to put in the top marked field?
I see. Wait, what am I supposed to put in the top marked field?
All you need to do is edit the @subject.id == # (actor id number, I already made it for upto 4 actors), and the return # (skill id number to counter with)

Exactly as I had it there.
All you need to do is edit the @subject.id == # (actor id number, I already made it for upto 4 actors), and the return # (skill id number to counter with)

Exactly as I had it there.
But it's not for actors... it's for enemies...
The following script appears to work alright, but the selected counter skill does not show an animation, play sound or use multiple attacks (simply deals the calculated damage of the selected skill). I am working on forcing the skill to trigger, but targeting is currently holding me up. The battle engine is not my place of expertise.

All you need to do is add the following tag to the note field of the enemy : 'counter_skill => {skill_id}' (example : counter_skill => 15).

class Game_BattlerBase #-------------------------------------------------------------------------- # * Get Skill ID of Normal Attack #-------------------------------------------------------------------------- unless method_defined?🙂ex_gbb_091513_attack_skill_id) alias_method🙂ex_gbb_091513_attack_skill_id, :attack_skill_id) end def attack_skill_id(*args, &block) if caller(1)[0].include?("invoke_counter_attack") && self.enemy? counter_hash = {} $data_enemies[self.enemy_id].note.split(/[\r\n]+/).each do |line| if line =~ /\A\s*[^\s:]*)\s*=>\s*(.*[^\s,])/ counter_hash[$1.to_sym] = eval($2) rescue $2 end end return counter_hash[:counter_skill] else ex_gbb_091513_attack_skill_id(*args, &block) end endendEDIT : Minor patch-fix to make certain that an enemy is the one counter-attacking.EDIT II : Hurf, actually, just use Tsukihime's Counter Skills or Formar's Counter Skills.
The following script appears to work alright, but the selected counter skill does not show an animation, play sound or use multiple attacks (simply deals the calculated damage of the selected skill). I am working on forcing the skill to trigger, but targeting is currently holding me up. The battle engine is not my place of expertise.

All you need to do is add the following tag to the note field of the enemy : 'counter_skill => {skill_id}' (example : counter_skill => 15).

class Game_BattlerBase #-------------------------------------------------------------------------- # * Get Skill ID of Normal Attack #-------------------------------------------------------------------------- unless method_defined?🙂ex_gbb_091513_attack_skill_id) alias_method🙂ex_gbb_091513_attack_skill_id, :attack_skill_id) end def attack_skill_id(*args, &block) if caller(1)[0].include?("invoke_counter_attack") && self.enemy? counter_hash = {} $data_enemies[self.enemy_id].note.split(/[\r\n]+/).each do |line| if line =~ /\A\s*[^\s:]*)\s*=>\s*(.*[^\s,])/ counter_hash[$1.to_sym] = eval($2) rescue $2 end end return counter_hash[:counter_skill] else ex_gbb_091513_attack_skill_id(*args, &block) end endendEDIT : Minor patch-fix to make certain that an enemy is the one counter-attacking.EDIT II : Hurf, actually, just use Tsukihime's Counter Skills or Formar's Counter Skills.
Tsukihime's Counter Skills works perfectly, thanks!

Sorry for all the trouble ^_^;

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-script-to-change-an-enemys-counterattack-to-another-skill.18130/