agan2 yang budiman bisa bantu nggak?
request skrip counter attack buat tankentai sbs, coz kalo cuma nyerang sama defend rasanya garing kriuk kriuk gitu...
kalo nggak skrip, request patch counter attack-nya KGC (KGC_Counter)... itu juga kalo boleh...
plz requestya ditanggepin sama agan2 penduduk
yang budiman....
terima kasih sebelum ma sesudahnya, maafin kalo ada salah kata
-richter_h
UPDATE:
ane udah nemuin script buat counter attack,kompatibel sama tankentai tapi masih ada satu problem.
nih!
- Spoiler:
- Code:
-
#==============================================================================
# * Dynamic Counter Attack Script By Omegazion
#==============================================================================
=begin
Thank you for using this script. If you find any bugs, please report immediately
to me . you can do so by pming omegaziion at rpgrevolution.com/forums
or posting at the thread there for this script. you may also e-mail
julianvillaruz@gmail.com
This script adds gives you the ability to have counter-attack skills, skills
that perform an action only when damage is taken. This script allows you to
have passive counter skills as well as active counter skill 'poses', which means
the user will only counter attack when the skills is active for that turn.
Instructions:
To set-up a counter attack skill put in that skills notebox first:
<counter>
then,
<counter_attack: (type)>
where type is either passive or active.
remember an active skill's scope must be 'None' in the database.
Then, put
<counter_type: (counter-type)>
counter-type is either skill or normal attack.
if counter-type is skill, you add
<counter_skill: (skillid)>
then put the counter chance:
<counter_chance: (chance)%>
you may also put (if you want to counter when the enemy misses):
<on_miss_counter_chance: (chance)%>
for passive skills, you may also opt to put:
<defend_counter_chance: (chance)%>
finally, end with
</counter>
Example:
<counter>
<counter_attack: active>
<counter_type: skill>
<counter_skill: 64>
<counter_chance: 100%>
</counter>
=end
$oz_script = {} if $oz_script.nil?
$oz_script["CounterAttack"] = true
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================
class Game_Actor
#--------------------------------------------------------------------------
# * Alias List
#--------------------------------------------------------------------------
alias oz_cntr_atk_initialize initialize
alias oz_cntr_atk_execute_damage execute_damage
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :set_to_counter_chance
attr_accessor :set_to_counter_onmiss
attr_accessor :passive_counter_skill
attr_accessor :passive_om_counter_skill
attr_accessor :passive_counter_attack_chance
attr_accessor :passive_counter_att_def_chance
attr_accessor :passive_counter_att_miss_chance
attr_accessor :counter_type
attr_accessor :action_before_counter
attr_accessor :countering
attr_writer :action
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(*args)
oz_cntr_atk_initialize(*args)
clear_counter_skills
end
def clear_counter_skills
@passive_counter_skill = nil
@passive_om_counter_skill = nil
@passive_counter_attack_chance = 0
@passive_counter_att_def_chance = 0
@passive_counter_att_miss_chance = 0
@set_to_counter_chance = 0 # counter chance of activated counters
@counter_type = 0 # 0 for normal atk, anything else is skill id
@countering = false
@action_before_counter = nil # Game_BattleAction obj.
@set_to_counter_onmiss = 0
end
alias oz_cntr_atk_attack_effect attack_effect
def attack_effect(*args)
stop_now = oz_cntr_atk_attack_effect(*args)
apply_on_miss_counter(args[0])
end
alias oz_cntr_atk_skill_effect skill_effect
def skill_effect(*args)
stop_now = oz_cntr_atk_skill_effect(*args)
apply_on_miss_counter(args[0])
end
def apply_on_miss_counter(user)
if @evaded or @missed
if @set_to_counter_onmiss > rand(100)
self.action_before_counter = self.action.dup
if @counter_type == 0
self.action.set_attack
self.countering = true
else
if $data_skills[@counter_type].mp_cost <= self.mp
self.action.set_skill(@counter_type)
self.countering = true
end
end
self.action.counter_target = user
self.action.target_index = user.index
elsif @passive_counter_att_miss_chance > rand(100)
self.action_before_counter = self.action.dup
self.action.set_attack
self.action.counter_target = user
self.countering = true
elsif (@passive_counter_skill != nil and @passive_counter_skill.on_miss_counter_chance > rand(100)) or
(@passive_om_counter_skill != nil and @passive_om_counter_skill.on_miss_counter_chance > rand(100))
self.action_before_counter = self.action.dup
self.action.set_skill(@passive_counter_skill.counter_skill)
self.action.target_index = user.index
self.action.counter_target = user
self.countering = true
end
end
end
#--------------------------------------------------------------------------
# * Damage Reflection
# user : User of skill or item
#--------------------------------------------------------------------------
def execute_damage(user)
oz_cntr_atk_execute_damage(user)
if @hp_damage > 0
if self.set_to_counter_chance > rand(100)
self.action_before_counter = self.action.dup
if @counter_type == 0
self.action.set_attack
self.countering = true
else
if $data_skills[@counter_type].mp_cost <= self.mp
self.action.set_skill(@counter_type)
self.countering = true
end
end
self.action.counter_target = user
self.action.target_index = user.index
elsif @passive_counter_attack_chance > rand(100)
self.action_before_counter = self.action.dup
self.action.set_attack
self.action.counter_target = user
self.countering = true
elsif self.action.guard? and @passive_counter_att_def_chance > rand(100)
self.action_before_counter = self.action.dup
self.action.set_attack
self.action.counter_target = user
self.countering = true
elsif @passive_counter_skill != nil and
$data_skills[@passive_counter_skill.counter_skill] != nil and
$data_skills[@passive_counter_skill.counter_skill] <= self.mp
(@passive_counter_skill.counter_chance > rand(100) or (
@passive_counter_skill.defend_counter_chance > rand(100) and
self.action.guard?))
self.action_before_counter = self.action.dup
self.action.set_skill(@passive_counter_skill.counter_skill)
self.action.target_index = user.index
self.action.counter_target = user
self.countering = true
end
end
end
end
#==============================================================================
# ** Game_BattleAction
#------------------------------------------------------------------------------
# This class handles battle actions. This class is used within the
# Game_Battler class.
#==============================================================================
class Game_BattleAction
#--------------------------------------------------------------------------
# * Alias List
#--------------------------------------------------------------------------
alias oz_cntr_atk_make_targets make_targets
alias oz_cntr_atk_valid? valid?
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :counter_target
#--------------------------------------------------------------------------
# * Determination if Action is Valid or Not
#--------------------------------------------------------------------------
def valid?
return true if @battler.actor? and @battler.countering
oz_cntr_atk_valid?
end
#--------------------------------------------------------------------------
# * Create Target Array
#--------------------------------------------------------------------------
def make_targets
return [@counter_target] if @battler.actor? and @battler.countering
oz_cntr_atk_make_targets
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Alias List
#--------------------------------------------------------------------------
alias oz_cntr_atk_execute_action_attack execute_action_attack
alias oz_cntr_atk_execute_action_skill execute_action_skill
alias oz_cntr_atk_start start
alias oz_cntr_atk_turn_end turn_end
alias oz_cntr_atk_battle_end battle_end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
setup_passive_counter_attacks
oz_cntr_atk_start
end
def battle_end(*args)
oz_cntr_atk_battle_end(*args)
for actor in $game_party
actor.clear_counter_skills
end
end
#--------------------------------------------------------------------------
# * Set-up passive counter chances
#--------------------------------------------------------------------------
def setup_passive_counter_attacks
for member in $game_party.members
if not $imported.nil? and $imported["SkillCPSystem"]
skills = member.battle_skills
else
skills = member.skills
end
for skill in skills
if skill.counter_attack == 'passive'
if skill.counter_type == 'skill'
if skill.on_miss_counter_chance > 0 and skill.counter_chance == 0
member.passive_om_counter_skill = skill
else
member.passive_counter_skill = skill
end
else
member.passive_counter_att_miss_chance = skill.on_miss_counter_chance
member.passive_counter_attack_chance = skill.counter_chance
member.passive_counter_att_def_chance = skill.defend_counter_chance
end
end
end
end
end
#--------------------------------------------------------------------------
# * End Turn
#--------------------------------------------------------------------------
def turn_end
oz_cntr_atk_turn_end
for member in $game_party.members
member.set_to_counter_chance = 0
end
end
#--------------------------------------------------------------------------
# * Execute Battle Action: Attack
#--------------------------------------------------------------------------
def execute_action_attack
targets_c = @active_battler.action.make_targets
if @active_battler.actor? and @active_battler.countering
oz_cntr_atk_execute_action_attack
@active_battler.countering = false
@active_battler.action = @active_battler.action_before_counter unless @active_battler.action_before_counter.nil?
else
oz_cntr_atk_execute_action_attack
for target in targets_c
if target.actor? and target.countering
@action_battlers.unshift(target)
end
end
end
end
#--------------------------------------------------------------------------
# * Execute Battle Action: Skill
#--------------------------------------------------------------------------
def execute_action_skill
targets_c = @active_battler.action.make_targets
oz_cntr_atk_execute_action_skill
if @active_battler.actor? and @active_battler.countering
@active_battler.countering = false
@active_battler.action = @active_battler.action_before_counter unless @active_battler.action_before_counter.nil?
elsif @active_battler.actor? and @active_battler.action.skill.counter_attack == 'active'
@active_battler.set_to_counter_chance = @active_battler.action.skill.counter_chance
@active_battler.set_to_counter_onmiss = @active_battler.action.skill.on_miss_counter_chance
@active_battler.counter_type = @active_battler.action.skill.counter_skill
else
for target in targets_c
if target.actor? and target.countering
@action_battlers.unshift(target)
end
end
end
end
end
#==============================================================================
# ** RPG
#------------------------------------------------------------------------------
# A module containing RPGVX data structures
#==============================================================================
module RPG
#==============================================================================
# ** RPG::Skill
#------------------------------------------------------------------------------
# Data class for skills.
#==============================================================================
class Skill
#--------------------------------------------------------------------------
# * Get the data enclosed in counter tags
#--------------------------------------------------------------------------
def counter_data
data = []
start_data = false
for line in self.note.downcase.split(/[\r\n]/)
if line =~ /\<counter\>/
start_data = true
elsif line =~ /\<\/counter\>/
start_data = false
else
data.push(line)
end
end
return data.join("\r\n")
end
#--------------------------------------------------------------------------
# * Determine counter attack type (passive or active)
#--------------------------------------------------------------------------
def counter_attack
return 'none' if self.counter_data.empty?
text = self.counter_data.scan(/\<counter\_attack\:\s*(.+)\>/)
text = text[0]
return 'none' if text == nil
return text[0]
end
#--------------------------------------------------------------------------
# * Determine counter action type (skill or attack)
#--------------------------------------------------------------------------
def counter_type
text = self.counter_data.scan(/\<counter\_type\:\s*(.+)\>/)
return text[0][0]
end
#--------------------------------------------------------------------------
# * Determine counter skill id
#--------------------------------------------------------------------------
def counter_skill
return 0 if self.counter_data.empty?
text = self.counter_data.scan(/\<counter\_skill\:\s*([0-9]+)\>/)
text = text[0]
return 0 if text == nil
return text[0].to_i
end
#--------------------------------------------------------------------------
# * Determine counter chance
#--------------------------------------------------------------------------
def counter_chance
return 0 if self.counter_data.empty?
text = self.counter_data.scan(/counter\_chance\:\s*([0-9]+)/)
text = text[0]
return 0 if text == nil
return text[0].to_i
end
#--------------------------------------------------------------------------
# * Determine counter chance when defending
#--------------------------------------------------------------------------
def defend_counter_chance
return 0 if self.counter_data.empty?
text = self.counter_data.scan(/defend\_counter\_chance\:\s*([0-9]+)/)
text = text[0]
return 0 if text == nil
return text[0].to_i
end
def on_miss_counter_chance
return 0 if self.counter_data.empty?
text = self.counter_data.scan(/on\_miss\_counter\_chance:\s*([0-9]+)/)
text = text[0]
return 0 if text == nil
return text[0].to_i
end
end
end
gimana cara biar bikin sequence si aktor sama enemy bisa kayak gini:
Musuh nyerang > aktor evade > aktor nabok musuh yang tadi > musuh balik ke posisisoale sequence saat ini kek gini:
Musuh nyerang > aktor evade > musuh balik ke posisi > aktor nabok musuh yang tadiplis bantuannya ya agan2 yang budiman...