# ** Ryex's Weapons Unleash Skills V 1.22 M #----------------------------------------------------------------------------- # สคริปต์เขียนโดย : Ryex # ลิงค์ต้นฉบับ : http://rmrk.net/index.php?topic=35252.0 #----------------------------------------------------------------------------- # *แก้บัค ตรงถ้าไม่ใส่อาวุธ จนเข้าฉากสู้แล้วโจนตีจะ Error (เครดิต Irrlicht) # *แก้บัค ขณะเลือกโจมตี แล้วกดยกเลิก ไปเลือกคำสั่งสกิลหรือใช้ไอเทมเสร็จ ยังเกิดการใช้สกิลนั้นอยู่ (เครดิต hengmana) #----------------------------------------------------------------------------- # Features # * Allows Weapons to have a chance to "Unleash" skills from the database # * Customizable unleash rates / chance to unleash for every weapon #----------------------------------------------------------------------------- # Instructions # Place in a new script above main then fill out the Configuration. #============================================================================== module RPG class Weapon def unleash_id(id) case id #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # START Configuration for the skills weapons unleash # Use when then return #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: when 1 then return 7 when 5 then return 10 when 25 then return 19 when 29 then return 22 #add new lines here #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # END Configuration #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: end return 0 end def unleash_chance(id) case id #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # START Configuration for unleash chance. # this must be filled out other wise weapons will NEVER unleash # Use when then return <% chance of unleash (a # 0 - 100)> #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: when 1 then return 100 when 5 then return 50 when 25 then return 25 when 29 then return 75 #add new lines here #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # END Configuration #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: end return false end end end class Game_BattleAction attr_accessor :unleash alias ryex_WUS_GBattleAction_clear_later clear def clear @unleash = false ryex_WUS_GBattleAction_clear_later end end class Scene_Battle alias ryex_WUS_SBattle_update_phase4_step2_later update_phase3_enemy_select def update_phase3_enemy_select if @active_battler.is_a?(Game_Actor) if @active_battler.current_action.basic == 0 && @actor_command_window.index == 0 unless $data_weapons[@active_battler.weapon_id].nil? or $data_weapons[@active_battler.weapon_id].unleash_chance(@active_battler.weapon_id) == false if rand(100.0) <= ($data_weapons[@active_battler.weapon_id].unleash_chance(@active_battler.weapon_id)) @active_battler.current_action.kind = 1 @active_battler.current_action.skill_id = $data_weapons[@active_battler.weapon_id].unleash_id(@active_battler.weapon_id) @active_battler.current_action.unleash = true else @active_battler.current_action.unleash = false end else @active_battler.current_action.unleash = false end end end ryex_WUS_SBattle_update_phase4_step2_later end alias ryex_WUS_SBattle_make_skill_action_result_later make_skill_action_result def make_skill_action_result if @active_battler.current_action.unleash == true # Get skill @skill = $data_skills[@active_battler.current_action.skill_id] @active_battler.current_action.unleash = false @status_window.refresh # Show skill name on help window @help_window.set_text(@active_battler.name+"'s Weapon Unleashes "+@skill.name, 1) # Set animation ID @animation1_id = @skill.animation1_id @animation2_id = @skill.animation2_id # Set command event ID @common_event_id = @skill.common_event_id # Set target battlers set_target_battlers(@skill.scope) # Apply skill effect for target in @target_battlers target.skill_effect(@active_battler, @skill) end else ryex_WUS_SBattle_make_skill_action_result_later end @active_battler.current_action.unleash = false end end