Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin =========================================================================
- ┌───────────────┐ v 1.0
- │ Actor Effects™│
- │ By Dekita │
- └───────────────┘
- ================================================================================
- Script Information:
- ====================
- 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 my effect blocks script for the default effects and block codes
- BIGGER NOTE :
- This script requires my Effect Blocks Script !!
- ================================================================================
- ★☆★☆★☆★☆★☆★☆★☆★ 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.(into other game engines e.g RGSS2)
- 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/ or DekitaRPG@gmail.com
- ================================================================================
- History:
- =========
- D /M /Y
- 13/o2/2o13 - Started, Finished,
- ================================================================================
- INSTRUCTIONS:
- ==============
- Place this script UNDER "▼ Materials" and ABOVE "▼ Main" in your script editor.
- Place this script UNDER my "Effect Blocks" script.
- =end #=========================================================================#
- 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.\..\.. #
- #===============================================================================#
- $imported = {} if $imported.nil?
- $imported[:Effect_Blocks['Actor_Basics']] = true
- #==============================================================================
- class Game_Battler < Game_BattlerBase
- #==============================================================================
- #--------------------------------------------------------------------------
- # * Alias List
- #--------------------------------------------------------------------------
- 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
- #--------------------------------------------------------------------------
- # * Add New State
- #--------------------------------------------------------------------------
- def add_new_state(state_id)
- ans_eff_block_GB(state_id)
- ans_effect(state_id)
- end
- #--------------------------------------------------------------------------
- # * Remove State
- #--------------------------------------------------------------------------
- def remove_state(state_id)
- rms_eff_block_GB(state_id)
- rems_effect(state_id) if state?(state_id)
- end
- #--------------------------------------------------------------------------
- # * Knock Out
- #--------------------------------------------------------------------------
- def die
- die_eff_block_GB
- die_effect
- end
- #--------------------------------------------------------------------------
- # * Revive from Knock Out
- #--------------------------------------------------------------------------
- def revive
- rev_eff_block_GB
- revi_effect
- end
- #--------------------------------------------------------------------------
- # * Escape
- #--------------------------------------------------------------------------
- def escape
- esc_eff_block_GB
- escap_effect
- end
- #--------------------------------------------------------------------------
- # * New Methods created for use in child class, ie Game_Actor
- #--------------------------------------------------------------------------
- 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 List
- #--------------------------------------------------------------------------
- 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
- #--------------------------------------------------------------------------
- # * Level Up
- #--------------------------------------------------------------------------
- def level_up
- lvup_eff_block_GA
- lv_up_e_bllock
- end
- #--------------------------------------------------------------------------
- # * Level Down
- #--------------------------------------------------------------------------
- def level_down
- lvdown_eff_block_GA
- lv_down_e_bllock
- end
- #--------------------------------------------------------------------------
- # * Learn Skill
- #--------------------------------------------------------------------------
- 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
- #--------------------------------------------------------------------------
- # * Forget Skill
- #--------------------------------------------------------------------------
- def forget_skill(skill_id)
- fskil_eff_block_GA(skill_id)
- forget_skilll_e_bllock(skill_id)
- end
- #--------------------------------------------------------------------------
- # * Change Class
- # keep_exp: Keep EXP
- #--------------------------------------------------------------------------
- def change_class(class_id, keep_exp = false)
- cclas_eff_block_GA(class_id, keep_exp = false)
- change_class_e_bllock
- end
- #--------------------------------------------------------------------------
- # * Add New State Effect Block Trigger
- #--------------------------------------------------------------------------
- def ans_effect(state_id)
- eff = [:state, :add]
- Actor_Effects.trigger(eff, id, state_id, @level, @class_id, nil)
- end
- #--------------------------------------------------------------------------
- # * Remove State Effect Block Trigger
- #--------------------------------------------------------------------------
- def rems_effect(state_id)
- eff = [:state, :rem]
- Actor_Effects.trigger(eff, id, state_id, @level, @class_id, nil)
- end
- #--------------------------------------------------------------------------
- # * Knock Out Effect Block Trigger
- #--------------------------------------------------------------------------
- def die_effect
- eff = [:die]
- Actor_Effects.trigger(eff, id, nil, @level, @class_id, nil)
- end
- #--------------------------------------------------------------------------
- # * Revive from Knock Out Effect Block Trigger
- #--------------------------------------------------------------------------
- def revi_effect
- eff = [:revive]
- Actor_Effects.trigger(eff, id, nil, @level, @class_id, nil)
- end
- #--------------------------------------------------------------------------
- # * Escape Effect Block Trigger
- #--------------------------------------------------------------------------
- def escap_effect
- eff = [:escape]
- Actor_Effects.trigger(eff, id, nil, @level, @class_id, nil)
- end
- #--------------------------------------------------------------------------
- # * Level Up Effect Block Trigger
- #--------------------------------------------------------------------------
- def lv_up_e_bllock
- eff = [:level, :up]
- Actor_Effects.trigger(eff, id, nil, @level, @class_id, nil)
- end
- #--------------------------------------------------------------------------
- # * Level Down Effect Block Trigger
- #--------------------------------------------------------------------------
- def lv_down_e_bllock
- eff = [:level, :down]
- Actor_Effects.trigger(eff, id, nil, @level, @class_id, nil)
- end
- #--------------------------------------------------------------------------
- # * Learn Skill Effect Block Trigger
- #--------------------------------------------------------------------------
- def learn_skilll_e_bllock(skill_id)
- eff = [:skill, :learn]
- Actor_Effects.trigger(eff, id, nil, @level, @class_id, skill_id)
- end
- #--------------------------------------------------------------------------
- # * Learn Skill Effect Block Trigger
- #--------------------------------------------------------------------------
- def forget_skilll_e_bllock(skill_id)
- eff = [:skill, :forget]
- Actor_Effects.trigger(eff, id, nil, @level, @class_id, skill_id)
- end
- #--------------------------------------------------------------------------
- # * Change Class Effect Block Trigger
- #--------------------------------------------------------------------------
- def change_class_e_bllock
- eff = [:change_class]
- Actor_Effects.trigger(eff, id, nil, @level, @class_id, skill_id)
- end
- end
- #==============================================================================#
- # - SCRIPT END - #
- #==============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #==============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement