нашел неплохой скрип, но чтот он не работате. может кто разберется:
#Cooking Script & Synthesis Shop
#Script Created by Neovastato11
class Game_Cooking Game_Party
attr_accessor :appraisals
attr_accessor :recipe_book
attr_accessor :ore
alias cooking_initialize initialize
def initialize
cooking_initialize
@ore={}
@bronze = 0
@copper = 0
@iron = 0
@silver = 0
@gold = 0
@mythril = 0
@crystalinne = 0
@damascus = 0
@new_wpn_name = #basic string for new weapon name
@atk_plus = 0 #base value of atk increase
@pdef_plus = 0 #base value of pdef increase
@mdef_plus = 0 #base value of mdef increase
@recipe_book = [] #Array holding the recipies as found / not found ~ true / false
# metal ores = [bronze, copper, iron,silver, gold, mithril,crystalinne, damascus]
@requirements = [0,0,0,0,0,0,0,0]
@appraisal = 0 #base value of gold for forging
$can_create = false
end
def ore
@bronze = $game_party.item_number(115)
@copper = $game_party.item_number(116)
@iron = $game_party.item_number(117)
@silver = $game_party.item_number(118)
@gold = $game_party.item_number(119)
@mythril = $game_party.item_number(120)
@crystalinne = $game_party.item_number(121)
@damascus = $game_party.item_number(122)
@ore[0] = @bronze
@ore[1] = @copper
@ore[2] = @iron
@ore[3] = @silver
@ore[4] = @gold
@ore[5] = @mythril
@ore[6] = @crystalinne
@ore[7] = @damascus
return @ore
end
def recipe_book
return @recipe_book
end
def appraisal #defines the necessary amount of gold to synthe
return @appraisal
end
def new_wpn_name #defines weapon s new name
return @new_wpn_name
end
def atk_plus #defines weapon s new atk
return @atk_plus
end
def pdef_plus #defines weapon s new pdef
return @pdef_plus
end
def mdef_plus #defines weapon s new mdef
return @mdef_plus
end
def appraisal
return @appraisal
end
def lose_ore
return @requirements
end
def synthe_now(id)
if $game_party.gold = @appraisal #update sythesis and $can_create == true
$data_weapons[id].name = @new_wpn_name
$data_weapons[id].atk += @atk_plus
$data_weapons[id].pdef += @pdef_plus
$data_weapons[id].mdef += @mdef_plus
$game_party.lose_item(115,lose_ore[0])
$game_party.lose_item(116,lose_ore[1])
$game_party.lose_item(117,lose_ore[2])
$game_party.lose_item(118,lose_ore[3])
$game_party.lose_item(119,lose_ore[4])
$game_party.lose_item(120,lose_ore[5])
$game_party.lose_item(121,lose_ore[6])
$game_party.lose_item(122,lose_ore[7])
$game_party.lose_gold(appraisal)
else
$game_system.se_play($data_system.buzzer_se)
end
end
def forge_weapon(id) #conditions necessary to create a new weapon
case id
when 1
if @recipe_book[0] == true
if @ore[0] = 2 and @ore[1] = 3
@new_wpn_name = Bronze Rose
@atk_plus = 5
@pdef_plus = 3
@mdef_plus = 2
@appraisal = 1500
@requirements[0] = 2
@requirements[1] = 3
$can_create = true
else
$can_create = false
end
end
if @recipe_book[1] == true
if @ore[1] = 8 and @ore[2] = 2
@new_wpn_name = Copper Sword
@atk_plus = 22
@pdef_plus = 3
@mdef_plus = 8
@appraisal = 4280
@requirements[1] = 8
@requirements[2] = 2
$can_create = true
else
$can_create = false
end
end
if @recipe_book[2] == true
if @ore[2] = 14 and @ore[3] = 6
@new_wpn_name = Iron Sword
@atk_plus = 39
@pdef_plus = 10
@mdef_plus = 15
@appraisal = 7315
@requirements[2] = 14
@requirements[3] = 6
$can_create = true
else
$can_create = false
end
end
if @recipe_book[3] == true
if @ore[3] = 18 and @ore[4] = 12
@new_wpn_name = Silver Sword
@atk_plus = 55
@pdef_plus = 20
@mdef_plus = 30
@appraisal = 16480
@requirements[3] = 18
@requirements[4] = 12
$can_create = true
else
$can_create = false
end
end
if @recipe_book[4] == true
if @ore[4] = 40 and @ore[5] = 10
@new_wpn_name = Golden Sword
@atk_plus = 78
@pdef_plus = 46
@mdef_plus = 28
@appraisal = 35760
@requirements[4] = 40
@requirements[5] = 10
$can_create = true
else
$can_create = false
end
end
if @recipe_book[5] == true
if @ore[5] = 55 and @ore[6] = 5
@new_wpn_name = Mythril Blade
@atk_plus = 99
@pdef_plus = 63
@mdef_plus = 48
@appraisal = 59999
@requirements[5] = 55
@requirements[6] = 5
$can_create = true
else
$can_create = false
end
end
if @recipe_book[6] == true
if @ore[6] = 75 and @ore[7] = 25
@new_wpn_name = Crystal Blade
@atk_plus = 104
@pdef_plus = 83
@mdef_plus = 62
@appraisal = 74320
@requirements[6] = 75
@requirements[7] = 25
$can_create = true
else
$can_create = false
end
end
if @recipe_book[7] == true
if @ore[8] = 25
@new_wpn_name = Damascus Blade
@atk_plus = 200
@pdef_plus = 145
@mdef_plus = 128
@appraisal = 99999
@requirements[8] = 25
$can_create = true
else
$can_create = false
end
end
end
synthe_now(id)
return
end
end
$game_cooking = Game_Cooking.new
#------------------------------------------------------------------------------------------------
#===================================================
# - CLASS Scene_SynthesisShop
#===================================================
class Scene_Synthe
#---------------------------------------------------------------------------------
def initialize
@menu_index = 0
end
#---------------------------------------------------------------------------------
def main
refresh
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@help_window.dispose
@goods.dispose
@items.dispose
@status1.dispose
@status2.dispose
@status3.dispose
@gold_window.dispose
@command_window.dispose
@upgrade_window.dispose
end
#---------------------------------------------------------------------------------
def refresh
@help_window = Window_Help.new
@help_window.x =160
@help_window.y =0
@help_window.height = 80
@help_window.width = 480
#@help_window.z = 200
@goods = Goods.new
@goods.x =0
@goods.y =300
@goods.height = 180
@goods.width = 480
#@goods.z = 200
@items = Items.new
@items.x =0
@items.y =0
@items.height = 300
@items.width = 160
@items.help_window = @help_window
#@items.z = 200
@status1 = Status1.new
@status1.x =160
@status1.y =80
@status1.height = 220
@status1.width = 160
#@status1.z = 200
@status2 = Status2.new
@status2.x =320
@status2.y =80
@status2.height = 220
@status2.width = 160
#@status2.z = 200
@status3 = Status3.new
@status3.x =480
@status3.y =80
@status3.height = 220
@status3.width = 160
#@status3.z = 200
@gold_window = Window_Gold.new
@gold_window.x = 480
@gold_window.y = 416
@gold_window.z = 200
s1 = Synthesize
s2 = Exit Shop
@command_window = Window_Command.new(129, [s1, s2])
@command_window.index = @menu_index
@command_window.x = 270
@command_window.y = 200
@command_window.z = 2000
s1 = Upgrade Weapon
s2 = Synthe Status
s3 = Back
@upgrade_window = Window_Command.new(160, [s1, s2, s3])
@upgrade_window.x = 480
@upgrade_window.y = 300
@upgrade_window.active = false
end
#---------------------------------------------------------------------------------
def update
@help_window.update
@goods.update
@items.update
@command_window.update
@gold_window.update
@upgrade_window.update
#----------------------------
# When the command window is active,: update_command is called
if @command_window.active
update_command
return
end
#----------------------------
# When the items is active,: update_items is called
if @items.active
update_items
return
end
#----------------------------
# When the upgrade_window is active,: update_weapon is called
if @upgrade_window.active
update_weapon
return
end
end
#---------------------------------------------------------------------------------
def update_command
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # synthe
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Change windows to Synthe Mode
@items.active = true
@command_window.active = false
@command_window.visible = false
when 1 # Exit
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Map.new
end
return
end
end
#------------------------------------------------
def update_items
if Input.trigger?(Input::B)
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Change windows to Synthe Mode
@items.active = false
@command_window.active = true
@command_window.visible = true
end
if Input.trigger?(Input::C)
# Play decision SE
$game_system.se_play($data_system.cancel_se)
# The goods_window is made active
@upgrade_window.active = true
@items.active = false
end
end
#---------------------------------------------------------
def update_weapon
if Input.trigger?(Input::B)
# Play decision SE
$game_system.se_play($data_system.cancel_se)
# The goods_window is made active
@items.active = true
@upgrade_window.active = false
return
end
if Input.trigger?(Input::C)
case @upgrade_window.index
when 0
# ----------------------------
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Get currently selected data on the item window
item = @items.item
$game_system.se_play($data_system.decision_se)
$game_cooking.forge_weapon(item.id)
@items.active = true
@upgrade_window.active = false
when 1
#not created yet
when 2
# Play decision SE
$game_system.se_play($data_system.cancel_se)
# The goods_window is made active
@items.active = true
@upgrade_window.active = false
end
return
end
@goods.refresh
@items.refresh
@command_window.refresh
@gold_window.refresh
@upgrade_window.refresh
end
#------------------------------------------------------------------------
end
#===================================================
#===================================================
# - CLASS Goods Begins
#===================================================
class Goods Window_Base
#---------------------------------------------------------------------------------
def initialize
super(0, 0, 480, 180)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = Arial
self.contents.font.size = 16
refresh
end
#-----------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(50, 0, 220, 32, Bronze )
self.contents.draw_text(0, 0, 180, 32, $game_cooking.ore[0].to_s, 2)
self.contents.draw_text(270, 0, 220, 32, Copper )
self.contents.draw_text(220, 0, 180, 32, $game_cooking.ore[1].to_s, 2)
self.contents.draw_text(50, 32, 220, 32, Iron )
self.contents.draw_text(0, 32, 180, 32, $game_cooking.ore[2].to_s, 2)
self.contents.draw_text(270, 32, 220, 32, Silver )
self.contents.draw_text(220, 32, 180, 32, $game_cooking.ore[3].to_s, 2)
self.contents.draw_text(50, 64, 220, 32, Gold )
self.contents.draw_text(0, 64, 180, 32, $game_cooking.ore[4].to_s, 2)
self.contents.draw_text(270, 64, 220, 32, Mythril )
self.contents.draw_text(220, 64, 180, 32, $game_cooking.ore[5].to_s, 2)
self.contents.draw_text(50, 96, 220, 32, Crystalinne )
self.contents.draw_text(0, 96, 180, 32, $game_cooking.ore[6].to_s, 2)
self.contents.draw_text(270, 96, 220, 32, Damascus )
self.contents.draw_text(220, 96, 180, 32, $game_cooking.ore[7].to_s, 2)
end
#---------------------------------------------------------------------------------
end
#===================================================
# - CLASS Goods Ends
#===================================================
#===================================================
# - CLASS Items Begins
#===================================================
class Items Window_Selectable
#---------------------------------------------------------------------------------
def initialize
super(0, 0, 160,300)
@column_max = 1
refresh
self.index = 0
self.active = false
end
#---------------------------------------------------------------------------------
def item
return @data[self.index]
end
#------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...$game_party.actors.size
@data.push($data_weapons[$game_party.actors[i].weapon_id])
end
# Add blank page
@data.push(nil)
# Make a bit map and draw all items
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = Arial
self.contents.font.size = 16
for i in 0...@item_max-1
draw_item(i)
end
end
#------------------------------
def draw_item(index)
item = @data[index]
x = 4
y = index * 32
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 212, 32, item.name, 0)
end
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? : self.item.description)
end
end
#===================================================
# - CLASS Items Ends
#===================================================
#===================================================
# - CLASS Status1 Begins
#===================================================
class Status1 Window_Base
#---------------------------------------------------------------------------------
def initialize
super(0, 0, 160,220)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = Arial
self.contents.font.size = 16
@actor = $game_party.actors[0]
refresh
end
def refresh
self.contents.clear
draw_menu_face(@actor, 54, 108)
self.contents.font.color = normal_color
draw_actor_name(@actor, 4 , 0)
self.contents.font.color = system_color
self.contents.draw_text(4, 120, 92, 32, $data_system.words.weapon)
self.contents.font.color = normal_color
draw_item_name($data_weapons[@actor.weapon_id], 4, 160)
end
#---------------------------------------------------------------------------------
end
#===================================================
# - CLASS Status2 Begins
#===================================================
class Status2 Window_Base
#---------------------------------------------------------------------------------
def initialize
super(0, 0, 160,220)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = Arial
self.contents.font.size = 16
@actor = $game_party.actors[1]
refresh
end
def refresh
self.contents.clear
if $game_party.actors.size 1
draw_menu_face(@actor, 54, 108)
self.contents.font.color = normal_color
draw_actor_name(@actor, 4 , 0)
self.contents.font.color = system_color
self.contents.draw_text(4, 120, 92, 32, $data_system.words.weapon)
self.contents.font.color = normal_color
draw_item_name($data_weapons[@actor.weapon_id], 4, 160)
end
end
#---------------------------------------------------------------------------------
end
#===================================================
# - CLASS Status3 Begins
#===================================================
class Status3 Window_Base
#---------------------------------------------------------------------------------
def initialize
super(0, 0, 160,220)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = Arial
self.contents.font.size = 16
@actor = $game_party.actors[2]
refresh
end
def refresh
self.contents.clear
if $game_party.actors.size 2
draw_menu_face(@actor, 54, 108)
self.contents.font.color = normal_color
draw_actor_name(@actor, 4 , 0)
self.contents.font.color = system_color
self.contents.draw_text(4, 120, 92, 32, $data_system.words.weapon)
self.contents.font.color = normal_color
draw_item_name($data_weapons[@actor.weapon_id], 4, 160)
end
end
#---------------------------------------------------------------------------------
end