Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
QuesTMajoR

Cooldown or Skill Timer Script

Recommended Posts

Does anyone have a Cooldown or Skill Timer Script.

 

Script like " AFTER a Hero uses a skill, it will cooldown for 4 TURNS before it is usable again ".

 

IF YOU HAVE THEN THANKS! :D 

~QMP

Share this post


Link to post
Share on other sites

Does this fit your needs, it's by KGC

 

 

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/    â—† é…延スキル - KGC_DelaySkill â—†
#_/    â—‡ Last update : 2008/03/23 â—‡
#_/----------------------------------------------------------------------------
#_/  発動ã¾ã§ã«ã‚¿ã‚¤ãƒ ãƒ©ã‚°ãŒç™ºç”Ÿã™ã‚‹ã‚¹ã‚­ãƒ«ã‚’作æˆã—ã¾ã™ã€‚
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

$imported = {} if $imported == nil
$imported["DelaySkill"] = true

if $game_special_elements == nil
  $game_special_elements = {}
  $data_system = load_data("Data/System.rxdata")
end
# é…延スキル属性
$game_special_elements["skill_delay"] = $data_system.elements.index("é…延スキル")
if $game_special_elements["skill_delay"] == nil
  # 互æ›æ€§ä¿æŒã®ãŸã‚ "時間差" ã«ã‚‚対応
  $game_special_elements["skill_delay"] = $data_system.elements.index("時間差スキル")
end
if $game_special_elements["skill_delay"] == nil
  $game_special_elements["skill_delay"] = $data_system.elements.index("DelaySkill")
end

#==============================================================================
# â–¡ Game_DelaySkillInfo
#------------------------------------------------------------------------------
#   é…延スキルã®æƒ…報をä¿æŒã™ã‚‹ã‚¯ãƒ©ã‚¹ã§ã™ã€‚
#==============================================================================

class Game_DelaySkillInfo
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :turn_count               # é…延ターン数
  attr_accessor :skill_id                 # 発動スキルID
  attr_accessor :user                     # 発動者
  #--------------------------------------------------------------------------
  # â—‹ オブジェクトåˆæœŸåŒ–
  #--------------------------------------------------------------------------
  def initialize
    @turn_count = 0
    @skill_id = 0
    @user = nil
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Game_Battler (分割定義 1)
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # ◠公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :delay_skills             # é…延スキルé…列
  attr_accessor :states                   # ステート
  #--------------------------------------------------------------------------
  # ◠オブジェクトåˆæœŸåŒ–
  #--------------------------------------------------------------------------
  alias initialize_KGC_DelaySkill initialize
  def initialize
    initialize_KGC_DelaySkill

    @delay_skills = []
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Scene_Battle (分割定義 1)
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # ◠メイン処ç†
  #--------------------------------------------------------------------------
  alias main_KGC_DelaySkill main
  def main
    clear_actor_delay_skills

    main_KGC_DelaySkill
  end
  #--------------------------------------------------------------------------
  # â—‹ アクター全員ã®é…延スキルを解除
  #--------------------------------------------------------------------------
  def clear_actor_delay_skills
    $game_party.actors.each { |actor| actor.delay_skills = [] }
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Scene_Battle (分割定義 4)
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # ◠フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
  #--------------------------------------------------------------------------
  alias update_phase4_step1_KGC_DelaySkill update_phase4_step1
  def update_phase4_step1
    update_phase4_step1_KGC_DelaySkill

    update_delay_skill if @active_battler != nil
  end
  #--------------------------------------------------------------------------
  # â—‹ é…延スキルã®æ›´æ–°
  #--------------------------------------------------------------------------
  def update_delay_skill
    # é…延スキル発動ã¾ã§ã®ã‚¿ãƒ¼ãƒ³æ•°ã‚’減らã™
    for ds in @active_battler.delay_skills
      ds.turn_count -= 1
    end
  end
  #--------------------------------------------------------------------------
  # ◠スキルアクション çµæžœä½œæˆ
  #--------------------------------------------------------------------------
  alias make_skill_action_result_KGC_DelaySkill make_skill_action_result
  def make_skill_action_result
    make_skill_action_result_KGC_DelaySkill

    make_delay_skill_effect
  end
  #--------------------------------------------------------------------------
  # â—‹ é…延スキル効果ã®ä½œæˆ
  #--------------------------------------------------------------------------
  def make_delay_skill_effect
    return unless @skill.element_set.include?($game_special_elements["skill_delay"])

    for i in 0...@target_battlers.size
      target = @target_battlers[i]
      # ダメージ㌠Miss ã®å ´åˆã¯æ¬¡ã¸
      next if target.damage == nil || target.damage == "Miss"
      # 対象をスキルヒットå‰ã«æˆ»ã™
      target.states = @target_battlers2[i].states.dup
      target.hp = @target_battlers2[i].hp
      target.sp = @target_battlers2[i].sp
      # 発動ターン, 発動スキル, 発動者をセット
      d_skill = Game_DelaySkillInfo.new
      d_skill.turn_count = @skill.variance
      d_skill.skill_id   = @skill.power
      d_skill.user       = @active_battler
      target.delay_skills << d_skill
      # ダメージ㫠"Reserve" を設定
      target.damage = "Reserve"
    end
  end
  #--------------------------------------------------------------------------
  # ◠スキルã¾ãŸã¯ã‚¢ã‚¤ãƒ†ãƒ ã®å¯¾è±¡å´ãƒãƒˆãƒ©ãƒ¼è¨­å®š
  #     scope : スキルã¾ãŸã¯ã‚¢ã‚¤ãƒ†ãƒ ã®åŠ¹æžœç¯„囲
  #--------------------------------------------------------------------------
  alias set_target_battlers_KGC_DelaySkill set_target_battlers
  def set_target_battlers(scope)
    set_target_battlers_KGC_DelaySkill(scope)

    # 対象å´ãƒãƒˆãƒ©ãƒ¼ã‚’ä¿å­˜
    @target_battlers2 = []
    for i in 0...@target_battlers.size
      @target_battlers2[i] = @target_battlers[i].dup
    end
  end
  #--------------------------------------------------------------------------
  # ◠フレーム更新 (メインフェーズ)
  #--------------------------------------------------------------------------
  alias update_phase4_KGC_DelaySkill update_phase4
  def update_phase4
    if @phase4_step == 6
      check_delay_skill
    end

    update_phase4_KGC_DelaySkill
  end
  #--------------------------------------------------------------------------
  # â—‹ é…延スキル発動判定
  #--------------------------------------------------------------------------
  def check_delay_skill
    # 対象(行動者)ãŒæˆ¦é—˜ä¸èƒ½ã®å ´åˆã¯é…延スキルを解除
    if @active_battler.dead?
      @active_battler.delay_skills = []
      return
    end

    for i in 0...@active_battler.delay_skills.size
      # ã¾ã ç™ºå‹•ã—ãªã„å ´åˆã¯æ¬¡ã¸
      next if @active_battler.delay_skills[i].turn_count > 0

      skill = $data_skills[@active_battler.delay_skills[i].skill_id]
      # スキルを発動
      @active_battler.skill_effect(@active_battler.delay_skills[i].user, skill)
      @help_window.set_text(skill.name, 1)
      @animation2_id = skill.animation2_id
      @common_event_id = skill.common_event_id
      @target_battlers = [@active_battler]

      # 発動ã—ãŸé…延スキルを削除ã—ã€ã‚¹ãƒ†ãƒƒãƒ— 4 ã«ç§»è¡Œ
      @active_battler.delay_skills.delete_at(i)
      @phase4_step = 4
      break
    end
  end
end

 

 

 

Share this post


Link to post
Share on other sites

Ummm.. Thanks for the Sript . Im sorry for this question but : " How can I make a skill to be delayed? "
I can't figure it out how to make it . 
Thanks again in advance!

Share this post


Link to post
Share on other sites

check this page out, if you're still confused after reading this then I'll see what I can do.

http://ytomy.sakura.ne.jp/tkool/rpgtech/php/tech.php?tool=XP&cat=tech_xp/skill&tech=delay_skill

 

It's in japanese so you're going to have to translate it. I'm using google chrome to translate the page.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...