118 lines
2.5 KiB
Lua
118 lines
2.5 KiB
Lua
|
|
function tifacheck(handle_armor)
|
|
|
|
cprint("tifacheck script")
|
|
|
|
for i = 1 , 10 do
|
|
|
|
option = get_item_random_option (handle_armor , i )
|
|
|
|
if option == nil or option == 0 or option == '' then
|
|
cprint (i .. " : 0 " )
|
|
else
|
|
cprint (i .. " : effect_type = " .. option[1] .. " opt_type = " .. option[2] .. " opt_value = " .. option[3] )
|
|
end
|
|
|
|
-- option = [array_item](1= effect_type,2 = opt_type,3 = opt_value)
|
|
|
|
end
|
|
|
|
-- set_item_random_option (get_wear_item_handle( 2 ) ,6 , 133 , 7001020 , 0 )
|
|
|
|
|
|
end
|
|
|
|
|
|
function tifacheckmenu(handle_armor)
|
|
dlg_title( "@90100301" )
|
|
dlg_text( "Hello tifa NPC tifacheckmenu script" )
|
|
|
|
|
|
for i = 1 , 10 do
|
|
|
|
option = get_item_random_option (handle_armor , i )
|
|
|
|
if option == nil or option == 0 or option == '' then
|
|
-- cprint (i .. " : 0 " )
|
|
else
|
|
if option[1] == 133 then
|
|
dlg_menu( "change skill pos" .. i, 'tifarandskilll('.. i ..')' )
|
|
end
|
|
--cprint (i .. " : effect_type = " .. option[1] .. " opt_type = " .. option[2] .. " opt_value = " .. option[3] )
|
|
end
|
|
|
|
-- option = [array_item](1= effect_type,2 = opt_type,3 = opt_value)
|
|
|
|
end
|
|
|
|
-- set_item_random_option (get_wear_item_handle( 2 ) ,6 , 133 , 7001020 , 0 )
|
|
|
|
dlg_show()
|
|
end
|
|
|
|
function tifarandskilll(i)
|
|
|
|
cprint(i .. 'random skill')
|
|
|
|
tab = {301001,301002,301002,301003,301003,201001,201002,201003,201004,201005,201006}
|
|
|
|
rand = tab[ math.random(1 , table.getn(tab) ) ]
|
|
|
|
|
|
--get_wear_item_handle( 2 ) attention ajouté la valeur handle dans script incomplet
|
|
set_item_random_option(get_wear_item_handle( 2 ) , i , 133 , rand , 0 )
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
function npc_tifa()
|
|
|
|
-- 다이얼로그 출력
|
|
dlg_title( "@90100301" )
|
|
dlg_text( "Hello tifa NPC clic pour affiché les Stat en cprint" )
|
|
|
|
|
|
|
|
local i, handle, lv, text, text2, command, enhance, f, price
|
|
|
|
for i = 0, 25 do
|
|
handle = get_wear_item_handle( i )
|
|
|
|
if handle ~= 0 then
|
|
|
|
lv = get_item_level( handle )
|
|
enhance = get_item_enhance( handle )
|
|
|
|
if lv == 0 then
|
|
set_item_level( handle , 1 )
|
|
end
|
|
|
|
price = get_item_price( handle )
|
|
if enhance ~= 0 then
|
|
|
|
text = sconv("@90010010", "#@enhance_level@#",tostring(enhance) ,"#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ) , "#@item_Lv@#",tostring(lv))
|
|
|
|
|
|
else
|
|
text = sconv("@90010011", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ), "#@item_Lv@#",tostring(lv))
|
|
|
|
end
|
|
if price > 20 then
|
|
command = 'tifacheckmenu( ' .. handle .. ' )'
|
|
dlg_menu( text, command )
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
dlg_menu( "@90010002", '' )
|
|
dlg_show()
|
|
|
|
|
|
|
|
end
|
|
|