[DiscordArchive] This an item or NPC?
[DiscordArchive] This an item or NPC?
Archived author: Revision • Posted: 2025-02-07T16:28:01.795000+00:00
Original source
The SendTrainerList function could be modified to function like SendListInventory and I'm sure it wouldn't be rejected if a PR was created
Archived author: OUTRAKE • Posted: 2025-02-07T16:28:22.857000+00:00
Original source
working for 4 hours on it and still cannot figure how
Archived author: Honey • Posted: 2025-02-07T16:28:35.401000+00:00
Original source
I'd check other cores first. There might be a mistake in the mod-eluna implementation.
Archived author: OUTRAKE • Posted: 2025-02-07T16:30:45.483000+00:00
Original source
this could be an eluna solution but i get error function except to get creature and not uint32
```
player:SendTrainerList(npcID)
int SendTrainerList(lua_State* L, Player* player)
{
Creature* obj = Eluna::CHECKOBJ<Creature>(L, 2);
if (obj) {
player->GetSession()->SendTrainerList(obj->GET_GUID());
} else {
uint32 entry = Eluna::CHECKVAL<uint32>(L, 2, 0);
float x = player->GetPositionX(), y = player->GetPositionY(), z = player->GetPositionZ();
Creature* summonedObj = player->SummonCreature(entry, x, y, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000);
player->GetSession()->SendTrainerList(summonedObj->GET_GUID());
}
return 0;
}
```
Archived author: OUTRAKE • Posted: 2025-02-07T16:31:26.878000+00:00
Original source
thats a method using spawn npc
Archived author: OUTRAKE • Posted: 2025-02-07T16:31:35.458000+00:00
Original source
bad af
Archived author: OUTRAKE • Posted: 2025-02-07T16:33:49.532000+00:00
Original source
other method is to implement `SendExternalTrainerList` in core
```
WorldSession.h
void SendExternalTrainerList(uint32 trainerEntry = 0);
NPCHandler.cpp
void WorldSession::SendExternalTrainerList(uint32 trainerEntry)
{
}
```
Archived author: OUTRAKE • Posted: 2025-02-07T16:34:08.378000+00:00
Original source
but idk how to convert entry to an object
Archived author: OUTRAKE • Posted: 2025-02-07T16:34:26.021000+00:00
Original source
other than
```
// Creature* trainer = GetPlayer()->SummonCreature(trainerEntry, x, y, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000);
// ObjectGuid trainerGuid = trainer->GetGUID();
```
Archived author: OUTRAKE • Posted: 2025-02-07T16:40:07.681000+00:00
Original source
SendListInventory has this `SetCurrentVendor(vendorEntry);`