Osiris/Shared/DB GiveTemplateFromPlayerDialogEvent

From Divinity Engine Wiki
Revision as of 14:46, 8 October 2017 by Tinkerer (talk | contribs) (documented DB_GiveTemplateFromPlayerDialogEvent)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Full Definition(s)
  • DB_GiveTemplateFromPlayerDialogEvent((STRING)_template, (STRING)_event, (STRING)_success,)
Description

Defining this database means that if the character/object flag _event gets set on an NPC while it is in a dialog, the party of the first player in that dialog will attempt to transfer one instance of an item with the root template _template to this NPC. If it succeeds (= if the player, or one of his party members, had such an item in its inventory), the flag _success will be set on that NPC. Otherwise nothing happens.

Notes
  • When checking the _success flag, watch out for frame delays.
Example
// if you set the character flag "MYPRE_give_blackroot" on an NPC in this dialog, and this NPC has blackroot in his inventory, then
// it will give one blackroot to the first player in that dialog and the flag "MYPRE_had_blackroot" will be set on the NPC.
DB_GiveTemplateFromPlayerDialogEvent("QUEST_Blackroot_843689bf-6498-45ac-98ba-b375bdbbb189", "MYPRE_give_blackroot", "MYPRE_had_blackroot");
See Also