[Archive] SQL 6xx Dialogs & multiple choice on an NPC by Gossip_menu & SmartAI
[Archive] SQL 6xx Dialogs & multiple choice on an NPC by Gossip_menu & SmartAI
Quote: REPLACE INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUESExplanations:
(11705, 0, 0, 'Station du terminus Sud', 0, 1, 1, 0, 0, 0, 0, '', 0),
(11705, 1, 0, 'Station d''orgrimmar', 0, 1, 1, 0, 0, 0, 0, '', 0),
(11705, 2, 0, 'Station Palais de Gallywix', 0, 1, 1, 0, 0, 0, 0, '', 0),
(11705, 3, 0, 'Station Nord (Camp de base Darnassien)', 0, 1, 1, 0, 0, 0, 0, '', 0),
(11705, 4, 0, 'Station des confins Amers', 0, 1, 1, 0, 0, 0, 0, '', 0);
Click to expand...
Quote: GOSSIP_ICON_CHAT 0option_text: the text for the proposed choice
GOSSIP_ICON_VENDOR 1
GOSSIP_ICON_TAXI 2
GOSSIP_ICON_TRAINER 3
GOSSIP_ICON_INTERACT_1 4
GOSSIP_ICON_INTERACT_2 5
GOSSIP_ICON_MONEY_BAG 6
GOSSIP_ICON_TALK 7
GOSSIP_ICON_TABARD 8
GOSSIP_ICON_BATTLE 9
GOSSIP_ICON_DOT10
Click to expand...
Quote: this script smartai :Last point, the gossip generally do not close. It is necessary for each choice to create another entry ACTION_CLOSE_GOSSIP to close it. In my script this was not necessary since the player's teleportation automatically closes the window.
-- Bilgewater Rocket-jockey SAI
SET @ENTRY := 43217;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,10,0,62,0,100,0,11705,0,0,0,62,1,0,0,0,0,0,7,0,0,0,2659.220459,-6163.652832,138.307510,0,"PNJ TP : Azshara fusorail - Station du terminus Sud"),
(@ENTRY,0,11,0,62,0,100,0,11705,2,0,0,62,1,0,0,0,0,0,7,0,0,0,3554.774902,-4793.672852,160.704224,0,"PNJ TP : Azshara fusorail - Station Palais de Gallywix"),
(@ENTRY,0,12,0,62,0,100,0,11705,3,0,0,62,1,0,0,0,0,0,7,0,0,0,4470.460449,-5715.648926,145.509689,0,"PNJ TP : Azshara fusorail - Station Nord (Camp de base Darnassien)"),
(@ENTRY,0,13,0,62,0,100,0,11705,4,0,0,62,1,0,0,0,0,0,7,0,0,0,4617.309082,-7033.515137,153.722672,0,"PNJ TP : Azshara fusorail - Station des confins Amers"),
(@ENTRY,0,14,0,62,0,100,0,11705,1,0,0,62,1,0,0,0,0,0,7,0,0,0,2954.566895,-4996.734375,165.674088,0,"PNJ TP : Azshara fusorail - Station d''orgrimmar");
Click to expand...
Quote: REPLACE INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUESThe option_id 3 designates the type of option as seller or master of profession etc.
(12022, 0, 1, 'Montrez moi ce que vous avez a vendre Fiona.', 0, 3, 128, 0, 0, 0, 0, '', 0);
Click to expand...
Quote: option_id & npc_option_npcflagthax for all and good game for you =)
0 nothing
1-1 gossip menu
2-2 Quest Giver
5-16 Coach
16-16 Clear TALENTS
16-17 Clear PET TALENTS
18-16 Double Specialty Coach
3-128 Seller
15-4096 Repairman
4-8192 Air Routes
6-16384 Guardian of Souls
7-32768 Spiritual Guide
8-65536 New Fireplace
9-131072 Bank
10-262144 Guild Creation
#
11-524288 Creation of Tabard
12-1048576 Battlefield
13-2097152 Auction House
14-4194304 Stable
? 6-67108864 Letter Box
? -268435456 Transmogrify
? -536870912 Vacuum chamber
? -1073741824 Battle Pet ?!
? -2147483648 Walking black
? -4294967296 ITEM_UPGRADE_MASTER
? -8589934592 Architect of the fief
? -17179869184 - CHIPMENT_CRAFTER
? -34359738368 - GARRISON_MISSION_NPC
? -68719476736 - TRADESKILL_NPC
? -137438953472 BLACK_MARKET_VIEW
? -549755813888 Black walk
Click to expand...
Archived author: dokuro • Posted: 2025-11-04T18:04:35.180368
Original source
Imgur: The magic of the Internet
Gossip_menu: dialogue & multiple choice on an NPC
A gossip_menu is simply as shown on the screen a window that opens and offers us several choices. It can be created on a NPC or a gameobject, to illustrate this tutorial I would take the example of a teleporting NPC that I created for Azshara.
To create a gossip_menu we will need to define 3 things:
1) The npcflag in creature_template (does not exist on a gameobject and is therefore not necessary) as well as gossip_menu_id (11705 in the example below).
2) create the gossip_menu entries in the gossip_menu_option table as below:
Quote: REPLACE INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUESExplanations:
(11705, 0, 0, 'Station du terminus Sud', 0, 1, 1, 0, 0, 0, 0, '', 0),
(11705, 1, 0, 'Station d''orgrimmar', 0, 1, 1, 0, 0, 0, 0, '', 0),
(11705, 2, 0, 'Station Palais de Gallywix', 0, 1, 1, 0, 0, 0, 0, '', 0),
(11705, 3, 0, 'Station Nord (Camp de base Darnassien)', 0, 1, 1, 0, 0, 0, 0, '', 0),
(11705, 4, 0, 'Station des confins Amers', 0, 1, 1, 0, 0, 0, 0, '', 0);
Click to expand...
Quote: GOSSIP_ICON_CHAT 0option_text: the text for the proposed choice
GOSSIP_ICON_VENDOR 1
GOSSIP_ICON_TAXI 2
GOSSIP_ICON_TRAINER 3
GOSSIP_ICON_INTERACT_1 4
GOSSIP_ICON_INTERACT_2 5
GOSSIP_ICON_MONEY_BAG 6
GOSSIP_ICON_TALK 7
GOSSIP_ICON_TABARD 8
GOSSIP_ICON_BATTLE 9
GOSSIP_ICON_DOT10
Click to expand...
Quote: this script smartai :Last point, the gossip generally do not close. It is necessary for each choice to create another entry ACTION_CLOSE_GOSSIP to close it. In my script this was not necessary since the player's teleportation automatically closes the window.
-- Bilgewater Rocket-jockey SAI
SET @ENTRY := 43217;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,10,0,62,0,100,0,11705,0,0,0,62,1,0,0,0,0,0,7,0,0,0,2659.220459,-6163.652832,138.307510,0,"PNJ TP : Azshara fusorail - Station du terminus Sud"),
(@ENTRY,0,11,0,62,0,100,0,11705,2,0,0,62,1,0,0,0,0,0,7,0,0,0,3554.774902,-4793.672852,160.704224,0,"PNJ TP : Azshara fusorail - Station Palais de Gallywix"),
(@ENTRY,0,12,0,62,0,100,0,11705,3,0,0,62,1,0,0,0,0,0,7,0,0,0,4470.460449,-5715.648926,145.509689,0,"PNJ TP : Azshara fusorail - Station Nord (Camp de base Darnassien)"),
(@ENTRY,0,13,0,62,0,100,0,11705,4,0,0,62,1,0,0,0,0,0,7,0,0,0,4617.309082,-7033.515137,153.722672,0,"PNJ TP : Azshara fusorail - Station des confins Amers"),
(@ENTRY,0,14,0,62,0,100,0,11705,1,0,0,62,1,0,0,0,0,0,7,0,0,0,2954.566895,-4996.734375,165.674088,0,"PNJ TP : Azshara fusorail - Station d''orgrimmar");
Click to expand...
Quote: REPLACE INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUESThe option_id 3 designates the type of option as seller or master of profession etc.
(12022, 0, 1, 'Montrez moi ce que vous avez a vendre Fiona.', 0, 3, 128, 0, 0, 0, 0, '', 0);
Click to expand...
Quote: option_id & npc_option_npcflagthax for all and good game for you =)
0 nothing
1-1 gossip menu
2-2 Quest Giver
5-16 Coach
16-16 Clear TALENTS
16-17 Clear PET TALENTS
18-16 Double Specialty Coach
3-128 Seller
15-4096 Repairman
4-8192 Air Routes
6-16384 Guardian of Souls
7-32768 Spiritual Guide
8-65536 New Fireplace
9-131072 Bank
10-262144 Guild Creation
#
11-524288 Creation of Tabard
12-1048576 Battlefield
13-2097152 Auction House
14-4194304 Stable
? 6-67108864 Letter Box
? -268435456 Transmogrify
? -536870912 Vacuum chamber
? -1073741824 Battle Pet ?!
? -2147483648 Walking black
? -4294967296 ITEM_UPGRADE_MASTER
? -8589934592 Architect of the fief
? -17179869184 - CHIPMENT_CRAFTER
? -34359738368 - GARRISON_MISSION_NPC
? -68719476736 - TRADESKILL_NPC
? -137438953472 BLACK_MARKET_VIEW
? -549755813888 Black walk
Click to expand...
Archived author: dokuro • Posted: 2025-11-04T18:04:35.180368
Original source
Thanks, very good to know.