rebf-gaiden/Scripts/_.28.rb
2025-04-27 12:52:39 -05:00

211 lines
No EOL
9.4 KiB
Ruby
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#
# * アイテム合成のデータ設定
#
#
# ※ アイテム合成スクリプト本体より下に導入してください。
# ※ 増減させるアイテムの設定で同じアイテムは重複できません。
# ※ データの出力は、テストプレイ時のみ行います。
# ※ データの出力後、このスクリプトは不要です。
#
# レシピの設定
ITEMMAKE_RECIPES = [
# Icon, Name, Price, [Items to Decrease], [Items to Increase], Description
# [1] Synthesis
[865, "Aloe Vera", 0, ["I31:2","I32"], ["I26:1"], 1026],
[862, "Blueberry Drink", 0, ["I27:3","I32"], ["I6:1"], 1006],#2
[901, "Adaman Crystal", 0, ["I22:5","I97"], ["I24:1"], 1024],
[902, "Emnium Crystal", 0, ["I23:5","I96"], ["I25:1"], 1025],
[865, "Aloe Vera", 0, ["I31:2","I32"], ["I26:1"], 1026],
[865, "Aloe Vera", 0, ["I31:2","I32"], ["I26:1"], 1026],
[301, "Cheese", 0, ["I37:5","I78","I49"], ["I33:1"], 1033],#7
[223, "Acid Bottle", 0, ["I83:1","I32"], ["I69:1"], 1069],
[1165, "Golden Apple", 0, ["I42:1","I25:5"], ["I16:1"], 1016],#9
[422, "Prism Stick", 0, ["I42:1","I24:5"], ["I30:1"], 1030],#10
[228, "Verbal Abuse Card", 0, ["A17"], ["A115:1"], 3115],#11
[899, "Adaman Fragment", 0, ["I23:1"], ["I22:1"], 1022],
[900, "Emnium Fragment", 0, ["I22:1"], ["I23:1"], 1023],
[901, "Adaman Crystal", 0, ["I25:1"], ["I24:1"], 1024],
[902, "Emnium Crystal", 0, ["I24:1"], ["I25:1"], 1025],
[832, "-", 0, ["I91","I171:1"], ["I93:1"], 1093],#16
[629, "Pharaoh's Helm", 0, ["I56:5","I45"], ["A257:1"], 3257],#17
[228, "-", 0, ["A18:1"], ["A25:1"], 3025],
[1028, "Glasses Battery", 0, ["A294:1"], ["I188:1"],1188],#19
[228, "-", 0, ["A24:2"], ["A58:1"], 3058],#20
[651, "Execution Sword", 0, ["I42:2","I46:10","I63:10","I59:10"], ["A245:1"], 3245],#21
[390, "Ogre Fang", 0, ["I42:2","I51:10","I49:10","I50:10"], ["A246:1"], 3246],#22
[393, "Mistilteinn", 0, ["I42:2","I35:5","I15:5","I67:10"], ["A247:1"], 3247],#23
[1404, "Flaming Tom Yum Kung", 0, ["I98:1","I99:1","I78:1"], ["I90:1"], 1090],#24
[978, "Poison Honey", 0, ["I7","I35"], ["I91:1"], 1091],#25
[216, "Iron Protein", 0, ["I72","I34","I37"], ["I92:1"], 1092],#26
[898, "Withered Tree Herbal Medicine", 0, ["I15","I10"], ["I93:1"], 1093],#27
[977, "Three-Color Herb Salad", 0, ["I80","I11","I79"], ["I94:1"], 1094],#28
[365, "Lucky Spice", 0, ["I12","I57"], ["I95:1"], 1095],#29
[1076, "Hunting Lance", 0, ["I64:5","I24","I96:5"], ["A277:1"], 3277],#30
[887, "Dullahan's Eye", 0, ["A224","I38"], ["A222:1"], 3222],#31
[628, "Cyclops Eye", 0, ["I57","I44","I38","I196:5","I96:5"], ["A294:1"], 3294],#32
[1361, "Sniper Suit", 0, ["I197:10","I97:5"], ["A215:1"], 3215],#33
[1067, "Disrobing Sword", 0, ["A249","I24","I96:5","I97:5"], ["A250:1"], 3250],#34
[1057, "Thief Crossbow", 0, ["A223","I96:5","I97:5"], ["A278:1"], 3278],#35
[1364, "Unicorn Horn", 0, ["A277","I42"], ["A234:1"], 3234],#36
[449, "Erniu Magic Cloak", 0, ["I25:3"], ["A237:1"], 3237],#37
[179, "Ancient Brooch", 0, ["A217:1","I42"], ["A256:1"], 3256],#38
[772, "Resonance Ring", 0, ["A285:1","A227:1","I96:5"], ["A284:1"], 3284],#39
[1378, "Golden Shield", 0, ["A296:1","I56:3"], ["A283:1"], 3283],#40
[1384, "Fierceness of Flaming Hair and Eyes", 0, ["I60:20"], ["A300:1"], 3300],#41
[1385, "Cry of Ryuusaki Sea", 0, ["I58:20"], ["A301:1"], 3301],#42
[1386, "Ram's Storm Surge", 0, ["I52:20"], ["A302:1"], 3302],#43
[1387, "Tsundereitus Cleft", 0, ["I69:20"], ["A303:1"], 3303],#44
[950, "Golden Head Pants", 0, ["I209:1"], ["I304:1"], 1304],#45
[1042, "Rainbow Carrot", 0, ["I209:5"], ["I206:1"], 1206],#46
[1343, "Cat Ear Headband", 0, ["I209:5"], ["I208:1"], 1208],#47
[1420, "Pope Cosplay", 0, ["I209:5"], ["I210:1"], 1210],#48
[1028, "Option Glasses", 0, ["I209:10"], ["I211:1"], 1211],#49
[1342, "Butterfly Mask", 0, ["I209:5"], ["I212:1"], 1212],#50
[1357, "Hihiiro Key", 0, ["I24","I25","I96","I97","I42","I56"], ["I184:1"], 1184],#51
[920, "Black Magic Stone", 0, ["I209:10"], ["I42:1"], 1042],#52
[1344, "Freyja Membership Ticket", 0, ["I209:10"], ["I65:1"], 1065],#53
# [6] Blacksmith
[147, "Longsword", 300, ["W19:2"], ["W20"], 2020],
[147, "Falchion", 1000, ["W20:2"], ["W21"], 2021],
[149, "Crossbow", 1000, ["W13","W55"], ["W33"], 2033],
[0, "Hydra Card 1000z", -1000, ["A27"], [], 3027],
# [9] Exchange
[168, "Casual Clothes", 0, ["A1"], ["I1"],
"Exchange casual clothes for potion."],
[162, "Bandana", 0, ["A6"], ["I1"],
"Exchange bandana for potion."],
[179, "Lucky Amulet", 0, ["A55"], ["I16:5"],
"Exchange lucky amulet for Luck Up."],
[179, "Talisman of Light", 0, ["A60"], ["I11","I12","I13","I14","I15","I16"],
"Exchange Talisman of Light for various items."],
# [13] Set Sale
[192, "Recovery Set", 350, [], ["I1:2","I4","I6"],
"Set contains Potion, Magic Water, and Antidote"],
[164, "Hero Set", 500, [], ["W19","A46","A21","I1:3","I6:2"],
"First Hero Set.\nRecommended for novice heroes."],
]
ITEMMAKE_BOOKS = [
# Icon, Name, [List], [Decrease,Increase], [Decrease Name,Increase Name], [Background,Foreground], ...
[230, "All", Array(1..14), [], []],
[279, "Synthesis", [1], [2,2], [], []],
[279, "Synthesis", [2], [2,2], [], []],
[279, "Synthesis", [3,4], [2,2], [], []],
[279, "Blacksmith", [4], [], [], [], :price, :nownd],
[284, "Blacksmith", [6,7,8], [], [], ["b","f"], :price, :nownd],
[495, "Exchange", [9,10,11,12], [1,6], ["Items Given","Items Received"]],
[270, "Set", [13,14], [0,5], ["","Set Contents"], [], [], :price],
[279, "Synthesis", [7], [2,2], [], []],
[279, "Synthesis", [1,8], [2,2], [], []],
[279, "Synthesis", [9,10,11], [2,2], [], []],
[279, "Synthesis", [12,13,14,15], [2,2], [], []],
[279, "Synthesis", [16], [2,2], [], []],
[279, "Synthesis", [17], [2,2], [], []],#14
[279, "Synthesis", [21], [2,2], [], []],#15
[279, "Synthesis", [22,23,24,25], [3,3], [], []],#16
[279, "Synthesis", [26,27,28], [5,2], [], []],#17
[279, "Synthesis", [1,8,9,10,11,16], [3,3], [], []],#18
[279, "Synthesis", [2,7,24,25,26,27,28,29], [3,3], [], []],#19
[279, "Synthesis", [36,37,38,39,40], [6,3], [], []],#20
[279, "Synthesis", [36], [6,3], [], []],#21
[279, "Synthesis", [36], [6,3], [], []],#22
[279, "Synthesis", [30,31,32,33,34,35,36,37,38,39,40,41,42,43,44], [7,3], [], []],#23
[279, "Synthesis", [21,22,23,17,51], [6,3], [], []],#24
[279, "Synthesis", [9,10], [6,3], [], []],#25
[279, "Synthesis", [19,11], [6,3], [], []],#26
[279, "Synthesis", [45,46,47,48,49,50,52,53], [7,3], [], []],#27
]
#/////////////////////////////////////////////////////////////////////////////#
# #
# 下記のスクリプトを変更する必要はありません。 #
# #
#/////////////////////////////////////////////////////////////////////////////#
# レシピデータの出力
def save_item_make_recipe_data
result = [nil]
ITEMMAKE_RECIPES.each do |data|
recipe = RPG::ItemMake::Recipe.new
recipe.id = result.size
recipe.icon_index = data[0]
recipe.name = data[1]
recipe.price = data[2].to_i
recipe.minus_items = data[3].map {|s| RPG::ItemMake::Item.new(s) }
recipe.plus_items = data[4].map {|s| RPG::ItemMake::Item.new(s) }
recipe.description = data[5]
result << recipe
end
save_data(result, "Data/#{CAO::ItemMake::FILE_RECIPE}")
end
# レシピブックデータの出力
def save_item_make_book_data
result = [nil]
ITEMMAKE_BOOKS.each do |data|
book = RPG::ItemMake::Book.new
book.id = result.size
book.icon_index = data[0]
book.name = data[1]
book.list = data[2]
if data[3].is_a?(Array)
book.minus_number = data[3][0] if data[3][0]
book.plus_number = data[3][1] if data[3][1]
end
if data[4].is_a?(Array)
book.minus_name = data[4][0]
book.plus_name = data[4][1]
end
if data[5].is_a?(Array)
book.background_name = data[5][0]
book.foreground_name = data[5][1]
end
book.display_price = data.include?(:price)
book.visible_window = !data.include?(:nownd)
result << book
end
save_data(result, "Data/#{CAO::ItemMake::FILE_BOOK}")
end
def chack_item_make_data
data = []
data << load_data("Data/Items.rvdata2")
data << load_data("Data/Weapons.rvdata2")
data << load_data("Data/Armors.rvdata2")
books = load_data("Data/#{CAO::ItemMake::FILE_BOOK}")
recipes = load_data("Data/#{CAO::ItemMake::FILE_RECIPE}")
(1...books.size).each do |book_id|
books[book_id].list.each do |recipe_id|
unless recipes[recipe_id]
msgbox "ブック #{book_id}\n#{recipe_id} 番のレシピが見つかりません。"
next
end
imitems = recipes[recipe_id].plus_items | recipes[recipe_id].minus_items
imitems.each do |im|
item = data[im.class_id][im.item_id]
unless item
msgbox "レシピ #{recipe_id}\n#{im.item_id} 番の" +
"#{["アイテム","武器","防具"][im.class_id]}が見つかりません。"
next
end
end
end
end
end
if $TEST
save_item_make_recipe_data
save_item_make_book_data
chack_item_make_data
end