Chasseur41 Admin
Nombre de messages : 49 Age : 31 Localisation : Vendôme (41) et Tours (37) Loisirs : Création de jeu, musique, livre et sortit Date d'inscription : 04/07/2007
Feuille de personnage Prénom du Personnage: Brutus Nom du Personnage: Macligan Âge du Personnage: 28 ans
| Sujet: Pour créer des potions (part. 1) Mer 4 Juil - 17:07 | |
| Bon voici enfin un logiciel que je recherchez depuis longtemps, il permet de créer des potions à partir de cel rencontrez dans le jeu. A ajoutez au dessus de "Main" appellez le "alchimie". Il est en deux partis. Puis insérez ce script: - Code:
-
#============================================================================== # Scene_Alchimie : Création d'objets #------------------------------------------------------------------------------ # Créé par Raven - [email]ravenevans@hotmail.com[/email] pour RPG Creative # Date: 18/02/07 #==============================================================================
class Window_AlItem < Window_Selectable #-------------------------------------------------------------------------- # ● Création de la fenêtre # items : Liste des objets # pos_x : Position de la fenêtre #-------------------------------------------------------------------------- def initialize(items, pos_x) super(pos_x, 65, 180, 350) @commands = items @item_max = items.size self.contents = Bitmap.new(width - 32, self.height - 32) self.contents.font.name = 'Monotype Corsiva' self.contents.font.size = 16 refresh self.index = 0 end #-------------------------------------------------------------------------- # ● Affichage #-------------------------------------------------------------------------- def refresh self.contents.clear for i in [email]0...@item_max[/email] draw_item(i) end end #-------------------------------------------------------------------------- # ● Mise à jour # new : Nouvelle liste d'items #-------------------------------------------------------------------------- def update_qty(new) @commands = new @item_max = new.size self.contents.clear for i in [email]0...@item_max[/email] draw_item(i) end end #-------------------------------------------------------------------------- # ● Fonction d'affichage # index : Position de l'objet #-------------------------------------------------------------------------- def draw_item(index) item = @commands[index] rect = Rect.new(4, 32 * index, self.contents.width - 8, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.draw_text(rect, $data_items[item].name + " x" + $game_party.item_number(item).to_s) end #-------------------------------------------------------------------------- # ● Fonction de validation de l'objet # index : Position de l'objet #-------------------------------------------------------------------------- def lose(index) item = @commands[index] $game_party.lose_item(item, 1) end #-------------------------------------------------------------------------- # ● Fonction d'annulation de l'objet # index : Position de l'objet #-------------------------------------------------------------------------- def gain(index) item = @commands[index] $game_party.gain_item(item, 1) end end class Window_AlRes < Window_Base #-------------------------------------------------------------------------- # ● Création de la fenêtre #-------------------------------------------------------------------------- def initialize super(200, 210, 230, 60) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = 'Monotype Corsiva' self.contents.font.size = 24 end #-------------------------------------------------------------------------- # ● Création de l'objet # inga : Ingrédient 1 # ingb : Ingrédient 2 # ingc : Ingrédient 3 #-------------------------------------------------------------------------- def make(inga, ingb, ingc) res = -1 @recipe = [] for i in 1..$data_items.size if ($game_party.item_number(i) > 0) and ($data_items[i].element_set[0] == 20) tmp = $data_items[i].description @recipe.push(tmp.split(" ")) end end for i in [email]0..@recipe.size[/email] - 1 if res != -1 break end if (@recipe[i][0].to_i == inga.to_i) and (@recipe[i][1].to_i == ingb.to_i) and (@recipe[i][2].to_i == ingc.to_i) res = @recipe[i][3].to_i end end if res == -1 $game_system.se_play($data_system.buzzer_se) self.contents.draw_text(0, 0, 230, 32, "Echec de la création") else $game_system.se_play($data_system.shop_se) res_item = $data_items[res] bitmap = RPG::Cache.icon(res_item.icon_name) self.contents.blt(0, 4, bitmap, Rect.new(0, 0, 24, 24)) self.contents.draw_text(35, 0, 200, 32, res_item.name) $game_party.gain_item(res, 1) end end end class Window_AlRecipe < Window_Base #-------------------------------------------------------------------------- # ● Création de la fenêtre #-------------------------------------------------------------------------- def initialize super(200, 0, 440, 480) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = 'Monotype Corsiva' self.contents.font.size = 24 end #-------------------------------------------------------------------------- # ● Mise à jour # recipe : Liste des recettes # index : Recette sélectionnée #-------------------------------------------------------------------------- def update(recipe, index) self.contents.clear if index > -1 selected = $data_items[recipe[index]] desc = selected.description res = desc.split(" ") items =[] for i in 0..3 items[i] = res[i].to_i end inga = $data_items[items[0]] ingb = $data_items[items[1]] ingc = $data_items[items[2]] res = $data_items[items[3]] nbra = $game_party.item_number(items[0]) nbrb = $game_party.item_number(items[1]) nbrc = $game_party.item_number(items[2]) self.contents.font.size = 36 self.contents.font.color = Color.new(255, 255, 170) self.contents.draw_text(-5, 0, 440, 50, selected.name, 1) self.contents.font.size = 22 self.contents.font.color = system_color self.contents.draw_text(15, 100, 200, 32, "Ingrédient 1") self.contents.draw_text(15, 170, 200, 32, "Ingrédient 2") self.contents.draw_text(15, 240, 200, 32, "Ingrédient 3") self.contents.font.color = normal_color self.contents.draw_text(-5, 35, 440, 32, res.description, 1) icona = RPG::Cache.icon(inga.icon_name) iconb = RPG::Cache.icon(ingb.icon_name) iconc = RPG::Cache.icon(ingc.icon_name) self.contents.blt(0, 134, icona, Rect.new(0, 0, 24, 24)) self.contents.blt(0, 204, iconb, Rect.new(0, 0, 24, 24)) self.contents.blt(0, 274, iconc, Rect.new(0, 0, 24, 24)) self.contents.draw_text(35, 130, 400, 32, inga.name + " (Possédés : " + nbra.to_s + " )") self.contents.draw_text(35, 200, 400, 32, ingb.name + " (Possédés : " + nbrb.to_s + " )") self.contents.draw_text(35, 270, 400, 32, ingc.name + " (Possédés : " + nbrc.to_s + " )") end end end class Window_AlSelect < Window_Selectable Reportez vous maintenant à la suite ! | |
|