Thanks to Rochet2 for the c++ multi vendor patch and AlexeWarr for the c++ multi trainer patch.
I just put the two patch together and add the Eluna methods support this.
patch link: http://paste.emudevs.com/?paste=67
Now the following three Eluna methods have the second param:
SendTrainerList(WorldObject, TrainerEntry) -- Sends the TrainerEntry's trainer list from object to player. The WorldObject should have trainer flag.
SendListInventory(WorldObject, VendorEntry) -- Sends the VendorEntry's vendor list from object to player. The WorldObject should have vendor flag.
SendVendorWindow(unit, VendorEntry) --Same as SendListInventory
If you set the secomd param nil, it will open the WorldObject's trainer/vendor list.
example:
p.s. If you use the SendTrainerList method you should open a gossip menu first, otherwise it won't work. Like this:
Credits:
Rochet2 - For the Multi Vendor C++ patch
AlexeWarr - For the Multi Trainer C++ patch
I just put the two patch together and add the Eluna methods support this.
patch link: http://paste.emudevs.com/?paste=67
Now the following three Eluna methods have the second param:
SendTrainerList(WorldObject, TrainerEntry) -- Sends the TrainerEntry's trainer list from object to player. The WorldObject should have trainer flag.
SendListInventory(WorldObject, VendorEntry) -- Sends the VendorEntry's vendor list from object to player. The WorldObject should have vendor flag.
SendVendorWindow(unit, VendorEntry) --Same as SendListInventory
If you set the secomd param nil, it will open the WorldObject's trainer/vendor list.
example:
Code:
local vendorEntry = 80011
function vendorGossipHello(event, player, creature)
player:GossipClearMenu()
player:GossipMenuAddItem(0, "vendor1", 0, 999916)
player:GossipMenuAddItem(0, "vendor2", 0, 999927)
player:GossipSendMenu(103, creature)
end
function vendorGossipSelect(event, player, creature, sender, intid, code)
player:SendListInventory(creature,intid)
end
RegisterCreatureGossipEvent(vendorEntry, 1, vendorGossipHello)
RegisterCreatureGossipEvent(vendorEntry, 2, vendorGossipSelect)
p.s. If you use the SendTrainerList method you should open a gossip menu first, otherwise it won't work. Like this:
Code:
player:GossipClearMenu() -- Should be used when triggering gossip without OnGossipHello hook
player:GossipSendMenu(100, creature) -- Send gossip menu. If you comment this out, the code wont work
player:SendTrainerList(creature,npcId) -- Send trainer window
Rochet2 - For the Multi Vendor C++ patch
AlexeWarr - For the Multi Trainer C++ patch
Last edited: