An example of how to make the Orb trader.
Code:
function NPC_US_2010_medal_trade_start()
dlg_title( "Orb Trader" )
dlg_text( "Hello, I am here take to your orbs.." )
dlg_menu( "Bronze Orbs", "bronze_orb()" )
dlg_menu( "@90010002", "" )
dlg_show()
return
end
function bronze_orb()
dlg_title( "Bronze" )
dlg_text("Hello I am here to give you cool things for bronze Orbs.")
dlg_menu("Somecoolthings", "br_cool()")
dlg_menu("Goodbye","")
dlg_show()
return
end
function br_cool()
dlg_title("Cool Stuff")
dlg_text( "Some cool stuff I have here")
dlg_menu("A carrot 2 Bronze Orbs","br_cool_1()")
dlg_menu("A Pear. 2 Bronze Orbs","br_cool_2()")
dlg_menu("Goodbye","")
dlg_show()
return
end
function br_cool_1()
local borb_count = find_item( 2011307 )
if borb_count >= 2 then
delete_item (get_item_handle(2011307), 2 )
insert_item(540019, 1)
insert_item(540019, 1, 0, 0, 0)
insert_item(710003, 1)
cprint("<#FFC125> You Traded 2 Bronze Orbs for something cool")
return
else
dlg_text( "You need more Bronze Orbs" )
dlg_menu( "@90010002", "" )
end
end