Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Dekita__Refine_Script
- =begin =========================================================================
- Dekita's v0.9
- ★ Perfect Equip Refine System™ ★
- ================================================================================
- Script Information:
- ====================
- NOTE :
- This is still a work in progress, i plan on increasing effiency and customisation
- options quite a lot, so if you have any ideas for improvements or a bug to report
- please let me know.
- NOTE 2 :
- Tsukihime's Custom DataManager script can be used with this script to increase
- compatability with other scripts. it is not required.
- Refining is a method of enhancing your gear by adding bonus stats to it.
- After each successful refine the refinement level of the equipment will
- increase up to a maximum of +12(default).
- Refining equipment adds any stat that you notetag the equipment with.
- e.g if you notetagged a piece of equipment like so...
- <ref_mhp>
- <ref_atk>
- <ref_def>
- <ref_luk>
- when you refined that equipment you would gain MaxHP, Atk, Def and Luk.
- equal to the formula (explained below).
- The only required items to refine a piece of equipment are "Mirage Celestones"
- BUT there are also refinement aids that will increase your chances of
- successful refinements.
- You can select how many mirage celestones are required for each piece of
- equipment by putting <req mir: X> in the equipment notebox.
- where X is the value you need to refine that equipment item.
- The higher the upgrade, the more difficult it becomes. Starting from level 1,
- your success is not guaranteed. If you fail an upgrade, your item returns to
- level 0 unless you use refinement aids which prevent loss (Explained later).
- ================================================================================
- ★☆★☆★☆★☆★☆★☆★☆★ 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
- 08/12/2o12 - Finished,(v0.9)
- 20/09/2o12 - Started Script,
- ================================================================================
- Credit and Thanks to :
- =======================
- Tsukihime - For the custom database script that makes this one more efficient,
- and various other help ^_^
- ================================================================================
- Known Bugs:
- ============
- You will not be able to use conditional branch checks for weapons and armors.
- I am working on improving this.
- 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 #######################
- # CUSTOMISATION BEGIN #
- #######################
- # VOCAB:
- Select_Equip = "Select Equip"
- S_E_Help_Info = "Select the piece of equipment you wish to refine."
- Select_Item = "Select Aid"
- S_I_Help_Info = "Select Refine Aid"
- Start_Refine = "Refine"
- S_R_Help_Info = "Start the refine process"
- S_R_Success = "Refine Successfull !"
- S_R_Fail = "Refine Failed !"
- S_R_Total_Fail = "Your equipment lost all refine !"
- S_R_Single_Fail = "Equipment refine level dropped by 1"
- S_R_NO_Fail = "Equipment refine level unchanged"
- # for selected equipment info box.
- Refine_Symbol = " +"
- # for equip screen.
- Refine_Symbols = "+%2d"
- Grade_Symbol = "Grade: "
- # Notetag for equipments mirage requirement
- Mirage_Celestone_Req_Note = /<req mir: (.*)>/i
- # Notetags for equipment's stats to increase upon refine
- Refine_MHP_Notetag = /<ref_mhp>/i
- Refine_MMP_Notetag = /<ref_mmp>/i
- Refine_Atk_Notetag = /<ref_atk>/i
- Refine_Def_Notetag = /<ref_def>/i
- Refine_Mat_Notetag = /<ref_mat>/i
- Refine_Mdf_Notetag = /<ref_mdf>/i
- Refine_Agi_Notetag = /<ref_agi>/i
- Refine_Luk_Notetag = /<ref_luk>/i
- # The level of refinement determines the multiple of the base refinement
- # bonus you will receive.
- # The base refinement value is determined by the equipment grade
- # <grade: X> X = value .
- # e.g <grade: 5>
- Equipment_Grade_Notetag = /<grade: (.*)>/i
- # The refinement bonuses are as follows: (default settings)
- ##################################################################
- # REFINE LV # BONUS VALUE #=|=# REFINE LV # BONUS VALUE #
- # +1 # Grade * 1 #=|=# +7 # Grade * 9.95 #
- # +2 # Grade * 2 #=|=# +8 # Grade * 13 #
- # +3 # Grade * 3.05 #=|=# +9 # Grade * 17.05 #
- # +4 # Grade * 4.3 #=|=# +10 # Grade * 22.03 #
- # +5 # Grade * 5.75 #=|=# +11 # Grade * 29 #
- # +6 # Grade * 7.55 #=|=# +12 # Grade * 37.5 #
- ##################################################################
- # Refine Lvl = Bonus Multiplier
- Plus_1_Ref_Val = 1.0
- Plus_2_Ref_Val = 2.0
- Plus_3_Ref_Val = 3.05
- Plus_4_Ref_Val = 4.3
- Plus_5_Ref_Val = 5.75
- Plus_6_Ref_Val = 7.55
- Plus_7_Ref_Val = 9.95
- Plus_8_Ref_Val = 13.0
- Plus_9_Ref_Val = 17.05
- Plus_10_Ref_Val = 22.03
- Plus_11_Ref_Val = 29.0
- Plus_12_Ref_Val = 37.5
- # The basic chances of refining success are as follows: (default settings)
- ##############################################################################
- # Refine Level # Mirage Only # Tienkang Stone # Tisha Stone # Chienkun Stone #
- # +1 # 50% # 65% # 53.5% # 100% #
- # +2 # 30% # 45% # 33.5% # 25% #
- # +3 # 30% # 45% # 33.5% # 10% #
- # +4 # 30% # 45% # 33.5% # 4% #
- # +5 # 30% # 45% # 33.5% # 1.67% #
- # +6 # 30% # 45% # 33.5% # 0.77% #
- # +7 # 30% # 45% # 33.5% # 0.47% #
- # +8 # 30% # 45% # 33.5% # 0.25% #
- # +9 # 25% # 40% # 28.5% # 0.13% #
- # +10 # 20% # 35% # 23.5% # 0.07% #
- # +11 # 12% # 27% # 15.5% # 0.04% #
- # +12 # 5% # 20% # 8.5% # 0.02% #
- ##############################################################################
- # There is also "dragon orbs" that give you 100% success rate (explained later)
- # Mirage Celestone ONLY
- # If refining fails, the item loses all previous refining and reverts back to +0.
- # If you want mirages to show in the refine aid list give it this notetag.
- Mirage_Celestone_Note = /<mirage>/i
- # Database ID for Mirage Celestones
- Mirage_Celestone_ID = 1
- # Success Rate's
- Plus_1_Mir_Val = 0.50
- Plus_2_Mir_Val = 0.30
- Plus_3_Mir_Val = 0.30
- Plus_4_Mir_Val = 0.30
- Plus_5_Mir_Val = 0.30
- Plus_6_Mir_Val = 0.30
- Plus_7_Mir_Val = 0.30
- Plus_8_Mir_Val = 0.30
- Plus_9_Mir_Val = 0.25
- Plus_10_Mir_Val = 0.20
- Plus_11_Mir_Val = 0.12
- Plus_12_Mir_Val = 0.05
- # Mirage Celestone AND Teinkang Stones
- # Teinkang Stones boost the chances of success.
- # If refining fails, the item loses all previous refining and reverts back to +0.
- # Notetag for tienkang stones
- Tienkang_Stone_Note = /<tienkang>/i
- # Success Rate's
- Plus_1_Tein_Val = 0.65
- Plus_2_Tein_Val = 0.45
- Plus_3_Tein_Val = 0.45
- Plus_4_Tein_Val = 0.45
- Plus_5_Tein_Val = 0.45
- Plus_6_Tein_Val = 0.45
- Plus_7_Tein_Val = 0.45
- Plus_8_Tein_Val = 0.45
- Plus_9_Tein_Val = 0.40
- Plus_10_Tein_Val = 0.35
- Plus_11_Tein_Val = 0.27
- Plus_12_Tein_Val = 0.20
- # Mirage Celestone AND Tisha Stones
- # Tisha Stones boost the chance of success AND prevent the item from
- # dropping more than 1 refining level if refining fails.
- # Notetag for tisha stones
- Tisha_Stone_Note = /<tisha>/i
- # Success Rate's
- Plus_1_Tish_Val = 0.535
- Plus_2_Tish_Val = 0.335
- Plus_3_Tish_Val = 0.335
- Plus_4_Tish_Val = 0.335
- Plus_5_Tish_Val = 0.335
- Plus_6_Tish_Val = 0.335
- Plus_7_Tish_Val = 0.335
- Plus_8_Tish_Val = 0.335
- Plus_9_Tish_Val = 0.285
- Plus_10_Tish_Val = 0.235
- Plus_11_Tish_Val = 0.155
- Plus_12_Tish_Val = 0.085
- # Mirage Celestone AND Chienkun Stones
- # Chienkun Stones LOWER the chance of success (except refine to lv 1)
- # AND prevent the item from dropping ANY level at all with failure.
- # Notetag for Chienkun stones
- Chienkun_Stone_Note = /<chienkun>/i
- # Success Rate's
- Plus_1_CKun_Val = 1.00 # 1.00 = 100% success
- Plus_2_CKun_Val = 0.25
- Plus_3_CKun_Val = 0.10
- Plus_4_CKun_Val = 0.04
- Plus_5_CKun_Val = 0.0167
- Plus_6_CKun_Val = 0.0077
- Plus_7_CKun_Val = 0.0047
- Plus_8_CKun_Val = 0.0025
- Plus_9_CKun_Val = 0.0013
- Plus_10_CKun_Val = 0.0007
- Plus_11_CKun_Val = 0.0004
- Plus_12_CKun_Val = 0.0002
- # Mirage Celestone AND Dragon Orb
- # Dragon Orbs Guarantee successfull refine as long as the equipments current
- # refine level is lower than the dragon orb level.
- # <dorb: X>
- # replace X with a value between 1 - 12
- Dragon_Orb_Note = /<dorb: (.*)>/i
- # NOTE: you cannot set this higher than 12, only lower(if you want).
- Max_Refine = 12
- Wait_Time = 60
- end # Dekita__Refine_Script
- #####################
- # CUSTOMISATION END #
- #####################
- #===============================================================================#
- # 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.\..\.. #
- #===============================================================================#
- module Dekita__Refine_Script
- COMMANDS =[
- [:sel_eqp, "Equips"],
- [:sel_itm, "Aids"],
- [:ref_str, "Refine"],
- # [:exit, "Quit Scene"],
- ]#DO NOT REMOVE
- Refine_Info =[ # // Dont Delete This.
- [:refine_equip, "Chosen Equipment :"],
- [:blank, " "],
- [:blank, " "],
- [:blank, " "],
- [:refine_aid, "Refine Aid :"],
- [:blank, " "],
- [:mirage_cost, "Mirage Cost :"],
- ] # Do not remove this.
- Item_Refine_Info =[ # // Dont Delete This.
- [:blank, " "],
- [:blank, " "],
- [:blank, " "],
- [:blank, " "],
- [:blank, " "],
- [:blank, " "],
- [:blank, " "],
- ] # Do not remove this.
- end # module
- $imported = {} if $imported.nil?
- $imported["DPB-WCB"] = true
- #==============================================================================
- class Object
- #==============================================================================
- def dup!
- Marshal.load(Marshal.dump(self))
- end
- end
- #==============================================================================
- module DataManager
- #==============================================================================
- if !$imported["Tsuki_CustomDataManager"]
- def self.save_game_without_rescue(index)
- File.open(make_filename(index), "wb") do |file|
- $game_system.on_before_save
- Marshal.dump(make_save_header, file)
- Marshal.dump(make_save_contents, file)
- Marshal.dump($data_weapons, file)
- Marshal.dump($data_armors, file)
- @last_savefile_index = index
- end
- return true
- end
- def self.load_game_without_rescue(index)
- File.open(make_filename(index), "rb") do |file|
- Marshal.load(file)
- extract_save_contents(Marshal.load(file))
- $data_weapons = Marshal.load(file)
- $data_armors = Marshal.load(file)
- reload_map_if_updated
- @last_savefile_index = index
- end
- return true
- end
- end # if $imported["Tsuki_CustomDataManager"]
- class <<self; alias load_database_refine_level load_database; end
- def self.load_database
- load_database_refine_level
- load_notetags_refine_level
- end
- def self.load_notetags_refine_level
- groups = [$data_weapons, $data_armors, $data_items]
- for group in groups
- for obj in group
- next if obj.nil?
- obj.load_notetags_refine_level
- end
- end
- end
- end # DataManager
- #==============================================================================
- module Dekita_Refine_Script
- #==============================================================================
- def self.copy_weapon(from_item)
- new_item = from_item.dup!
- make_new_copy(new_item, from_item)
- id = self.gain_weapon_id($data_weapons)
- if id.nil?
- new_item.id = $data_weapons.size
- $custom_weapons.push(new_item) if $imported["Tsuki_CustomDataManager"]
- $data_weapons.push(new_item)
- print "new weapon id #{new_item.id}\n"
- print "weapon array size #{$data_weapons.size}\n"
- print "Custom weapon array size #{$custom_weapons.size}\n" if $imported["Tsuki_CustomDataManager"]
- else
- new_item.id = id
- $data_weapons[id] = new_item
- end
- return new_item
- end
- def self.copy_armor(from_item)
- new_item = from_item.dup!
- make_new_copy(new_item, from_item)
- id = self.gain_armor_id($data_armors)
- if id.nil?
- new_item.id = $data_armors.size
- $custom_armors.push(new_item) if $imported["Tsuki_CustomDataManager"]
- $data_armors.push(new_item)
- print "new armor id #{new_item.id}\n"
- print "armor array size #{$data_armors.size}\n"
- print "Custom armor array size #{$custom_armors.size}\n" if $imported["Tsuki_CustomDataManager"]
- else
- new_item.id = id
- $data_armors[id] = new_item
- end
- return new_item
- end
- def self.gain_weapon_id(database)
- id = 1
- for i in 1...database.size
- weapon = database[i]
- if weapon.nil?
- print id
- return id
- end
- id += 1
- end
- return nil
- end
- def self.gain_armor_id(database)
- id = 1
- for i in 1...database.size
- armor = database[i]
- if armor.nil?
- print id
- return id
- end
- id += 1
- end
- return nil
- end
- def self.make_new_copy(new_item, from_item)
- new_item.params = from_item.params.dup!
- new_item.features = from_item.features.dup!
- new_item.xparams = from_item.xparams.dup! if $imported["DPB-PSPDS"]
- new_item.sparams = from_item.sparams.dup! if $imported["DPB-PSPDS"]
- new_item.dpbzparams = from_item.dpbzparams.dup! if $imported["DPB-PSPDS"]
- new_item.dpbzformulazS = from_item.dpbzformulazS.dup! if $imported["DPB-ATLANDDFL"]
- new_item.pwistyles = from_item.pwistyles.dup! if $imported["DPB-SoulForce"]
- end
- end # module
- #==============================================================================
- class RPG::Item < RPG::UsableItem
- #==============================================================================
- include Dekita__Refine_Script
- attr_accessor :mirage_celestone
- attr_accessor :tienkang_stone
- attr_accessor :tisha_stone
- attr_accessor :chienkun_stone
- attr_accessor :dragon_orb
- attr_accessor :refine_item
- attr_accessor :dpbz_epik_refinez_id_fs_Fs_Fs_fs
- def load_notetags_refine_level
- @refine_item = false
- @mirage_celestone = false
- @tienkang_stone = false
- @tisha_stone = false
- @chienkun_stone = false
- @dragon_orb = 0
- @dpbz_epik_refinez_id_fs_Fs_Fs_fs = nil
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when Mirage_Celestone_Note
- @mirage_celestone = true
- @refine_item = true
- when Tienkang_Stone_Note
- @tienkang_stone = true
- @refine_item = true
- when Tisha_Stone_Note
- @tisha_stone = true
- @refine_item = true
- when Chienkun_Stone_Note
- @chienkun_stone = true
- @refine_item = true
- when Dragon_Orb_Note
- @dragon_orb = $1.to_i
- @refine_item = true
- end
- } # self.note.split
- end
- end # RPG::Item < RPG::UsableItem
- #==============================================================================
- class RPG::EquipItem < RPG::BaseItem
- #==============================================================================
- include Dekita__Refine_Script
- attr_accessor :mirage_celestone_req
- attr_accessor :refine_mhp
- attr_accessor :refine_mmp
- attr_accessor :refine_atk
- attr_accessor :refine_def
- attr_accessor :refine_mat
- attr_accessor :refine_mdf
- attr_accessor :refine_agi
- attr_accessor :refine_luk
- attr_accessor :refine_level
- attr_accessor :equipment_grade
- attr_accessor :times_modified
- def load_notetags_refine_level
- @mirage_celestone_req = 0
- @equipment_grade = 0
- @times_modified = 0
- @refine_level = 0
- @refine_mhp = false
- @refine_mmp = false
- @refine_atk = false
- @refine_def = false
- @refine_mat = false
- @refine_mdf = false
- @refine_agi = false
- @refine_luk = false
- @refine_eva = false
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when Mirage_Celestone_Req_Note
- @mirage_celestone_req = $1.to_i
- when Equipment_Grade_Notetag
- @equipment_grade = $1.to_i
- when Refine_MHP_Notetag
- @refine_mhp = true
- when Refine_MMP_Notetag
- @refine_mmp = true
- when Refine_Atk_Notetag
- @refine_atk = true
- when Refine_Def_Notetag
- @refine_def = true
- when Refine_Mat_Notetag
- @refine_mat = true
- when Refine_Mdf_Notetag
- @refine_mdf = true
- when Refine_Agi_Notetag
- @refine_agi = true
- when Refine_Luk_Notetag
- @refine_luk = true
- end
- } # self.note.split
- end
- def max_refine
- return Max_Refine
- end
- def refine_level_up(item)
- @refine_level += 1
- end
- def refine_level_down(item)
- health_loss(item) if item.refine_mhp
- mana_loss(item) if item.refine_mmp
- attack_loss(item) if item.refine_atk
- defence_loss(item) if item.refine_def
- magic_loss(item) if item.refine_mat
- magic_def_loss(item) if item.refine_mdf
- agility_loss(item) if item.refine_agi
- luck_loss(item) if item.refine_luk
- item.refine_level -= 1
- end
- def refine_fail(item)
- health_fail(item) if item.refine_mhp
- mana_fail(item) if item.refine_mmp
- attack_fail(item) if item.refine_atk
- defence_fail(item) if item.refine_def
- magic_fail(item) if item.refine_mat
- magic_def_fail(item) if item.refine_mdf
- agility_fail(item) if item.refine_agi
- luck_fail(item) if item.refine_luk
- @refine_level = 0
- end
- def determine_refine_bonus(item)
- return if item.refine_level == item.max_refine
- health_refine(item) if item.refine_mhp
- mana_refine(item) if item.refine_mmp
- attack_refine(item) if item.refine_atk
- defence_refine(item) if item.refine_def
- magic_refine(item) if item.refine_mat
- magic_def_refine(item) if item.refine_mdf
- agility_refine(item) if item.refine_agi
- luck_refine(item) if item.refine_luk
- refine_level_up(item)
- end
- def health_refine(item)
- if @refine_level == 0
- item.params[0] += (item.equipment_grade * Plus_1_Ref_Val).to_i
- elsif @refine_level == 1
- item.params[0] += (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 2
- item.params[0] += (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[0] += (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[0] += (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[0] += (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[0] += (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[0] += (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[0] += (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[0] += (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[0] += (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[0] += (item.equipment_grade * Plus_12_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def health_loss(item)
- if @refine_level == 0
- elsif @refine_level == 1
- item.params[0] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- elsif @refine_level == 2
- item.params[0] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[0] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[0] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[0] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[0] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[0] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[0] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[0] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[0] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[0] -= (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def health_fail(item)
- index = 0
- if @refine_level == 0
- elsif @refine_level == 1
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- elsif @refine_level == 2
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def mana_refine(item)
- if @refine_level == 0
- item.params[1] += (item.equipment_grade * Plus_1_Ref_Val).to_i
- elsif @refine_level == 1
- item.params[1] += (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 2
- item.params[1] += (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[1] += (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[1] += (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[1] += (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[1] += (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[1] += (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[1] += (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[1] += (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[1] += (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[1] += (item.equipment_grade * Plus_12_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def mana_loss(item)
- if @refine_level == 0
- elsif @refine_level == 1
- item.params[1] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- elsif @refine_level == 2
- item.params[1] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[1] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[1] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[1] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[1] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[1] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[1] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[1] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[1] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[1] -= (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def mana_fail(item)
- index = 1
- if item.refine_level == 0
- elsif item.refine_level == 1
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- elsif item.refine_level == 2
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif item.refine_level == 3
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif item.refine_level == 4
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif item.refine_level == 5
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif item.refine_level == 6
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif item.refine_level == 7
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def attack_refine(item)
- if @refine_level == 0
- item.params[2] += item.equipment_grade * Plus_1_Ref_Val
- elsif @refine_level == 1
- item.params[2] += (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 2
- item.params[2] += (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[2] += (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[2] += (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[2] += (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[2] += (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[2] += (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[2] += (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[2] += (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[2] += (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[2] += (item.equipment_grade * Plus_12_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def attack_loss(item)
- if @refine_level == 0
- elsif @refine_level == 1
- item.params[2] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- elsif @refine_level == 2
- item.params[2] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[2] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[2] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[2] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[2] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[2] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[2] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[2] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[2] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[2] -= (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def attack_fail(item)
- index = 2
- if @refine_level == 0
- elsif @refine_level == 1
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- elsif @refine_level == 2
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def defence_refine(item)
- if @refine_level == 0
- item.params[3] += item.equipment_grade * Plus_1_Ref_Val
- elsif @refine_level == 1
- item.params[3] += (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 2
- item.params[3] += (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[3] += (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[3] += (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[3] += (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[3] += (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[3] += (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[3] += (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[3] += (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[3] += (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[3] += (item.equipment_grade * Plus_12_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def defence_loss(item)
- if @refine_level == 0
- elsif @refine_level == 1
- item.params[3] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- elsif @refine_level == 2
- item.params[3] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[3] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[3] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[3] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[3] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[3] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[3] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[3] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[3] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[3] -= (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def defence_fail(item)
- index = 3
- if @refine_level == 0
- elsif @refine_level == 1
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- elsif @refine_level == 2
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def magic_refine(item)
- if @refine_level == 0
- item.params[4] += item.equipment_grade * Plus_1_Ref_Val
- elsif @refine_level == 1
- item.params[4] += (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 2
- item.params[4] += (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[4] += (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[4] += (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[4] += (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[4] += (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[4] += (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[4] += (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[4] += (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[4] += (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[4] += (item.equipment_grade * Plus_12_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def magic_loss(item)
- if @refine_level == 0
- elsif @refine_level == 1
- item.params[4] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- elsif @refine_level == 2
- item.params[4] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[4] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[4] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[4] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[4] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[4] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[4] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[4] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[4] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[4] -= (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def magic_fail(item)
- index = 4
- if @refine_level == 4
- elsif @refine_level == 1
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- elsif @refine_level == 2
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def magic_def_refine(item)
- if @refine_level == 0
- item.params[5] += item.equipment_grade * Plus_1_Ref_Val
- elsif @refine_level == 1
- item.params[5] += (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 2
- item.params[5] += (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[5] += (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[5] += (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[5] += (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[5] += (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[5] += (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[5] += (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[5] += (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[5] += (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[5] += (item.equipment_grade * Plus_12_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def magic_def_loss(item)
- if @refine_level == 0
- elsif @refine_level == 1
- item.params[5] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- elsif @refine_level == 2
- item.params[5] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[5] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[5] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[5] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[5] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[5] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[5] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[5] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[5] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[5] -= (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def magic_def_fail(item)
- index = 5
- if @refine_level == 0
- elsif @refine_level == 1
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- elsif @refine_level == 2
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def agility_refine(item)
- if @refine_level == 0
- item.params[6] += item.equipment_grade * Plus_1_Ref_Val
- elsif @refine_level == 1
- item.params[6] += (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 2
- item.params[6] += (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[6] += (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[6] += (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[6] += (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[6] += (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[6] += (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[6] += (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[6] += (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[6] += (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[6] += (item.equipment_grade * Plus_12_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def agility_loss(item)
- if @refine_level == 0
- elsif @refine_level == 1
- item.params[6] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- elsif @refine_level == 2
- item.params[6] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[6] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[6] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[6] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[6] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[6] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[6] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[6] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[6] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[6] -= (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def agility_fail(item)
- index = 6
- if @refine_level == 0
- elsif @refine_level == 1
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- elsif @refine_level == 2
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def luck_refine(item)
- if @refine_level == 0
- item.params[7] += item.equipment_grade * Plus_1_Ref_Val
- elsif @refine_level == 1
- item.params[7] += (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 2
- item.params[7] += (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[7] += (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[7] += (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[7] += (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[7] += (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[7] += (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[7] += (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[7] += (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[7] += (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[7] += (item.equipment_grade * Plus_12_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def luck_loss(item)
- if @refine_level == 0
- elsif @refine_level == 1
- item.params[7] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- elsif @refine_level == 2
- item.params[7] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[7] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[7] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[7] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[7] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[7] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[7] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[7] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[7] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[7] -= (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- def luck_fail(item)
- index = 7
- if @refine_level == 0
- elsif @refine_level == 1
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- elsif @refine_level == 2
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 3
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 4
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 5
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 6
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 7
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 8
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 9
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 10
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- elsif @refine_level == 11
- item.params[index] -= (item.equipment_grade * Plus_1_Ref_Val).to_i
- item.params[index] -= (item.equipment_grade * Plus_2_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_3_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_4_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_5_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_6_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_7_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_8_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_9_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_10_Ref_Val - (item.equipment_grade)).to_i
- item.params[index] -= (item.equipment_grade * Plus_11_Ref_Val - (item.equipment_grade)).to_i
- end
- end
- end # equip item
- #==============================================================================
- class Game_Party < Game_Unit
- #==============================================================================
- alias item_number_gp_dpbz item_number
- def item_number(item)
- if item.is_a?(RPG::EquipItem)
- return 1
- else
- return item_number_gp_dpbz(item)
- end
- end
- alias gain_item_gp_dpbz gain_item
- def gain_item(item, amount, include_equip = false)
- if item.is_a?(RPG::Weapon)
- if amount > 0
- amount.times do
- new_item = Dekita_Refine_Script.copy_weapon(item)
- @weapons[new_item.id] = new_item
- end
- elsif amount < 0
- @weapons.delete(item.id)
- end
- elsif item.is_a?(RPG::Armor)
- if amount > 0
- amount.times do
- new_item = Dekita_Refine_Script.copy_armor(item)
- @armors[new_item.id] = new_item
- end
- elsif amount < 0
- @armors.delete(item.id)
- end
- else
- gain_item_gp_dpbz(item, amount, include_equip)
- end
- end
- end # Game_Party
- #==============================================================================
- class Window_ItemList < Window_Selectable
- #==============================================================================
- def draw_item(index)
- item = @data[index]
- if item
- rect = item_rect(index)
- rect.width -= 4
- draw_item_name(item, rect.x, rect.y, enable?(item))
- if item.is_a?(RPG::EquipItem)
- draw_item_refine_level(rect, item)
- else
- draw_item_number(rect, item)
- end
- end
- end
- def draw_item_refine_level(rect, item)
- plu = Dekita__Refine_Script::Refine_Symbols
- draw_text(rect, sprintf(plu, item.refine_level), 2)
- end
- end # Window_ItemList
- #==============================================================================
- class Window_DPBzEquipCommand < Window_Command
- #==============================================================================
- def initialize(x, y, width)
- @window_width = width
- super(x, y)
- end
- def window_width
- return @window_width
- end
- def make_command_list
- for command in Dekita__Refine_Script::COMMANDS
- case command[0]
- when :sel_eqp
- add_command("", :sel_eqp)
- when :sel_itm
- add_command("", :sel_itm)
- when :ref_str
- add_command("", :ref_str)
- when :eqp_inf
- add_command("", :eqp_inf)
- when :exit
- add_command("", :exit)
- else
- end
- end
- end
- end # Window_DPBzEquipCommand
- #==============================================================================
- class Window_RefineConfirm < Window_Command
- #==============================================================================
- def initialize(x, y, width)
- @window_width = width
- super(x, y)
- end
- def window_width
- @window_width
- end
- def window_height
- fitting_height(4)
- end
- def make_command_list
- add_command("ok", :ok)
- add_command("cancel", :cancel)
- end
- end # Window_Refine_Confirm
- #==============================================================================
- class Window_MirageItemList < Window_ItemList
- #==============================================================================
- def col_max
- return 1
- end
- def include?(item)
- return true if item.is_a?(RPG::Item) && item.mirage_celestone
- return false
- end
- def enable?(item)
- $game_party.usable?(item)
- end
- end # Window
- #==============================================================================
- class Window_RefineItemList < Window_ItemList
- #==============================================================================
- def col_max
- return 1
- end
- def include?(item)
- return true if item.is_a?(RPG::Item) && item.refine_item
- return false
- end
- def enable?(item)
- $game_party.usable?(item)
- end
- end # Window
- #==============================================================================
- class Window_RefineEquipList < Window_ItemList
- #==============================================================================
- def col_max
- return 1
- end
- def include?(item)
- return true if item.is_a?(RPG::EquipItem)
- return false
- end
- def enable?(item)
- return false if item.refine_level == item.max_refine
- return false if item.equipment_grade == 0
- return true
- end
- end # Window
- #==============================================================================
- class Window_DPBzEquipStatus < Window_Base
- #==============================================================================
- attr_reader :item_window
- def initialize(x, y, width, height)
- super(x, y, width, height)
- @actor = nil
- @temp_actor = nil
- @width = width
- @height = height
- refresh
- end
- def window_width
- return @width
- end
- def window_height
- @height
- end
- def visible_line_number
- return 7
- end
- def actor=(actor)
- return if @actor == actor
- @actor = actor
- refresh
- end
- def refresh
- contents.clear
- draw_selected_equip
- draw_equipinfo_list
- draw_commands_list
- ax = (window_width-24)/2.5
- draw_actor_face(@actor, ax, 0) if @actor
- draw_horz_line(line_height * 4)
- draw_horz_line((Graphics.height) - (line_height * 4))
- end
- def draw_horz_line(y)
- line_y = y + line_height / 2 - 1
- contents.fill_rect(0, line_y, contents_width, 2, line_color)
- end
- def line_color
- color = normal_color
- color.alpha = 48
- color
- end
- def set_temp_actor(temp_actor)
- return if @temp_actor == temp_actor
- @temp_actor = temp_actor
- refresh
- end
- def item
- @actor ? @actor.equips[index] : nil
- end
- def draw_selected_equip
- dx = 0
- dw = (Graphics.width-24) / 2
- dy = Graphics.height / 3
- for info in Dekita__Refine_Script::Refine_Info
- dy = draw_info(info, dx, dy, dw)
- end
- end
- def draw_commands_list
- dx = 0
- dw = (window_width + 24) / 5
- dy = line_height * 0
- for info in Dekita__Refine_Script::COMMANDS
- dy = draw_info(info, dx, dy, dw)
- end
- end
- def draw_equipinfo_list
- dx = (Graphics.width) / 4 * 2
- dw = (window_width + 24) / 2
- dy = Graphics.height/3
- for info in Dekita__Refine_Script::Item_Refine_Info
- dy = draw_info(info, dx, dy, dw)
- end
- end
- def draw_pagefour_info3
- dx = 5
- dw = (window_width - 24)
- dy = line_height * DPB::PSS::INFO3LH
- for info in Dekita__Refine_Script::Refine_Info
- dy = draw_info(info, dx, dy, dw)
- end
- end
- def draw_info(info, dx, dy, dw)
- case info[0]
- when :refine_equip
- text = ""
- when :refine_aid
- text = ""
- when :mirage_cost
- text = ""
- when :blank
- when :sel_eqp
- when :sel_itm
- when :ref_Str
- when :eqp_inf
- end
- colour = Color.new(0, 0, 0, translucent_alpha/2)
- rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
- contents.fill_rect(rect, colour)
- change_color(system_color)
- draw_text(dx+4, dy, dw-8, line_height, info[1], 0)
- change_color(normal_color)
- draw_text(dx+4, dy, dw-8, line_height, text, 2)
- return dy + line_height
- end
- end # end Window_DPBzEquipStatus
- #==============================================================================
- class Game_Temp
- #==============================================================================
- attr_reader :select_refine_equip
- attr_reader :select_refine_item
- alias refinesGTinit initialize
- def initialize
- refinesGTinit
- @select_refine_equip = 0
- @select_refine_item = 0
- end
- end # class
- #==============================================================================
- class Scene_Refine < Scene_MenuBase
- #==============================================================================
- def msg
- s = [
- "#{Dekita__Refine_Script::S_E_Help_Info}",
- "#{Dekita__Refine_Script::S_I_Help_Info}",
- "#{Dekita__Refine_Script::S_R_Help_Info}",
- "#{""}"
- ] # Do not remove this
- return s
- end
- def start
- super
- create_status_window
- create_help_window
- create_command_window
- @command_window.opacity = 0
- create_refine_selection_window
- make_selected_item_window
- make_refine_prog_window
- make_refine_cost_window
- make_item_info_window
- create_category_window
- create_refine_item_window
- create_refine_equip_window
- # create_mirage_window
- # / Equip Name
- @rs_window.x = 0
- @rs_window.y = (Graphics.height/5*2)-4
- @rs_window.opacity = 0
- # / Grade
- @rp_window.x = 0
- @rp_window.y = @rs_window.y + 24
- @rp_window.opacity = 0
- # / Aid Name
- @is_window.x = 0
- @is_window.y = (Graphics.height / 5 * 3) + 8
- @is_window.opacity = 0
- # / Cost
- @rc_window.x = 0
- @rc_window.y = (Graphics.height / 5 * 3) + 33
- @rc_window.opacity = 0
- # / Cost
- @ii_window.x = 0
- @ii_window.y = (Graphics.height / 2) / 1.5
- @ii_window.opacity = 0
- @ii_window.height = 200
- # / Help
- @help_window.y = Graphics.height - @help_window.height
- @help_window.set_text(msg[@command_window.index])
- @help_window.opacity = 0
- end
- def create_refine_selection_window
- @rs_window = Window_Help.new
- @rs_window.viewport = @viewport
- end
- def make_selected_item_window
- @is_window = Window_Help.new
- @is_window.viewport = @viewport
- end
- def make_refine_prog_window
- @rp_window = Window_Help.new
- @rp_window.viewport = @viewport
- end
- def make_refine_cost_window
- @rc_window = Window_Help.new
- @rc_window.viewport = @viewport
- end
- def make_item_info_window
- @ii_window = Window_Help.new
- @ii_window.viewport = @viewport
- end
- def create_status_window
- wx = 0
- wy = 0
- ww = Graphics.width
- wh = Graphics.height
- @status_window = Window_DPBzEquipStatus.new(wx, wy, ww, wh)
- @status_window.viewport = @viewport
- @status_window.actor = @actor
- end
- def create_command_window
- wx = 0
- wy = 0
- ww = 140
- @command_window = Window_DPBzEquipCommand.new(wx, wy, ww)
- @command_window.viewport = @viewport
- @command_window.help_window = @help_window
- @command_window.set_handler(:sel_eqp,method(:command_select_equip))
- @command_window.set_handler(:sel_itm,method(:command_select_item))
- @command_window.set_handler(:ref_str,method(:command_start_refine))
- @command_window.set_handler(:eqp_inf,method(:command_start_refine))
- @command_window.set_handler(:exit, method(:return_scene))
- @command_window.set_handler(:cancel, method(:return_scene))
- @command_window.set_handler(:pagedown, method(:next_actor))
- @command_window.set_handler(:pageup, method(:prev_actor))
- end
- def create_confirm_window
- wx = @command_window.width - 24
- wy = 0
- ww = 140
- @confirm_window = Window_RefineConfirm.new(wx, wy, ww)
- @confirm_window.opacity = 0
- @confirm_window.viewport = @viewport
- @confirm_window.help_window = @help_window
- @confirm_window.set_handler(:ok, method(:confirm_equip))
- @confirm_window.set_handler(:cancel, method(:select_equip_cancel))
- end
- def create_confirm_item_window
- wx = @command_window.width - 24
- wy = 0
- ww = 140
- @confirm_window = Window_RefineConfirm.new(wx, wy, ww)
- @confirm_window.opacity = 0
- @confirm_window.viewport = @viewport
- @confirm_window.help_window = @help_window
- @confirm_window.set_handler(:ok, method(:confirm_item))
- @confirm_window.set_handler(:cancel, method(:select_equip_cancel))
- end
- def create_item_window
- wx = Graphics.width / 2
- wy = Graphics.height / 3
- ww = Graphics.width / 2
- wh = Graphics.height - wy - @help_window.height
- @item_window = Window_DPBzEquipItem.new(wx, wy, ww, wh)
- @item_window.viewport = @viewport
- @item_window.help_window = @help_window
- @item_window.status_window = @status_window
- @item_window.actor = @actor
- @item_window.set_handler(:ok, method(:on_item_ok))
- @item_window.set_handler(:cancel, method(:on_item_cancel))
- end
- def create_category_window
- @category_window = Window_ItemCategory.new
- @category_window.viewport = @viewport
- @category_window.help_window = @help_window
- @category_window.y = @help_window.height
- @category_window.opacity = 0
- @category_window.deactivate
- @category_window.hide
- @category_window.set_handler(:ok, method(:on_category_ok))
- @category_window.set_handler(:cancel, method(:return_scene))
- end
- def create_refine_item_window
- wx = Graphics.width / 2 * 1
- wy = Graphics.height / 3
- ww = Graphics.width / 2
- wh = Graphics.height - wy - @help_window.height
- @refine_item_window = Window_RefineItemList.new(wx, wy, ww, wh)
- @refine_item_window.viewport = @viewport
- @refine_item_window.opacity = 0
- @refine_item_window.hide
- @refine_item_window.help_window = @help_window
- @refine_item_window.set_handler(:ok, method(:on_refine_item_ok))
- @refine_item_window.set_handler(:cancel, method(:on_item_cancel))
- @category_window.item_window = @refine_item_window
- end
- def create_refine_equip_window
- wx = Graphics.width / 2 * 1
- wy = Graphics.height / 3
- ww = Graphics.width / 2
- wh = Graphics.height - wy - @help_window.height
- @refine_equip_window = Window_RefineEquipList.new(wx, wy, ww, wh)
- @refine_equip_window.opacity = 0
- @refine_equip_window.hide
- @refine_equip_window.viewport = @viewport
- @refine_equip_window.help_window = @help_window
- @refine_equip_window.set_handler(:ok, method(:on_refine_equip_ok))
- @refine_equip_window.set_handler(:cancel, method(:on_item_cancel))
- @category_window.item_window = @refine_equip_window
- end
- def create_mirage_window
- wx = Graphics.width / 2 * 1
- wy = (Graphics.height / 3) - 48
- ww = Graphics.width / 2
- wh = Graphics.height - wy - @help_window.height
- @mirage_window = Window_MirageItemList.new(wx, wy, ww, wh)
- @mirage_window.opacity = 0
- @mirage_window.viewport = @viewport
- @category_window.item_window = @mirage_window
- end
- def on_category_ok
- end
- def command_select_equip
- @refine_equip_window.activate
- @refine_equip_window.select_last
- end
- def command_select_item
- @refine_item_window.activate
- @refine_item_window.select_last
- end
- def command_start_refine
- check_refine_success
- @status_window.refresh
- @command_window.activate
- @refine_equip_window.refresh
- @refine_item_window.refresh
- # @mirage_window.refresh
- end
- def command_refine
- @select_refine_equip.refine_level_up
- end
- def on_slot_ok
- create_confirm_window
- end
- def on_slot_cancel
- @command_window.activate
- end
- def select_equip_cancel
- @refine_equip_window.unselect
- @confirm_window.close
- @command_window.open
- @command_window.activate
- end
- # // Confirm Equip Choice
- def confirm_equip
- @confirm_window.close
- if !@refine_equip_window.item.nil?
- @select_refine_equip = @refine_equip_window.item
- @select_refine_equip_name = @refine_equip_window.item.name
- @rs_window.set_text(@refine_equip_window.item.name + " +" +
- @refine_equip_window.item.refine_level.to_s)
- @rp_window.set_text("Grade #{@refine_equip_window.item.equipment_grade.to_s}")
- @rc_window.set_text("Mirage Cost : #{@refine_equip_window.item.mirage_celestone_req.to_s}")
- end
- @refine_equip_window.select_last
- @refine_equip_window.unselect
- @command_window.activate
- end
- # // Confirm Aid Choice
- def confirm_item
- @confirm_window.close
- if !@refine_item_window.item.nil?
- @select_refine_item = @refine_item_window.item
- @is_window.set_text(@refine_item_window.item.name)
- end
- @refine_item_window.select_last
- @refine_item_window.unselect
- @command_window.activate
- end
- def on_item_ok
- create_confirm_window
- @select_refine_item = @item_window.item
- end
- def on_refine_item_ok
- create_confirm_item_window
- @select_refine_item = @refine_item_window.item
- end
- def on_refine_equip_ok
- create_confirm_window
- @select_refine_equip = @refine_equip_window.item
- end
- def on_item_cancel
- @command_window.activate
- @refine_item_window.unselect
- @refine_equip_window.unselect
- end
- def on_actor_change
- @status_window.actor = @actor
- @command_window.activate
- end
- def update
- super
- if @command_window.active
- @help_window.set_text(msg[@command_window.index])
- update_item_windowz
- elsif @refine_equip_window.active
- @help_window.set_item(@refine_equip_window.item)
- elsif @refine_item_window.active
- @help_window.set_item(@refine_item_window.item)
- else
- end
- end
- def update_item_windowz
- if @command_window.index == 0
- @refine_equip_window.show
- @refine_item_window.hide
- elsif @command_window.index == 1
- @refine_equip_window.hide
- @refine_item_window.show
- elsif @command_window.index == 3
- @refine_equip_window.hide
- @refine_item_window.hide
- else
- end
- end
- def check_refine_success
- item = @select_refine_equip
- aid = @select_refine_item
- # // Mirage check / loss
- return false if item.nil?
- mir_loss = item.mirage_celestone_req
- mir = Dekita__Refine_Script::Mirage_Celestone_ID
- return false if $game_party.item_number($data_items[mir]) < item.mirage_celestone_req
- $game_party.lose_item($data_items[mir], mir_loss)
- # // Check for AIDS !!
- if aid.nil?
- mirage_only_aid
- item.times_modified += 1
- elsif aid.refine_item
- # // Tisha Stone
- if aid.tisha_stone
- tisha_stone_aid
- item.times_modified += 1
- $game_party.lose_item(aid, 1)
- if $game_party.has_item?(aid, include_equip = false)
- @is_window.set_text(aid.name)
- else
- @select_refine_item = nil
- aid = @select_refine_item
- @is_window.set_text("")
- end
- # // Tienkang Stone
- elsif aid.tienkang_stone
- tienkang_stone_aid
- item.times_modified += 1
- $game_party.lose_item(aid, 1)
- if $game_party.has_item?(aid, include_equip = false)
- @is_window.set_text(aid.name)
- else
- @select_refine_item = nil
- aid = @select_refine_item
- @is_window.set_text("")
- end
- # // Chienkun Stone
- elsif aid.chienkun_stone
- chienkun_stone_aid
- item.times_modified += 1
- $game_party.lose_item(aid, 1)
- if $game_party.has_item?(aid, include_equip = false)
- @is_window.set_text(aid.name)
- else
- @select_refine_item = nil
- aid = @select_refine_item
- @is_window.set_text("")
- end
- # // Dragon Orb
- elsif aid.dragon_orb
- dragon_orb_aid
- item.times_modified += 1
- $game_party.lose_item(aid, 1)
- if $game_party.has_item?(aid, include_equip = false)
- @is_window.set_text(aid.name)
- else
- @select_refine_item = nil
- aid = @select_refine_item
- @is_window.set_text("")
- end
- end
- end
- @rs_window.set_text("#{item.name+Dekita__Refine_Script::Refine_Symbol+item.refine_level.to_s}")
- wait(Dekita__Refine_Script::Wait_Time)
- end
- # Tisha Stone Aid
- def tisha_stone_aid
- item = @select_refine_equip
- aid = @select_refine_item
- @aid_val_find = rand(0.99999)
- if item.refine_level == 0
- if @aid_val_find <= Dekita__Refine_Script::Plus_1_Tish_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_NO_Fail}")
- end
- elsif item.refine_level == 1
- if @aid_val_find <= Dekita__Refine_Script::Plus_2_Tish_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_level_down(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Single_Fail}")
- end
- elsif item.refine_level == 2
- if @aid_val_find <= Dekita__Refine_Script::Plus_3_Tish_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_level_down(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Single_Fail}")
- end
- elsif item.refine_level == 3
- if @aid_val_find <= Dekita__Refine_Script::Plus_4_Tish_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_level_down(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Single_Fail}")
- end
- elsif item.refine_level == 4
- if @aid_val_find <= Dekita__Refine_Script::Plus_5_Tish_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_level_down(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Single_Fail}")
- end
- elsif item.refine_level == 5
- if @aid_val_find <= Dekita__Refine_Script::Plus_6_Tish_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_level_down(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Single_Fail}")
- end
- elsif item.refine_level == 6
- if @aid_val_find <= Dekita__Refine_Script::Plus_7_Tish_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_level_down(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Single_Fail}")
- end
- elsif item.refine_level == 7
- if @aid_val_find <= Dekita__Refine_Script::Plus_8_Tish_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_level_down(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Single_Fail}")
- end
- elsif item.refine_level == 8
- if @aid_val_find <= Dekita__Refine_Script::Plus_9_Tish_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_level_down(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Single_Fail}")
- end
- elsif item.refine_level == 9
- if @aid_val_find <= Dekita__Refine_Script::Plus_10_Tish_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_level_down(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Single_Fail}")
- end
- elsif item.refine_level == 10
- if @aid_val_find <= Dekita__Refine_Script::Plus_11_Tish_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_level_down(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Single_Fail}")
- end
- elsif item.refine_level == 11
- if @aid_val_find <= Dekita__Refine_Script::Plus_12_Tish_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_level_down(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Single_Fail}")
- end
- end
- end
- # Tienkang Stone Aid
- def tienkang_stone_aid
- item = @select_refine_equip
- aid = @select_refine_item
- @aid_val_find = rand(0.99999)
- if item.refine_level == 0
- if @aid_val_find <= Dekita__Refine_Script::Plus_1_Tein_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_NO_Fail}")
- end
- elsif item.refine_level == 1
- if @aid_val_find <= Dekita__Refine_Script::Plus_2_Tein_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- elsif item.refine_level == 2
- if @aid_val_find <= Dekita__Refine_Script::Plus_3_Tein_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- elsif item.refine_level == 3
- if @aid_val_find <= Dekita__Refine_Script::Plus_4_Tein_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- elsif item.refine_level == 4
- if @aid_val_find <= Dekita__Refine_Script::Plus_5_Tein_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- elsif item.refine_level == 5
- if @aid_val_find <= Dekita__Refine_Script::Plus_6_Tein_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- elsif item.refine_level == 6
- if @aid_val_find <= Dekita__Refine_Script::Plus_7_Tein_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- elsif item.refine_level == 7
- if @aid_val_find <= Dekita__Refine_Script::Plus_8_Tein_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- elsif item.refine_level == 8
- if @aid_val_find <= Dekita__Refine_Script::Plus_9_Tein_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- elsif item.refine_level == 9
- if @aid_val_find <= Dekita__Refine_Script::Plus_10_Tein_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- elsif item.refine_level == 10
- if @aid_val_find <= Dekita__Refine_Script::Plus_11_Tein_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- elsif item.refine_level == 11
- if @aid_val_find <= Dekita__Refine_Script::Plus_12_Tein_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- end
- end
- # Chienkun Stone Aid
- def chienkun_stone_aid
- item = @select_refine_equip
- aid = @select_refine_item
- @aid_val_find = rand(0.99999)
- if item.refine_level == 0
- if @aid_val_find <= Dekita__Refine_Script::Plus_1_CKun_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_NO_Fail}")
- end
- elsif item.refine_level == 1
- if @aid_val_find <= Dekita__Refine_Script::Plus_2_CKun_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_NO_Fail}")
- end
- elsif item.refine_level == 2
- if @aid_val_find <= Dekita__Refine_Script::Plus_3_CKun_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_NO_Fail}")
- end
- elsif item.refine_level == 3
- if @aid_val_find <= Dekita__Refine_Script::Plus_4_CKun_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_NO_Fail}")
- end
- elsif item.refine_level == 4
- if @aid_val_find <= Dekita__Refine_Script::Plus_5_CKun_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_NO_Fail}")
- end
- elsif item.refine_level == 5
- if @aid_val_find <= Dekita__Refine_Script::Plus_6_CKun_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_NO_Fail}")
- end
- elsif item.refine_level == 6
- if @aid_val_find <= Dekita__Refine_Script::Plus_7_CKun_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_NO_Fail}")
- end
- elsif item.refine_level == 7
- if @aid_val_find <= Dekita__Refine_Script::Plus_8_CKun_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_NO_Fail}")
- end
- elsif item.refine_level == 8
- if @aid_val_find <= Dekita__Refine_Script::Plus_9_CKun_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_NO_Fail}")
- end
- elsif item.refine_level == 9
- if @aid_val_find <= Dekita__Refine_Script::Plus_10_CKun_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_NO_Fail}")
- end
- elsif item.refine_level == 10
- if @aid_val_find <= Dekita__Refine_Script::Plus_11_CKun_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_NO_Fail}")
- end
- elsif item.refine_level == 11
- if @aid_val_find <= Dekita__Refine_Script::Plus_12_CKun_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_NO_Fail}")
- end
- end
- end
- # Dragon Orb Aid
- def dragon_orb_aid
- item = @select_refine_equip
- aid = @select_refine_item
- @aid_val_find = rand(0.99999)
- if item.refine_level == 0
- if aid.dragon_orb >= 1
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- mirage_only_aid
- end
- elsif item.refine_level == 1
- if aid.dragon_orb >= 2
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- mirage_only_aid
- end
- elsif item.refine_level == 2
- if aid.dragon_orb >= 3
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- mirage_only_aid
- end
- elsif item.refine_level == 3
- if aid.dragon_orb >= 4
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- mirage_only_aid
- end
- elsif item.refine_level == 4
- if aid.dragon_orb >= 5
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- mirage_only_aid
- end
- elsif item.refine_level == 5
- if aid.dragon_orb >= 6
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- mirage_only_aid
- end
- elsif item.refine_level == 6
- if aid.dragon_orb >= 7
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- mirage_only_aid
- end
- elsif item.refine_level == 7
- if aid.dragon_orb >= 8
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- mirage_only_aid
- end
- elsif item.refine_level == 8
- if aid.dragon_orb >= 9
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- mirage_only_aid
- end
- elsif item.refine_level == 9
- if aid.dragon_orb >= 10
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- mirage_only_aid
- end
- elsif item.refine_level == 10
- if aid.dragon_orb >= 11
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- mirage_only_aid
- end
- elsif item.refine_level == 11
- if aid.dragon_orb >= 12
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- mirage_only_aid
- end
- end
- end
- # Mirage Stone Aid
- def mirage_only_aid
- item = @select_refine_equip
- aid = @select_refine_item
- @aid_val_find = rand(0.99999)
- if item.refine_level == 0
- if @aid_val_find <= Dekita__Refine_Script::Plus_1_Mir_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_NO_Fail}")
- end
- elsif item.refine_level == 1
- if @aid_val_find <= Dekita__Refine_Script::Plus_2_Mir_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Single_Fail}")
- end
- elsif item.refine_level == 2
- if @aid_val_find <= Dekita__Refine_Script::Plus_3_Mir_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- elsif item.refine_level == 3
- if @aid_val_find <= Dekita__Refine_Script::Plus_4_Mir_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- elsif item.refine_level == 4
- if @aid_val_find <= Dekita__Refine_Script::Plus_5_Mir_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- elsif item.refine_level == 5
- if @aid_val_find <= Dekita__Refine_Script::Plus_6_Mir_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- elsif item.refine_level == 6
- if @aid_val_find <= Dekita__Refine_Script::Plus_7_Mir_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- elsif item.refine_level == 7
- if @aid_val_find <= Dekita__Refine_Script::Plus_8_Mir_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- elsif item.refine_level == 8
- if @aid_val_find <= Dekita__Refine_Script::Plus_9_Mir_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- elsif item.refine_level == 9
- if @aid_val_find <= Dekita__Refine_Script::Plus_10_Mir_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- elsif item.refine_level == 10
- if @aid_val_find <= Dekita__Refine_Script::Plus_11_Mir_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- elsif item.refine_level == 11
- if @aid_val_find <= Dekita__Refine_Script::Plus_12_Mir_Val
- item.determine_refine_bonus(@select_refine_equip)
- @help_window.set_text(Dekita__Refine_Script::S_R_Success)
- else
- item.refine_fail(@select_refine_equip)
- @help_window.set_text("#{Dekita__Refine_Script::S_R_Fail}
- #{Dekita__Refine_Script::S_R_Total_Fail}")
- end
- end
- end
- def wait(time)
- t = 0 ; loop do
- Graphics.update
- if t == time
- break
- end ; t += 1 ; end
- end
- end # end scene
- #==============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #==============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement