查看: 4735|回复: 14

[已经过期] 一个合成脚本,按照使用方法使用却完全调不出合成界面

[复制链接]
梦石
0
星屑
50
在线时间
24 小时
注册时间
2013-9-11
回帖
19
发表于 2013-10-23 15:25:17 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 76213585 于 2013-10-23 16:39 编辑

各位大大,求教啊!!!

很久以前的一个脚本,然后是合成脚本啦~渣渣我很是喜爱啊!!!!

未标题-2.jpg

然后就和他对话嘛,居然完全没反应啊……
那么我就想,可能是配方没学,我就弄了让主角学了,结果……
还是完全没有用啊!!!!
关于那个人的脚本调用是这样的:

未标题-1.jpg

完全按照脚本的说明弄的啊!!!

脚本也附上:

  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. # 欢迎访问[url]www.66RPG.com[/url]
  4. # 梦想世界,在你手中
  5. #==============================================================================  
  6. #
  7. # Sample master list for crafting script (物品分类增强版) v1.1
  8. # written by Deke
  9. # 增强:叶子
  10. #
  11. # 12-30-2005 v1.0
  12. # 8-17-2006 v1.1
  13. # 修正了返回界面时不显示成品的BUG
  14. # 修正了材料大于8个不显示的BUG
  15. # 描绘物品美化
  16. # 自动检测能否合成
  17. #============================================================================================
  18. # 简介:
  19. # 这是一个很不错的合成物品系统,可以通过游戏的过程,不断学习可以合成的
  20. # 物品方法。
  21. # ------
  22. # 增强版补充说明:
  23. # 在这个增强版中,可以对成品进行手动分类。
  24. # 成品增加了一个分类属性。
  25. # 这个分类纯粹是按自己的意愿,没有规定第几类必须是什么。
  26. # 召唤特定分类的界面,就只会看到特定分类的成品。
  27. #
  28. # 例如:
  29. # 使用脚本$scene = Scene_Craft.new(1),
  30. # 出来的界面就只会显示成品分类为1的东西
  31. # 同样道理,使用脚本$scene = Scene_Craft.new(2),
  32. # 出来的界面就只会显示成品分类为2的东西
  33. #
  34. # 如果使用脚本$scene = Scene_Craft.new或$scene = Scene_Craft.new(0)来召唤界面
  35. # 就可以看到所有成品。
  36. #
  37. # 注意:不要弄混淆“成品种类”和“成品分类”
  38. # 成品种类是指成品是普通物品(0),防具(1)或武器(2)
  39. # 成品分类是指此物品的自定义分类
  40. #
  41. #
  42. # 使用方法:
  43. # 1、召唤界面:使用脚本$scene = Scene_Craft.new(分类的数字)
  44. # 例如:使用脚本$scene = Scene_Craft.new(1),出来分类1的界面
  45. #
  46. # 2、学习合成:$game_party.learn_recipe(合成项目)
  47. #
  48. #  2.1、其实这个脚本可以使同一成品有不同配方
  49. #
  50. #    就这样说可能解释得不清楚,先来解释一下脚本学习配方的原理:
  51. #    $game_party.learn_recipe(合成项目)的处理过程并不是直接学习这个配方,
  52. #    而是在配方库中找到和合成项目成品相同的配方。
  53. #
  54. #    如果配方库中有两个配方成品相同的话,配方版本就变得重要。
  55. #    $game_party.learn_recipe(合成项目,配方版本)
  56. #    配方版本为1的话,学到的配方就是@recipe_list[xx]中与合成项目成品相同且数字最小的配方
  57. #    配方版本为2的话,学到的配方就是数字第二小的配方
  58. #    在上面这个脚本语句中,不填配方版本的话就默认为1
  59. #
  60. #  2.2、忘记配方:$game_party.forget_recipe(合成项目)
  61. #   2.21、同样道理,这个语句也可以写配方版本
  62. #    $game_party.forget_recipe(合成项目,配方版本)
  63. #    配方版本定义见2.1
  64. #
  65. #  2.3、配方版本不能乱填!例如游戏中某一个配方的成品是唯一的,与所有其它配方的成品都不相同
  66. #   那么学习的时候就不用填配方版本。
  67. #   如果这时在配方版本填了2的话,就有可能学不到或者忘不了(-_-||)
  68. #   
  69. #
  70. # 3、合成定义:
  71. # 这个合成脚本可以定义两种合成物品。一种是预先定义好了的,就像下面这样,
  72. # 直接写在这里就可以,另一种是在学习之前现场定义。
  73. #
  74. # 4、举例
  75. #  4.1、学会recipe_list[1]定义的合成:$game_party.learn_recipe($game_temp.recipe_list[1])
  76. #       注意,一行如果输入不下,在(的后面或[的后面按回车换行,否则可能出错
  77. #
  78. #  4.2、在游戏中临时定义一种合成,让玩家学会。使用事件中的脚本如下,   
  79. #  脚本:
  80. #    材料 = [$game_variables[1],$game_variables[2]]  #——材料编号是变量1、2的编号
  81. #    材料种类 = [0,0]                                #——材料是物品
  82. #    材料数量 = [$game_variables[3],$game_variables[4]]  #——需要材料数量是变量3、4的编号
  83. #    成品 = $game_variables[5]                       #——获得结果编号是5
  84. #    成品种类 = 1                                    #——成品是防具类
  85. #    成品分类 = 1                                    #——这一项不写的话默认为0
  86. #    $game_party.learn_recipe(Game_Recipe.new(材料,材料种类,材料数量,成品,成品种类,成品分类))
  87. #    上面这条语句的成品分类这一项不写也行,这样它就默认为0了。
  88. #    (也就是此物品没有分类,不会在分类菜单中出现)
  89. #    省略成品分类的脚本语句可以像下面这样写:
  90. #    $game_party.learn_recipe(Game_Recipe.new(材料,材料种类,材料数量,成品,成品种类))
  91. #
  92. #===========================================================================================
  93. class Game_Temp
  94.   attr_reader :recipe_list  
  95.   alias crafting_temp_initialize initialize
  96.   def initialize
  97.     crafting_temp_initialize
  98.     @recipe_list=[]
  99.     get_recipe_list
  100.   end  
  101.   def get_recipe_list   

  102.     材料 = [31]             # 需要材料的数据库编号
  103.     材料种类 = [0]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  104.     材料数量 = [1]         # 需要材料的数量
  105.     成品 = 1                  # 获得物品编号
  106.     成品种类 = 0              # 获得物品种类,0是普通物品,1是防具,2是武器
  107.     成品分类 = 10              # 获得成品分类
  108.     @recipe_list[1] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类,成品分类)

  109.     材料 = [31, 29, 37]             # 需要材料的数据库编号
  110.     材料种类 = [0, 0, 0]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  111.     材料数量 = [1, 1, 1]         # 需要材料的数量
  112.     成品 = 2                  # 获得物品编号
  113.     成品种类 = 0              # 获得物品种类,0是普通物品,1是防具,2是武器
  114.     成品分类 = 1              # 获得成品分类
  115.     @recipe_list[2] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类,成品分类)
  116.     ##########################################################################
  117.     # 1 号合成物品设定 (物品小药水×2 + 中药水 = 大药水) 成品分类:1
  118.     ##########################################################################
  119.     材料 = [1, 2]             # 需要材料的数据库编号
  120.     材料种类 = [0, 0]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  121.     材料数量 = [2, 1]         # 需要材料的数量
  122.     成品 = 3                  # 获得物品编号
  123.     成品种类 = 0              # 获得物品种类,0是普通物品,1是防具,2是武器
  124.     成品分类 = 1              # 获得成品分类
  125.     @recipe_list[3] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类,成品分类)
  126.    
  127.     ##########################################################################
  128.     # 2 号合成物品设定 (武器铜剑3、铁剑2、钢剑1 = 密切斯特剑) 成品分类:2
  129.     ##########################################################################
  130.     材料 = [1, 2, 3]          # 需要材料的数据库编号
  131.     材料种类 = [2, 2, 2]      # 需要材料的种类,0是普通物品,1是防具,2是武器
  132.     材料数量 = [3, 2, 1]      # 需要材料的数量
  133.     成品 = 4                  # 获得物品编号
  134.     成品种类 = 2              # 获得物品种类,0是普通物品,1是防具,2是武器
  135.     成品分类 = 2              # 获得成品分类
  136.     @recipe_list[4] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类,成品分类)
  137.    
  138.     ##########################################################################
  139.     # 3 号合成物品设定 (物品力量之石×2 + 防具钢盾×1 = 密切斯特盾) 成品分类:3
  140.     ##########################################################################
  141.     材料 = [13, 3]            # 需要材料的数据库编号
  142.     材料种类 = [0, 1]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  143.     材料数量 = [2, 1]         # 需要材料的数量
  144.     成品 = 4                  # 获得物品编号
  145.     成品种类 = 1              # 获得物品种类,0是普通物品,1是防具,2是武器
  146.     成品分类 = 3              # 获得成品分类
  147.     @recipe_list[5] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类,成品分类)
  148.    
  149.     ##########################################################################
  150.     # 4 号合成物品设定 成品分类:3
  151.     ##########################################################################
  152.     材料 = [1,2,3,4,5,6,7,8,9,10]            # 需要材料的数据库编号
  153.     材料种类 = [0,0,0,0,0,0,0,0,0,0]         # 需要材料的种类,0是普通物品,1是防具,2是武器
  154.     材料数量 = [1,1,1,1,1,1,1,1,1,1]         # 需要材料的数量
  155.     成品 = 28                  # 获得物品编号
  156.     成品种类 = 1              # 获得物品种类,0是普通物品,1是防具,2是武器
  157.     成品分类 = 3              # 获得成品分类
  158.     @recipe_list[6] = Game_Recipe.new(材料,材料种类, 材料数量,成品,成品种类,成品分类)
  159.    
  160.   end # of get_recipe_list method
  161. end # of updates to Game_Temp Class

  162. #================================
  163. # CRAFTING PROGRAM
  164. #----------------------------------------------------------------
  165. #-written by Deke
  166. #-yes_no window code created by Phsylomortis
  167. #----------------------------------------------------------------
  168. #================================

  169. #updates to Game_Party class

  170. class Game_Party
  171.   
  172.   attr_accessor       :recipes
  173.   
  174.   alias crafting_party_initialize initialize
  175.   
  176.   def initialize
  177.     crafting_party_initialize
  178.     @recipes=[]
  179.   end
  180.   
  181.   #----------------------------------------------------------------------
  182.   def know?(recipe, version = 1)
  183.     unless recipe.is_a?(Game_Recipe)
  184.       recipe = get_recipe_from_master_list(recipe, version)
  185.     end
  186.     return $game_party.recipes.include?(recipe)
  187.   end
  188.   
  189. #----------------------------------------------------------------------
  190.   def learn_recipe(recipe , version = 1)
  191.     unless recipe.is_a?(Game_Recipe)
  192.       recipe = get_recipe_from_master_list(recipe, version)
  193.     end
  194.     if recipe.is_a?(Game_Recipe)
  195.       unless know?(recipe)
  196.         @recipes.push(recipe)
  197.       end
  198.     end
  199.   end
  200.   
  201. #----------------------------------------------------------------------
  202.   def forget_recipe(recipe , version = 1)
  203.     if !recipe.is_a?(Game_Recipe)
  204.       recipe = get_recipe_from_master_list(recipe, version)
  205.     end
  206.     if recipe.is_a?(Game_Recipe)
  207.       for i in [email]0...@recipes.size[/email]
  208.         if recipe == @recipes[i]
  209.           index = i
  210.           break
  211.         end
  212.       end
  213.       if index != nil
  214.         @recipes.delete(@recipes[index])
  215.       end
  216.     end
  217.   end
  218.   
  219. #----------------------------------------------------------------------
  220.   def get_recipe_from_master_list(item, version)
  221.     index = nil
  222.     for i in 0...$game_temp.recipe_list.size
  223.       if item[0] == $game_temp.recipe_list[i].result and item[1] ==$game_temp.recipe_list[i].result_type
  224.         version -= 1
  225.         if version == 0
  226.           index = i
  227.           break
  228.         end
  229.       end
  230.     end
  231.     if index.is_a?(Integer)
  232.       return ($game_temp.recipe_list[index])
  233.     else
  234.       return false
  235.     end
  236.   end
  237.   
  238. end # of Game_Party updates

  239. #================================
  240. class Game_Recipe

  241.   attr_reader :ingredients
  242.   attr_reader :quantities
  243.   attr_reader :result
  244.   attr_reader :result_type
  245.   attr_reader :ingredient_types
  246.   attr_reader :craft_type  #物品分类
  247.   
  248. #----------------------------------------------------------------------
  249.   def initialize( ingredients, ingredient_types, quantities, result, result_type, craft_type=0)
  250.     @ingredients = ingredients
  251.     @ingredient_types = ingredient_types
  252.     @quantities = quantities
  253.     @result = result
  254.     @result_type = result_type
  255.     @craft_type = craft_type
  256.   end
  257.   
  258. #----------------------------------------------------------------------
  259.   def name
  260.     case @result_type
  261.       when 0
  262.         name = $data_items[@result].name
  263.       when 1
  264.         name = $data_armors[@result].name
  265.       when 2
  266.         name = $data_weapons[@result].name
  267.     end
  268.     return name
  269.   end
  270.   
  271. #----------------------------------------------------------------------

  272.   def item
  273.     case @result_type
  274.       when 0
  275.         item = $data_items[@result]
  276.       when 1
  277.         item = $data_armors[@result]
  278.       when 2
  279.         item = $data_weapons[@result]
  280.     end
  281.     return item
  282.   end

  283. #----------------------------------------------------------------------
  284.   def have
  285.     have_all = true
  286.     for i in [email]0...@ingredients.size[/email]
  287.       case @ingredient_types[i]
  288.         when 0
  289.           if $game_party.item_number(@ingredients[i]) < @quantities[i]
  290.             have_all=false
  291.           end
  292.         when 1
  293.           if $game_party.armor_number(@ingredients[i]) < @quantities[i]
  294.             have_all=false
  295.           end
  296.         when 2
  297.           if $game_party.weapon_number(@ingredients[i]) < @quantities[i]
  298.             have_all=false
  299.           end
  300.       end
  301.     end
  302.     return have_all
  303.   end

  304. #----------------------------------------------------------------------
  305.   def decrement
  306.     for i in [email]0...@ingredients.size[/email]
  307.       case @ingredient_types[i]
  308.       when 0
  309.         $game_party.lose_item(@ingredients[i], @quantities[i])
  310.       when 1
  311.         $game_party.lose_armor(@ingredients[i], @quantities[i])
  312.       when 2
  313.         $game_party.lose_weapon(@ingredients[i], @quantities[i])
  314.       end
  315.     end
  316.   end

  317. #----------------------------------------------------------------------
  318.   def make
  319.     if have
  320.       case @result_type
  321.       when 0
  322.         $game_party.gain_item(@result, 1)
  323.       when 1
  324.         $game_party.gain_armor(@result, 1)
  325.       when 2
  326.         $game_party.gain_weapon(@result, 1)
  327.       end
  328.       decrement
  329.     end
  330.   end
  331.   
  332. #----------------------------------------------------------------------
  333.   def == (recipe)
  334.     if recipe.is_a?(Game_Recipe)
  335.       equal = true
  336.       if recipe.ingredients != self.ingredients
  337.         equal = false
  338.       end
  339.       if recipe.ingredient_types != self.ingredient_types
  340.         equal = false
  341.       end
  342.       if recipe.quantities != self.quantities
  343.         equal = false
  344.       end
  345.       if recipe.result != self.result
  346.         equal=false
  347.       end
  348.       if recipe.result_type != self.result_type
  349.         equal = false
  350.       end
  351.     else
  352.       equal = false
  353.     end
  354.     return equal
  355.   end
  356.   
  357. end # of Game_Recipe class

  358. #===================================

  359. class Window_Craft < Window_Selectable
  360.   attr_reader :data #声明数据
  361.   #--------------------------------------------------------------------------
  362.   def initialize(craft_type=0)
  363.     @craft_type = craft_type
  364.     super(0, 64, 240, 416)
  365.     @column_max = 1
  366.     refresh
  367.     self.index = 0
  368.   end

  369.   #--------------------------------------------------------------------------
  370.   def recipe
  371.     return @data[self.index]
  372.   end

  373.   #--------------------------------------------------------------------------
  374.   def refresh
  375.     if self.contents != nil
  376.       self.contents.dispose
  377.       self.contents = nil
  378.     end
  379.     @data = []
  380.     for i in 0...$game_party.recipes.size
  381.        #@craft_type为0时就显示全部物品
  382.        #不为0时就显示对应物品
  383.       if @craft_type == 0
  384.         @data.push($game_party.recipes[i])
  385.       elsif $game_party.recipes[i].craft_type == @craft_type
  386.         @data.push($game_party.recipes[i])
  387.       end
  388.     end
  389.     @item_max = @data.size
  390.     if @item_max > 0
  391.       self.contents = Bitmap.new(width - 32, row_max * 32)
  392.       self.contents.font.name = "黑体" # = "黑体"
  393.       self.contents.font.size = 18 # = 18
  394.       for i in 0...@item_max
  395.         x = 16
  396.         y = i * 32
  397.         able = true
  398.         for ingredient in 0...@data[i].ingredients.size
  399.           case @data[i].ingredient_types[ingredient]
  400.           when 0
  401.             count = $game_party.item_number(@data[i].ingredients[ingredient])
  402.           when 1
  403.             count = $game_party.armor_number(@data[i].ingredients[ingredient])
  404.           when 2
  405.             count = $game_party.weapon_number(@data[i].ingredients[ingredient])
  406.           end
  407.           if count < @data[i].quantities[ingredient]
  408.             able = false
  409.             break
  410.           end
  411.         end
  412.         draw_item_name(@data[i].item, x, y, able)
  413.       end
  414.     end
  415.   end

  416.   #--------------------------------------------------------------------------
  417.   #def draw_item(index)
  418.   #  recipe = @data[index]
  419.   #  self.contents.font.color = recipe.have ? normal_color : disabled_color
  420.   #  x = 16
  421.   #  y = index * 32
  422.   #  self.contents.draw_text(x , y, self.width-32, 32, recipe.name, 0)
  423.   #end
  424.   
  425.   #--------------------------------------------------------------------------
  426.   # ● 描绘物品名
  427.   #     item : 物品
  428.   #     x    : 描画目标 X 坐标
  429.   #     y    : 描画目标 Y 坐标
  430.   #--------------------------------------------------------------------------
  431.   def draw_item_name(item, x, y, able = true)
  432.     if item == nil
  433.       return
  434.     end
  435.     if !able
  436.       self.contents.font.color = disabled_color
  437.     end
  438.     bitmap = RPG::Cache.icon(item.icon_name)
  439.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  440.     self.contents.draw_text(x + 28, y, 212, 32, item.name)
  441.     self.contents.font.color = normal_color
  442.   end
  443.   
  444.   #--------------------------------------------------------------------------
  445.   def update_help
  446.     current_recipe = recipe
  447.     if current_recipe.is_a?(Game_Recipe)
  448.     case current_recipe.result_type
  449.       when 0
  450.         description = $data_items[current_recipe.result].description
  451.       when 1
  452.         description = $data_armors[current_recipe.result].description
  453.       when 2
  454.         description = $data_weapons[current_recipe.result].description
  455.       end
  456.     else
  457.       description = ""
  458.     end
  459.     @help_window.set_text(description)
  460.     @help_window.update
  461.   end
  462.   
  463. end # of Window_Craft

  464. #=======================================
  465. class Window_CraftResult < Window_Base

  466.   #--------------------------------------------------------------------------
  467.   def initialize
  468.     super(240, 64, 400, 184)
  469.     self.contents = Bitmap.new(width - 32, height - 32)
  470.     self.contents.font.name = "黑体" # = $fontface.is_a?(String) ? $fontface : $defaultfonttype
  471.     self.contents.font.size = 18 # = 20
  472.     @result = nil
  473.     @type = nil
  474.   end

  475.   #--------------------------------------------------------------------------
  476.   def refresh
  477.     self.contents.clear
  478.     case @type
  479.       when 0
  480.         item = $data_items[@result]
  481.         if item.recover_hp_rate > item.recover_hp
  482.           hp_string = "HP回复率:"
  483.           hp_stat = item.recover_hp_rate
  484.         else
  485.           hp_string = "HP回复量:"
  486.           hp_stat = item.recover_hp
  487.         end
  488.         if item.recover_sp_rate > item.recover_sp
  489.           sp_string = "SP回复率:"
  490.           sp_stat = item.recover_sp_rate
  491.         else
  492.           sp_string = "SP回复量:"
  493.           sp_stat = item.recover_sp
  494.         end
  495.         @strings = [hp_string, sp_string, "物理防御:" , "魔法防御:", "命中率:", "分散度:"]
  496.         @stats = [hp_stat, sp_stat, item. pdef_f, item.mdef_f, item.hit, item.variance,
  497.                        $game_party.item_number(@result)]
  498.         @bitmap = RPG::Cache.icon(item.icon_name)
  499.       when 1
  500.         item = $data_armors[@result]
  501.         @strings = ["物理防御:", "魔法防御:", "回避修正:", "力量增加:", "灵巧增加:",
  502.                        "速度增加:", "魔力增加:"]
  503.         @stats = [item.pdef, item.mdef, item.eva, item.str_plus, item.dex_plus,
  504.                     item.agi_plus, item.int_plus, $game_party.armor_number(@result) ]
  505.         @bitmap = RPG::Cache.icon(item.icon_name)
  506.       when 2
  507.         item = $data_weapons[@result]
  508.         @strings =["攻击力:", "物理防御:", "魔法防御:", "力量增加:", "灵巧增加:",
  509.                     "速度增加:", "魔力增加:"]
  510.         @stats = [item.atk, item.pdef, item.mdef, item.str_plus, item.dex_plus,
  511.                     item.agi_plus, item.int_plus, $game_party.weapon_number(@result) ]
  512.         @bitmap = RPG::Cache.icon(item.icon_name)
  513.     end
  514.     for i in [email]0...@strings.size[/email]
  515.       x = i%2 * 184
  516.       y = i /2 *28 +32
  517.       self.contents.font.color = normal_color
  518.       self.contents.draw_text(x,y,100, 28,@strings[i])
  519.       self.contents.font.color = system_color
  520.       self.contents.draw_text(x + 110, y, 45, 28, @stats[i].to_s)
  521.     end
  522.     self.contents.blt(0, 0, @bitmap, Rect.new(0, 0, 24, 24), 255)
  523.     self.contents.font.color= normal_color
  524.     self.contents.draw_text(40, 0, 300, 28, "待合成物品的现有数量:")
  525.     self.contents.font.color = system_color
  526.     count = @stats[@stats.size - 1].to_s
  527.     self.contents.draw_text(294, 0, 45, 28, count )
  528.   end
  529.    
  530. #----------------------------------------------------------------------
  531.   def set_result(result , type)
  532.     @result = result
  533.     @type = type
  534.     refresh
  535.   end

  536. end #of Window_CraftResult

  537. #=======================================
  538. class Window_CraftIngredients < Window_Base

  539.   #--------------------------------------------------------------------------
  540.   def initialize
  541.     super(240, 248, 400, 232)
  542.     self.contents = Bitmap.new(width - 32, height - 32)
  543.     self.contents.font.name = "黑体" # = $fontface.is_a?(String) ? $fontface : $defaultfonttype
  544.     self.contents.font.size = 18 # = 20
  545.     @ingredients = []
  546.     @types = []
  547.     @quantities = []
  548.     @item = nil
  549.     @count = 0
  550.     @counter = 0
  551.     @real_oy = 0
  552.   end

  553.   #--------------------------------------------------------------------------
  554.   def refresh
  555.     @counter = 0
  556.     self.contents.clear
  557.     self.contents = Bitmap.new(width - 32, @ingredients.size * 26)
  558.     for i in [email]0...@ingredients.size[/email]
  559.       case @types[i]
  560.       when 0
  561.         @item = $data_items[@ingredients[i]]
  562.         @count = $game_party.item_number(@ingredients[i])
  563.       when 1
  564.         @item = $data_armors[@ingredients[i]]
  565.         @count = $game_party.armor_number(@ingredients[i])
  566.       when 2
  567.         @item = $data_weapons[@ingredients[i]]
  568.         @count = $game_party.weapon_number(@ingredients[i])
  569.       end
  570.       y = i *26
  571.       self.contents.blt(0, y, RPG::Cache.icon(@item.icon_name), Rect.new(0, 0, 24, 24), 255)
  572.       self.contents.font.color = @count >= @quantities[i] ? normal_color : disabled_color
  573.       self.contents.draw_text(30, y, 280, 28, @item.name)
  574.       self.contents.draw_text(300, y, 45, 28, @quantities[i].to_s)
  575.       self.contents.font.color = system_color
  576.       self.contents.draw_text(245, y, 45, 28, @count.to_s )     
  577.     end
  578.   end
  579.       
  580.   #--------------------------------------------------------------------------
  581.   def set_ingredients(ingredients , types, quantities)
  582.     @ingredients = ingredients
  583.     @types = types
  584.     @quantities = quantities
  585.     refresh
  586.     if @ingredients.size > 7
  587.       self.oy = -52
  588.       @real_oy = 0
  589.     else
  590.       self.oy = 0
  591.     end
  592.   end

  593.   def update
  594.     super
  595.     @counter += 1
  596.     if @ingredients.size > 7 and @counter > 30
  597.       @real_oy = (@real_oy + 1) % ((@ingredients.size - 3) * 26)
  598.       self.oy = @real_oy - 52
  599.     end
  600.   end
  601.    
  602. end # of Window_CraftIngredients

  603. #======================================
  604. class Scene_Craft

  605.   #--------------------------------------------------------------------------
  606.   # @craft_type:物品种类,0就是全部
  607.   def initialize(craft_type=0,craft_index=0)
  608.     @craft_index=craft_index
  609.     @craft_type = craft_type
  610.   end
  611.   
  612.   #--------------------------------------------------------------------------
  613.   def main
  614.     @craft_window = Window_Craft.new(@craft_type)
  615.     @craft_window.index=@craft_index
  616.     @confirm_window = Window_Base.new(120, 188, 400, 64)
  617.     @confirm_window.contents = Bitmap.new(368, 32)
  618.     @confirm_window.contents.font.name = "黑体"
  619.     @confirm_window.contents.font.size = 20
  620.     @help_window = Window_Help.new
  621.     @craft_window.help_window = @help_window
  622.     @result_window=Window_CraftResult.new
  623.     @ingredients_window=Window_CraftIngredients.new
  624.     if @craft_window.data.size > 0 #本类窗口物品大于0的话
  625.       @result_window.set_result(@craft_window.recipe.result, @craft_window.recipe.result_type)
  626.       @ingredients_window.set_ingredients(@craft_window.recipe.ingredients,
  627.                                                           @craft_window.recipe.ingredient_types,
  628.                                                           @craft_window.recipe.quantities)
  629.     end
  630.     @yes_no_window = Window_Command.new(100, ["确定", "放弃"])
  631.     @confirm_window.visible = false
  632.     @confirm_window.z = 1500
  633.     @yes_no_window.visible = false
  634.     @yes_no_window.active = false
  635.     @yes_no_window.index = 1
  636.     @yes_no_window.x = 270
  637.     @yes_no_window.y = 252
  638.     @yes_no_window.z = 1500
  639.     @label_window = Window_Base.new(450,200,190,52)
  640.     @label_window.contents=Bitmap.new(@label_window.width - 32,@label_window.height - 32)
  641.     @label_window.contents.font.size=20
  642.     @label_window.contents.font.color = @label_window.normal_color
  643.     @label_window.contents.font.name = "黑体"
  644.     @label_window.contents.draw_text(0, 0, @label_window.contents.width, 20, "  现有   需要")
  645.     Graphics.transition
  646.     loop do
  647.       Graphics.update
  648.       Input.update
  649.       update
  650.       if $scene != self
  651.         break
  652.       end
  653.     end
  654.     Graphics.freeze
  655.     @help_window.dispose
  656.     @craft_window.dispose
  657.     @result_window.dispose
  658.     @ingredients_window.dispose
  659.     @confirm_window.dispose
  660.     @yes_no_window.dispose
  661.     @label_window.dispose
  662.   end

  663.   #--------------------------------------------------------------------------
  664.   def update
  665.     @craft_window.update
  666.     @ingredients_window.update
  667.     if @craft_window.active
  668.       update_craft
  669.       return
  670.     end
  671.     if @yes_no_window.active
  672.       confirm_update
  673.       return
  674.     end
  675.   end

  676.   #--------------------------------------------------------------------------
  677.   def update_craft
  678.     if Input.dir4 != 0
  679.       if @craft_window.data.size > 0 #本类窗口物品大于0的话
  680.         @result_window.set_result(@craft_window.recipe.result, @craft_window.recipe.result_type)
  681.         @ingredients_window.set_ingredients(@craft_window.recipe.ingredients,
  682.                                                            @craft_window.recipe.ingredient_types,
  683.                                                            @craft_window.recipe.quantities)
  684.       end
  685.     end
  686.     if Input.trigger?(Input::B)
  687.       $game_system.se_play($data_system.cancel_se)
  688.       $scene = Scene_Map.new
  689.       return
  690.     end
  691.     if Input.trigger?(Input::C) and $game_party.recipes.size != 0
  692.       @recipe = @craft_window.recipe
  693.       if @recipe != nil
  694.         if @recipe.have
  695.           @yes_no_window.active = true
  696.           @craft_window.active = false
  697.         else
  698.           $game_system.se_play($data_system.buzzer_se)
  699.           return
  700.         end
  701.       else
  702.         $game_system.se_play($data_system.buzzer_se)
  703.         return
  704.       end
  705.     end
  706.   end

  707.   #--------------------------------------------------------------------------
  708.   def confirm_update
  709.     @craft_index = @craft_window.index
  710.     @confirm_window.visible = true
  711.     @confirm_window.z = 1500
  712.     @yes_no_window.visible = true
  713.     @yes_no_window.active = true
  714.     @yes_no_window.z = 1500
  715.     @yes_no_window.update
  716.     string = "合成 " + @recipe.name + "?"
  717.     cw = @confirm_window.contents.text_size(string).width
  718.     center = @confirm_window.contents.width/2 - cw /2
  719.     unless @drawn
  720.       @confirm_window.contents.draw_text(center, 0, cw, 30, string)
  721.       @drawn = true
  722.     end
  723.     if Input.trigger?(Input::C)
  724.       if @yes_no_window.index == 0
  725.         $game_system.se_play($data_system.decision_se)
  726.         @recipe.make
  727.         $game_system.se_play($data_system.save_se)
  728.         $scene=Scene_Craft.new(@craft_type,@craft_index)
  729.       else
  730.         $game_system.se_play($data_system.cancel_se)
  731.         $scene=Scene_Craft.new(@craft_type,@craft_index)
  732.       end
  733.     end
  734.     if Input.trigger?(Input::B)
  735.       $game_system.se_play($data_system.cancel_se)
  736.       $scene=Scene_Craft.new(@craft_type,@craft_index)
  737.     end
  738.   end

  739. end # of Scene_Craft

  740. #==============================================================================
  741. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  742. # 欢迎访问[url]www.66RPG.com[/url]
  743. # 梦想世界,在你手中
  744. #==============================================================================
复制代码
梦石
0
星屑
50
在线时间
24 小时
注册时间
2013-9-11
回帖
19
 楼主| 发表于 2013-10-23 15:26:29 | 显示全部楼层
希望某位大大为刚入门的渣渣指引一下啊
回复

使用道具 举报

梦石
0
星屑
3348
在线时间
1120 小时
注册时间
2009-4-15
回帖
761
发表于 2013-10-23 19:18:13 | 显示全部楼层
我的天啊,我想帮你都……
回复

使用道具 举报

梦石
0
星屑
50
在线时间
24 小时
注册时间
2013-9-11
回帖
19
 楼主| 发表于 2013-10-23 20:04:16 | 显示全部楼层
tan12345 发表于 2013-10-23 19:18
我的天啊,我想帮你都……

啊?是为什么呢?没说明白?
回复

使用道具 举报

梦石
0
星屑
407
在线时间
1291 小时
注册时间
2013-1-12
回帖
3349

贵宾

发表于 2013-10-24 07:38:55 | 显示全部楼层
本帖最后由 76213585 于 2013-10-23 19:17 编辑

呼出方式看起來有點像VX...  不過也很VA 有人指出是XP的...
@kangxi0109  恩!謝謝了..  我原本也有去查deke是寫什麼  結果是XP  我記得葉子有把他移植!?
VA的可以用白魔的或是我記得是BubbleBolg也有  然後還有很多....  
總之VX及VA的腳本不合用的

点评

这个脚本是XP的,我正在用。  发表于 2013-10-24 10:12

回复

使用道具 举报

梦石
0
星屑
50
在线时间
24 小时
注册时间
2013-9-11
回帖
19
 楼主| 发表于 2013-10-24 08:17:44 | 显示全部楼层
76213585 发表于 2013-10-24 07:38
這怎麼看都是VX的腳本.....
VA的可以用白魔的或是我記得是BubbleBolg也有  然後還有很多....  
總之VX及VA ...

啊!?这样吗?我还以为是va的呢……

点评

葉子只是增強.. 現在看到了(中文嚴重退步 所以其實得確有可能是VA的... 之前的話收回  发表于 2013-10-24 08:36
其實也超有可能是VA的...... 不過我記得葉子是寫VX的  发表于 2013-10-24 08:33
回复

使用道具 举报

梦石
0
星屑
407
在线时间
1291 小时
注册时间
2013-1-12
回帖
3349

贵宾

发表于 2013-10-24 08:32:19 | 显示全部楼层

回复

使用道具 举报

梦石
0
星屑
3348
在线时间
1120 小时
注册时间
2009-4-15
回帖
761
发表于 2013-10-24 08:39:39 | 显示全部楼层
本帖最后由 tan12345 于 2013-10-24 08:40 编辑
n361819978 发表于 2013-10-23 20:04
啊?是为什么呢?没说明白?


之前你的帖子太乱了,不好看,所以想帮你都不行,现在你貌似重新编辑过了,可以看了,说明里写了调用很简单的,你说你和NPC对话失败,方便的话,附上工程吧。截图已经看不出来为什么了。

点评

是我编辑的...  发表于 2013-10-24 08:50
回复

使用道具 举报

梦石
0
星屑
50
在线时间
24 小时
注册时间
2013-9-11
回帖
19
 楼主| 发表于 2013-10-24 08:45:02 | 显示全部楼层
76213585 发表于 2013-10-24 08:32
順便補上現有腳本:
白魔的
http://izumiwhite.web.fc2.com/rgss3/rgss3_004.html

哇!谢谢大大!!!但是都打不开啊……全部都无法显示

点评

也許要開代理? 因為都是國外的網站.....  发表于 2013-10-24 08:50
回复

使用道具 举报

梦石
0
星屑
50
在线时间
24 小时
注册时间
2013-9-11
回帖
19
 楼主| 发表于 2013-10-24 08:50:52 | 显示全部楼层
tan12345 发表于 2013-10-24 08:39
之前你的帖子太乱了,不好看,所以想帮你都不行,现在你貌似重新编辑过了,可以看了,说明里写了调用很简 ...

工程是什么啊???我就只是在那个人的事件上放了一个脚本啊……其他什么都没弄
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部