Heya, wait a moment i think there is a command in LuaHypArc for opening the vendor window...
anyway here is the structure of an item with gossip:
Code:
local LuaVendorItem = ITEMID
function LuaVendor_OnUse(item, event, player)
LuaVendor_Menu(item, player)
end
function LuaVendor_Menu(item, player)
item:GossipCreateMenu(1000, player, 0)
item:GossipMenuAddItem(9, "I want to buy food.", 300, 0)
item:GossipMenuAddItem(0, "Nevermind.", 301, 0)
item:GossipSendMenu(player)
end
function LuaVendor_OnSelect(item, event, player, id, intid, code)
if (intid == 300) then
--[[ Lua Command for VendorWindow here ]]--
end
if (intid == 301) then
player:GossipComplete()
end
end
RegisterItemGossipEvent(LuaVendorItem, 1, "LuaVendor_OnUse")
RegisterItemGossipEvent(LuaVendorItem, 2, "LuaVendor_OnSelect")
You only need to add your item id in ITEMID.