Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

player:SendListInventory does not fire #109

Closed
Shadowveil-WotLK opened this issue Mar 29, 2023 · 9 comments
Closed

player:SendListInventory does not fire #109

Shadowveil-WotLK opened this issue Mar 29, 2023 · 9 comments

Comments

@Shadowveil-WotLK
Copy link

Shadowveil-WotLK commented Mar 29, 2023

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! ^.^

@55Honey
Copy link
Member

55Honey commented Mar 29, 2023

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

@Shadowveil-WotLK
Copy link
Author

Shadowveil-WotLK commented Mar 29, 2023

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;
}

@Shadowveil-WotLK
Copy link
Author

Shadowveil-WotLK commented Mar 29, 2023

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

@55Honey
Copy link
Member

55Honey commented Mar 29, 2023

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.

@Shadowveil-WotLK
Copy link
Author

Shadowveil-WotLK commented Mar 30, 2023

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

@55Honey
Copy link
Member

55Honey commented Mar 30, 2023

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

@Shadowveil-WotLK
Copy link
Author

Shadowveil-WotLK commented Mar 30, 2023

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 =)

@Shadowveil-WotLK
Copy link
Author

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 ^^''

@55Honey
Copy link
Member

55Honey commented Mar 30, 2023

I'm glad you solved it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants