Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] What does the code look like?

[DiscordArchive] What does the code look like?

[DiscordArchive] What does the code look like?

rektbyfaith
Administrator
0
09-03-2022, 12:31 AM
#1
Archived author: Revision • Posted: 2022-09-03T00:31:18.794000+00:00
Original source

What does the code look like?
rektbyfaith
09-03-2022, 12:31 AM #1

Archived author: Revision • Posted: 2022-09-03T00:31:18.794000+00:00
Original source

What does the code look like?

rektbyfaith
Administrator
0
09-03-2022, 12:32 AM
#2
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;
}
```
rektbyfaith
09-03-2022, 12:32 AM #2

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

rektbyfaith
Administrator
0
09-03-2022, 12:32 AM
#3
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
rektbyfaith
09-03-2022, 12:32 AM #3

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

rektbyfaith
Administrator
0
09-03-2022, 12:34 AM
#4
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?
rektbyfaith
09-03-2022, 12:34 AM #4

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?

rektbyfaith
Administrator
0
09-03-2022, 12:34 AM
#5
Archived author: Kek • Posted: 2022-09-03T00:34:38.430000+00:00
Original source

4900 is the gossip_menu id in the database
rektbyfaith
09-03-2022, 12:34 AM #5

Archived author: Kek • Posted: 2022-09-03T00:34:38.430000+00:00
Original source

4900 is the gossip_menu id in the database

rektbyfaith
Administrator
0
09-03-2022, 12:34 AM
#6
Archived author: Kek • Posted: 2022-09-03T00:34:46.523000+00:00
Original source

I just stole a number that wasn't being used
rektbyfaith
09-03-2022, 12:34 AM #6

Archived author: Kek • Posted: 2022-09-03T00:34:46.523000+00:00
Original source

I just stole a number that wasn't being used

rektbyfaith
Administrator
0
09-03-2022, 12:35 AM
#7
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
rektbyfaith
09-03-2022, 12:35 AM #7

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

rektbyfaith
Administrator
0
09-03-2022, 12:36 AM
#8
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.
rektbyfaith
09-03-2022, 12:36 AM #8

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.

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)