Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin =========================================================================
- Dekita's v1.0
- ★ Random Parameter Gains™ ★
- ================================================================================
- Script Information:
- ====================
- This script simply randomizes actors parameter gains on level up.
- use notetags to set an actor's/class's individual parameter gains.
- use script calls to change them during gameplay.
- set the default gains in the customisation.
- You can also set enemies to have random params(params change each encounter).
- plug and play ^_^
- if anyone doesnt know what a "param" is... "shakes head in disapproval"
- ================================================================================
- ★☆★☆★☆★☆★☆★☆★☆★ 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
- 22/10/2o12 - started and finished,
- ================================================================================
- Credit and Thanks to :
- =======================
- ================================================================================
- Known Bugs:
- ============
- N/A
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- If a new bug is found please contact me at
- http://dekitarpg.wordpress.com/
- ================================================================================
- INSTRUCTIONS:
- ==============
- Place this script UNDER "▼ Materials" and ABOVE "▼ Main" in your script editor.
- ================================================================================
- Script Calls:
- ==============
- change_rpg(actor_id, par_id, gain, min, max)
- actor_id = the id of the actor
- par_id = the id of the parameter you want to change
- gain = the guaranteed gain (before min and max values)
- min = the minimum extra value gained
- max = the maximum extra value gained
- no_rpg_gains(actor_id, bool)
- use this script call to stop/start random param gains
- bool = true / false
- true = use random gains
- false= DONT use random gains
- ================================================================================
- NoteTags:
- ==========
- <rpg: par_id, gain, min, max>
- <rpg: par_id, min, max> <- THIS ONE IS FOR ENEMIES ONLY !
- par_id = the id of the parameter you want to change
- gain = the guaranteed gain (before min and max values)
- min = the minimum extra value gained
- max = the maximum extra value gained
- e.g
- <rpg: 0, 100, -50, 50>
- this will make param_id 0 gain 100 each level with a random loss of 50
- and a random gain of 50
- <no rand gains>
- use this notetag to make an actor/class not have random gains (they will gain
- params equal to their class settings in the database)
- =end #==========================================================================#
- module Dekita__R_P_G
- # Gain = The guaranteed gain before min and max values.
- # Min = the minimum extra gain(can be negative).
- # Max = the maximum extra gain.
- # Param_id = 0.
- HP_Gain = 100
- HP_Min = -50
- HP_Max = 50
- # Param_id = 1.
- MP_Gain = 100
- MP_Min = -50
- MP_Max = 50
- # Param_id = 2.
- ATK_Gain = 10
- ATK_Min = -5
- ATK_Max = 5
- # Param_id = 3.
- DEF_Gain = 10
- DEF_Min = -5
- DEF_Max = 5
- # Param_id = 4.
- MAT_Gain = 10
- MAT_Min = -5
- MAT_Max = 5
- # Param_id = 5.
- MDF_Gain = 10
- MDF_Min = -5
- MDF_Max = 5
- # Param_id = 6.
- AGI_Gain = 10
- AGI_Min = -5
- AGI_Max = 5
- # Param_id = 7.
- LUK_Gain = 10
- LUK_Min = -5
- LUK_Max = 5
- #####################
- # CUSTOMISATION END #
- # # Do not remove this. #####################
- p 'Loaded : DPBz - Random Parameter Gains (RPG)'
- ACT_CLA_Note = /<rpg: (.*), (.*), (.*), (.*)>/i
- No_Rand_Note = /<no rand gains>/i
- ENEMY___Note = /<rpg: (.*), (.*), (.*)>/i
- end # Dekita__R_P_G
- #===============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #===============================================================================#
- # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
- # YES?\.\. #
- # OMG, REALLY? #
- # WELL SLAP MY FACE AND CALL ME A DRAGON.\..\.. #
- # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
- #===============================================================================#
- # - SCRIPT BEGIN - #
- #==============================================================================
- class Object
- #==============================================================================
- if !$imported[:Dekita__CORE]
- def dpbz_randy(min, max)
- min + rand(max - min + 1)
- end
- end #imported[:Dekita__CORE]
- end # class Object
- #==============================================================================
- module DataManager
- #==============================================================================
- class <<self; alias load_database_DPBz_Rand_PAR_ga1n load_database; end
- def self.load_database
- load_database_DPBz_Rand_PAR_ga1n
- load_notetags_DPBz_Rand_PAR_ga1n
- end
- def self.load_notetags_DPBz_Rand_PAR_ga1n
- groups = [$data_actors, $data_classes, $data_enemies]
- for group in groups
- for obj in group
- next if obj.nil?
- obj.load_notetags_DPBz_Rand_PAR_ga1n
- end
- end
- end
- end # DataManager
- #==============================================================================
- class RPG::Actor < RPG::BaseItem
- #==============================================================================
- attr_accessor :rand_par
- attr_accessor :use_dpbz_rpg_feat
- def load_notetags_DPBz_Rand_PAR_ga1n
- @use_dpbz_rpg_feat = true
- @rand_par = []
- @rand_par[0] = [Dekita__R_P_G::HP_Gain, Dekita__R_P_G::HP_Min, Dekita__R_P_G::HP_Max]
- @rand_par[1] = [Dekita__R_P_G::MP_Gain, Dekita__R_P_G::MP_Min, Dekita__R_P_G::MP_Max]
- @rand_par[2] = [Dekita__R_P_G::ATK_Gain, Dekita__R_P_G::ATK_Min, Dekita__R_P_G::ATK_Max]
- @rand_par[3] = [Dekita__R_P_G::DEF_Gain, Dekita__R_P_G::DEF_Min, Dekita__R_P_G::DEF_Max]
- @rand_par[4] = [Dekita__R_P_G::MAT_Gain, Dekita__R_P_G::MAT_Min, Dekita__R_P_G::MAT_Max]
- @rand_par[5] = [Dekita__R_P_G::MDF_Gain, Dekita__R_P_G::MDF_Min, Dekita__R_P_G::MDF_Max]
- @rand_par[6] = [Dekita__R_P_G::AGI_Gain, Dekita__R_P_G::AGI_Min, Dekita__R_P_G::AGI_Max]
- @rand_par[7] = [Dekita__R_P_G::LUK_Gain, Dekita__R_P_G::LUK_Min, Dekita__R_P_G::LUK_Max]
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when Dekita__R_P_G::ACT_CLA_Note
- @rand_par[$1.to_i] = [$2.to_i, $3.to_i, $4.to_i]
- p "Reading : DPBz - RPG notes for #{name}, par_id #{$1.to_s}, gain #{$2.to_s}, min #{$3.to_s}, max #{$4.to_s}"
- when Dekita__R_P_G::No_Rand_Note
- @use_dpbz_rpg_feat = false
- p "Reading : DPBz - RPG notes No Rand Gains for #{name}"
- end
- } # self.note.split
- end
- end # RPG::Actor < RPG::BaseItem
- #==============================================================================
- class RPG::Class < RPG::BaseItem
- #==============================================================================
- attr_accessor :rand_par
- attr_accessor :use_dpbz_rpg_feat
- def load_notetags_DPBz_Rand_PAR_ga1n
- @use_dpbz_rpg_feat = true
- @rand_par = []
- @rand_par[0] = [Dekita__R_P_G::HP_Gain, Dekita__R_P_G::HP_Min, Dekita__R_P_G::HP_Max]
- @rand_par[1] = [Dekita__R_P_G::MP_Gain, Dekita__R_P_G::MP_Min, Dekita__R_P_G::MP_Max]
- @rand_par[2] = [Dekita__R_P_G::ATK_Gain, Dekita__R_P_G::ATK_Min, Dekita__R_P_G::ATK_Max]
- @rand_par[3] = [Dekita__R_P_G::DEF_Gain, Dekita__R_P_G::DEF_Min, Dekita__R_P_G::DEF_Max]
- @rand_par[4] = [Dekita__R_P_G::MAT_Gain, Dekita__R_P_G::MAT_Min, Dekita__R_P_G::MAT_Max]
- @rand_par[5] = [Dekita__R_P_G::MDF_Gain, Dekita__R_P_G::MDF_Min, Dekita__R_P_G::MDF_Max]
- @rand_par[6] = [Dekita__R_P_G::AGI_Gain, Dekita__R_P_G::AGI_Min, Dekita__R_P_G::AGI_Max]
- @rand_par[7] = [Dekita__R_P_G::LUK_Gain, Dekita__R_P_G::LUK_Min, Dekita__R_P_G::LUK_Max]
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when Dekita__R_P_G::ACT_CLA_Note
- @rand_par[$1.to_i] = [$2.to_i, $3.to_i, $4.to_i]
- p "Reading : DPBz - RPG notes for #{name}, par_id #{$1.to_s}, gain #{$2.to_s}, min #{$3.to_s}, max #{$4.to_s}"
- when Dekita__R_P_G::No_Rand_Note
- @use_dpbz_rpg_feat = false
- p "Reading : DPBz - RPG notes No Rand Gains for #{name}"
- end
- } # self.note.split
- end
- end # RPG::Class < RPG::BaseItem
- #==============================================================================
- class RPG::Enemy < RPG::BaseItem
- #==============================================================================
- def load_notetags_DPBz_Rand_PAR_ga1n
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when Dekita__R_P_G::ENEMY___Note
- @params[$1.to_i] = dpbz_randy($2.to_i, $3.to_i)
- p "Reading : DPBz - RPG notes for #{name}, par_id #{$1.to_s}, min #{$3.to_s}, max #{$4.to_s}"
- end
- } # self.note.split
- end
- end # RPG::Enemy < RPG::BaseItem
- #==============================================================================
- class Game_Actor < Game_Battler
- #==============================================================================
- alias _Rand_PAR_ga1n_setup setup
- def setup(actor_id)
- _Rand_PAR_ga1n_setup(actor_id)
- @rand_par = $data_classes[@class_id].rand_par
- @rand_par = actor.rand_par if actor.note =~ Dekita__R_P_G::ACT_CLA_Note
- @use_dpbz_rpg_feat = $data_classes[@class_id].use_dpbz_rpg_feat
- @use_dpbz_rpg_feat = actor.use_dpbz_rpg_feat if actor.note =~ Dekita__R_P_G::No_Rand_Note
- end
- alias myrandalisnameforthisscriptlol param_base
- def param_base(param_id)
- return self.class.params[param_id, actor.initial_level] if @use_dpbz_rpg_feat
- return myrandalisnameforthisscriptlol(param_id)
- end
- alias _DPBz_Rand_PAR_ga1n__level_up level_up
- def level_up
- _DPBz_Rand_PAR_ga1n__level_up
- _WHAT_THE_FUNK? if @use_dpbz_rpg_feat
- end
- def _WHAT_THE_FUNK?
- add_param(0, @rand_par[0][0] + dpbz_randy(@rand_par[0][1], @rand_par[0][2]))
- add_param(1, @rand_par[1][0] + dpbz_randy(@rand_par[1][1], @rand_par[1][2]))
- add_param(2, @rand_par[2][0] + dpbz_randy(@rand_par[2][1], @rand_par[2][2]))
- add_param(3, @rand_par[3][0] + dpbz_randy(@rand_par[3][1], @rand_par[3][2]))
- add_param(4, @rand_par[4][0] + dpbz_randy(@rand_par[4][1], @rand_par[4][2]))
- add_param(5, @rand_par[5][0] + dpbz_randy(@rand_par[5][1], @rand_par[5][2]))
- add_param(6, @rand_par[6][0] + dpbz_randy(@rand_par[6][1], @rand_par[6][2]))
- add_param(7, @rand_par[7][0] + dpbz_randy(@rand_par[7][1], @rand_par[7][2]))
- end
- def _CHANGE_THE_FUNK?(par_id, gain, min, max)
- @rand_par[par_id] = [gain, min, max]
- end
- def stop_go_rand_gain(actor_id, boolean)
- @use_dpbz_rpg_feat = boolean
- end
- end # Game_Actor
- #==============================================================================
- class Game_Interpreter
- #==============================================================================
- def change_rpg(actor_id, par_id, gain, min, max)
- actor = $game_actors[actor_id]
- return if actor == nil
- actor._CHANGE_THE_FUNK?(par_id, gain, min, max)
- end
- def no_rpg_gains(actor_id, boolean)
- actor = $game_actors[actor_id]
- return if actor == nil
- actor.stop_go_rand_gain(actor_id, boolean)
- end
- end # Game_Interpreter
- #===============================================================================#
- # - SCRIPT END - #
- #===============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #===============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement