Jump to content
Sign in to follow this  
Daemonium

[Conversion request] Auto Preemptive-Surprise attacks

Recommended Posts

Hello, I've found this script for do automatic preemptive/surprise attacks when facing certain troops, but is only for VX, can someone do this script compatible with VX Ace?

 

 

 

=begin
AlphaWhelp's Auto Preemptive or Surprise

Add the troop ids to the appropriate variables below
noted with comments above them. If you input a troop
ID into both variables, auto-preemptive takes effect
instead of auto-surprise. Enjoy.

Version 0.2a
Changes from 0.1a
Minor bug fix involving random encounters
Created 6/7/09, 1:34 A.M.
=end
module AW
#Insert auto-preemptive troop IDs below
#E.X. [1, 2, 3, 4]
AUTOPREEMPTTROOPIDS = [1]

#Insert auto-surprise troop IDs below
#E.X. [5, 6, 7, 8]
AUTOSURPRISETROOPIDS = [2]
end

class Scene_Battle < Scene_Base
  alias aw_preempt_pbs process_battle_start
  def process_battle_start
    awtroopid = $game_troop.troop.id
      if AW::AUTOPREEMPTTROOPIDS.include?(awtroopid)
        $game_troop.preemptive = true
      else
        if AW::AUTOSURPRISETROOPIDS.include?(awtroopid)
        $game_troop.surprise = true
        end
      end
    aw_preempt_pbs
  end
end

class Scene_Map < Scene_Base
  alias aw_preempt_pos preemptive_or_surprise
  def preemptive_or_surprise
    awtroopid = $game_troop.troop.id
      if AW::AUTOPREEMPTTROOPIDS.include?(awtroopid)
        $game_troop.preemptive = true
      else
      if AW::AUTOSURPRISETROOPIDS.include?(awtroopid)
        $game_troop.surprise = true
      else
      aw_preempt_pos
      end
    end
  end
end

 

 

If not, is there any script with similar (or better) features?

 

Thanks in advance.

Edited by Daemonium

Share this post


Link to post
Share on other sites

module BattleManager

 

PREEMPTIVE = [1,3,4,5,6] # Troop ID's for preemptive

SURPRISE = [2,7,8,9] # Troop ID's for surprise

 

class << self; alias galv_dae_battle_start battle_start; end

def self.battle_start

@preemptive = true if PREEMPTIVE.include?($game_troop.troop.id)

@surprise = true if SURPRISE.include?($game_troop.troop.id)

galv_dae_battle_start

end

end

Try that

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×