local function Test(event, player, msg, Type, lang)
if(msg == "test") then
local unit = player:GetSelection() -- just to test, get the selected unit (needs vendor flags set in DB)
-- This code should be run only on startup. You may also change the items on the fly,
-- but you should not try to show 2 different vendors to 2 players at the same time from one NPC.
VendorRemoveAllItems(unit:GetEntry(), false) -- Remove all previous items
-- Add our items to the vendor:
AddVendorItem(unit:GetEntry(), 25, 0, 0, 0, false)
AddVendorItem(unit:GetEntry(), 35, 0, 0, 0, false)
AddVendorItem(unit:GetEntry(), 36, 0, 0, 0, false)
AddVendorItem(unit:GetEntry(), 37, 0, 0, 0, false)
AddVendorItem(unit:GetEntry(), 38, 0, 0, 0, false)
AddVendorItem(unit:GetEntry(), 39, 0, 0, 0, false)
AddVendorItem(unit:GetEntry(), 40, 0, 0, 0, false)
AddVendorItem(unit:GetEntry(), 43, 0, 0, 0, false)
--
player:SendVendorWindow(unit) -- show vendor to player
return false
end
end
RegisterServerHook(18, Test)