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 - Expert Exp Control
- # -- Author : Dekita
- # -- Version : 1.2
- # -- Level : Normal
- # -- Requires : N/A
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:Expert_Exp]=true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # 12/11/2o13 - Added Formula Requirement,
- # 11/11/2o13 - Fixed some typo's and bugs,
- # o4/11/2o13 - Finished,
- # 28/1o/2o13 - Started.
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # This script completely changes the way exp is handled in game.
- # You can now gain exp per battle, attack, guard, skill / item used, based on
- # FULLY customizable formulas.
- # Each item/skill can also give additional exp when used, again using formulas.
- #
- # The Party now has its own Exp Rate, default is 1.0. This can be changed via
- # script calls only. This gives the ability to reduce all party members exp
- # rates at once.
- #
- # The Map now also has its own unique Exp Rate, defalt is 1.0. This is set using
- # notetags, this provides the ability to have secret caves/areas that have a
- # boosted exp gain rate.
- #
- # You can also now have items or skills that when used, increase the actors
- # exp rate by [x] for [y] amount of battles.
- #
- # As well as the above features, you now have complete control over the
- # requirements for each level. you can either have a fixed value for [x] level,
- # an exp curve (without database limitations) or you can opt for a fully
- # customisable formula to determine the required exp.
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ 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.
- #
- #===============================================================================
- # ☆ Script Calls
- #-------------------------------------------------------------------------------
- # $game_party.add_exp_ratio(value)
- # $game_party.sub_exp_ratio(value)
- # $game_party.div_exp_ratio(value)
- # $game_party.mul_exp_ratio(value)
- # $game_party.mod_exp_ratio(value)
- # $game_party.add_exp_ratio(value, ref)
- # $game_party.sub_exp_ratio(value, ref)
- # $game_party.div_exp_ratio(value, ref)
- # $game_party.mul_exp_ratio(value, ref)
- # $game_party.mod_exp_ratio(value, ref)
- # value = value to modify party exp rate.
- # ref = refresh party ? default is true.
- #
- # -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
- # * The Following script calls are to modify the exp rate for [x] battles.
- #
- # $game_actors[ID].set_exp_battle_count(Value)
- # ID = Actor ID
- # Value = Exp Battles Effect Duration
- # $game_actors[ID].set_exp_battle_modifier(Value)
- # ID = Actor ID
- # Value = Exp Battles Rate Modifier
- #
- #===============================================================================
- # ☆ Notetags ( default )
- #-------------------------------------------------------------------------------
- # Class Notetags |
- # - - - - - - - -
- # <exp type: Type , ID >
- # Type :
- # 0 = Fixed Growth Type
- # 1 = Curve Growth Type
- # 2 = Formula Growth Type
- # ID = The ID of the fixed / curve growth data you wish to use.
- #
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- # <exp time: X, Y>
- # X = Frequency, 1 = 1 second
- # Y = Exp gain formula, ie '@level * 2'
- #
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- # <exp batt: X>
- # X = Exp gain for each battle. - (formula)
- #
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- # <exp datk: X>
- # X = Exp gain for each time default "Attack" is used. - (formula)
- #
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- # <exp guar: X>
- # X = Exp gain for each time default "Guard" is used. - (formula)
- #
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- # <exp skil: X>
- # X = Exp gain for each time any Skill is used. - (formula)
- #
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- # <exp item: X>
- # X = Exp gain for each time any Item is used. - (formula)
- #
- #-------------------------------------------------------------------------------
- # Skill/ Item Notetags |
- # - - - - - - - - - - -
- # <battle exp: X, Y>
- # X = the exp gain rate
- # Y = how many battles it lasts
- #
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- # <exp gain: X>
- # X = Exp Gained when this skill / item is used. - (formula)
- #
- #-------------------------------------------------------------------------------
- # Map Notetags |
- # - - - - - - -
- # <exp rate: X>
- # X = Map Exp Rate. Default = 1.0
- #
- #===============================================================================
- # ☆ HELP
- #-------------------------------------------------------------------------------
- #
- #===============================================================================
- module Expert_Exp
- #===============================================================================
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # Enemy Exp / Gold Mode :
- # :default
- # :pokemon # Requires $D13x Enemy Levels
- # :average # Requires $D13x Enemy Levels
- # :sD13x # Requires $D13x Enemy Levels + $D13x Attack & Defence Levels
- #-----------------------------------------------------------------------------
- Enemy_Exp_Mode = :sD13x #pokemon #default
- Enemy_Gold_Mode = :sD13x
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # ☆ General Settings :
- #-----------------------------------------------------------------------------
- Defaults={
- # [ type_id , setting_id ], make type nil to disable default
- :exp_req_type => [ 1 , 4 ],
- # [ Use? , Frequency , 'Formula']
- :over_time => [ true , 2 , '@level' ],
- # Default Exp gained Per Battle
- :each_battle => '@level * 5',
- # Default Exp Gained Each Attack
- :each_attack => '@level * 1.5',
- # Default Exp Gained Each Guard
- :each_guard => '@level * 1.5',
- # Default Exp Gained Each Skill
- :each_skill => '@level * 1.8',
- # Default Exp Gained Each Item
- :each_item => '@level * 2.0',
- # Default for when Skill / Items are Used
- :each__use => '@level * 1.2',
- }
- #-----------------------------------------------------------------------------
- # Show Level Up Info ?
- Show_Level_Up = false
- #-----------------------------------------------------------------------------
- # Notetag Defaults
- Exp_Notes ={
- # Classes
- :exp_req_type => /<exp type:(.*),(.*)>/i,
- :over_time => /<exp time:(.*),(.*)>/i,
- :each_battle => /<exp batt:(.*)>/i,
- :each_attack => /<exp datk:(.*)>/i,
- :each_guard => /<exp guar:(.*)>/i,
- :each_skill => /<exp skil:(.*)>/i,
- :each_item => /<exp item:(.*)>/i,
- # Skills / Items.
- :each__use => /<exp gain:(.*)>/i,
- :battles => /<battle exp:(.*),(.*)>/i,
- # Maps
- :map_exp => /<exp rate:(.*)>/i,
- } # << Keep
- #-----------------------------------------------------------------------------
- # Exp Over Time Settings
- # which party members will get exp over time (if they are meant to) ?
- # :battle_members then members = $game_party.battle_members
- # :all_members then members = $game_party.members
- # :only_leader then members = [$game_party.leader]
- Exp_OT_Dist = :battle_members
- # NOTE : Only alive actors will recieve exp over time, regardless of setting.
- #-----------------------------------------------------------------------------
- # Who gains exp per battle at battle end. Same options as above.
- Exp_Battle_Dist = :battle_members
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # ☆ Exp Requirement Settings ( FIXED )
- #-----------------------------------------------------------------------------
- # The below settings adjust the requirements for each level up, these values
- # are based on the PoKeMoN Game series for GameBoy and NDS.
- # You are free to add your own custom exp groups following the same format
- # as below.
- Exp_Req_Fixed ={
- #-----------------------------------------------------------------------------
- # The Fast Experience Group is one of the four experience groups introduced
- # in 1st Generation Pokemon games.
- # 800,000 experience points required for level 100.
- 0 => [ 0, 6, 21, 51, 100,
- 172, 274, 409, 583, 800, # 6 - 10
- 1064, 1382, 1757, 2195, 2700,
- 3276, 3930, 4665, 5487, 6400, # 16 - 20
- 7408, 8518, 9733, 11059, 12500,
- 14060, 15746, 17561, 19511, 21600, # 26 - 30
- 23832, 26214, 28749, 31443, 34300,
- 37324, 40522, 43897, 47455, 51200, # 36 - 40
- 55136, 59270, 63605, 68147, 72900,
- 77868, 83058, 88473, 94119, 100000,# 46 - 50
- 106120, 112486, 119101, 125971, 133100,
- 140492, 148154, 156089, 164303, 172800,# 56 - 60
- 181584, 190662, 200037, 209715, 219700,
- 229996, 240610, 251545, 262807, 274400,# 66 - 70
- 286328, 298598, 311213, 324179, 337500,
- 351180, 365226, 379641, 394431, 409600,# 76 - 80
- 425152, 441094, 457429, 474163, 491300,
- 508844, 526802, 545177, 563975, 583200,# 86 - 90
- 602856, 622950, 643485, 664467, 685900,
- 707788, 730138, 752953, 776239, 800000 # 96 - 100
- ],
- #-----------------------------------------------------------------------------
- # The Medium Fast Group, which was also introduced in Generation I.
- # This is by far the most average of the experience groups.
- # 1,000,000 experience points required for level 100.
- 1 => [ 0, 8, 27, 64, 125,
- 216, 343, 512, 729, 1000, # 6 - 10
- 1331, 1728, 2197, 2744, 3375,
- 4096, 4913, 5832, 6859, 8000, # 16 - 20
- 9261, 10648, 12167, 13824, 15625,
- 17579, 19683, 21952, 24389, 27000, # 26 - 30
- 29791, 32786, 35937, 39304, 42875,
- 46656, 50653, 54872, 59319, 64000, # 36 - 40
- 68921, 74088, 79507, 85184, 91125,
- 97336, 103823, 110592, 117649, 125000,# 46 - 50
- 132651, 140608, 148877, 157464, 166375,
- 175616, 185193, 195112, 205379, 216000,# 56 - 60
- 226981, 238328, 250047, 262144, 274625,
- 287496, 300763, 314432, 328509, 343000,# 66 - 70
- 357911, 373248, 389017, 405224, 421875,
- 438976, 456533, 474552, 493039, 512000,# 76 - 80
- 531441, 551368, 571787, 592704, 614125,
- 636056, 658503, 681472, 704969, 729000,# 86 - 90
- 753571, 778688, 804357, 830584, 857375,
- 884736, 912673, 941192, 970299, 1000000 # 96 - 100
- ],
- #-----------------------------------------------------------------------------
- # The Medium Slow Experience Group. The only experience group whose
- # level 100 experience is not evenly divisible by 10,000.
- # 1,059,860 experience points required for level 100.
- 2 => [ 0, 9, 57, 96, 135,
- 179, 236, 314, 419, 560, # 6 - 10
- 742, 973, 1261, 1612, 2035,
- 2535, 3120, 3798, 4575, 5460, # 16 - 20
- 6458, 7577, 8825, 10208, 11735,
- 13411, 15244, 17242, 19411, 21760, # 26 - 30
- 24294, 27021, 29949, 33084, 36435,
- 40007, 43808, 47846, 52127, 56660, # 36 - 40
- 61450, 66505, 71883, 77440, 83335,
- 89523, 96012, 102810, 109923, 117360,# 46 - 50
- 125126, 133229, 141677, 150476, 159635,
- 169159, 179056, 189334, 199999, 211060,# 56 - 60
- 222522, 234393, 246681, 259392, 272535,
- 286115, 300140, 314618, 329555, 344960,# 66 - 70
- 360838, 377197, 394045, 411388, 429235,
- 447591, 466464, 485862, 505791, 526260,# 76 - 80
- 547274, 568841, 590969, 613664, 636935,
- 660787, 685228, 710266, 735907, 762160,# 86 - 90
- 789030, 816525, 844653, 873420, 902835,
- 932903, 963632, 995030, 1027103, 1059860 # 96 - 100
- ],
- #-----------------------------------------------------------------------------
- # The Slow Experience Group.
- # The final of the four Generation I experience groups.
- # 1,250,000 experience points required for level 100.
- 3 => [ 0, 10, 33, 80, 156,
- 270, 428, 640, 911, 1250, # 6 - 10
- 1663, 2160, 2746, 3430, 4218,
- 5120, 6141, 7290, 8573, 10000, # 16 - 20
- 11576, 13310, 15208, 17280, 19531,
- 21970, 24603, 27440, 30486, 33750, # 26 - 30
- 37238, 40960, 44921, 49130, 53593,
- 58320, 63316, 68590, 74148, 80000, # 36 - 40
- 86151, 92610, 99383, 106480, 113906,
- 121670, 129778, 138240, 147061, 156250,# 46 - 50
- 165813, 175760, 186096, 196830, 207968,
- 219520, 231491, 243890, 256723, 270000,# 56 - 60
- 283726, 297910, 312558, 327680, 343281,
- 359370, 375953, 393040, 410636, 428750,# 66 - 70
- 447388, 466560, 486271, 506530, 527343,
- 548720, 570666, 593190, 616298, 640000,# 76 - 80
- 664301, 689210, 714733, 740880, 767656,
- 795070, 823128, 851840, 881211, 911250,# 86 - 90
- 941963, 973360, 1005446, 1038230, 1071718,
- 1105920, 1140841, 1176490, 1212873, 1250000 # 96 - 100
- ],
- #-----------------------------------------------------------------------------
- # The Erratic Experience Group.
- # One of the two groups introduced in 3rd Generation PoKeMoN.
- # 600,000 experience points required for level 100.
- 4 => [ 0, 15, 52, 122, 237,
- 416, 637, 942, 1326, 1800, # 6 - 10
- 2369, 3041, 3822, 4719, 5737,
- 6881, 8155, 9564, 11111, 12800, # 16 - 20
- 14632, 16610, 18737, 21012, 23437,
- 26012, 28737, 31610, 34632, 37800, # 26 - 30
- 41111, 44564, 48155, 51881, 55737,
- 59719, 63822, 68041, 72369, 76800, # 36 - 40
- 81326, 85942, 90637, 95406, 100237,
- 105122, 110052, 115015, 120001, 125000,# 46 - 50
- 131324, 137795, 144410, 151165, 158056,
- 165079, 172229, 179503, 186894, 194400,# 56 - 60
- 202013, 209728, 217540, 225443, 233431,
- 241496, 249633, 257934, 267406, 276458,# 66 - 70
- 286328, 296358, 305767, 316074, 326531,
- 336255, 346965, 357812, 367807, 378880,# 76 - 80
- 390077, 400293, 411686, 423190, 433572,
- 445239, 457001, 467489, 479378, 491346,# 86 - 90
- 501878, 513934, 526049, 536557, 548720,
- 560922, 571333, 583539, 591882, 600000 # 96 - 100
- ],
- #-----------------------------------------------------------------------------
- # The Fluctuating Experience Group.
- # The 2nd exp group introduced in 3rd Gen PkMn. Opposite to the Erratic group.
- # 1,640,000 experience points required for level 100.
- 5 => [ 0, 4, 13, 32, 65,
- 112, 178, 276, 393, 540, # 6 - 10
- 745, 967, 1230, 1591, 1957,
- 2457, 3046, 3732, 4526, 5440, # 16 - 20
- 6482, 7666, 9003, 10506, 12187,
- 14060, 16140, 18439, 20974, 23760, # 26 - 30
- 26811, 30146, 33780, 37731, 42017,
- 46656, 50653, 55969, 60505, 66560, # 36 - 40
- 71677, 78533, 84277, 91998, 98415,
- 107069, 114205, 123863, 131766, 142500,# 46 - 50
- 151222, 163105, 172697, 185807, 196322,
- 210739, 222231, 238036, 250562, 267840,# 56 - 60
- 281456, 300293, 315059, 335544, 351520,
- 373744, 390991, 415050, 433631, 459620,# 66 - 70
- 479600, 507617, 529063, 559209, 582187,
- 614566, 639146, 673863, 700115, 737280,# 76 - 80
- 765275, 804997, 834809, 877201, 908905,
- 954084, 987754, 1035837, 1071552, 1122660,# 86 - 90
- 1160499, 1214753, 1254796, 1312322, 1354652,
- 1415577, 1460276, 1524731, 1571884, 1640000 # 96 - 100
- ],
- }# << KEEP !!
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # ☆ Exp Requirement Settings ( EXP CURVE )
- #-----------------------------------------------------------------------------
- # The below settings adjust the requirements for each level up.
- Exp_Req_Curve ={
- #-----------------------------------------------------------------------------
- # This setting,(by default) the exp needed will be a constant 5 exp per level
- # TOTAL EXP NEEDED:
- # level 10 = 45 || Level 25 = 120
- # Level 50 = 245 || Level 99 = 490
- 0 => {
- :basis => 0 ,
- :extra => 5 ,
- :acc_A => 0 ,
- :acc_B => 0 ,
- },
- #-----------------------------------------------------------------------------
- # This setting,(by default) the exp needed will increase very slightly.
- # MUCH lower than vx ace normally allows.
- # TOTAL EXP NEEDED:
- # level 10 = 108 || Level 25 = 638
- # Level 50 = 1561 || Level 99 = 3134
- 1 => {
- :basis => 1 ,
- :extra => 1 ,
- :acc_A => 1 ,
- :acc_B => 1 ,
- },
- #-----------------------------------------------------------------------------
- # This setting,(by default) the exp needed will be slightly more than
- # vx ace normally allows.
- # TOTAL EXP NEEDED:
- # level 10 = 14,123 || Level 25 = 189,663
- # Level 50 = 1,359,580 || Level 99 = 8,797,536
- 2 => {
- :basis => 100 ,
- :extra => 100 ,
- :acc_A => 200 ,
- :acc_B => 200 ,
- },
- #-----------------------------------------------------------------------------
- # This setting,(by default) the exp for low levels will be lower than vx ace
- # normally allows but much more than vx ace normally allows at higher levels.
- # TOTAL EXP NEEDED:
- # level 10 = 2401 || Level 25 = 90,682
- # Level 50 = 1,371,571 || Level 99 = 19,403,779
- 3 => {
- :basis => 2 ,
- :extra => 2 ,
- :acc_A => 250 ,
- :acc_B => 1000 ,
- },
- #-----------------------------------------------------------------------------
- # This setting,(by default) the exp needed per level will be ridiculously more
- # than vx ace normally allows.
- # TOTAL EXP NEEDED:
- # level 10 = 79,550 || Level 25 = 4,534,130
- # Level 50 = 68,442,075 || Level 99 = 962,585,688 lol @ 962 mil exp...
- 4 => {
- :basis => 100 ,
- :extra => 200 ,
- :acc_A => 400 ,
- :acc_B => 800 ,
- },
- }# << KEEP
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # ☆ Exp Requirement Settings ( EXP FORMULAS )
- #-----------------------------------------------------------------------------
- # The below settings adjust the formula for requirements to level up.
- Exp_Req_Form={
- # --
- 0 => "((level + 5 + $game_variables[100]) * 4)" ,
- # --
- 1 => "((level + 8 + $game_variables[101]) * 2)" ,
- # --
- 2 => "(((level*2)+4+$game_variables[102]) * 4)" ,
- # --
- 3 => "(((level*8)+8+$game_variables[103]) * 8)" ,
- }# << KEEP
- #####################
- # CUSTOMISATION END #
- end #####################
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- # #
- # 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.\..\.. #
- #===============================================================================#
- module DataManager
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Alias List
- #-----------------------------------------------------------------------------
- class << self
- alias :lbd_expert_exp :load_database
- end
- #-----------------------------------------------------------------------------
- # Load Database (alias)
- #-----------------------------------------------------------------------------
- def self.load_database
- lbd_expert_exp
- loa_expert_exp
- end
- #-----------------------------------------------------------------------------
- # Load Unique Shit
- #-----------------------------------------------------------------------------
- def self.loa_expert_exp
- for g in [$data_classes, $data_skills, $data_items]
- for o in g
- next if o == nil
- o.load_expert_exp
- end
- end
- end
- end # DataManager
- #===============================================================================
- module BattleManager
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Alias List
- #-----------------------------------------------------------------------------
- class << self
- alias :gain_exp_expert_exp :gain_exp
- end
- #-----------------------------------------------------------------------------
- # Process Victory
- #-----------------------------------------------------------------------------
- def self.gain_exp
- gain_battle_exp_
- gain_exp_expert_exp
- end
- #-----------------------------------------------------------------------------
- # Gain Battle Exp
- #-----------------------------------------------------------------------------
- def self.gain_battle_exp_
- case Expert_Exp::Exp_Battle_Dist
- when :battle_members then members = $game_party.battle_members
- when :all_members then members = $game_party.members
- when :only_leader then members = [$game_party.leader]
- else ; members = [$game_party.leader]
- end
- members.each do |m|
- next unless m != nil
- next unless m.hp > 0
- m.gain_battle_exp
- m.reduce_exp_battle_count
- end
- end
- end
- #===============================================================================
- class RPG::Class < RPG::BaseItem
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Alias List
- #-----------------------------------------------------------------------------
- alias :expert_exp_efl :exp_for_level
- #-----------------------------------------------------------------------------
- # Pi Variables
- #-----------------------------------------------------------------------------
- attr_accessor :exp_req_type
- attr_accessor :exp_over_time
- attr_accessor :exp_each_battle
- attr_accessor :exp_each_attack
- attr_accessor :exp_each_guard
- attr_accessor :exp_each_skill
- attr_accessor :exp_each_item
- #-----------------------------------------------------------------------------
- # Load Exp Info
- #-----------------------------------------------------------------------------
- def load_expert_exp
- defs = Expert_Exp::Defaults
- @exp_req_type = [defs[:exp_req_type][0],defs[:exp_req_type][1]]
- @exp_over_time = [defs[:over_time][0], defs[:over_time][1],defs[:over_time][2]]
- @exp_each_battle = defs[:each_battle]
- @exp_each_attack = defs[:each_attack]
- @exp_each_guard = defs[:each_guard]
- @exp_each_skill = defs[:each_skill]
- @exp_each_item = defs[:each_item]
- check_expert_exp_notes
- end
- #-----------------------------------------------------------------------------
- # Parse Notes
- #-----------------------------------------------------------------------------
- def check_expert_exp_notes
- self.note.split(/[\r\n]+/).each do |line|
- case line
- when Expert_Exp::Exp_Notes[:exp_req_type] then @exp_req_type = [$1.to_i,$2.to_i]
- when Expert_Exp::Exp_Notes[:over_time] then @exp_over_time = [true, $1.to_i,$2.to_s]
- when Expert_Exp::Exp_Notes[:each_battle] then @exp_each_battle = $1.to_s
- when Expert_Exp::Exp_Notes[:each_attack] then @exp_each_attack = $1.to_s
- when Expert_Exp::Exp_Notes[:each_guard] then @exp_each_guard = $1.to_s
- when Expert_Exp::Exp_Notes[:each_skill] then @exp_each_skill = $1.to_s
- when Expert_Exp::Exp_Notes[:each_item] then @exp_each_item = $1.to_s
- end
- end
- end
- #-----------------------------------------------------------------------------
- # Get Exp Requirements For Level Up
- #-----------------------------------------------------------------------------
- def exp_for_level(level)
- data = self.exp_req_type[1]
- case self.exp_req_type[0]
- when 0
- return Expert_Exp::Exp_Req_Fixed[data][level-1]
- when 1
- l = level.to_f
- b = Expert_Exp::Exp_Req_Curve[data][:basis]
- e = Expert_Exp::Exp_Req_Curve[data][:extra]
- aa = Expert_Exp::Exp_Req_Curve[data][:acc_A]
- ab = Expert_Exp::Exp_Req_Curve[data][:acc_B]
- return (b*((l-1)**(0.9+aa/250))*l*(l+1)/(6+l**2/50/ab)+(l-1)*e).round.to_i
- when 2
- return ([eval(Expert_Exp::Exp_Req_Fixed[data]), 0].max.to_i rescue 0)
- else
- return expert_exp_efl(level)
- end
- end
- end # << RPG::BaseItem
- #===============================================================================
- class RPG::UsableItem < RPG::BaseItem
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Pi Variables
- #-----------------------------------------------------------------------------
- attr_accessor :exp_each_use
- attr_accessor :exp_battles
- #-----------------------------------------------------------------------------
- # Load Exp Info
- #-----------------------------------------------------------------------------
- def load_expert_exp
- @exp_each_use = 0
- @exp_battles = [false,0,0]
- check_expert_exp_notes
- end
- #-----------------------------------------------------------------------------
- # Parse Notes
- #-----------------------------------------------------------------------------
- def check_expert_exp_notes
- self.note.split(/[\r\n]+/).each do |line|
- case line
- when Expert_Exp::Exp_Notes[:each__use] then @exp_each_use = $1.to_s
- when Expert_Exp::Exp_Notes[:battles] then @exp_battles = [true,$1.to_f,$2.to_i]
- end
- end
- end
- end # << RPG::BaseItem
- #===============================================================================
- class RPG::Map
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Exp Ratio
- #-----------------------------------------------------------------------------
- def exp_ratio
- if self.note =~ Expert_Exp::Defaults[:map_exp]
- return $1.to_f
- else
- return 1.0
- end
- end
- end
- #===============================================================================
- class Game_Map
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Exp Ratio
- #-----------------------------------------------------------------------------
- def exp_ratio
- return @map.exp_ratio
- end
- end
- #===============================================================================
- class Game_Party < Game_Unit
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Pi Variables
- #-----------------------------------------------------------------------------
- attr_reader :exp_ratio
- #-----------------------------------------------------------------------------
- # Alias List
- #-----------------------------------------------------------------------------
- alias :init_party_expexp :initialize
- #-----------------------------------------------------------------------------
- # Initialize
- #-----------------------------------------------------------------------------
- def initialize
- init_party_expexp
- reset_exp_ratio(1.0,false)
- end
- #-----------------------------------------------------------------------------
- # Reset Exp Ratio
- #-----------------------------------------------------------------------------
- def reset_exp_ratio(value = 1.0, ref = true)
- @exp_ratio = value
- refresh if ref
- end
- #-----------------------------------------------------------------------------
- # Add To Exp Ratio
- #-----------------------------------------------------------------------------
- def add_exp_ratio(value, ref = true)
- @exp_ratio += value
- refresh if ref
- end
- #-----------------------------------------------------------------------------
- # Subtract from Exp Ratio
- #-----------------------------------------------------------------------------
- def sub_exp_ratio(value, ref = true)
- @exp_ratio -= value
- refresh if ref
- end
- #-----------------------------------------------------------------------------
- # Divide Exp Ratio By Value
- #-----------------------------------------------------------------------------
- def div_exp_ratio(value, ref = true)
- @exp_ratio /= value
- refresh if ref
- end
- #-----------------------------------------------------------------------------
- # Multiply Exp Ratio By Value
- #-----------------------------------------------------------------------------
- def mul_exp_ratio(value, ref = true)
- @exp_ratio *= value
- refresh if ref
- end
- #-----------------------------------------------------------------------------
- # Mod Exp Ratio By Value
- #-----------------------------------------------------------------------------
- def mod_exp_ratio(value, ref = true)
- @exp_ratio %= value
- refresh if ref
- end
- end
- #===============================================================================
- class Game_Battler < Game_BattlerBase
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Alias List
- #-----------------------------------------------------------------------------
- alias :_MDV__expexp :make_damage_value
- #-----------------------------------------------------------------------------
- # M.D.V
- #-----------------------------------------------------------------------------
- def make_damage_value(user, item)
- check_item_exp_effect(item)
- check_exp_gain(user,item)
- _MDV__expexp(user, item)
- end
- #-----------------------------------------------------------------------------
- # Check Exp Gains
- #-----------------------------------------------------------------------------
- def check_exp_gain(user,item)
- return unless user.is_a?(Game_Actor)
- if item.is_a?(RPG::Skill)
- case item.id
- when user.attack_skill_id
- user.gain_attack_exp
- when user.guard_skill_id
- user.gain_guard_exp
- else
- user.gain_skill_exp
- end
- else
- user.gain_item_exp
- end
- user.gain_exp_for_use(item)
- end
- #-----------------------------------------------------------------------------
- # Check Exp Effects
- #-----------------------------------------------------------------------------
- def check_item_exp_effect(item)
- return unless self.is_a?(Game_Actor)
- return unless item.exp_battles[0]
- self.set_exp_battle_count(item.exp_battles[2])
- self.set_exp_battle_modifier(item.exp_battles[1])
- end
- end
- #===============================================================================
- class Game_Actor < Game_Battler
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Alias List
- #-----------------------------------------------------------------------------
- alias :setup_exp_pro_style :setup
- #-----------------------------------------------------------------------------
- # Pi Variables
- #-----------------------------------------------------------------------------
- attr_reader :exp_ot_counter
- attr_reader :exp_battle_count
- attr_reader :exp_battle_modifier
- #-----------------------------------------------------------------------------
- # Setup
- #-----------------------------------------------------------------------------
- def setup(actor_id)
- setup_exp_pro_style(actor_id)
- init_exp_over_time
- init_exp_battle_counter
- init_exp_battle_modifier
- end
- #-----------------------------------------------------------------------------
- # Initialize exp over time counter
- #-----------------------------------------------------------------------------
- def init_exp_over_time
- @exp_ot_counter = 0
- end
- #-----------------------------------------------------------------------------
- # Set exp over time counter
- #-----------------------------------------------------------------------------
- def set_exp_battle_count(value)
- @exp_battle_count = value
- end
- #-----------------------------------------------------------------------------
- # Init Exp Battle Counter
- #-----------------------------------------------------------------------------
- def init_exp_battle_counter
- set_exp_battle_count(0)
- end
- #-----------------------------------------------------------------------------
- # Gain Exp Battle Counter
- #-----------------------------------------------------------------------------
- def gain_exp_battle_count
- @exp_battle_count += 1
- @exp_battle_count = 0 if @exp_battle_count < 0
- end
- #-----------------------------------------------------------------------------
- # Reduce Exp Battle Counter
- #-----------------------------------------------------------------------------
- def reduce_exp_battle_count
- return if @exp_battle_count == 0
- @exp_battle_count -= 1
- if @exp_battle_count < 0
- @exp_battle_count = 0
- init_exp_battle_modifier
- end
- end
- #-----------------------------------------------------------------------------
- # Initialize Exp Battle Modifier
- #-----------------------------------------------------------------------------
- def init_exp_battle_modifier
- set_exp_battle_modifier(1)
- end
- #-----------------------------------------------------------------------------
- # Set Up Exp Battle Modifier
- #-----------------------------------------------------------------------------
- def set_exp_battle_modifier(value)
- @exp_battle_modifier = value.to_f
- end
- #-----------------------------------------------------------------------------
- # Gain Exp (overwrite)
- #-----------------------------------------------------------------------------
- def gain_exp(exp)
- change_exp(exp_gain_ratio(exp), Expert_Exp::Show_Level_Up)
- end
- #-----------------------------------------------------------------------------
- # Rapid Exp Gain Method
- #-----------------------------------------------------------------------------
- def rapid_exp_gain
- @exp_ot_counter += 1
- eexp = exp_over_time
- return unless eexp[0]
- return unless (@exp_ot_counter/60) >= (eexp[1])
- show = false # show level up
- e = ([eval(eexp[2]), 0].max rescue 0)
- change_exp(exp_gain_ratio(e), show)
- init_exp_over_time
- end
- #-----------------------------------------------------------------------------
- # Get Exp Over Time Data
- #-----------------------------------------------------------------------------
- def exp_over_time
- return self.class.exp_over_time
- end
- #-----------------------------------------------------------------------------
- # Gain Battle Exp
- #-----------------------------------------------------------------------------
- def gain_battle_exp
- e = ([eval(exp_per_battle), 0].max rescue 0)
- change_exp(exp_gain_ratio(e), Expert_Exp::Show_Level_Up)
- end
- #-----------------------------------------------------------------------------
- # Get Battle Exp Value
- #-----------------------------------------------------------------------------
- def exp_per_battle
- return self.class.exp_each_battle
- end
- #-----------------------------------------------------------------------------
- # Gain Attack Exp
- #-----------------------------------------------------------------------------
- def gain_attack_exp
- e = ([eval(exp_per_attack), 0].max rescue 0)
- change_exp(exp_gain_ratio(e), Expert_Exp::Show_Level_Up)
- end
- #-----------------------------------------------------------------------------
- # Get Attack Exp Value
- #-----------------------------------------------------------------------------
- def exp_per_attack
- return self.class.exp_each_attack
- end
- #-----------------------------------------------------------------------------
- # Gain Guard Exp
- #-----------------------------------------------------------------------------
- def gain_guard_exp
- e = ([eval(exp_per_guard), 0].max rescue 0)
- change_exp(exp_gain_ratio(e), Expert_Exp::Show_Level_Up)
- end
- #-----------------------------------------------------------------------------
- # Get Guard Exp Value
- #-----------------------------------------------------------------------------
- def exp_per_guard
- return self.class.exp_each_guard
- end
- #-----------------------------------------------------------------------------
- # Gain Skill Exp
- #-----------------------------------------------------------------------------
- def gain_skill_exp
- e = ([eval(exp_per_skill), 0].max rescue 0)
- change_exp(exp_gain_ratio(e), Expert_Exp::Show_Level_Up)
- end
- #-----------------------------------------------------------------------------
- # Get Skill Exp Value
- #-----------------------------------------------------------------------------
- def exp_per_skill
- return self.class.exp_each_skill
- end
- #-----------------------------------------------------------------------------
- # Gain Item Exp
- #-----------------------------------------------------------------------------
- def gain_item_exp
- e = ([eval(exp_per_item), 0].max rescue 0)
- change_exp(exp_gain_ratio(e), Expert_Exp::Show_Level_Up)
- end
- #-----------------------------------------------------------------------------
- # Get Item Exp Value
- #-----------------------------------------------------------------------------
- def exp_per_item
- return self.class.exp_each_item
- end
- #-----------------------------------------------------------------------------
- # Gain Exp For Skill Use
- #-----------------------------------------------------------------------------
- def gain_exp_for_use(item)
- e = ([eval(item.exp_each_use), 0].max rescue 0)
- change_exp(exp_gain_ratio(e), Expert_Exp::Show_Level_Up)
- end
- #-----------------------------------------------------------------------------
- # Gain Exp For Skill Use
- #-----------------------------------------------------------------------------
- def exp_gain_ratio(ratio)
- a = self.exp
- b = ratio
- c = final_exp_rate
- d = $game_party.exp_ratio
- e = $game_map.exp_ratio
- return (a + (b * c * d * e)).to_i
- end
- end
- #===============================================================================
- class Game_Enemy < Game_Battler
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Exp
- #-----------------------------------------------------------------------------
- def exp
- case Expert_Exp::Enemy_Exp_Mode
- when :default then return exp_calc_default
- when :pokemon then return exp_calc_pokemon
- when :average then return exp_calc_average
- when :sD13x then return exp_calc_sD13x
- else ; return exp_calc_default
- end
- end
- #-----------------------------------------------------------------------------
- # Default Calculation
- #-----------------------------------------------------------------------------
- def exp_calc_default
- return enemy.exp
- end
- #-----------------------------------------------------------------------------
- # Pokemon Calculation (party leader level as active poke level)
- #-----------------------------------------------------------------------------
- def exp_calc_pokemon
- return enemy.exp unless $D13x[:Enemy_Levels]
- _A = ((@level * 2) + 10)
- _B = (enemy.exp * @level / 5)
- _C = (@level + $game_party.battle_members[0].level + 10)
- val = ((_A)*(_A*_A).floor).floor*_B/((_C)*(_C*_C)).floor+1
- return val
- end
- #-----------------------------------------------------------------------------
- # Pokemon Calculation (average party level as active poke level)
- #-----------------------------------------------------------------------------
- def exp_calc_average
- return enemy.exp unless $D13x[:Enemy_Levels]
- _L = 0 ; _S = 0
- $game_party.battle_members.each do |m|
- next unless m != nil
- next unless m.hp > 0
- _L += m.level
- _S += 1
- end
- _A = ((@level * 2) + 10)
- _B = (enemy.exp * @level / 5)
- _C = (@level + (_L/_S).to_i + 10)
- val = ((_A)*(_A*_A).floor).floor*_B/((_C)*(_C*_C)).floor+1
- return val
- end
- #-----------------------------------------------------------------------------
- # Amped Pokemon Calculation
- #-----------------------------------------------------------------------------
- def exp_calc_sD13x
- return enemy.exp unless $D13x[:Enemy_Levels]
- _L = (@level + atl + dfl)
- _A = ((_L * 2) + 10)
- _B = ((enemy.exp * _L / 5) * 2)
- _C = (_L + $game_party.leader.level + 10)
- val = ((_A)*(_A*_A).floor).floor*_B/((_C)*(_C*_C)).floor+1
- return val
- end
- #-----------------------------------------------------------------------------
- # Gold
- #-----------------------------------------------------------------------------
- def gold
- case Expert_Exp::Enemy_Gold_Mode
- when :default then return gold_calc_default
- when :pokemon then return gold_calc_pokemon
- when :average then return gold_calc_average
- when :sD13x then return gold_calc_sD13x
- else ; return gold_calc_default
- end
- end
- #-----------------------------------------------------------------------------
- # Default Calculation
- #-----------------------------------------------------------------------------
- def gold_calc_default
- return enemy.gold
- end
- #-----------------------------------------------------------------------------
- # Pokemon Calculation (party leader level as active poke level)
- #-----------------------------------------------------------------------------
- def gold_calc_pokemon
- return enemy.gold unless $D13x[:Enemy_Levels]
- _A = ((@level * 2) + 10)
- _B = (enemy.gold * @level / 5)
- _C = (@level + $game_party.battle_members[0].level + 10)
- val = ((_A)*(_A*_A).floor).floor*_B/((_C)*(_C*_C)).floor+1
- return val
- end
- #-----------------------------------------------------------------------------
- # Pokemon Calculation (average party level as active poke level)
- #-----------------------------------------------------------------------------
- def gold_calc_average
- return enemy.gold unless $D13x[:Enemy_Levels]
- _L = 0 ; _S = 0
- $game_party.battle_members.each do |m|
- next unless m != nil
- next unless m.hp > 0
- _L += m.level
- _S += 1
- end
- _A = ((@level * 2) + 10)
- _B = (enemy.gold * @level / 5)
- _C = (@level + (_L/_S).to_i + 10)
- val = ((_A)*(_A*_A).floor).floor*_B/((_C)*(_C*_C)).floor+1
- return val
- end
- #-----------------------------------------------------------------------------
- # Amped Pokemon Calculation
- #-----------------------------------------------------------------------------
- def gold_calc_sD13x
- return enemy.gold unless $D13x[:Enemy_Levels]
- _L = (@level + atl + dfl)
- _A = ((_L * 2) + 10)
- _B = ((enemy.gold * _L / 5) * 2)
- _C = (_L + $game_party.leader.level + 10)
- val = ((_A)*(_A*_A).floor).floor*_B/((_C)*(_C*_C)).floor+1
- return val
- end
- end
- #===============================================================================
- class Scene_Map < Scene_Base
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Alias List
- #-----------------------------------------------------------------------------
- alias :update_gain_exp_ot :update
- #-----------------------------------------------------------------------------
- # Update Scene
- #-----------------------------------------------------------------------------
- def update
- update_gain_exp_ot
- update_gain_exp_over_time
- end
- #-----------------------------------------------------------------------------
- # Update Exp Per Second Gain
- #-----------------------------------------------------------------------------
- def update_gain_exp_over_time
- return if $game_map.interpreter.running?
- case Expert_Exp::Exp_OT_Dist
- when :battle_members then members = $game_party.battle_members
- when :all_members then members = $game_party.members
- when :only_leader then members = [$game_party.leader]
- else ; members = [$game_party.leader]
- end
- members.each do |m|
- next unless m != nil
- next unless m.hp > 0
- m.rapid_exp_gain
- end
- 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