Though not all, but (many) some are governed by XML dialog files calling an "action" order which corresponds/calls to relevant script files for related "functions." I'm not on a PC right now, but posting the notes with (rather innovative but still cumbersome) mobile phone. When I've got back at my PC tonight (I'm in UK, too), I'll post an example from the vanilla files.

------------------------------
Edit/Add:OK....
Now I can try to give an example:
Returning to the Bar after Dark ValleyWhen looking at the game as if the game playing, first let's see how the relevant dialog goes:
In
config\text\eng folder,
stable_dialogs.xml<string id="bar_bar_barmen_start_171">
<text>So, Marked One, you brought the documents from X18?</text>
</string>
<string id="bar_bar_barmen_start_172">
<text>Yeah. Here.</text>
</string>
Action point will be set at
bar_bar_barmen_start_172 when actor says
"Yeah. Here."We go to
config\gameplay folder and find
dialogs_bar.xml <phrase id="172">
<text>bar_bar_barmen_start_172</text>
<action>bar_dialogs.give_darklab_documents</action>
<action>bar_dialogs.give_darklab_reward</action>
<give_info>bar_darklab_document_done</give_info>
<next>1721</next>
This file governs the process, when the
phrase id="172" is called, it activates/calls the text lines and also initiates the
action order which in turn points to the "
function give_darklab_reward" in
bar_dialogs.scriptLike this, (from
bar_dialogs.script) :
function give_darklab_reward(first_speaker, second_speaker)
dialogs.relocate_money(second_speaker, 10000, "in")
end
Hope it helps
================
ONE WARNING TO MODDING ENTHUSIASTS,THOUGH:
People who are not experienced in modding should not try at all, or if in case of some experience, then they should exercise
extreme caution as any simple misspelling, missing or added comma, dot or absolutely anything that you can produce with your keyboard, even misalignment WILL prove FATAL... then CTD...