[DiscordArchive] What does the code look like?
[DiscordArchive] What does the code look like?
Archived author: Revision • Posted: 2022-09-03T00:31:18.794000+00:00
Original source
What does the code look like?
Archived author: Kek • Posted: 2022-09-03T00:32:27.561000+00:00
Original source
```cpp
bool OnGossipHello(Player* player, Creature* creature) override
{
AddGossipItemFor(player, 4900, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
SendGossipMenuFor(player, 4900, creature->GetGUID());
return true;
}
```
Archived author: Kek • Posted: 2022-09-03T00:32:47.719000+00:00
Original source
If I remove the addGossipItemFor, then the gossip menu will popup with the intro text
Archived author: Revision • Posted: 2022-09-03T00:34:14.958000+00:00
Original source
I'm not sure how it works that way. Is 4900 called somewhere?
Archived author: Kek • Posted: 2022-09-03T00:34:38.430000+00:00
Original source
4900 is the gossip_menu id in the database
Archived author: Kek • Posted: 2022-09-03T00:34:46.523000+00:00
Original source
I just stole a number that wasn't being used
Archived author: Kek • Posted: 2022-09-03T00:35:11.414000+00:00
Original source
To be fair, the 2nd 4900 is actually a textID that was also not being used
Archived author: Revision • Posted: 2022-09-03T00:36:57.717000+00:00
Original source
I don't know how it even chooses what options to use. I tend to do something like this:
```
AddGossipItemFor(player, GOSSIP_ICON_TALK, "Insert some text here", GOSSIP_SENDER_MAIN, <action-id>);
SendGossipMenuFor(player, <npc_text_id>, creature->GetGUID());
```
However, using only 1 option will automatically select it.