[DoE] Cylosis Administrateur fondateur
Nombre de messages : 281 Age : 28 Date d'inscription : 09/06/2007
Mon niveau de Making Niveau Script: (14/20) Niveau construction de MAP: (15/20) Niveau Base de donnée: (19/20)
| Sujet: [Script] Optimisation de l'équipement Dim 10 Juin - 15:39 | |
| Optimisation de l'équipement Grâce à ces petits scripts, on va pouvoir faire en sorte que quand l'on appuie sur le bouton X, l'équipement dans le slot selectionné soit optimisé et que quand on appuie sur Y, tout l'équipement sera optimisé. Pour ceux qui n'ont jamais joué aux anciens FF (Oh Mon Dieu lol) Optimiser ici signifie remplacer l'équipement actuel par le meilleur, c'est le personnage qui s'équipe immédiatement des meilleurs équipements. C'est configurable. Bon alors, au début de Scene_Equip, ligne 8 si je ne m'abuse apres "class Scene_Equip" rajoutez ceci : Citation: - Code:
-
# ------------------------- WEAPON_ATK_WEIGHT = 1.0 WEAPON_PDF_WEIGHT = 0.0 WEAPON_MDF_WEIGHT = 0.0 WEAPON_STR_WEIGHT = 0.0 WEAPON_DEX_WEIGHT = 0.0 WEAPON_AGI_WEIGHT = 0.0 WEAPON_INT_WEIGHT = 0.0 ARMOR_EVA_WEIGHT = 0.0 ARMOR_PDF_WEIGHT = 0.75 ARMOR_MDF_WEIGHT = 0.25 ARMOR_STR_WEIGHT = 0.0 ARMOR_DEX_WEIGHT = 0.0 ARMOR_AGI_WEIGHT = 0.0 ARMOR_INT_WEIGHT = 0.0 NO_ACCESSORY_OPTIMIZATION = false
Si vous voulez que les accessoires ne soient pas les sujets d'optimisation remplacer false par true dans la derniere ligne de code si dessus.
ligne 256 la ou y'a "def update_right", et remplacez tout ce code jusqu'à la ligne 303 "end" par ce code ci :
Citation: def update_right if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Menu.new(2) return end if Input.trigger?(Input::C) if @actor.equip_fix?(@right_window.index) $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) @right_window.active = false @item_window.active = true @item_window.index = 0 return end if Input.trigger?(Input::X) $game_system.se_play($data_system.decision_se) optimize(@right_window.index) @left_window.refresh @right_window.refresh @item_window1.refresh @item_window2.refresh @item_window3.refresh @item_window4.refresh @item_window5.refresh return end if Input.trigger?(Input::Y) $game_system.se_play($data_system.decision_se) optimize(0)
optimize(1) optimize(2) optimize(3) optimize(4) @left_window.refresh @right_window.refresh @item_window1.refresh @item_window2.refresh @item_window3.refresh @item_window4.refresh @item_window5.refresh return end if Input.trigger?(Input::R) $game_system.se_play($data_system.cursor_se) @actor_index += 1 @actor_index %= $game_party.actors.size $scene = Scene_Equip.new(@actor_index, @right_window.index) return end if Input.trigger?(Input::L) $game_system.se_play($data_system.cursor_se) @actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size $scene = Scene_Equip.new(@actor_index, @right_window.index) return end end Juste apres le script précédent, ou n'importe ou apres la fin d'un "def", rajoutez le code suivant : Citation: - Code:
-
def optimize(slot) if slot == 0 object = $data_weapons[@actor.weapon_id] optimal = object.id current = 0.00 if @actor.weapon_id != 0 current += object.atk * WEAPON_ATK_WEIGHT current += object.pdef * WEAPON_PDF_WEIGHT current += object.mdef * WEAPON_MDF_WEIGHT current += object.str_plus * WEAPON_STR_WEIGHT current += object.dex_plus * WEAPON_DEX_WEIGHT current += object.agi_plus * WEAPON_AGI_WEIGHT current += object.int_plus * WEAPON_INT_WEIGHT else optimal = 0 end max_eval = current @actor.equip(0, 0) flag = false zero_flag = true for weapon in $data_weapons if !flag flag = true next end evaluation = 0.00 evaluation += weapon.atk * WEAPON_ATK_WEIGHT evaluation += weapon.pdef * WEAPON_PDF_WEIGHT evaluation += weapon.mdef * WEAPON_MDF_WEIGHT evaluation += weapon.str_plus * WEAPON_STR_WEIGHT evaluation += weapon.dex_plus * WEAPON_DEX_WEIGHT evaluation += weapon.agi_plus * WEAPON_AGI_WEIGHT evaluation += weapon.int_plus * WEAPON_INT_WEIGHT if evaluation > 0 zero_flag = false end if @actor.equippable?(weapon) && $game_party.weapon_number(weapon.id) > 0 && evaluation > max_eval max_eval = evaluation optimal = weapon.id end end if zero_flag optimal = 0 end @actor.equip(0, optimal) #------------------------UNIQUEMENT SI VOUS AVEZ LE SCRIPT "Epée à deux mains" TWO_HANDED_WEAPON if $game_system.two_handed_weapons.include?(optimal) @actor.equip(1, 0) end #------------------------FIN end if slot >= 1 not_equipped = false case slot when 1 #------------------------UNIQUEMENT SI VOUS AVEZ LE SCRIPT "Epée à deux mains" TWO_HANDED_WEAPON if $game_system.two_handed_weapons.include?(@actor.weapon_id) return end #------------------------FIN if @actor.armor1_id == 0 not_equipped = true else object = $data_armors[@actor.armor1_id] end when 2 if @actor.armor2_id == 0 not_equipped = true else object = $data_armors[@actor.armor2_id] end when 3 if @actor.armor3_id == 0 not_equipped = true else object = $data_armors[@actor.armor3_id] end when 4 if NO_ACCESSORY_OPTIMIZATION return end if @actor.armor4_id == 0 not_equipped = true else object = $data_armors[@actor.armor4_id] end end optimal = object.id current = 0.00 if not_equipped = false current += object.eva * ARMOR_EVA_WEIGHT current += object.pdef * ARMOR_PDF_WEIGHT current += object.mdef * ARMOR_MDF_WEIGHT current += object.str_plus * ARMOR_STR_WEIGHT current += object.dex_plus * ARMOR_DEX_WEIGHT current += object.agi_plus * ARMOR_AGI_WEIGHT current += object.int_plus * ARMOR_INT_WEIGHT else optimal = 0 end max_eval = current @actor.equip(slot, 0) flag = false zero_flag = true for armor in $data_armors if !flag flag = true next end if armor.kind != slot-1 next end evaluation = 0.00 evaluation += armor.eva * ARMOR_EVA_WEIGHT evaluation += armor.pdef * ARMOR_PDF_WEIGHT evaluation += armor.mdef * ARMOR_MDF_WEIGHT evaluation += armor.str_plus * ARMOR_STR_WEIGHT evaluation += armor.dex_plus * ARMOR_DEX_WEIGHT evaluation += armor.agi_plus * ARMOR_AGI_WEIGHT evaluation += armor.int_plus * ARMOR_INT_WEIGHT if evaluation > 0 zero_flag = false end if @actor.equippable?(armor) && $game_party.armor_number(armor.id) > 0 && evaluation > max_eval max_eval = evaluation optimal = armor.id end end if zero_flag optimal = 0 end @actor.equip(slot, optimal) end end Attention s'il vous plait, si vous n'avez pas le script "Epée à deux mains" Supprimez les codes concernés dans le script ci-dessus. Bonne optimisation des équipements | |
|