azerothcore/mod-eluna

player:SendListInventory does not fire

Closed this issue · 9 comments

want to do a multi vendor script via eluna... so wanted to use the player:SendListInventory function but nothing happens at all.

extra checked the function in PlayerMethods.h to see if it is able to call the vendor directly via entry and was like... yes it is able to...

and then nothing happens on triggering it via lua =(
here a snippet of my code e.g.:

local function MultiVendorOnGossipSelect(event, player, creature, sender, intid, code)
    if (intid == 1) then
        player:SendListInventory(creature, 500059)
        else if (intid == 2) then
            player:SendListInventory(creature, 500058)

would be really nice if somebody could look over that issue! =D
thx in advance! ^.^

I expect this to fire an error, since you're passing 2 arguments for a method, which expects only one.
See
https://www.azerothcore.org/pages/eluna/Player/SendListInventory.html

yeah but if u look in the playermethods.h at that function it is different and according to that i coded my part

here u see the function out of the playermethods.h from mod-eluna:

int SendListInventory(lua_State* L, Player* player)
{
    WorldObject* obj = Eluna::CHECKOBJ<WorldObject>(L, 2);
    uint32 vendorId = Eluna::CHECKVAL<uint32>(L, 3, 0);

    player->GetSession()->SendListInventory(obj->GET_GUID(), vendorId);
    return 0;
}

with the one statement only there would be less code...

that way it would then look with the one statement only(taken from a "very old" mod-eluna version the code down below):


int SendListInventory(lua_State* L, Player* player)
{
    WorldObject* obj = Eluna::CHECKOBJ<WorldObject>(L, 2);

    player->GetSession()->SendListInventory(obj->GET_GUID());
    return 0;
}

since the way i understand it is that it takes the creature/object which we are talking to (so obj->GET_GUID()) and then state the vendor entry which we want to send to player (so the vendorId)

plus... i get no error at all!
so it definitly does not fire ^^

u can try it yourself with that codesnippet of mine if u want to npc id which i talk to has 600001 and according to that lua hook it should be creature/object (so which we are talking to) and the vendor entry of some other npc we want to show ^^

acore version btw is from 25th of march. eluna mod i also updated with the core of course

See #48 for an example and what table to pick numbers from.

Also we need to add the param vendorId to the doxygen, which was added in PR 48.
Obviously we missed it when reviewing the PR.

Yeah from code it looks quite the same like on noisiver from what i see ^^

Ah kk I see I see =)
Good then I am looking forward to the fully implemented version of it and am glad that the issue can be solved! =D

Since noisiver got it working, i am not sure what is missing. Did you try a custom vendor id? Try one from the core?

yep i took a custom created vendor with the id 500059 and 500058
will try it with a regular vendor id... let's see then =)

OMFG... I was just an idiot!

From script all was fine...
But I forgot to implement on the updated fresh compiled server at lua_scripts AIO_Server 🤦‍♂️ x100
So yeah... that was the problem in the end... works now fine with regular blizz vendors as well as custom ones... xD ^^''

I'm glad you solved it!