• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

TrinityCore WotLK SendGossipMenu from Database

jonmii

Enthusiast
Hi,

I have a gossip made from sql, but i need to add some scripting to add cost to teleports.
How can i send gossipitems from database and not making in script?

Regards
 

Rochet2

Moderator / Eluna Dev
What kind of cost are we talking about?
Why not make it all from database? or is it not possible?

Take a look at ADD_GOSSIP_ITEM_DB
https://github.com/TrinityCore/Trin...erver/game/AI/ScriptedAI/ScriptedGossip.h#L98

its used like player->ADD_GOSSIP_ITEM_DB(menu_id, id, sender, action)
sender and action are passed to the gossip select hook as usual. menu_id and id are from the gossip_menu_option database table.
This is in ScriptedGossip.h

Also to send the whole menu directly you can take a look at:
Code:
                PrepareGossipMenu(source, menuItemData->GossipActionMenuId);
                SendPreparedGossip(source);
which can be found at Player::OnGossipSelect in Player.cpp



Hmm or do you mean that you want to make it all in database?
or you mean that you want to make a script that shows gossip options from the database or did I completely misunderstand?
 
Last edited:

jonmii

Enthusiast
What kind of cost are we talking about?
Why not make it all from database? or is it not possible?

Take a look at ADD_GOSSIP_ITEM_DB
https://github.com/TrinityCore/Trin...erver/game/AI/ScriptedAI/ScriptedGossip.h#L98

its used like player->ADD_GOSSIP_ITEM_DB(menu_id, id, sender, action)
sender and action are passed to the gossip select hook as usual. menu_id and id are from the gossip_menu_option database table.
This is in ScriptedGossip.h

Also to send the whole menu directly you can take a look at:
Code:
                PrepareGossipMenu(source, menuItemData->GossipActionMenuId);
                SendPreparedGossip(source);
which can be found at Player::OnGossipSelect in Player.cpp



Hmm or do you mean that you want to make it all in database?
or you mean that you want to make a script that shows gossip options from the database or did I completely misunderstand?

That: or you mean that you want to make a script that shows gossip options from the database or did I completely misunderstand?
 
Top