Difference between revisions of "Osiris/Shared/DB GiveTemplateFromPlayerDialogEvent"

From Divinity Engine Wiki
Jump to: navigation, search
(documented DB_GiveTemplateFromPlayerDialogEvent)
 
m
 
Line 16: Line 16:
 
* Helper [[Osiris/Shared/DB_HasTemplateItem|DB_HasTemplateItem]]
 
* Helper [[Osiris/Shared/DB_HasTemplateItem|DB_HasTemplateItem]]
  
[[Category:Osiris Shared Mod Helpers]]
+
[[Category:Osiris Shared Mod Helpers|GiveTemplateFromPlayerDialogEvent]]

Latest revision as of 15:50, 19 December 2017

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