Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin =========================================================================
- Dekita's v1.0
- ★ Enémy Natures™ ★
- ================================================================================
- Script Information:
- ====================
- This script replicates the natures / iv / levels feature from pokemon,
- e.g each pokemon, (in this case ENEMY) is given a random nature, iv value and
- level upon encounter, That enemies stats are then determined by that.
- Use map notetags toset enemy levels and use script calls to make fixed encounters
- e.g set nature iv and lvl.
- NOTE: This works 100% like pokemon.
- BIG_NOTE: This scrip requires My Pokemon Natures (actors) 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
- 16/11/2o12 - 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.
- =end #==========================================================================#
- module Dekita__Pokemon_Enemies
- # NOTETAGS :
- # <lv: min, max>
- # these go in map noteboxes, replace min with the maps minimum map level max with the max
- # SCRIPT CALLS :
- # fix_lv_battle(val)
- # fix_nature_battle(val)
- # fix_iv_battle(mhp, mmp, atk, def, mat, mdf, agi, luk)
- # val = an integer
- # replace mhp, mmp, atk, def, mat, mdf, agi and luk with values between 0 - 31
- # and this will change that enemies iv values to whatever you set.
- # REMEMBER iv values are different from the acctual param value, but they do
- # affect param values
- # The maximum level for enemies
- Max_Level = 99
- # as enemy levels are based on maps and during battle test there is no map id,
- # you have to set the min and max level for enemies in test battles here.
- BattleTest_Level = [5, 10] # [min, max]
- Gold_Inc = 0.10 # 0.10 % more gold each enemy level
- end
- $imported = {} if $imported.nil?
- $imported[:Dekita_Pokémon_Enemies] = true
- #################################################################################
- #################################################################################
- # As team rocket where once again "blasting off" Ash, Brock and Misty slowly #
- # lifted their bodies from the ground, turning, gasping at the horror they could#
- # see before them... #
- #################################################################################
- #################### !! DONT MODIFY SHIT AFTER HERE !! ##########################
- #################################################################################
- class RPG::Map
- #===============================================================================#
- attr_accessor :map_level_range
- def load_enemy_levels
- @map_level_range = [1, Dekita__Pokemon_Enemies::Max_Level]
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<lv: (.*), (.*)>/i
- @map_level_range = [$1.to_i, $2.to_i]
- #---
- end
- } # self.note.split
- end
- end
- #===============================================================================#
- class Game_Map
- #===============================================================================#
- attr_reader :level_range_min
- attr_reader :level_range_max
- alias enemylevelsmapsetup setup
- def setup(map_id)
- enemylevelsmapsetup(map_id)
- @map.load_enemy_levels
- @level_range_min = @map.map_level_range[0]
- @level_range_max = @map.map_level_range[1]
- end
- end
- #===============================================================================#
- class Game_Temp
- #===============================================================================#
- attr_accessor :fixed_level_battle
- attr_accessor :fixed_nature_battle
- attr_accessor :fixed_iv_battle
- alias pokenemylvsgtinit initialize
- def initialize
- pokenemylvsgtinit
- init_fixed_enemies_info
- end
- def init_fixed_enemies_info
- @fixed_level_battle = [false, 0]
- @fixed_nature_battle = [false, 0]
- @fixed_iv_battle = [false, 0, 0, 0, 0, 0, 0, 0, 0]
- end
- def clear_fixed_level_data
- @fixed_level_battle = [false, 0]
- end
- def clear_fixed_nature_data
- @fixed_nature_battle = [false, 0]
- end
- def clear_fixed_iv_data
- @fixed_iv_battle = [false, 0, 0, 0, 0, 0, 0, 0, 0]
- end
- end # Game_Temp
- #===============================================================================#
- class Game_Enemy < Game_Battler
- #===============================================================================#
- attr_accessor :level
- attr_accessor :nature
- attr_accessor :init_ivs
- alias init_for_enemy_levels initialize
- def initialize(index, enemy_id)
- setup_enemies_pokestylee
- init_for_enemy_levels(index, enemy_id)
- end
- def setup_enemies_pokestylee
- dekita_natures_for_enemies_agogo
- get_enemy_level
- end
- def dekita_natures_for_enemies_agogo
- return if !$imported[:Dekita_Pokémon_Natures]
- @init_ivs = [0] * 8
- @nature = get_rand_nature
- get_init_ivs
- end
- def get_enemy_level
- if $game_temp.fixed_level_battle[0] == true
- @level = $game_temp.fixed_level_battle[1]
- $game_temp.clear_fixed_level_data
- elsif $BTEST
- min = Dekita__Pokemon_Enemies::BattleTest_Level[0]
- max = Dekita__Pokemon_Enemies::BattleTest_Level[1]
- @level = (min+rand(max-min+1))
- else
- @level = ($game_map.level_range_min + rand($game_map.level_range_max - $game_map.level_range_min+1))
- end
- @level = [[@level, Dekita__Pokemon_Enemies::Max_Level].min, 1].max
- end
- def get_init_ivs
- return get_fixed_ivs if $game_temp.fixed_iv_battle[0]
- p "Got enemies iv's RAND"
- 8.times {|i| @init_ivs[i] = (rand(Dekita__Pokémon_Nature::Max_IV_Amount+1))}
- end
- def get_fixed_ivs
- p "Got enemies iv's FIXED"
- fixed_val = $game_temp.fixed_iv_battle
- 8.times {|i| @init_ivs[i] = fixed_val[i+1]}
- $game_temp.clear_fixed_iv_data
- end
- def get_rand_nature
- t1_ = $game_temp.fixed_nature_battle[0]
- dnar = (Dekita__Pokémon_Nature::Nature.size)
- val = rand(dnar)
- if t1_
- val = $game_temp.fixed_nature_battle[1]
- $game_temp.clear_fixed_nature_data
- return Dekita__Pokémon_Nature::Nature[val]
- end
- return Dekita__Pokémon_Nature::Nature[val]
- end
- alias enemiesparbase param_base
- def param_base(param_id)
- if $imported[:Dekita_Pokémon_Natures]
- par_id = param_id
- case par_id
- when 0, 1 # NOTE : if you change these calculations your a fucking moron ! ijs...
- return ( (((@init_ivs[par_id]+2*enemy.params[par_id]+(0/4))*@level/100)+10+@level)*@nature[par_id+1]).to_i
- when 2, 3, 4, 5, 6, 7
- return ( (((@init_ivs[par_id]+2*enemy.params[par_id]+(0/4))*@level/100)+5)*@nature[par_id+1]).to_i
- end
- else
- enemiesparbase(param_id)
- end
- end
- alias pokgold gold
- def gold
- @level.times(pokgold * Dekita__Pokemon_Enemies::Gold_Inc)
- end
- end # Game_Enemy < Game_Battler
- #==============================================================================
- class Game_Interpreter
- #==============================================================================
- def fix_lv_battle(val)
- $game_temp.fixed_level_battle[0] = true
- $game_temp.fixed_level_battle[1] = val
- end
- def fix_nature_battle(val)
- $game_temp.fixed_nature_battle[0] = true
- $game_temp.fixed_nature_battle[1] = val
- end
- def fix_iv_battle(val_1,val_2,val_3,val_4,val_5,val_6,val_7,val_8)
- $game_temp.fixed_iv_battle[0] = true
- $game_temp.fixed_iv_battle[1] = val_1
- $game_temp.fixed_iv_battle[2] = val_2
- $game_temp.fixed_iv_battle[3] = val_3
- $game_temp.fixed_iv_battle[4] = val_4
- $game_temp.fixed_iv_battle[5] = val_5
- $game_temp.fixed_iv_battle[6] = val_6
- $game_temp.fixed_iv_battle[7] = val_7
- $game_temp.fixed_iv_battle[8] = val_8
- end
- end # Game_Interpreter
- #===============================================================================#
- # - SCRIPT END - #
- #===============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #===============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement