Gossip System¶
How NPC menus ("gossips") work in VMaNGOS: which tables are involved, how menus chain together, and where conditions and scripts hook in.
Requirements¶
A creature only shows gossip if:
creature_template.npc_flags containsUNIT_NPC_FLAG_GOSSIP(0x1) - or the interacting player has a reason to talk to it (quest giver, vendor, trainer…), and- a matching menu exists (see flow below), otherwise the core falls back to default vendor/quest/trainer windows.
NPC flag values are defined in src/game/Objects/UnitDefines.h (enum NPCFlags).
The Menu Flow¶
player interacts with creature
│
▼
creature_template.gossip_menu_id ──► gossip_menu.entry ──► npc_text (menu greeting text)
│ │
│ ▼
└───────────────────────────► gossip_menu_option.menu_id
│ (filtered by condition_id,
│ npc_option_npcflag)
▼
action_menu_id → open another menu (chain)
action_script_id → run gossip_scripts
action_poi_id → show map point of interest
gossip_menumaps a menu id (fromcreature_template.gossip_menu_id) to one or more text ids fromnpc_text. Multiple rows = condition-dependent greetings: the core picks the text of the fitting row with the highestcondition_id. Each row can carry its owncondition_idand an optionalscript_id(a gossip_scripts run when the text is shown).gossip_menu_optionholds the selectable options for amenu_id. Each option defines:option_icon/ text (option_textor localizedoption_broadcast_textfrombroadcast_text),option_id- what kind of action the client offers (vendor, trainer, taxi…),npc_option_npcflag- option only shows when the NPC has this npc flag (e.g. vendor options need0x4),- one of the three actions: open another menu (
action_menu_id), run a script (action_script_id), or show a point of interest (action_poi_id), - an optional input box (
box_text,box_money,box_coded) used e.g. for petition names, - a
condition_idgate per option.
Conditions¶
Both gossip_menu rows and gossip_menu_option rows
support conditions. Failed conditions hide the row entirely - use this for
faction-specific greetings, phase-dependent options, or quest-state-gated choices
(CONDITION_QUESTTAKEN, …).
Scripts¶
action_script_id points into gossip_scripts, which uses the
generic script command set: make the NPC talk (TALK), cast spells,
teleport the player, start quests, terminate the gossip (TERMINATE_SCRIPT) and more.
Localization¶
Option and box texts can be localized via
locales_gossip_menu_option; menu greetings via the locales_*
machinery of npc_text.