-- Lua ½ºÅ©¸³Æ® ¾ÏÈ£È
function get_module_name()
return "NPC_ItemUP"
end
-- "ÀÌ°Ç ºüÁ® Àִµ¥ À̰͵µ DB·Î ³Ö¾î¾ß ÇÑ´Ù" ¶ó°í »ý°¢µÇ½Ã´Â
-- ºÎºÐµé¿¡ ´ëÇØ¼´Â ¿¬¶ô ÁÖ¼¼¿è.
--============================================================
-- <<<<<< NPC °øÅë >>>>>>
--============================================================
------------------------------------------------------------------·çÇǸ¦ ÀÌ¿ëÇÑ ³»±¸µµ ȸº¹ ----
function max_item_durability()
local delete_gold = 0
for index_item = 0, 198 do -- µ· °Ë»ç¸¦ À§ÇÑ LOOP
local handle = get_wear_item_handle( index_item )--¾ÆÀÌÅÛ Âø¿ë ºÎÀ§º°·Î ÂÓ Èȴ´Ù.
if handle ~= 0 then-- °¢ Âø¿ë ºÎÀ§¿¡ ¾ÆÀÌÅÛÀÌ ÀÖÀ¸¸é
local e_max = get_max_item_ethereal_durability( handle ) --Âø¿ë ¾ÆÀÌÅÛÀÇ ÃÖ´ë ³»±¸µµ¸¦ °¡Á®¿Â´Ù.
local e_durability = get_item_ethereal_durability( handle ) --Âø¿ë ¾ÆÀÌÅÛÀÇ ÇöÀç ³»±¸µµ¸¦ °¡Á®¿Â´Ù.
if e_durability ~= 0 then --Âø¿ë ¾ÆÀÌÅÛÀÇ ÇöÀç ³»±¸µµ°¡ 0ÀÌ ¾Æ´Ñ °æ¿ì¿¡¸¸
local item_rank = get_item_rank( handle )
delete_gold = delete_gold + (math.floor((e_max-e_durability)/10000))*(3^item_rank) -- ÃÖ´ë ³»±¸µµ °ª¿¡¼ ÇöÀç ³»±¸µµ°ªÀ» »« °ªÀ» 10000À¸·Î ³ª´©°í ¼Ò¼öÁ¡À» ¹ö¸°´Ù. ±× °ª¿¡ 3¿¡ ¾ÆÀÌÅÛ·©Å©¸¸ÅÀÇ Á¦°öÀ» ÇÑ °ªÀ» °öÇÑ °ª
end
end
end
local gold = get_value("gold")
local text_gold = sconv("@263", "#@gold@#",tostring(delete_gold))
if delete_gold == 0 then
cprint("@732") -- ¼ö¸®ÇÒ ¾ÆÀÌÅÛÀÌ ¾ø½À´Ï´Ù
elseif gold >= delete_gold then
set_value("gold", gold-delete_gold)
for index_item = 0, 94 do -- ¼ö¸®¸¦ À§ÇÑ LOOP
local handle = get_wear_item_handle( index_item )--¾ÆÀÌÅÛ Âø¿ë ºÎÀ§º°·Î ÂÓ Èȴ´Ù.
if handle ~= 0 then-- °¢ Âø¿ë ºÎÀ§¿¡ ¾ÆÀÌÅÛÀÌ ÀÖÀ¸¸é
local e_durability = get_item_ethereal_durability( handle ) --Âø¿ë ¾ÆÀÌÅÛÀÇ ÇöÀç ³»±¸µµ¸¦ °¡Á®¿Â´Ù.
if e_durability ~= 0 then --Âø¿ë ¾ÆÀÌÅÛÀÇ ÇöÀç ³»±¸µµ°¡ 0ÀÌ ¾Æ´Ñ °æ¿ì¿¡¸¸
set_item_ethereal_durability( handle, get_max_item_ethereal_durability( handle ) ) -- Âø¿ëµÈ ¾ÆÀÌÅÛÀÇ ³»±¸µµ¸¦ ÃÖ´ë°ªÀ¸·Î ä¿öÁØ´Ù.
end
end
end
cprint(text_gold)
cprint("@690000080")
else
cprint("@90010008") -- ¼ÒÁö±ÝÀÌ ºÎÁ·ÇÒ °æ¿ì ¼ÒÁö±ÝÀÌ ºÎÁ·ÇÏ´Ù´Â ¸Þ¼¼Áö Ãâ·Â
end
end
--====================================================================·£´ý ¿É¼Ç ¾ÆÀÌÅÛ ±³È¯
function random_item_change_menu()
local count = 0
-- ´ÙÀ̾ó·Î±× Ãâ·Â
local npc_id = get_npc_id()
-- µ¥¹Ù ´ëÀåÀåÀÌ Æ¼¸®¿¤
if npc_id == 1003 then
dlg_title( "@90100301" )
-- ¾Æ¼ö¶ó ´ëÀåÀåÀÌ ÆÄÀÌ·Ð
elseif npc_id == 2003 then
dlg_title( "@90200301" )
-- Ãʺ¸ÀÚ¼¶ ´ëÀåÀåÀÌ Å¸³ª¿¤
elseif npc_id == 3003 then
dlg_title( "@90300301" )
-- °¡ÀÌ¾Æ ´ëÀåÀåÀÌ ¹Ì¸£ÇÇÀ¯
elseif npc_id == 4003 then
dlg_title( "@90400301" )
-- ·Ðµµ ´ëÀåÀåÀÌ ¶ó½´¹«
elseif npc_id == 6003 then
dlg_title( "@90600301" )
-- ½ÃÅ©·çÆ® ´ëÀåÀåÀÌ Áö¿Â
elseif npc_id == 7003 then
dlg_title( "@90700301" )
-- µµ½ÃÀ¯Àû ´ëÀåÀåÀÌ ÇϹÂ
elseif npc_id == 7031 then
dlg_title( "@90703101" )
end
-- ¾Æ·¡ ¸ñ·ÏÁß¿¡¼ ¹Ù²Ü ¾ÆÀÌÅÛÀ» ¼±ÅÃÇØ ¶ó´Â ´ë»ç Ãâ·Â
dlg_text( "@90606096" )
-- 0¹ø¿¡¼ 7¹ø ½½·Ô±îÁö ÈȾ¸é¼ ¸Þ´º¿¡ Ãß°¡
for i = 0, 7 do
-- ÀÔ°íÀÖ´Â ¾ÆÀÌÅÛ ÇÚµé ¾ò¾î¿È
handle = get_wear_item_handle( i )
-- ÀÔ°í ÀÖ´Â ¾ÆÀÌÅÛ ÄÚµå ¾ò¾î¿È
item_code = get_item_code( handle )
-- ¸¸¾à ±³È¯ ´ë»óÀÌ µÇ´Â ¾ÆÀÌÅÛÀ» ÀÔ°í ÀÖ´Ù¸é
if item_code == 601100300 or item_code == 601100301 or item_code == 601100302 or item_code == 601100303
or item_code == 601100304 or item_code == 601100305 or item_code == 601100306 or item_code == 601100307 or item_code == 700000585 then
count = count + 1
lv = get_item_level( handle )
enhance = get_item_enhance( handle )
if lv == 0 then
set_item_level( handle , 1 )
end
-- ÇØ´ç ¾ÆÀÌÅÛÀÇ °È´Ü°è, ¾ÆÀÌÅÛ¸í, LvÀ» ÅØ½ºÆ®·Î ±¸¼º
if enhance ~= 0 then
-- °ÈµÇ¾îÀÖÀ¸¸é +x Ç¥½Ã
text = sconv("@90010010", "#@enhance_level@#",tostring(enhance) ,"#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ) , "#@item_Lv@#",tostring(lv))
-- ## ³¡ @90010010 = + #@enhance_level@# #@item_name@# Lv #@item_Lv@#
else
text = sconv("@90010011", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ), "#@item_Lv@#",tostring(lv))
-- ## ³¡ @90010011 = #@item_name@# Lv #@item_Lv@#
end
-- ¾ÆÀÌÅÛ ·¹º§¾÷ ½ºÅ©¸³Æ® Æã¼ÇÀ» ¸Þ´º¿¡ Ãß°¡
command = 'random_item_change( ' .. handle .. ' )'
dlg_menu( text, command )
end
end
if count == 0 then
-- ¹Ù²ãÁÙ ¾ÆÀÌÅÛÀÌ ¾ø¾î ¶ó´Â ´ë»ç Ãâ·Â
dlg_text( "@90606097" )
end
dlg_menu( "@90010002", '' )
dlg_show()
end
function random_item_change( handle )
-- ´ëÀåÀåÀÌ ¸Þ´º¿¡¼ ¸ñ·Ï¿¡ ³ª¿Â ¾ÆÀÌÅÛÀÇ ID¸¦ °¡Á®¿Â´Ù.
local item_code = get_item_code( handle )
local reward_code = 0
-- ¸¸¾à ¾ÆÀÌÅÛ ID°¡ item_code¿Í ¸Â´Ù¸é ±³È¯ ÇØÁÙ ¾ÆÀÌÅÛ ID¸¦ reward_codeÀÇ ID·Î ¼³Á¤Çϰí
if item_code == 601100300 then
reward_code = 601100354
elseif item_code == 601100301 then
reward_code = 601100355
elseif item_code == 601100302 then
reward_code = 601100356
elseif item_code == 601100303 then
reward_code = 601100357
elseif item_code == 601100304 then
reward_code = 601100358
elseif item_code == 601100305 then
reward_code = 601100359
elseif item_code == 601100306 then
reward_code = 601100360
elseif item_code == 601100307 then
reward_code = 601100361
elseif item_code == 700000585 then
reward_code = 700000822
end
-- ±³Ã¼µÈ ¾ÆÀÌÅÛÀÇ ·£´ý ¿É¼Ç ù¹ø?¿Í µÎ¹ø? °ªµéÀ» ºÒ·¯¿À°í
local value_1 = get_item_random_option( handle, 1 )
local value_2 = get_item_random_option( handle, 2 )
-- ºÒ·¯¿Â ¾ÆÀÌÅÛÀÇ ·£´ý ¿É¼Ç °ªµéÀÌ 0 ¶Ç´Â -1 (0 : °ª¾øÀ½, -1 : ½Ã½ºÅÛ ¿À·ù ½Ã)ÀÌ ¾Æ´Ï¶ó¸é ¼³Á¤µÈ ´ë·Î ±× °ªµéÀ» ¹Ù²ãÁà¶ó.
if value_1 ~= 0 and value_1 ~= -1 then
if value_1[1] == 96 and value_1[2] == 512 then
value_1[3] = value_1[3]*2
set_item_random_option( handle, 1, value_1[1], value_1[2], value_1[3] )
end
if value_2[1] == 96 and value_2[2] == 1024 then
value_2[3] = value_2[3]*2
set_item_random_option( handle, 2, value_2[1], value_2[2], value_2[3] )
end
end
-- À§¿¡¼ ¼³Á¤µÈ reward_codeÀÇ ID·Î ±³Ã¼Ç϶ó.
change_item_code( handle, reward_code )
-- ¾î¶² ¾ÆÀÌÅÛÀÇ ¼³Á¤ÀÌ º¯°æµÇ¾ú´ÂÁö ½Ã½ºÅÛ ¸Þ¼¼Áö·Î ¾Ë·ÁÁà¶ó.
text = sconv("@690000139", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ))
cprint( text )
-- Àü ´Ü°è ¸Þ´º·Î µ¹¾Æ°¡¶ó.
random_item_change_menu()
end
--============================================================
-- <<<<<< µ¥¹Ù Ãø NPC >>>>>>
--============================================================
function NPC_ItemUP_Deva_init()
cprint( "!´ëÀåÀåÀÌ Æ¼¸®¿¤ °¡µ¿" )
set_npc_name( "@90100300" )
end
function NPC_ItemUP_Deva_contact()
-- ´ÙÀ̾ó·Î±× Ãâ·Â
dlg_title( "@90100301" )
if get_quest_progress(10173) == 1 and find_item( 1100310 ) == 0 then
dlg_text_without_quest_menu( "@90100302" )
dlg_menu( "@80010173", "Quest_Link_119_1()" )
else
dlg_text( "@90100302" )
end
local i, handle, lv, text, text2, command, enhance, f, price
-- 0¹ø¿¡¼ 7¹ø ½½·Ô±îÁö ÈȾ¸é¼ ¸Þ´º¿¡ Ãß°¡
for i = 0, 7 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 )
-- 9.4 ¹«±â °¡°Ý
if get_item_code( handle ) >= 3100020 and get_item_code( handle ) <= 3100026 then
price = 674086
elseif get_item_code( handle ) >= 3100027 and get_item_code( handle ) <= 3100031 then
price = 539270
end
-- ## ½ÃÀÛ
-- ÇØ´ç ¾ÆÀÌÅÛÀÇ °È´Ü°è, ¾ÆÀÌÅÛ¸í, LvÀ» ÅØ½ºÆ®·Î ±¸¼º
if enhance ~= 0 then
-- °ÈµÇ¾îÀÖÀ¸¸é +x Ç¥½Ã
text = sconv("@90010010", "#@enhance_level@#",tostring(enhance) ,"#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ) , "#@item_Lv@#",tostring(lv))
-- ## ³¡ @90010010 = + #@enhance_level@# #@item_name@# Lv #@item_Lv@#
else
text = sconv("@90010011", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ), "#@item_Lv@#",tostring(lv))
-- ## ³¡ @90010011 = #@item_name@# Lv #@item_Lv@#
end
-- ¾ÆÀÌÅÛ ·¹º§¾÷ ½ºÅ©¸³Æ® Æã¼ÇÀ» ¸Þ´º¿¡ Ãß°¡
if price > 20 then
command = 'ItemLevelUp_Deva_check( ' .. handle .. ' )'
dlg_menu( text, command )
end
end
end
dlg_menu( "@90100703", "open_market( 'itemUP_suppert' )" )
--dlg_menu( "@690000079", "max_item_durability()" )
--dlg_menu( "@90606098", "random_item_change_menu()" )
dlg_menu( "@90010002", '' )
dlg_show()
end
function Quest_Link_119_1()
if find_item( 1100310 ) == 0 then
dlg_title("@90100301")
dlg_text_without_quest_menu( "@90999590" )
dlg_menu("@90010002", '')
dlg_show()
insert_item( 1100310, 1 )
else
dlg_title("@90100301")
dlg_menu( "@90010002", '' )
dlg_show()
end
end
function ItemLevelUp_Deva_check( handle )
local i, j, k, max_level, rank, lv, price, cost, text
rank = get_item_rank( handle )
if rank < 1 then
rank = 1
end
lv = get_item_level( handle )
-- ·©Å©°¡ 1À̸é max=5·¹º§, ¾Æ´Ï¸é 10·¹º§
if rank == 1 then
max_level = 5
else
max_level = 10
end
if lv >= max_level then
--¾÷±Û °¡´ÉÇÑ ·¹º§À» ¹þ¾î³ª¹Ç·Î ¹«È¿
dlg_title( "@90100301" )
dlg_text( "@90100303" )
dlg_menu( "@90010003", 'NPC_ItemUP_Deva_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
-- ¾÷±Û °¡´ÉÇÑ ·¹º§À̹ǷΠ°¡°Ý °è»ê
price = get_item_price( handle )
-- 9.4 ¹«±â °¡°Ý
if get_item_code( handle ) >= 3100020 and get_item_code( handle ) <= 3100026 then
price = 674086
elseif get_item_code( handle ) >= 3100027 and get_item_code( handle ) <= 3100031 then
price = 539270
end
-- price < 20 ÀÎ ¾ÆÀÌÅÛÀº ±âº»¾ÆÀÌÅÛÀ̹ǷΠ¾÷±Û ºÒ°¡
if price < 20 then
dlg_title( "@90100301" )
dlg_text( "@90100304" )
dlg_menu( "@90010003", 'NPC_ItemUP_Deva_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
--============================================================================================
-- ¸ðµç ·©Å© ¾÷±×·¹ÀÌµå ºñ¿ë °è»ê ÅëÇÕ
--============================================================================================
-- if rank == 1 then
-- 1·©Å©ÀÇ ¾÷±Ûºñ¿ë °è»ê
-- if lv == 1 then
-- cost = 120
-- else
-- cost = (lv ^ 2) * 100
-- end
-- else
-- ¾÷±Ûºñ¿ë °è»ê
k = price
f = {1.35, 0.2, 0.115, 0.092, 0.085, 0.1, 0.1, 0.1} -- Lv´ç Áõ°¡°¡°Ý¿ë ÆÑÅÍ Å×À̺í
for i = 1, lv do
-- 1·©Å©À϶© µÚ¿¡ 1ÀÚ¸®¸¦, 2·©Å©À϶© µÚÀÇ 2ÀÚ¸®, 3·©Å©ÀÌ»óÀ϶© µÚ¿¡ ¼¼ÀÚ¸®¸¦ 0À¸·Î ¸ÂÃá´Ù.
-- lua ÀÇ ¹è¿Àº zerobase °¡ ¾Æ´Ï´Ù!!! Áß¿ä. C·Î Àû¿ëÇÒ ¶§´Â ¹è¿ ÁÖ¼Ò¸¦ -1 ¾¿ ÇØÁà¾ß ÇÑ´Ù.
-- ¿¹¸¦ µé¾î ¾Æ·¡ÀÇ ¹è¿Àº C¿¡¼´Â f[rank-1] À̾î¾ß ¸Â°í lua¿¡¼´Â f[rank] ¿©¾ß ¸Â´Ù.
if rank == 1 then
cost = math.floor(k * f[rank] * 0.1) * 10
elseif rank == 2 then
cost = math.floor(k * f[rank] * 0.01) * 100
else
cost = math.floor(k * f[rank] * 0.001) * 1000
end
k = k + cost
end
-- end
--##½ÃÀÛ
-- °¡°Ý ¾Ë¸²
text = sconv("@90100305", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ),"#@item_Lv@#",tostring(lv),"#@item_up_Lv@#",tostring((lv+1)),"#@upgrade_cost@#",tostring(cost))
--##³¡ #@item_name@# Lv #@item_Lv@#À» Lv#@item_up_Lv@# '(/À¸)·Î ¾÷±×·¹À̵å ÇÏ´Â ºñ¿ëÀº #@upgrade_cost@#·çÇÇ ÀÔ´Ï´Ù.
¾÷±×·¹À̵å ÇϽðڽÀ´Ï±î?'
dlg_title( "@90100301" )
dlg_text( text )
dlg_menu( "@90010004", 'ItemLevelUp_Deva( ' .. handle .. ' , ' .. cost .. ' )' )
dlg_menu( "@90010003", 'NPC_ItemUP_Deva_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
end
function ItemLevelUp_Deva( handle , cost )
-- ÇöÀç µ· ¾ò¾î¿È
local gold = get_value( "gold" )
local result
-- µ· ¸ðÀÚ¶ó¸é KIN
if gold < cost then
dlg_title( "@90100301" )
dlg_text( "@90010005" )
dlg_menu( "@90010003", 'NPC_ItemUP_Deva_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
-- ¾ÆÀÌÅÛ ·¹º§ ¾ò¾î¿È
local lv = get_item_level( handle )
-- ·¹º§ Áõ°¡
result = set_item_level( handle , lv + 1 )
if result == 0 then
cprint("ÇØ´ç ¹«±â¸¦ ¼ÒÁöÇϰí ÀÖÁö ¾Ê½À´Ï´Ù.")
return
else
-- ¾÷±Ûºñ¿ë Â÷°¨
set_value( "gold", gold - cost )
update_gold_chaos()
save()
--##½ÃÀÛ
-- ½Ã½ºÅÛ ¸Þ¼¼Áö
message(sconv("@90010006", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ),"#@item_Lv@#",tostring(lv),"#@item_up_Lv@#",tostring((lv+1))))
--##³¡ #@item_name@#Lv #@item_Lv@#ÀÌ Lv "#@item_up_Lv@#" (/À¸)·Î ¾÷±×·¹ÀÌµå µÇ¾ú½À´Ï´Ù.
end
--dlg_menu( "@90010003", 'NPC_ItemUP_Deva_contact()' )
NPC_ItemUP_Deva_contact()
end
--============================================================
-- <<<<<< ¾Æ¼ö¶ó Ãø NPC >>>>>>
--============================================================
function NPC_ItemUP_Asura_init()
cprint( "!´ëÀåÀåÀÌ ÆÄÀÌ·Ð °¡µ¿" )
set_npc_name( "@90200300" )
end
function NPC_ItemUP_Asura_contact()
-- ´ÙÀ̾ó·Î±× Ãâ·Â
dlg_title( "@90200301" )
dlg_text( "@90200302" )
local i, handle, lv, text, text2, command, enhance
-- 0¹ø¿¡¼ 7¹ø ½½·Ô±îÁö ÈȾ¸é¼ ¸Þ´º¿¡ Ãß°¡
for i = 0, 7 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 )
-- 9.4 ¹«±â °¡°Ý
if get_item_code( handle ) >= 3100020 and get_item_code( handle ) <= 3100026 then
price = 674086
elseif get_item_code( handle ) >= 3100027 and get_item_code( handle ) <= 3100031 then
price = 539270
end
-- ## ½ÃÀÛ
-- ÇØ´ç ¾ÆÀÌÅÛÀÇ °È´Ü°è, ¾ÆÀÌÅÛ¸í, LvÀ» ÅØ½ºÆ®·Î ±¸¼º
if enhance ~= 0 then
-- °ÈµÇ¾îÀÖÀ¸¸é +x Ç¥½Ã
text = sconv("@90010010", "#@enhance_level@#",tostring(enhance) ,"#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ) , "#@item_Lv@#",tostring(lv))
-- ## ³¡ @90010010 = + #@enhance_level@# #@item_name@# Lv #@item_Lv@#
else
text = sconv("@90010011", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ) , "#@item_Lv@#",tostring(lv))
-- ## ³¡ @90010011 = #@item_name@# Lv #@item_Lv@#
end
-- ¾ÆÀÌÅÛ ·¹º§¾÷ ½ºÅ©¸³Æ® Æã¼ÇÀ» ¸Þ´º¿¡ Ãß°¡
if price > 20 then
command = 'ItemLevelUp_Asura_check( ' .. handle .. ' )'
dlg_menu( text, command )
end
end
end
dlg_menu( "@90100703", "open_market( 'itemUP_suppert' )" )
--dlg_menu( "@690000079", "max_item_durability()" )
--dlg_menu( "@90606098", "random_item_change_menu()" )
dlg_menu( "@90010002", '' )
dlg_show()
end
function ItemLevelUp_Asura_check( handle )
local i, j, k, max_level, rank, lv, price, cost, text
rank = get_item_rank( handle )
if rank < 1 then
rank = 1
end
lv = get_item_level( handle )
-- ·©Å©°¡ 1À̸é max=3·¹º§, ¾Æ´Ï¸é 10·¹º§
if rank == 1 then
max_level = 5
else
max_level = 10
end
if lv >= max_level then
--¾÷±Û °¡´ÉÇÑ ·¹º§À» ¹þ¾î³ª¹Ç·Î ¹«È¿
dlg_title( "@90200301" )
dlg_text( "@90200303" )
dlg_menu( "@90010003", 'NPC_ItemUP_Asura_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
-- ¾÷±Û °¡´ÉÇÑ ·¹º§À̹ǷΠ°¡°Ý °è»ê
price = get_item_price( handle )
if get_item_code( handle ) >= 3100020 and get_item_code( handle ) <= 3100026 then
price = 674086
elseif get_item_code( handle ) >= 3100027 and get_item_code( handle ) <= 3100031 then
price = 539270
end
-- price < 20 ÀÎ ¾ÆÀÌÅÛÀº ±âº»¾ÆÀÌÅÛÀ̹ǷΠ¾÷±Û ºÒ°¡
if price < 20 then
dlg_title( "@90200301" )
dlg_text( "@90200304" )
dlg_menu( "@90010003", 'NPC_ItemUP_Asura_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
--============================================================================================
-- ¸ðµç ·©Å© ¾÷±×·¹ÀÌµå ºñ¿ë °è»ê ÅëÇÕ
--============================================================================================
-- if rank == 1 then
-- 1·©Å©ÀÇ ¾÷±Ûºñ¿ë °è»ê
-- if lv == 1 then
-- cost = 120
-- else
-- cost = (lv ^ 2) * 100
-- end
-- else
-- ¾÷±Ûºñ¿ë °è»ê
k = price
f = {1.35, 0.2, 0.115, 0.092, 0.085, 0.1, 0.1, 0.1} -- Lv´ç Áõ°¡°¡°Ý¿ë ÆÑÅÍ Å×À̺í
for i = 1, lv do
-- 1·©Å©À϶© µÚ¿¡ 1ÀÚ¸®¸¦, 2·©Å©À϶© µÚÀÇ 2ÀÚ¸®, 3·©Å©ÀÌ»óÀ϶© µÚ¿¡ ¼¼ÀÚ¸®¸¦ 0À¸·Î ¸ÂÃá´Ù.
-- lua ÀÇ ¹è¿Àº zerobase °¡ ¾Æ´Ï´Ù!!! Áß¿ä. C·Î Àû¿ëÇÒ ¶§´Â ¹è¿ ÁÖ¼Ò¸¦ -1 ¾¿ ÇØÁà¾ß ÇÑ´Ù.
-- ¿¹¸¦ µé¾î ¾Æ·¡ÀÇ ¹è¿Àº C¿¡¼´Â f[rank-1] À̾î¾ß ¸Â°í lua¿¡¼´Â f[rank] ¿©¾ß ¸Â´Ù.
if rank == 1 then
cost = math.floor(k * f[rank] * 0.1) * 10
elseif rank == 2 then
cost = math.floor(k * f[rank] * 0.01) * 100
else
cost = math.floor(k * f[rank] * 0.001) * 1000
end
k = k + cost
end
-- end
--##½ÃÀÛ
-- °¡°Ý ¾Ë¸²
text = sconv("@90200305", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ),"#@item_Lv@#",tostring(lv),"#@item_up_Lv@#",tostring((lv+1)),"#@upgrade_cost@#",tostring(cost))
--##³¡ #@item_name@# Lv #@item_Lv@#À» Lv #@Lv+1@# '(/À¸)·Î ¾÷±×·¹À̵å ÇÏ´Â ºñ¿ëÀº #@upgrade_cost@#·çÇÇ ÀÔ´Ï´Ù.
¾÷±×·¹À̵å ÇϽðڽÀ´Ï±î?'
dlg_title( "@90200301" )
dlg_text( text )
dlg_menu( "@90010004", 'ItemLevelUp_Asura( ' .. handle .. ' , ' .. cost .. ' )' )
dlg_menu( "@90010003", 'NPC_ItemUP_Asura_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
end
function ItemLevelUp_Asura( handle , cost )
-- ÇöÀç µ· ¾ò¾î¿È
local gold = get_value( "gold" )
local result
-- µ· ¸ðÀÚ¶ó¸é KIN
if gold < cost then
dlg_title( "@90200301" )
dlg_text( "@90010005" )
dlg_menu( "@90010003", 'NPC_ItemUP_Asura_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
-- ¾ÆÀÌÅÛ ·¹º§ ¾ò¾î¿È
local lv = get_item_level( handle )
-- ·¹º§ Áõ°¡
result = set_item_level( handle , lv + 1 )
if result == 0 then
cprint("ÇØ´ç ¹«±â¸¦ ¼ÒÁöÇϰí ÀÖÁö ¾Ê½À´Ï´Ù.")
return
else
-- ¾÷±Ûºñ¿ë Â÷°¨
set_value( "gold", gold - cost )
update_gold_chaos()
save()
--##½ÃÀÛ
-- ½Ã½ºÅÛ ¸Þ¼¼Áö
message(sconv("@90010006", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ),"#@item_Lv@#",tostring(lv),"#@item_up_Lv@#",tostring((lv+1))))
--##³¡ #@item_name@# Lv #@item_Lv@#ÀÌ Lv #@item_up_Lv@# (/À¸)·Î ¾÷±×·¹ÀÌµå µÇ¾ú½À´Ï´Ù.
end
NPC_ItemUP_Asura_contact()
end
function Quest_Link_102_1()
local count = find_item( 1000022 )
if count == 0 then
insert_item( 1000022, 1 )
else
end
end
--============================================================
-- <<<<<< Ãʺ¸ÀÚ¼¶ NPC >>>>>>
--============================================================
function NPC_ItemUP_Beginner_init()
cprint( "!´ëÀåÀåÀÌ Å¸³ª¿¤ °¡µ¿" )
set_npc_name( "@90300300" )
end
function NPC_ItemUP_Beginner_contact()
-- ´ÙÀ̾ó·Î±× Ãâ·Â
dlg_title( "@90300301" )
dlg_text( "@90300302" )
local i, handle, lv, text, text2, command, enhance, f, price
-- 0¹ø¿¡¼ 7¹ø ½½·Ô±îÁö ÈȾ¸é¼ ¸Þ´º¿¡ Ãß°¡
for i = 0, 7 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 )
--9.4 ¹«±â °¡°Ý
if get_item_code( handle ) >= 3100020 and get_item_code( handle ) <= 3100026 then
price = 674086
elseif get_item_code( handle ) >= 3100027 and get_item_code( handle ) <= 3100031 then
price = 539270
end
-- ## ½ÃÀÛ
-- ÇØ´ç ¾ÆÀÌÅÛÀÇ °È´Ü°è, ¾ÆÀÌÅÛ¸í, LvÀ» ÅØ½ºÆ®·Î ±¸¼º
if enhance ~= 0 then
-- °ÈµÇ¾îÀÖÀ¸¸é +x Ç¥½Ã
text = sconv("@90010010", "#@enhance_level@#",tostring(enhance) ,"#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ) , "#@item_Lv@#",tostring(lv))
-- ## ³¡ @90010010 = + #@enhance_level@# #@item_name@# Lv #@item_Lv@#
else
text = sconv("@90010011", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ) , "#@item_Lv@#",tostring(lv))
-- ## ³¡ @90010011 = #@item_name@# Lv #@item_Lv@#
end
-- ¾ÆÀÌÅÛ ·¹º§¾÷ ½ºÅ©¸³Æ® Æã¼ÇÀ» ¸Þ´º¿¡ Ãß°¡
if price > 20 then
command = 'ItemLevelUp_Beginner_check( ' .. handle .. ' )'
dlg_menu( text, command )
end
end
end
dlg_menu( "@90100703", "open_market( 'itemUP_suppert' )" )
--dlg_menu( "@690000079", "max_item_durability()" )
--dlg_menu( "@90606098", "random_item_change_menu()" )
dlg_menu( "@90010002", '' )
dlg_show()
end
function ItemLevelUp_Beginner_check( handle )
local i, j, k, max_level, rank, lv, price, cost, text
rank = get_item_rank( handle )
if rank < 1 then
rank = 1
end
lv = get_item_level( handle )
-- ·©Å©°¡ 1À̸é max=3·¹º§, ¾Æ´Ï¸é 10·¹º§
if rank == 1 then
max_level = 5
else
max_level = 10
end
if lv >= max_level then
--¾÷±Û °¡´ÉÇÑ ·¹º§À» ¹þ¾î³ª¹Ç·Î ¹«È¿
dlg_title( "@90300301" )
dlg_text( "@90300303" )
dlg_menu( "@90010003", 'NPC_ItemUP_Beginner_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
-- ¾÷±Û °¡´ÉÇÑ ·¹º§À̹ǷΠ°¡°Ý °è»ê
price = get_item_price( handle )
--9.4 ¹«±â °¡°Ý
if get_item_code( handle ) >= 3100020 and get_item_code( handle ) <= 3100026 then
price = 674086
elseif get_item_code( handle ) >= 3100027 and get_item_code( handle ) <= 3100031 then
price = 539270
end
-- price < 20 ÀÎ ¾ÆÀÌÅÛÀº ±âº»¾ÆÀÌÅÛÀ̹ǷΠ¾÷±Û ºÒ°¡
if price < 20 then
dlg_title( "@90300301" )
dlg_text( "@90300304" )
dlg_menu( "@90010003", 'NPC_ItemUP_Beginner_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
--============================================================================================
-- ¸ðµç ·©Å© ¾÷±×·¹ÀÌµå ºñ¿ë °è»ê ÅëÇÕ
--============================================================================================
-- if rank == 1 then
-- 1·©Å©ÀÇ ¾÷±Ûºñ¿ë °è»ê
-- if lv == 1 then
-- cost = 120
-- else
-- cost = (lv ^ 2) * 100
-- end
-- else
-- ¾÷±Ûºñ¿ë °è»ê
k = price
f = {1.35, 0.2, 0.115, 0.092, 0.085, 0.1, 0.1, 0.1} -- Lv´ç Áõ°¡°¡°Ý¿ë ÆÑÅÍ Å×À̺í
for i = 1, lv do
-- 1·©Å©À϶© µÚ¿¡ 1ÀÚ¸®¸¦, 2·©Å©À϶© µÚÀÇ 2ÀÚ¸®, 3·©Å©ÀÌ»óÀ϶© µÚ¿¡ ¼¼ÀÚ¸®¸¦ 0À¸·Î ¸ÂÃá´Ù.
-- lua ÀÇ ¹è¿Àº zerobase °¡ ¾Æ´Ï´Ù!!! Áß¿ä. C·Î Àû¿ëÇÒ ¶§´Â ¹è¿ ÁÖ¼Ò¸¦ -1 ¾¿ ÇØÁà¾ß ÇÑ´Ù.
-- ¿¹¸¦ µé¾î ¾Æ·¡ÀÇ ¹è¿Àº C¿¡¼´Â f[rank-1] À̾î¾ß ¸Â°í lua¿¡¼´Â f[rank] ¿©¾ß ¸Â´Ù.
if rank == 1 then
cost = math.floor(k * f[rank] * 0.1) * 10
elseif rank == 2 then
cost = math.floor(k * f[rank] * 0.01) * 100
else
cost = math.floor(k * f[rank] * 0.001) * 1000
end
k = k + cost
end
-- end
--##½ÃÀÛ
-- °¡°Ý ¾Ë¸²
text = sconv("@90300305", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ),"#@item_Lv@#",tostring(lv),"#@item_up_Lv@#",tostring((lv+1)),"#@upgrade_cost@#",tostring(cost))
--##³¡ #@item_name@# Lv #@item_Lv@#À» Lv#@item_up_Lv@# '(/À¸)·Î¾÷±×·¹À̵å ÇÏ´Â ºñ¿ëÀº #@upgrade_cost@#·çÇÇ ÀÔ´Ï´Ù.
¾÷±×·¹À̵å ÇϽðڽÀ´Ï±î?'
dlg_title( "@90300301" )
dlg_text( text )
dlg_menu( "@90010004", 'ItemLevelUp_Beginner( ' .. handle .. ' , ' .. cost .. ' )' )
dlg_menu( "@90010003", 'NPC_ItemUP_Beginner_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
end
function ItemLevelUp_Beginner( handle , cost )
-- ÇöÀç µ· ¾ò¾î¿È
local gold = get_value( "gold" )
local result
-- µ· ¸ðÀÚ¶ó¸é KIN
if gold < cost then
dlg_title( "@90300301" )
dlg_text( "@90010005" )
dlg_menu( "@90010003", 'NPC_ItemUP_Beginner_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
-- ¾ÆÀÌÅÛ ·¹º§ ¾ò¾î¿È
local lv = get_item_level( handle )
-- ·¹º§ Áõ°¡
result = set_item_level( handle , lv + 1 )
if result == 0 then
cprint("ÇØ´ç ¹«±â¸¦ ¼ÒÁöÇϰí ÀÖÁö ¾Ê½À´Ï´Ù.")
return
else
-- ¾÷±Ûºñ¿ë Â÷°¨
set_value( "gold", gold - cost )
update_gold_chaos()
save()
--½ÃÀÛ
-- ½Ã½ºÅÛ ¸Þ¼¼Áö
message(sconv("@90010006", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ),"#@item_Lv@#",tostring(lv),"#@item_up_Lv@#",tostring((lv+1))))
--##³¡ #@item_name@#Lv #@item_Lv@#ÀÌ Lv "#@item_up_Lv@#" (/À¸)·Î ¾÷±×·¹ÀÌµå µÇ¾ú½À´Ï´Ù.
end
NPC_ItemUP_Beginner_contact()
end
--============================================================
-- <<<<<< °¡ÀÌ¾Æ Ãø NPC >>>>>>
--============================================================
function NPC_ItemUP_Gaia_init()
cprint( "!°¡ÀÌ¾Æ ´ëÀåÀåÀÌ °¡µ¿" )
set_npc_name( "@90400300" )
end
-- ´ëÀåÀåÀÌ ¹Ì¸£ÇÇÀ¯
function NPC_ItemUP_Gaia_contact()
-- ´ÙÀ̾ó·Î±× Ãâ·Â
dlg_title( "@90400301" )
dlg_text( "@90400302" )
local i, handle, lv, text, text2, command, enhance, f, price
-- 0¹ø¿¡¼ 7¹ø ½½·Ô±îÁö ÈȾ¸é¼ ¸Þ´º¿¡ Ãß°¡
for i = 0, 7 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 )
--9.4 ¹«±â °¡°Ý
if get_item_code( handle ) >= 3100020 and get_item_code( handle ) <= 3100026 then
price = 674086
elseif get_item_code( handle ) >= 3100027 and get_item_code( handle ) <= 3100031 then
price = 539270
end
-- ## ½ÃÀÛ
-- ÇØ´ç ¾ÆÀÌÅÛÀÇ °È´Ü°è, ¾ÆÀÌÅÛ¸í, LvÀ» ÅØ½ºÆ®·Î ±¸¼º
if enhance ~= 0 then
-- °ÈµÇ¾îÀÖÀ¸¸é +x Ç¥½Ã
text = sconv("@90010010", "#@enhance_level@#",tostring(enhance) ,"#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ) , "#@item_Lv@#",tostring(lv))
-- ## ³¡ @90010010 = + #@enhance_level@# #@item_name@# Lv #@item_Lv@#
else
text = sconv("@90010011", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ) , "#@item_Lv@#",tostring(lv))
-- ## ³¡ @90010011 = #@item_name@# Lv #@item_Lv@#
end
-- ¾ÆÀÌÅÛ ·¹º§¾÷ ½ºÅ©¸³Æ® Æã¼ÇÀ» ¸Þ´º¿¡ Ãß°¡
if price > 20 then
command = 'ItemLevelUp_Gaia_check( ' .. handle .. ' )'
dlg_menu( text, command )
end
end
end
dlg_menu( "@90100703", "open_market( 'itemUP_suppert' )" )
--dlg_menu( "@690000079", "max_item_durability()" )
--dlg_menu( "@90606098", "random_item_change_menu()" )
dlg_menu( "@90010002", '' )
dlg_show()
local qstart_text = get_value( "level" )
local quest_progress1 = get_quest_progress(2008)
local quest_progress100 = get_quest_progress(2000)
-- ¹Ì·¡¸¦ ¿¹¾ðÇÏ´Â ¼Ò³à
if qstart_text == 50 or qstart_text > 50 and quest_progress100 == 0 then
dlg_menu( "@90999617", "quest_rumor10()" )
end
-- ±¤½Åµµ ¾Ï»ìÀÚ
if quest_progress1 == 255 then
dlg_menu( "@90999842", "quest_witcharmy1()" )
end
end
-- ¼¼ºÎ´ëÈ ¹Ì¸£ÇÇÀ¯
function quest_rumor10()
-- ´ÙÀ̾ó·Î±× Ãâ·Â
dlg_title( "@90400301" )
dlg_text( "@90999619" )
-- ¼¼ºÎ´ëÈ 1-1, ¹Ì·¡¸¦ ³»´Ùº¸´Â ¼Ò³à
dlg_menu( "@90999621", "quest_rumor_a_7()" )
dlg_menu( "@90010002", '' )
dlg_show()
end
-- ¼¼ºÎ´ëÈ ¼Ò³à¿¡ ´ëÇÑ À̾߱⸦ ²¨¸²
function quest_rumor_a_7()
-- ´ÙÀ̾ó·Î±× Ãâ·Â
dlg_title( "@90400301" )
dlg_text( "@90999630" )
dlg_menu( "@90010002", '' )
dlg_show()
end
function ItemLevelUp_Gaia_check( handle )
local i, j, k, max_level, rank, lv, price, cost, text
rank = get_item_rank( handle )
if rank < 1 then
rank = 1
end
lv = get_item_level( handle )
-- ·©Å©°¡ 1À̸é max=3·¹º§, ¾Æ´Ï¸é 10·¹º§
if rank == 1 then
max_level = 5
else
max_level = 10
end
if lv >= max_level then
--¾÷±Û °¡´ÉÇÑ ·¹º§À» ¹þ¾î³ª¹Ç·Î ¹«È¿
dlg_title( "@90400301" )
dlg_text( "@90400303" )
dlg_menu( "@90010003", 'NPC_ItemUP_Gaia_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
-- ¾÷±Û °¡´ÉÇÑ ·¹º§À̹ǷΠ°¡°Ý °è»ê
price = get_item_price( handle )
--9.4 ¹«±â °¡°Ý
if get_item_code( handle ) >= 3100020 and get_item_code( handle ) <= 3100026 then
price = 674086
elseif get_item_code( handle ) >= 3100027 and get_item_code( handle ) <= 3100031 then
price = 539270
end
-- price < 20 ÀÎ ¾ÆÀÌÅÛÀº ±âº»¾ÆÀÌÅÛÀ̹ǷΠ¾÷±Û ºÒ°¡
if price < 20 then
dlg_title( "@90400301" )
dlg_text( "@90400304" )
dlg_menu( "@90010003", 'NPC_ItemUP_Gaia_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
--============================================================================================
-- ¸ðµç ·©Å© ¾÷±×·¹ÀÌµå ºñ¿ë °è»ê ÅëÇÕ
--============================================================================================
-- if rank == 1 then
-- 1·©Å©ÀÇ ¾÷±Ûºñ¿ë °è»ê
-- if lv == 1 then
-- cost = 120
-- else
-- cost = (lv ^ 2) * 100
-- end
-- else
-- ¾÷±Ûºñ¿ë °è»ê
k = price
f = {1.35, 0.2, 0.115, 0.092, 0.085, 0.1, 0.1, 0.1} -- Lv´ç Áõ°¡°¡°Ý¿ë ÆÑÅÍ Å×À̺í
for i = 1, lv do
-- 1·©Å©À϶© µÚ¿¡ 1ÀÚ¸®¸¦, 2·©Å©À϶© µÚÀÇ 2ÀÚ¸®, 3·©Å©ÀÌ»óÀ϶© µÚ¿¡ ¼¼ÀÚ¸®¸¦ 0À¸·Î ¸ÂÃá´Ù.
-- lua ÀÇ ¹è¿Àº zerobase °¡ ¾Æ´Ï´Ù!!! Áß¿ä. C·Î Àû¿ëÇÒ ¶§´Â ¹è¿ ÁÖ¼Ò¸¦ -1 ¾¿ ÇØÁà¾ß ÇÑ´Ù.
-- ¿¹¸¦ µé¾î ¾Æ·¡ÀÇ ¹è¿Àº C¿¡¼´Â f[rank-1] À̾î¾ß ¸Â°í lua¿¡¼´Â f[rank] ¿©¾ß ¸Â´Ù.
if rank == 1 then
cost = math.floor(k * f[rank] * 0.1) * 10
elseif rank == 2 then
cost = math.floor(k * f[rank] * 0.01) * 100
else
cost = math.floor(k * f[rank] * 0.001) * 1000
end
k = k + cost
end
-- end
--##½ÃÀÛ
-- °¡°Ý ¾Ë¸²
text = sconv("@90400305", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ),"#@item_Lv@#",tostring(lv),"#@item_up_Lv@#",tostring((lv+1)),"#@upgrade_cost@#",tostring(cost))
--##³¡ #@item_name@# Lv #@item_Lv@#À» Lv#@item_up_Lv@# '(/À¸)·Î¾÷±×·¹À̵å ÇÏ´Â ºñ¿ëÀº #@upgrade_cost@#·çÇÇ ÀÔ´Ï´Ù.
¾÷±×·¹À̵å ÇϽðڽÀ´Ï±î?'
dlg_title( "@90400301" )
dlg_text( text )
dlg_menu( "@90010004", 'ItemLevelUp_Gaia( ' .. handle .. ' , ' .. cost .. ' )' )
dlg_menu( "@90010003", 'NPC_ItemUP_Gaia_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
end
function ItemLevelUp_Gaia( handle , cost )
-- ÇöÀç µ· ¾ò¾î¿È
local gold = get_value( "gold" )
local result
-- µ· ¸ðÀÚ¶ó¸é KIN
if gold < cost then
dlg_title( "@90400301" )
dlg_text( "@90010005" )
dlg_menu( "@90010003", 'NPC_ItemUP_Gaia_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
-- ¾ÆÀÌÅÛ ·¹º§ ¾ò¾î¿È
local lv = get_item_level( handle )
-- ·¹º§ Áõ°¡
result = set_item_level( handle , lv + 1 )
if result == 0 then
cprint("ÇØ´ç ¹«±â¸¦ ¼ÒÁöÇϰí ÀÖÁö ¾Ê½À´Ï´Ù.")
return
else
-- ¾÷±Ûºñ¿ë Â÷°¨
set_value( "gold", gold - cost )
update_gold_chaos()
save()
--##½ÃÀÛ
-- ½Ã½ºÅÛ ¸Þ¼¼Áö
message(sconv("@90010006", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ),"#@item_Lv@#",tostring(lv),"#@item_up_Lv@#",tostring((lv+1))))
--##³¡ #@item_name@#Lv #@item_Lv@#ÀÌ Lv "#@item_up_Lv@#" (/À¸)·Î ¾÷±×·¹ÀÌµå µÇ¾ú½À´Ï´Ù.
end
NPC_ItemUP_Gaia_contact()
end
--============================================================
-- <<<<<< ·Ðµµ Ãø NPC >>>>>>
--============================================================
function NPC_ItemUP_Rondoh_init()
cprint( "!·Ðµµ ´ëÀåÀåÀÌ °¡µ¿" )
set_npc_name( "@90600300" )
end
function NPC_ItemUP_Rondoh_contact()
-- ´ÙÀ̾ó·Î±× Ãâ·Â
dlg_title( "@90600301" )
dlg_text( "@90600302" )
local i, handle, lv, text, text2, command, enhance, f, price
-- 0¹ø¿¡¼ 7¹ø ½½·Ô±îÁö ÈȾ¸é¼ ¸Þ´º¿¡ Ãß°¡
for i = 0, 7 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 )
--9.4 ¹«±â °¡°Ý
if get_item_code( handle ) >= 3100020 and get_item_code( handle ) <= 3100026 then
price = 674086
elseif get_item_code( handle ) >= 3100027 and get_item_code( handle ) <= 3100031 then
price = 539270
end
-- ## ½ÃÀÛ
-- ÇØ´ç ¾ÆÀÌÅÛÀÇ °È´Ü°è, ¾ÆÀÌÅÛ¸í, LvÀ» ÅØ½ºÆ®·Î ±¸¼º
if enhance ~= 0 then
-- °ÈµÇ¾îÀÖÀ¸¸é +x Ç¥½Ã
text = sconv("@90010010", "#@enhance_level@#",tostring(enhance) ,"#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ) , "#@item_Lv@#",tostring(lv))
-- ## ³¡ @90010010 = + #@enhance_level@# #@item_name@# Lv #@item_Lv@#
else
text = sconv("@90010011", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ) , "#@item_Lv@#",tostring(lv))
-- ## ³¡ @90010011 = #@item_name@# Lv #@item_Lv@#
end
-- ¾ÆÀÌÅÛ ·¹º§¾÷ ½ºÅ©¸³Æ® Æã¼ÇÀ» ¸Þ´º¿¡ Ãß°¡
if price > 20 then
command = 'ItemLevelUp_Rondoh_check( ' .. handle .. ' )'
dlg_menu( text, command )
end
end
end
dlg_menu( "@90100703", "open_market( 'itemUP_suppert' )" )
--dlg_menu( "@690000079", "max_item_durability()" )
--dlg_menu( "@90606098", "random_item_change_menu()" )
dlg_menu( "@90010002", '' )
dlg_show()
end
function ItemLevelUp_Rondoh_check( handle )
local i, j, k, max_level, rank, lv, price, cost, text
rank = get_item_rank( handle )
if rank < 1 then
rank = 1
end
lv = get_item_level( handle )
-- ·©Å©°¡ 1À̸é max=3·¹º§, ¾Æ´Ï¸é 10·¹º§
if rank == 1 then
max_level = 5
else
max_level = 10
end
if lv >= max_level then
--¾÷±Û °¡´ÉÇÑ ·¹º§À» ¹þ¾î³ª¹Ç·Î ¹«È¿
dlg_title( "@90600301" )
dlg_text( "@90600303" )
dlg_menu( "@90010003", 'NPC_ItemUP_Rondoh_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
-- ¾÷±Û °¡´ÉÇÑ ·¹º§À̹ǷΠ°¡°Ý °è»ê
price = get_item_price( handle )
--9.4 ¹«±â °¡°Ý
if get_item_code( handle ) >= 3100020 and get_item_code( handle ) <= 3100026 then
price = 674086
elseif get_item_code( handle ) >= 3100027 and get_item_code( handle ) <= 3100031 then
price = 539270
end
-- price < 20 ÀÎ ¾ÆÀÌÅÛÀº ±âº»¾ÆÀÌÅÛÀ̹ǷΠ¾÷±Û ºÒ°¡
if price < 20 then
dlg_title( "@90600301" )
dlg_text( "@90600304" )
dlg_menu( "@90010003", 'NPC_ItemUP_Rondoh_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
--============================================================================================
-- ¸ðµç ·©Å© ¾÷±×·¹ÀÌµå ºñ¿ë °è»ê ÅëÇÕ
--============================================================================================
-- if rank == 1 then
-- 1·©Å©ÀÇ ¾÷±Ûºñ¿ë °è»ê
-- if lv == 1 then
-- cost = 120
-- else
-- cost = (lv ^ 2) * 100
-- end
-- else
-- ¾÷±Ûºñ¿ë °è»ê
k = price
f = {1.35, 0.2, 0.115, 0.092, 0.085, 0.1, 0.1, 0.1} -- Lv´ç Áõ°¡°¡°Ý¿ë ÆÑÅÍ Å×À̺í
for i = 1, lv do
-- 1·©Å©À϶© µÚ¿¡ 1ÀÚ¸®¸¦, 2·©Å©À϶© µÚÀÇ 2ÀÚ¸®, 3·©Å©ÀÌ»óÀ϶© µÚ¿¡ ¼¼ÀÚ¸®¸¦ 0À¸·Î ¸ÂÃá´Ù.
-- lua ÀÇ ¹è¿Àº zerobase °¡ ¾Æ´Ï´Ù!!! Áß¿ä. C·Î Àû¿ëÇÒ ¶§´Â ¹è¿ ÁÖ¼Ò¸¦ -1 ¾¿ ÇØÁà¾ß ÇÑ´Ù.
-- ¿¹¸¦ µé¾î ¾Æ·¡ÀÇ ¹è¿Àº C¿¡¼´Â f[rank-1] À̾î¾ß ¸Â°í lua¿¡¼´Â f[rank] ¿©¾ß ¸Â´Ù.
if rank == 1 then
cost = math.floor(k * f[rank] * 0.1) * 10
elseif rank == 2 then
cost = math.floor(k * f[rank] * 0.01) * 100
else
cost = math.floor(k * f[rank] * 0.001) * 1000
end
k = k + cost
end
-- end
--##½ÃÀÛ
-- °¡°Ý ¾Ë¸²
text = sconv("@90600305", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ),"#@item_Lv@#",tostring(lv),"#@item_up_Lv@#",tostring((lv+1)),"#@upgrade_cost@#",tostring(cost))
--##³¡ #@item_name@# Lv #@item_Lv@#À» Lv#@item_up_Lv@# '(/À¸)·Î¾÷±×·¹À̵å ÇÏ´Â ºñ¿ëÀº #@upgrade_cost@#·çÇÇ ÀÔ´Ï´Ù.
¾÷±×·¹À̵å ÇϽðڽÀ´Ï±î?'
dlg_title( "@90600301" )
dlg_text( text )
dlg_menu( "@90010004", 'ItemLevelUp_Rondoh( ' .. handle .. ' , ' .. cost .. ' )' )
dlg_menu( "@90010003", 'NPC_ItemUP_Rondoh_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
end
function ItemLevelUp_Rondoh( handle , cost )
-- ÇöÀç µ· ¾ò¾î¿È
local gold = get_value( "gold" )
local result
-- µ· ¸ðÀÚ¶ó¸é KIN
if gold < cost then
dlg_title( "@90600301" )
dlg_text( "@90010005" )
dlg_menu( "@90010003", 'NPC_ItemUP_Rondoh_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
-- ¾ÆÀÌÅÛ ·¹º§ ¾ò¾î¿È
local lv = get_item_level( handle )
-- ·¹º§ Áõ°¡
result = set_item_level( handle , lv + 1 )
if result == 0 then
cprint("ÇØ´ç ¹«±â¸¦ ¼ÒÁöÇϰí ÀÖÁö ¾Ê½À´Ï´Ù.")
return
else
-- ¾÷±Ûºñ¿ë Â÷°¨
set_value( "gold", gold - cost )
update_gold_chaos()
save()
--##½ÃÀÛ
-- ½Ã½ºÅÛ ¸Þ¼¼Áö
message(sconv("@90010006", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ),"#@item_Lv@#",tostring(lv),"#@item_up_Lv@#",tostring((lv+1))))
--##³¡ #@item_name@#Lv #@item_Lv@#ÀÌ Lv "#@item_up_Lv@#" (/À¸)·Î ¾÷±×·¹ÀÌµå µÇ¾ú½À´Ï´Ù.
end
NPC_ItemUP_Rondoh_contact()
end
--============================================================
-- <<<<<< ½ÃÅ©·çÆ® Ãø NPC >>>>>>
--============================================================
function NPC_ItemUP_Secroute_init()
cprint( "!½ÃÅ©·çÆ® ´ëÀåÀåÀÌ °¡µ¿" )
set_npc_name( "@90700300" )
end
function NPC_ItemUP_Secroute_contact()
if is_premium() == false then
dlg_title( "@90700301" )
dlg_text( "@90700118" )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
-- ´ÙÀ̾ó·Î±× Ãâ·Â
dlg_title( "@90700301" )
dlg_text( "@90700302" )
local i, handle, lv, text, text2, command, enhance, f, price
-- 0¹ø¿¡¼ 7¹ø ½½·Ô±îÁö ÈȾ¸é¼ ¸Þ´º¿¡ Ãß°¡
for i = 0, 7 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 )
--9.4 ¹«±â °¡°Ý
if get_item_code( handle ) >= 3100020 and get_item_code( handle ) <= 3100026 then
price = 674086
elseif get_item_code( handle ) >= 3100027 and get_item_code( handle ) <= 3100031 then
price = 539270
end
-- ## ½ÃÀÛ
-- ÇØ´ç ¾ÆÀÌÅÛÀÇ °È´Ü°è, ¾ÆÀÌÅÛ¸í, LvÀ» ÅØ½ºÆ®·Î ±¸¼º
if enhance ~= 0 then
-- °ÈµÇ¾îÀÖÀ¸¸é +x Ç¥½Ã
text = sconv("@90010010", "#@enhance_level@#",tostring(enhance) ,"#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ) , "#@item_Lv@#",tostring(lv))
-- ## ³¡ @90010010 = + #@enhance_level@# #@item_name@# Lv #@item_Lv@#
else
text = sconv("@90010011", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ) , "#@item_Lv@#",tostring(lv))
-- ## ³¡ @90010011 = #@item_name@# Lv #@item_Lv@#
end
-- ¾ÆÀÌÅÛ ·¹º§¾÷ ½ºÅ©¸³Æ® Æã¼ÇÀ» ¸Þ´º¿¡ Ãß°¡
if price > 20 then
command = 'ItemLevelUp_Secroute_check( ' .. handle .. ' )'
dlg_menu( text, command )
end
end
end
dlg_menu( "@690000079", "max_item_durability()" )
dlg_menu( "@90606098", "random_item_change_menu()" )
dlg_menu( "@90010002", '' )
dlg_show()
end
function ItemLevelUp_Secroute_check( handle )
local i, j, k, max_level, rank, lv, price, cost, text
rank = get_item_rank( handle )
if rank < 1 then
rank = 1
end
lv = get_item_level( handle )
-- ·©Å©°¡ 1À̸é max=3·¹º§, ¾Æ´Ï¸é 10·¹º§
if rank == 1 then
max_level = 5
else
max_level = 10
end
if lv >= max_level then
--¾÷±Û °¡´ÉÇÑ ·¹º§À» ¹þ¾î³ª¹Ç·Î ¹«È¿
dlg_title( "@90700301" )
dlg_text( "@90700303" )
dlg_menu( "@90010003", 'NPC_ItemUP_Secroute_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
-- ¾÷±Û °¡´ÉÇÑ ·¹º§À̹ǷΠ°¡°Ý °è»ê
price = get_item_price( handle )
--9.4 ¹«±â °¡°Ý
if get_item_code( handle ) >= 3100020 and get_item_code( handle ) <= 3100026 then
price = 674086
elseif get_item_code( handle ) >= 3100027 and get_item_code( handle ) <= 3100031 then
price = 539270
end
-- price < 20 ÀÎ ¾ÆÀÌÅÛÀº ±âº»¾ÆÀÌÅÛÀ̹ǷΠ¾÷±Û ºÒ°¡
if price < 20 then
dlg_title( "@90700301" )
dlg_text( "@90700304" )
dlg_menu( "@90010003", 'NPC_ItemUP_Secroute_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
-- ¾÷±Ûºñ¿ë °è»ê
k = price
f = {1.35, 0.2, 0.115, 0.092, 0.085, 0.1, 0.1, 0.1} -- Lv´ç Áõ°¡°¡°Ý¿ë ÆÑÅÍ Å×À̺í
for i = 1, lv do
-- 1·©Å©À϶© µÚ¿¡ 1ÀÚ¸®¸¦, 2·©Å©À϶© µÚÀÇ 2ÀÚ¸®, 3·©Å©ÀÌ»óÀ϶© µÚ¿¡ ¼¼ÀÚ¸®¸¦ 0À¸·Î ¸ÂÃá´Ù.
-- lua ÀÇ ¹è¿Àº zerobase °¡ ¾Æ´Ï´Ù!!! Áß¿ä. C·Î Àû¿ëÇÒ ¶§´Â ¹è¿ ÁÖ¼Ò¸¦ -1 ¾¿ ÇØÁà¾ß ÇÑ´Ù.
-- ¿¹¸¦ µé¾î ¾Æ·¡ÀÇ ¹è¿Àº C¿¡¼´Â f[rank-1] À̾î¾ß ¸Â°í lua¿¡¼´Â f[rank] ¿©¾ß ¸Â´Ù.
if rank == 1 then
cost = math.floor(k * f[rank] * 0.1) * 10
elseif rank == 2 then
cost = math.floor(k * f[rank] * 0.01) * 100
else
cost = math.floor(k * f[rank] * 0.001) * 1000
end
k = k + cost
end
-- ½ÃÅ©·çÆ® ÇÁ¸®ÆÐ½º°¡ Ȱ¼ºÈµÈ »óÅÂ(ÇÁ¸®¹Ì¾ö ȸ¿ø)
-- ÇÁ¸®¹Ì¾ö ¼ºñ½º üũ ÁÖ¼®Ã³¸®
-- ½ÃÅ©·çÆ® ÀÏ ¶§ (7022 ¸ðÇè °¡À̵å ÄÉÀÎ)
if is_premium() then
-- ½ÃÅ©·çÆ®¿¡¼´Â 15% ÇÒÀÎµÈ °¡°ÝÀ¸·Î ¼ºñ½º
cost = math.floor ( cost * 0.85 )
end
--##½ÃÀÛ
-- °¡°Ý ¾Ë¸²
text = sconv("@90700305", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ),"#@item_Lv@#",tostring(lv),"#@item_up_Lv@#",tostring((lv+1)),"#@upgrade_cost@#",tostring(cost))
--##³¡ #@item_name@# Lv #@item_Lv@#À» Lv#@item_up_Lv@# '(/À¸)·Î¾÷±×·¹À̵å ÇÏ´Â ºñ¿ëÀº #@upgrade_cost@#·çÇÇ ÀÔ´Ï´Ù.
¾÷±×·¹À̵å ÇϽðڽÀ´Ï±î?'
dlg_title( "@90700301" )
dlg_text( text )
dlg_menu( "@90010004", 'ItemLevelUp_Secroute( ' .. handle .. ' , ' .. cost .. ' )' )
dlg_menu( "@90010003", 'NPC_ItemUP_Secroute_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
end
function ItemLevelUp_Secroute( handle , cost )
-- ÇöÀç µ· ¾ò¾î¿È
local gold = get_value( "gold" )
local result
-- µ· ¸ðÀÚ¶ó¸é KIN
if gold < cost then
dlg_title( "@90700301" )
dlg_text( "@90010005" )
dlg_menu( "@90010003", 'NPC_ItemUP_Secroute_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
-- ¾ÆÀÌÅÛ ·¹º§ ¾ò¾î¿È
local lv = get_item_level( handle )
-- ·¹º§ Áõ°¡
result = set_item_level( handle , lv + 1 )
if result == 0 then
cprint("ÇØ´ç ¹«±â¸¦ ¼ÒÁöÇϰí ÀÖÁö ¾Ê½À´Ï´Ù.")
return
else
-- ¾÷±Ûºñ¿ë Â÷°¨
set_value( "gold", gold - cost )
update_gold_chaos()
save()
--##½ÃÀÛ
-- ½Ã½ºÅÛ ¸Þ¼¼Áö
message(sconv("@90010006", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ),"#@item_Lv@#",tostring(lv),"#@item_up_Lv@#",tostring((lv+1))))
--##³¡ #@item_name@#Lv #@item_Lv@#ÀÌ Lv "#@item_up_Lv@#" (/À¸)·Î ¾÷±×·¹ÀÌµå µÇ¾ú½À´Ï´Ù.
end
NPC_ItemUP_Secroute_contact()
end
--============================================================
-- <<<<<< µµ½Ã À¯Àû Ãø NPC >>>>>>
--============================================================
--°í´ë°È
function NPC_ItemUP_Ancient_relic_init()
cprint( "!µµ½ÃÀ¯Àû ´ëÀåÀåÀÌ °¡µ¿" )
set_npc_name( "@90703100" )
end
function NPC_ItemUP_Ancient_relic_contact()
dlg_title( "@90703100") -- °í´ëÀÇ ´ëÀåÀåÀÌ ÇϹÂ
dlg_text( "@90703107") -- °í´ëÀÇ °Ã¶Á¶°¢°ú LV10 ÀÌ»óÀÇ ¹«±â³ª ¹æ¾î±¸¸¦ °¡Á®¿À¸é °ÈÇØ ÁÖ°Ú½À´Ï´Ù.
local i
for i = 0, 7 do
local handle = get_wear_item_handle(i)
local lv = get_item_level( handle )
if handle ~= 0 then
enhance = get_item_enhance( handle )
local text
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
local lv = get_item_level( handle )
if lv > 9 and lv < 20 then
local command = 'ItemLevelUp_Ancient_check( ' .. handle .. ' )'
dlg_menu( text, command )
end
end
end
dlg_menu( "@690000079", "max_item_durability()" )
dlg_menu( "@90010002", '' )
dlg_show()
end
function ItemLevelUp_Ancient_check( handle )
local code = get_item_code( handle )
local name = get_item_name_id( code )
local lv = get_item_level( handle )
local req_cost
-- lv11 lv12 lv13 lv14 lv15 lv16 lv17 lv18 lv19 lv20
if get_local_info() == 8192 then
req_cost = { 10000000,20000000,30000000,40000000,50000000,60000000,70000000,80000000,90000000,100000000} -- 秵else
req_cost = { 1000000, 2000000, 3000000, 4000000, 5000000, 6000000, 7000000, 8000000, 9000000, 10000000}
end
local req_iron = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
local cost = req_cost[lv-9]
local iron = req_iron[lv-9]
local text = sconv("@90703108", "#@item_name@#", "@" .. tostring(name ),"#@item_Lv@#",tostring(lv),"#@item_up_Lv@#",tostring((lv+1)),"#@upgrade_cost@#",tostring(cost), "#@count@#", tostring(iron))
dlg_title( "@90703101" )
dlg_text( text )
dlg_menu( "@90010004", 'ItemLevelUp_Ancient( ' .. handle .. ' , ' .. cost .. ' , ' .. iron .. ' )' )
dlg_menu( "@90010003", 'NPC_ItemUP_Ancient_relic_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
end
function ItemLevelUp_Ancient( handle , cost, iron )
local gold = get_value( "gold" )
if gold < cost then
dlg_title( "@90703101" )
dlg_text( "@90010005" )
dlg_menu( "@90010003", 'NPC_ItemUP_Ancient_relic_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
-- ·¹µåÆ÷¼ÇLV1(602001~602004)·Î Å×½ºÆ®
local iron_code = 1100117
local count = find_item( iron_code)
if count < iron then
dlg_title("@90703101")
dlg_text( "@90703109") -- °í´ëÀÇ °Ã¶Á¶°¢ÀÌ ºÎÁ·ÇÕ´Ï´Ù
dlg_menu( "@90010003", 'NPC_ItemUP_Ancient_relic_contact()' )
dlg_menu( "@90010002", '' )
dlg_show()
return
end
local lv = get_item_level( handle )
local result = set_item_level( handle , lv + 1 )
if result == 0 then
cprint("ÇØ´ç ¹«±â¸¦ ¼ÒÁöÇϰí ÀÖÁö ¾Ê½À´Ï´Ù.")
return
end
local req_item_handle = get_item_handle(iron_code)
delete_item( req_item_handle, iron )
set_value( "gold", gold-cost )
update_gold_chaos()
save()
message(sconv("@90010006", "#@item_name@#", "@" .. tostring( get_item_name_id( get_item_code( handle ) ) ),"#@item_Lv@#",tostring(lv),"#@item_up_Lv@#",tostring((lv+1))))
NPC_ItemUP_Ancient_relic_contact()
end
------------------------------ ´ëÀåÀåÀÌ Å¸·é 9.5 --------------
function NPC_Smith_Tarun_contact()
local state_code = get_local_info() -- ±¹°¡ÄÚµå
local npc_name = "@"..get_npc_type().."|@"..get_npc_name()
dlg_title(npc_name)
dlg_text( "@90610353")
dlg_menu( "@90610355", 'NPC_Tarun_Make_Armor()' )
dlg_menu( "@90610469", 'NPC_Tarun_OpenBox()' )
if state_code == 4 or state_code == 8 or state_code == 128 or state_code == 16384 or state_code == 32768 or state_code == 65536 then
dlg_menu( "@90610487", "open_market( 'medusa_shaper' )" )
end
dlg_menu( "@90010002", '' )
dlg_show()
end
function NPC_Tarun_OpenBox()
local npc_name = "@"..get_npc_type().."|@"..get_npc_name()
dlg_title(npc_name)
dlg_text( "@90610470")
dlg_menu( "@90610471", 'NPC_Tarun_OpenBox_Done()' )
dlg_menu( "@90010003", " NPC_Smith_Tarun_contact() " ) --µ¹¾Æ°¡±â
dlg_menu( "@90010002", '' )
dlg_show()
end
function NPC_Tarun_OpenBox_Done()
local npc_name = "@"..get_npc_type().."|@"..get_npc_name()
dlg_title(npc_name)
local Box_Count = find_item(2016132)
if Box_Count >= 100 then -- ¼º°ø
dlg_text( "@90610472")
delete_item( get_item_handle(2016132), 100 )
insert_item(2016128,100)
else -- ½ÇÆÐ
dlg_text( "@90610473")
end
dlg_menu( "@90010003", " NPC_Tarun_OpenBox() " ) --µ¹¾Æ°¡±â
dlg_menu( "@90010002", '' )
dlg_show()
end
-----------------Ÿ·é ¹æ¾î±¸ Á¦ÀÛ
function NPC_Tarun_Make_Armor()
local npc_name = "@"..get_npc_type().."|@"..get_npc_name()
dlg_title(npc_name)
dlg_text( "@90610365")
dlg_menu( "@90610357", 'NPC_Tarun_Make_Armor_select(601100280)' )
dlg_menu( "@90610358", 'NPC_Tarun_Make_Armor_select(601100424)' )
dlg_menu( "@90610359", 'NPC_Tarun_Make_3rdArmor_select()' )
dlg_menu( "@90610360", 'NPC_Tarun_Make_4thArmor_select()' )
dlg_menu( "@90010002", '' )
dlg_show()
end
function NPC_Tarun_Make_Armor_select(item_id)
local npc_name = "@"..get_npc_type().."|@"..get_npc_name()
dlg_title(npc_name)
dlg_text( "@90610366") -- Á¦ÀÛ ÇÒ ¹æ¾î±¸´Â ²À Âø¿ëÀ» ÇØ¾ßÁö¸¸..
local text1 = sconv("@90610361","#@item@#","@"..tostring(item_id+10000000))
local text2 = sconv("@90610361","#@item@#","@"..tostring(item_id+10000001))
local text3 = sconv("@90610361","#@item@#","@"..tostring(item_id+10000002))
local text4 = sconv("@90610361","#@item@#","@"..tostring(item_id+10000003))
dlg_menu( text1, 'NPC_Tarun_Make_Armor_select_1(3,'..tostring(item_id)..')' ) -- Åõ±¸
dlg_menu( text2, 'NPC_Tarun_Make_Armor_select_1(4,'..tostring(item_id+1)..')' ) -- Àå°©
dlg_menu( text3, 'NPC_Tarun_Make_Armor_select_1(5,'..tostring(item_id+2)..')' ) -- ºÎÃ÷
dlg_menu( text4, 'NPC_Tarun_Make_Armor_select_1(2,'..tostring(item_id+3)..')' ) -- °©¿Ê
dlg_menu( "@90010002", '' )
dlg_show()
end
function NPC_Tarun_Make_Armor_select_1(part, Want_Item)
local npc_name = "@"..get_npc_type().."|@"..get_npc_name()
dlg_title(npc_name)
local pdata = { -- need_item_string, want_item, level, count,
710000904, 601100280, 175, 50,
90610376, 601100281, 175, 50, -- °ÈµÈ À̰ø°£ÀÇ ±Û·¯ºê
90610377, 601100282, 175, 50, -- °ÈµÈ À̰ø°£ÀÇ ºÎÃ÷
90610378, 601100283, 175, 50, -- °ÈµÈ À̰ø°£ÀÇ °©¿Ê
611100280, 601100424, 181, 130,
611100281, 601100425, 182, 150,
611100282, 601100426, 183, 220,
611100283, 601100427, 185, 300,
--611100424, 601100428, 181, 300,
--611100425, 601100429, 182, 500,
--611100426, 601100430, 183, 700,
--611100427, 601100431, 185, 1000,
--611100428, 601100432, 186, 2100,
--611100429, 601100433, 187, 2300,
--611100430, 601100434, 188, 2500,
--611100431, 601100435, 190, 3100,
}
local old_item = get_item_code( get_wear_item_handle( part ) )
local equip_item = 0
local length = table.getn(pdata)
local Need_Item, Level, Count
for i = 2, length,4 do
if pdata[i] == Want_Item then
New_Item = pdata[i]
New_Item_string = pdata[i]+10000000
Need_Item = pdata[i-1]
Level = pdata[i+1]
Count = pdata[i+2]
equip_item = 1
break
end
end
dlg_text( sconv ("@90610368", "#@item@#", "@"..tostring( New_Item_string ), "#@level@#", Level, "#@need_item@#", "@"..tostring( Need_Item ), "#@number@#", Count )) -- ·¹º§ Àç·á....
if equip_item == 1 then
dlg_menu( "@90610362", 'NPC_Tarun_Make_Armor_done('..tostring(part)..','..tostring(New_Item )..')' ) -- Á¦ÀÛÇϱâ
end
dlg_menu( "@90010002", '' )
dlg_show()
end
function NPC_Tarun_Make_Armor_done(part, WantItem)
local npc_name = "@"..get_npc_type().."|@"..get_npc_name()
dlg_title(npc_name)
local pdata = { -- old_item, new_item, level, count,
700000896, 601100281, 175, 50,
700000897, 601100281, 175, 50,
700000898, 601100281, 175, 50,
700000899, 601100281, 175, 50,
700000900, 601100282, 175, 50,
700000901, 601100282, 175, 50,
700000902, 601100282, 175, 50,
700000903, 601100282, 175, 50,
700000883, 601100283, 175, 50,
700000884, 601100283, 175, 50,
700000885, 601100283, 175, 50,
700000886, 601100283, 175, 50,
700000904, 601100280, 175, 50,
601100280, 601100424, 181, 130,
601100281, 601100425, 182, 150,
601100282, 601100426, 183, 220,
601100283, 601100427, 185, 300,
--601100424, 601100428, 181, 300,
--601100425, 601100429, 182, 500,
--601100426, 601100430, 183, 700,
--601100427, 601100431, 185, 1000,
--601100428, 601100432, 186, 2100,
--601100429, 601100433, 187, 2300,
--601100430, 601100434, 188, 2500,
--601100431, 601100435, 190, 3100,
}
-- ¹æ¾î±¸ Âø¿ë ¾ÈÇßÀ» °æ¿ì
if get_wear_item_handle( part ) == 0 then --¹æ¾î±¸ ¾ø
dlg_text( "@90610367") -- ÀåÂø ÈÄ Á¦ÀÛ °¡´É
else
local equip_item = get_item_code( get_wear_item_handle( part ) )
local length = table.getn(pdata)
local item_compare = 0
local NewItem, Level, Count
for i = 1, length,4 do
--private_notice(i .." : "..pdata[i])
if pdata[i] == equip_item then
--private_notice("WantItem : "..WantItem)
--private_notice("Pdata : "..pdata[i+1])
if pdata[i+1] == WantItem then
--private_notice("µé¾î¿ÔÀ½")
Count = pdata[i+3]
--private_notice("Count : "..Count)
Level = pdata[i+2]
--private_notice("Level : "..Level)
NewItem = pdata[i+1]
item_compare = 1
break
end
end
end
if item_compare == 0 then -- º¯°æ °¡´ÉÇÑ ¾ÆÀÌÅÛÀÌ ¾Æ´Ô
dlg_text( "@90610379") -- Á¦ÀÛ¸øÇÔ
elseif get_value( 'level' ) < Level then -- ·¹º§ÀÌ ³·À½
dlg_text( "@90610380")
elseif find_item ( 2016129 ) < Count then -- Àç·á ¸ðÀÚ¶÷
dlg_text( "@90610381")
else
dlg_text( "@90610382") -- Á¦ÀÛ¿Ï·á
delete_item( get_item_handle( 2016129 ), Count )
change_item_code( get_wear_item_handle( part ), NewItem )
set_item_ethereal_durability( get_wear_item_handle( part ), get_max_item_ethereal_durability( get_wear_item_handle( part ) ) ) -- Âø¿ëµÈ ¾ÆÀÌÅÛÀÇ ³»±¸µµ¸¦ ÃÖ´ë°ªÀ¸·Î ä¿öÁØ´Ù.
update_wear() -- ¹æ¾î±¸ º¯°æÈÄ ¿ÜÇü ¾÷µ¥ÀÌÆ®
end
end
dlg_menu( "@90010002", '' )
dlg_show()
end
---3Â÷ ¹æ¾î±¸
function NPC_Tarun_Make_3rdArmor_select()
local Cha_Job = get_value('job')
local npc_name = "@"..get_npc_type().."|@"..get_npc_name()
dlg_title(npc_name)
dlg_text( "@90610366") -- Á¦ÀÛ ÇÒ ¹æ¾î±¸´Â ²À Âø¿ëÀ» ÇØ¾ßÁö¸¸..
dlg_menu( "@90610361\v#@item@#\v@611100449", 'NPC_Tarun_Make_3rdArmor_select_1(3, 601100449)' ) -- Åõ±¸
dlg_menu( "@90610361\v#@item@#\v@611100450", 'NPC_Tarun_Make_3rdArmor_select_1(4, 601100450)' ) -- Àå°©
dlg_menu( "@90610361\v#@item@#\v@611100451", 'NPC_Tarun_Make_3rdArmor_select_1(5, 601100451)' ) -- ºÎÃ÷
if Cha_Job == 120 or Cha_Job == 220 or Cha_Job == 221 or Cha_Job == 320 then
dlg_menu( "@90610361\v#@item@#\v@611100452", 'NPC_Tarun_Make_3rdArmor_select_1(2, 601100452)' ) -- ¾Æ¸Ó ±â»ç
elseif Cha_Job == 121 or Cha_Job == 321 then
dlg_menu( "@90610361\v#@item@#\v@611100453", 'NPC_Tarun_Make_3rdArmor_select_1(2, 601100453)' ) -- ŸÀÌÁî ÇåÅÍ
elseif Cha_Job == 122 or Cha_Job == 123 or Cha_Job == 222 or Cha_Job == 223 or Cha_Job == 322 or Cha_Job == 323 then
dlg_menu( "@90610361\v#@item@#\v@611100454", 'NPC_Tarun_Make_3rdArmor_select_1(2, 601100454)' ) -- °¡ºê ¸¶¹ý»ç
elseif Cha_Job == 124 or Cha_Job == 224 or Cha_Job == 324 then
dlg_menu( "@90610361\v#@item@#\v@611100455", 'NPC_Tarun_Make_3rdArmor_select_1(2, 601100455)' ) -- ÄÚÆ® ¼Òȯ»ç
end
dlg_menu( "@90010002", '' )
dlg_show()
end
function NPC_Tarun_Make_3rdArmor_select_1(part, Want_Item) -- ÀÎÆä¸£³ë
local npc_name = "@"..get_npc_type().."|@"..get_npc_name()
dlg_title(npc_name)
local pdata = { -- need_item_string, want_item, level, count,
611100424, 601100449, 186, 300, 3000, 1500, 750, 15,
611100425, 601100450, 187, 300, 3000, 1500, 750, 15,
611100426, 601100451, 188, 600, 4000, 2000, 1000, 20,
611100427, 601100452, 190, 1000, 5000, 3000, 1500, 50,
611100427, 601100453, 190, 1000, 5000, 3000, 1500, 50,
611100427, 601100454, 190, 1000, 5000, 3000, 1500, 50,
611100427, 601100455, 190, 1000, 5000, 3000, 1500, 50,
}
local old_item = get_item_code( get_wear_item_handle( part ) )
local equip_item = 0
local length = table.getn(pdata)
local Need_Item, Level, Count1, Count2, Count3, Count4, Count5
for i = 2, length,8 do
if pdata[i] == Want_Item then
New_Item = pdata[i]
New_Item_string = pdata[i]+10000000
Need_Item = pdata[i-1]
Level = pdata[i+1]
Count1 = pdata[i+2]
Count2 = pdata[i+3]
Count3 = pdata[i+4]
Count4 = pdata[i+5]
Count5 = pdata[i+6]
equip_item = 1
break
end
end
dlg_text( sconv ("@90610858", "#@item@#", "@"..tostring( New_Item_string ), "#@level@#", Level, "#@need_item@#", "@"..tostring( Need_Item ), "#@number1@#", Count1, "#@number2@#", Count2, "#@number3@#", Count3, "#@number4@#", Count4, "#@number5@#", Count5 )) -- ·¹º§ Àç·á....
if equip_item == 1 then
dlg_menu( "@90610362", 'NPC_Tarun_Make_3rdArmor_done('..tostring(part)..','..tostring(New_Item )..')' ) -- Á¦ÀÛÇϱâ
end
dlg_menu( "@90010002", '' )
dlg_show()
end
function NPC_Tarun_Make_3rdArmor_done(part, WantItem)
local npc_name = "@"..get_npc_type().."|@"..get_npc_name()
dlg_title(npc_name)
local pdata = { -- old_item, new_item, level, count1, count2, count3, count4, count5,
601100424, 601100449, 186, 300, 3000, 1500, 750, 15,
601100425, 601100450, 187, 300, 3000, 1500, 750, 15,
601100426, 601100451, 188, 600, 4000, 2000, 1000, 20,
601100427, 601100452, 190, 1000, 5000, 3000, 1500, 50,
601100427, 601100453, 190, 1000, 5000, 3000, 1500, 50,
601100427, 601100454, 190, 1000, 5000, 3000, 1500, 50,
601100427, 601100455, 190, 1000, 5000, 3000, 1500, 50,
}
-- ¹æ¾î±¸ Âø¿ë ¾ÈÇßÀ» °æ¿ì
if get_wear_item_handle( part ) == 0 then --¹æ¾î±¸ ¾ø
dlg_text( "@90610367") -- ÀåÂø ÈÄ Á¦ÀÛ °¡´É
else
local equip_item = get_item_code( get_wear_item_handle( part ) )
local length = table.getn(pdata)
local item_compare = 0
local NewItem, Level, Count1, Count2, Count3, Count4, Count5
for i = 1, length,8 do
--private_notice(i .." : "..pdata[i])
if pdata[i] == equip_item then
--private_notice("WantItem : "..WantItem)
--private_notice("Pdata : "..pdata[i+1])
if pdata[i+1] == WantItem then
--private_notice("µé¾î¿ÔÀ½")
Count1 = pdata[i+3]
Count2 = pdata[i+4]
Count3 = pdata[i+5]
Count4 = pdata[i+6]
Count5 = pdata[i+7]
--private_notice("Count5 : "..Count5)
Level = pdata[i+2]
--private_notice("Level : "..Level)
NewItem = pdata[i+1]
item_compare = 1
break
end
end
end
if item_compare == 0 then -- º¯°æ °¡´ÉÇÑ ¾ÆÀÌÅÛÀÌ ¾Æ´Ô
dlg_text( "@90610379") -- Á¦ÀÛ¸øÇÔ
elseif get_value( 'level' ) < Level then -- ·¹º§ÀÌ ³·À½
dlg_text( "@90610380")
elseif find_item ( 2016129 ) < Count1 or find_item ( 1000540 ) < Count2 or find_item ( 1000541 ) < Count3 or find_item ( 1000542 ) < Count4 or find_item ( 2016158 ) < Count5 then -- Àç·á ¸ðÀÚ¶÷
dlg_text( "@90610381")
else
dlg_text( "@90610382") -- Á¦ÀÛ¿Ï·á
delete_item( get_item_handle( 2016129 ), Count1 )
delete_item( get_item_handle( 1000540 ), Count2 )
delete_item( get_item_handle( 1000541 ), Count3 )
delete_item( get_item_handle( 1000542 ), Count4 )
delete_item( get_item_handle( 2016158 ), Count5 )
change_item_code( get_wear_item_handle( part ), NewItem )
set_item_ethereal_durability( get_wear_item_handle( part ), get_max_item_ethereal_durability( get_wear_item_handle( part ) ) ) -- Âø¿ëµÈ ¾ÆÀÌÅÛÀÇ ³»±¸µµ¸¦ ÃÖ´ë°ªÀ¸·Î ä¿öÁØ´Ù.
update_wear() -- ¹æ¾î±¸ º¯°æÈÄ ¿ÜÇü ¾÷µ¥ÀÌÆ®
end
end
dlg_menu( "@90010002", '' )
dlg_show()
end
---4Â÷ ¹æ¾î±¸
function NPC_Tarun_Make_4thArmor_select()
local Cha_Job = get_value('job')
local npc_name = "@"..get_npc_type().."|@"..get_npc_name()
dlg_title(npc_name)
dlg_text( "@90610366") -- Á¦ÀÛ ÇÒ ¹æ¾î±¸´Â ²À Âø¿ëÀ» ÇØ¾ßÁö¸¸..
dlg_menu( "@90610361\v#@item@#\v@611100456", 'NPC_Tarun_Make_4thArmor_select_1(3, 601100456)' ) -- Åõ±¸
dlg_menu( "@90610361\v#@item@#\v@611100457", 'NPC_Tarun_Make_4thArmor_select_1(4, 601100457)' ) -- Àå°©
dlg_menu( "@90610361\v#@item@#\v@611100458", 'NPC_Tarun_Make_4thArmor_select_1(5, 601100458)' ) -- ºÎÃ÷
if Cha_Job == 120 or Cha_Job == 220 or Cha_Job == 221 or Cha_Job == 320 then
dlg_menu( "@90610361\v#@item@#\v@611100459", 'NPC_Tarun_Make_4thArmor_select_1(2, 601100459)' ) -- ¾Æ¸Ó ±â»ç
elseif Cha_Job == 121 or Cha_Job == 321 then
dlg_menu( "@90610361\v#@item@#\v@611100460", 'NPC_Tarun_Make_4thArmor_select_1(2, 601100460)' ) -- ŸÀÌÁî ÇåÅÍ
elseif Cha_Job == 122 or Cha_Job == 123 or Cha_Job == 222 or Cha_Job == 223 or Cha_Job == 322 or Cha_Job == 323 then
dlg_menu( "@90610361\v#@item@#\v@611100461", 'NPC_Tarun_Make_4thArmor_select_1(2, 601100461)' ) -- °¡ºê ¸¶¹ý»ç
elseif Cha_Job == 124 or Cha_Job == 224 or Cha_Job == 324 then
dlg_menu( "@90610361\v#@item@#\v@611100462", 'NPC_Tarun_Make_4thArmor_select_1(2, 601100462)' ) -- ÄÚÆ® ¼Òȯ»ç
end
dlg_menu( "@90010002", '' )
dlg_show()
end
function NPC_Tarun_Make_4thArmor_select_1(part, Want_Item) -- ·çŰ½º
local npc_name = "@"..get_npc_type().."|@"..get_npc_name()
dlg_title(npc_name)
local pdata = { -- need_item_string, want_item, level, count,
611100449, 601100456, 191, 1500, 6000, 3000, 1500, 10,
611100450, 601100457, 192, 1500, 6000, 3000, 1500, 10,
611100451, 601100458, 193, 2000, 8000, 4000, 2000, 15,
611100452, 601100459, 195, 3000, 10000, 6000, 3000, 35,
611100453, 601100460, 195, 3000, 10000, 6000, 3000, 35,
611100454, 601100461, 195, 3000, 10000, 6000, 3000, 35,
611100455, 601100462, 195, 3000, 10000, 6000, 3000, 35,
}
local old_item = get_item_code( get_wear_item_handle( part ) )
local equip_item = 0
local length = table.getn(pdata)
local Need_Item, Level, Count1, Count2, Count3, Count4, Count5
for i = 2, length,8 do
if pdata[i] == Want_Item then
New_Item = pdata[i]
New_Item_string = pdata[i]+10000000
Need_Item = pdata[i-1]
Level = pdata[i+1]
Count1 = pdata[i+2]
Count2 = pdata[i+3]
Count3 = pdata[i+4]
Count4 = pdata[i+5]
Count5 = pdata[i+6]
equip_item = 1
break
end
end
dlg_text( sconv ("@90610859", "#@item@#", "@"..tostring( New_Item_string ), "#@level@#", Level, "#@need_item@#", "@"..tostring( Need_Item ), "#@number1@#", Count1, "#@number2@#", Count2, "#@number3@#", Count3, "#@number4@#", Count4, "#@number5@#", Count5 )) -- ·¹º§ Àç·á....
if equip_item == 1 then
dlg_menu( "@90610362", 'NPC_Tarun_Make_4thArmor_done('..tostring(part)..','..tostring(New_Item )..')' ) -- Á¦ÀÛÇϱâ
end
dlg_menu( "@90010002", '' )
dlg_show()
end
function NPC_Tarun_Make_4thArmor_done(part, WantItem)
local npc_name = "@"..get_npc_type().."|@"..get_npc_name()
dlg_title(npc_name)
local pdata = { -- old_item, new_item, level, count1, count2, count3, count4, count5,
601100449, 601100456, 191, 1500, 6000, 3000, 1500, 10,
601100450, 601100457, 192, 1500, 6000, 3000, 1500, 10,
601100451, 601100458, 193, 2000, 8000, 4000, 2000, 15,
601100452, 601100459, 195, 3000, 10000, 6000, 3000, 35,
601100453, 601100460, 195, 3000, 10000, 6000, 3000, 35,
601100454, 601100461, 195, 3000, 10000, 6000, 3000, 35,
601100455, 601100462, 195, 3000, 10000, 6000, 3000, 35,
}
-- ¹æ¾î±¸ Âø¿ë ¾ÈÇßÀ» °æ¿ì
if get_wear_item_handle( part ) == 0 then --¹æ¾î±¸ ¾ø
dlg_text( "@90610367") -- ÀåÂø ÈÄ Á¦ÀÛ °¡´É
else
local equip_item = get_item_code( get_wear_item_handle( part ) )
local length = table.getn(pdata)
local item_compare = 0
local NewItem, Level, Count1, Count2, Count3, Count4, Count5
for i = 1, length,8 do
--private_notice(i .." : "..pdata[i])
if pdata[i] == equip_item then
--private_notice("WantItem : "..WantItem)
--private_notice("Pdata : "..pdata[i+1])
if pdata[i+1] == WantItem then
--private_notice("µé¾î¿ÔÀ½")
Count1 = pdata[i+3]
Count2 = pdata[i+4]
Count3 = pdata[i+5]
Count4 = pdata[i+6]
Count5 = pdata[i+7]
--private_notice("Count5 : "..Count5)
Level = pdata[i+2]
--private_notice("Level : "..Level)
NewItem = pdata[i+1]
item_compare = 1
break
end
end
end
if item_compare == 0 then -- º¯°æ °¡´ÉÇÑ ¾ÆÀÌÅÛÀÌ ¾Æ´Ô
dlg_text( "@90610379") -- Á¦ÀÛ¸øÇÔ
elseif get_value( 'level' ) < Level then -- ·¹º§ÀÌ ³·À½
dlg_text( "@90610380")
elseif find_item ( 2016129 ) < Count1 or find_item ( 1000540 ) < Count2 or find_item ( 1000541 ) < Count3 or find_item ( 1000542 ) < Count4 or find_item ( 2016156 ) < Count5 then -- Àç·á ¸ðÀÚ¶÷
dlg_text( "@90610381")
else
dlg_text( "@90610382") -- Á¦ÀÛ¿Ï·á
delete_item( get_item_handle( 2016129 ), Count1 )
delete_item( get_item_handle( 1000540 ), Count2 )
delete_item( get_item_handle( 1000541 ), Count3 )
delete_item( get_item_handle( 1000542 ), Count4 )
delete_item( get_item_handle( 2016156 ), Count5 )
change_item_code( get_wear_item_handle( part ), NewItem )
set_item_ethereal_durability( get_wear_item_handle( part ), get_max_item_ethereal_durability( get_wear_item_handle( part ) ) ) -- Âø¿ëµÈ ¾ÆÀÌÅÛÀÇ ³»±¸µµ¸¦ ÃÖ´ë°ªÀ¸·Î ä¿öÁØ´Ù.
update_wear() -- ¹æ¾î±¸ º¯°æÈÄ ¿ÜÇü ¾÷µ¥ÀÌÆ®
end
end
dlg_menu( "@90010002", '' )
dlg_show()
end