Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if true # << Make true to use this script, false to disable.
- #===============================================================================
- #
- # ☆ $D13x - Actor Control
- # -- Author : Dekita
- # -- Version : 1.2
- # -- Level : Easy / Normal
- # -- Requires : N/A
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:Actor_Effz]=true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # 17/o3/2o14 - Ported Script to $D13x Engine,
- # o7/o2/2o13 - changed import method,
- # 13/o2/2o13 - Started, Finished,
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # This script allows you to trigger various things at times that are usually
- # outwith a developers control, you can trigger various effects such as ...
- # control game switches, control game variables, trigger common events,
- # change party gold and whatever else you can code, with minimal effort.
- #
- # Examples of why you may want to do this;
- #
- # An actor dies and increases a certain variable...
- # An actor escapes but it costs 50 gold...
- # An actor learns a skill and it triggers a common event, if skill is id X...
- # An actor reaches level 25 so you want to reward them with extra gold...
- # An actor changes class and it controls a custom effect you coded..
- # - This effect could be *almost* any other script call from other scripts
- # - Note ~ *almost*
- # - Note 2 ~ Some script calls would not be wise to use with this script
- # ~ Use common sense..
- #
- # BiG NOTE :
- # ALL of the default settings control variables.
- # you would probably want to change this, i only done it this way to show
- # how the effects should be set up.
- # Consult the $D13x CORE Script for the effects and block codes
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
- #===============================================================================
- # 1. You MUST give credit to "Dekita" !!
- # 2. You are NOT allowed to repost this script.(or modified versions)
- # 3. You are NOT allowed to convert this script.
- # 4. You are NOT allowed to use this script for Commercial games.
- # 5. ENJOY!
- #
- # "FINE PRINT"
- # By using this script you hereby agree to the above terms and conditions,
- # if any violation of the above terms occurs "legal action" may be taken.
- # Not understanding the above terms and conditions does NOT mean that
- # they do not apply to you.
- # If you wish to discuss the terms and conditions in further detail you can
- # contact me at http://dekitarpg.wordpress.com/
- #
- #===============================================================================
- # ☆ Instructions
- #-------------------------------------------------------------------------------
- # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
- #
- #===============================================================================
- module Actor_Effects
- #===============================================================================
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- def self.trigger(block,actor_id,state_id,level,class_id,skill_id)
- return if block == nil ; effect = nil ; case block[0]# DONT DELETE
- # Note, arguements are only passed if they are available at the time of
- # being triggered.
- # state_id is only passed when a state is added/removed
- # skill_id is only passed when a skill is learned/forgot
- # all other args* are passed regardless(as they are variables/methods too).
- # you can simply make effect = nil to have no effect
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # This is where you adjust the effects that happen when states are added
- # and removed.
- #---------------------------------------------------------------------------
- when :state
- case block[1]
- when :add
- effect = [:variable, 1, :add, 1] if actor_id == 1 && state_id == 5
- effect = [:variable, 2, :add, 1] if actor_id == 2
- effect = [:variable, 3, :add, 1] if actor_id == 3
- effect = [:variable, 4, :add, 1] if actor_id == 4
- when :rem
- effect = [:variable, 5, :add, 1] if actor_id == 1
- effect = [:variable, 6, :add, 1] if actor_id == 2
- effect = [:variable, 7, :add, 1] if actor_id == 3
- effect = [:variable, 8, :add, 1] if actor_id == 4
- end
- #---------------------------------------------------------------------------
- # This is where you adjust the effects that happen when an actor dies
- #---------------------------------------------------------------------------
- when :die
- effect = [:variable, 9 , :add, 1] if actor_id == 1
- effect = [:variable, 10, :add, 1] if actor_id == 2
- effect = [:variable, 11, :add, 1] if actor_id == 3
- effect = [:variable, 12, :add, 1] if actor_id == 4
- #---------------------------------------------------------------------------
- # This is where you adjust the effects that happen when an actor is revived
- #---------------------------------------------------------------------------
- when :revive
- effect = [:variable, 13, :add, 1] if actor_id == 1
- effect = [:variable, 14, :add, 1] if actor_id == 2
- effect = [:variable, 15, :add, 1] if actor_id == 3
- effect = [:variable, 16, :add, 1] if actor_id == 4
- #---------------------------------------------------------------------------
- # This is where you adjust the effects that happen when an actor escapes
- #---------------------------------------------------------------------------
- when :escape
- effect = [:variable, 17, :add, 1] if actor_id == 1
- effect = [:variable, 18, :add, 1] if actor_id == 2
- effect = [:variable, 19, :add, 1] if actor_id == 3
- effect = [:variable, 20, :add, 1] if actor_id == 4
- #---------------------------------------------------------------------------
- # This is where you adjust the effects that happen when an actor levels
- # up and down .
- #---------------------------------------------------------------------------
- when :level
- case block[1]
- when :up
- effect = [:variable, 21, :add, 1] if actor_id == 1
- effect = [:variable, 22, :add, 1] if actor_id == 2
- effect = [:variable, 23, :add, 1] if actor_id == 3
- effect = [:variable, 24, :add, 1] if actor_id == 4
- when :down
- # by removing this code it will make effect = nil
- end
- #---------------------------------------------------------------------------
- # This is where you adjust the effects that happen when an actor learns
- # and forgets skills
- #---------------------------------------------------------------------------
- when :skill
- case block[1]
- when :learn
- effect = [:variable, 29, :add, 1] if actor_id == 1
- effect = [:variable, 30, :add, 1] if actor_id == 2
- effect = [:variable, 31, :add, 1] if actor_id == 3
- effect = [:variable, 32, :add, 1] if actor_id == 4
- when :forget
- effect = [:variable, 33, :add, 1] if actor_id == 1
- effect = [:variable, 34, :add, 1] if actor_id == 2
- effect = [:variable, 35, :add, 1] if actor_id == 3
- effect = [:variable, 36, :add, 1] if actor_id == 4
- end
- #---------------------------------------------------------------------------
- # This is where you adjust the effects that happen when an actor changes
- # to a new class
- #---------------------------------------------------------------------------
- when :change_class
- # by removing this code it will make effect = nil
- #---------------------------------------------------------------------------
- # If you want to make custom effects you can do so in the Effect Blocks
- # script, if you have sufficient coding knowladge..
- end #-----------------------------------------------------------------------
- #---------------------------------------------------------------------------
- # This is where the script triggers the effect you defined
- # (unless effect = nil), you can use this to your advantage if you want
- # to use advanced coding.
- #---------------------------------------------------------------------------
- Effect_Blocks.trigger(effect)
- end #####################
- # CUSTOMISATION END #
- end # end module #####################
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- # #
- # http://dekitarpg.wordpress.com/ #
- # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- #===============================================================================#
- # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
- # YES?\.\. #
- # OMG, REALLY? \| #
- # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
- # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
- #===============================================================================#
- class Game_Battler < Game_BattlerBase
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- alias :ans_eff_block_GB :add_new_state
- alias :rms_eff_block_GB :remove_state
- alias :die_eff_block_GB :die
- alias :rev_eff_block_GB :revive
- alias :esc_eff_block_GB :escape
- alias :addbuff_eff_block_GB :add_buff
- alias :add_dbuff_eff_block_GB :add_debuff
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def add_new_state(state_id)
- ans_eff_block_GB(state_id)
- ans_effect(state_id)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def remove_state(state_id)
- rms_eff_block_GB(state_id)
- rems_effect(state_id) if state?(state_id)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def die
- die_eff_block_GB
- die_effect
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def revive
- rev_eff_block_GB
- revi_effect
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def escape
- esc_eff_block_GB
- escap_effect
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def ans_effect(state_id)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def rems_effect(state_id)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def die_effect
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def revi_effect
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def escap_effect
- end
- end
- #==============================================================================
- class Game_Actor < Game_Battler
- #==============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- alias :lvup_eff_block_GA :level_up
- alias :lvdown_eff_block_GA :level_down
- alias :lskill_eff_block_GA :learn_skill
- alias :fskil_eff_block_GA :forget_skill
- alias :cclas_eff_block_GA :change_class
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def level_up
- lvup_eff_block_GA
- lv_up_e_bllock
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def level_down
- lvdown_eff_block_GA
- lv_down_e_bllock
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def learn_skill(skill_id)
- lskill_eff_block_GA(skill_id)
- unless skill_learn?($data_skills[skill_id])
- learn_skilll_e_bllock(skill_id)
- end
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def forget_skill(skill_id)
- fskil_eff_block_GA(skill_id)
- forget_skilll_e_bllock(skill_id)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def change_class(class_id, keep_exp = false)
- cclas_eff_block_GA(class_id, keep_exp)
- change_class_e_bllock
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def ans_effect(state_id)
- eff = [:state, :add]
- Actor_Effects.trigger(eff, id, state_id, @level, @class_id, nil)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def rems_effect(state_id)
- eff = [:state, :rem]
- Actor_Effects.trigger(eff, id, state_id, @level, @class_id, nil)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def die_effect
- eff = [:die]
- Actor_Effects.trigger(eff, id, nil, @level, @class_id, nil)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def revi_effect
- eff = [:revive]
- Actor_Effects.trigger(eff, id, nil, @level, @class_id, nil)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def escap_effect
- eff = [:escape]
- Actor_Effects.trigger(eff, id, nil, @level, @class_id, nil)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def lv_up_e_bllock
- eff = [:level, :up]
- Actor_Effects.trigger(eff, id, nil, @level, @class_id, nil)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def lv_down_e_bllock
- eff = [:level, :down]
- Actor_Effects.trigger(eff, id, nil, @level, @class_id, nil)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def learn_skilll_e_bllock(skill_id)
- eff = [:skill, :learn]
- Actor_Effects.trigger(eff, id, nil, @level, @class_id, skill_id)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def forget_skilll_e_bllock(skill_id)
- eff = [:skill, :forget]
- Actor_Effects.trigger(eff, id, nil, @level, @class_id, skill_id)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def change_class_e_bllock
- eff = [:change_class]
- Actor_Effects.trigger(eff, id, nil, @level, @class_id, skill_id)
- end
- end
- #==============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #==============================================================================#
- end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement