• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] Vendor problem

Status
Not open for further replies.

mjafko

Epic Member
Hellou guy's.

Find on forum example of code and wanted to test it. Well 75002 is gossip entry, and 75006 is npc vendor flaged entry. But When I click Test nothing happen and no error's show. Where seems to be a problem ?
Code:
local vendorEntry = 75002
function vendorGossipHello(event, player, creature)
    player:GossipClearMenu()
    player:GossipMenuAddItem(0, "Test",0, 75006)
    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)
 

Rochet2

Moderator / Eluna Dev
If you only have Eluna without custom modifications then the function only takes the creature argument and the intid you pass is ignored.
http://eluna.emudevs.com/Player/SendListInventory.html
The creature must be a valid vendor and it may need to have items in it's vendor.

If you want to pass the entry of the vendor you want to show to the SendListInventory method, you need the multivendor coremodification and a small edit in Eluna so that the intid id passed to the SendListInventory c++ function.
 

mjafko

Epic Member
Since I am still more newb at this. Can someone tell/post me all needed modeficatio's I need ?

Thank you emudev's comunity!

Greeting's, Marko.
 

Rochet2

Moderator / Eluna Dev
You need this: http://rochet2.github.io/Multivendor.html
and then to enable using it through Eluna you need to edit this:
https://github.com/ElunaLuaEngine/E...23f454124234087fc/PlayerMethods.h#L2302-L2308
Like so:

Code:
      * Sends a vendor window to the [Player] from the [WorldObject] specified.
      *
      * @param [WorldObject] sender
+     * @param uint32 vendorentry = 0 : entry of the vendor to show, sender's vendor shown if omitted
      */
     int SendListInventory(Eluna* /*E*/, lua_State* L, Player* player)
     {
         WorldObject* obj = Eluna::CHECKOBJ<WorldObject>(L, 2);
+        uint32 vendorentry = Eluna::CHECKVAL<uint32>(L, 3, 0);
 
-        player->GetSession()->SendListInventory(obj->GET_GUID());
+        player->GetSession()->SendListInventory(obj->GET_GUID(), vendorentry);
         return 0;
     }
 
Status
Not open for further replies.
Top