Difference between revisions of "Osiris/API/GenerateTreasure"

From Divinity Engine Wiki
Jump to: navigation, search
m
m
 
(4 intermediate revisions by one other user not shown)
Line 3: Line 3:
 
===== Description =====
 
===== Description =====
 
Generates treasure from the '''_TreasureID''' [[Treasure_Tables|treasure table]] and puts the item(s) generated in the '''_Item''''s inventory.
 
Generates treasure from the '''_TreasureID''' [[Treasure_Tables|treasure table]] and puts the item(s) generated in the '''_Item''''s inventory.
*If the '''_Level''' is greater than or equal to 0, it will be used to generate treasure.
+
* If the '''_Level''' is greater than or equal to 0, it will be used to generate treasure.
*If the '''_Level''' is less than 0, if the item is set (in the sidebar) to ''Use Party Level For Treasure'', the highest level in the '''_Character''' 's party is used.
+
* If the '''_Level''' is less than 0, if the item is set (in the sidebar) to ''Use Party Level For Treasure'', the highest level in the '''_Character''' 's party is used.
*If the '''_Level''' is less than 0, and ''Use Party Level For Treasure'' is false, the item's ''Treasure Level'' setting is used.
+
* If the '''_Level''' is less than 0, and ''Use Party Level For Treasure'' is false, the item's ''Treasure Level'' setting is used.
*If the ''Treasure Level'' setting is also less than 0, the level of the nearest character is used.
+
* If the ''Treasure Level'' setting is also less than 0, the level of the nearest character is used.
 +
* This adds the contents of the treasure to whatever is already inside the item's inventory. If it has a treasure table defined in the sidebar, it will get both. The treasure defined in the sidebar is generated whenever the first of the following occurs:
 +
** The item is destroyed
 +
** The item is used (e.g. opened)
 +
** The item is picked up
 +
** The item is unlocked
 +
** The item is moved
 +
** Something is added to the item's inventory (this can happen if an item is added e.g. through Story).
 
===== Notes =====
 
===== Notes =====
*/
+
* The equivalent API for characters is [[Osiris/API/GenerateItems|GenerateItems]].
 
===== See Also =====
 
===== See Also =====
*[[Treasure_Tables|Treasure Table]]
+
* [[Osiris/API/CharacterGiveReward|CharacterGiveReward]]
 +
* [[Osiris/API/CharacterGiveQuestReward|CharacterGiveQuestReward]]
 +
* [[Osiris/API/GenerateItems|GenerateItems]]
 +
* [[Treasure_Tables|Treasure Table]]
  
 
[[Category:Osiris Calls|GenerateTreasure]]
 
[[Category:Osiris Calls|GenerateTreasure]]

Latest revision as of 11:22, 19 August 2018

Full Definition(s)
  • call GenerateTreasure((ITEMGUID)_Item, (STRING)_TreasureID, (INTEGER)_Level, (CHARACTERGUID)_Character)
Description

Generates treasure from the _TreasureID treasure table and puts the item(s) generated in the _Item's inventory.

  • If the _Level is greater than or equal to 0, it will be used to generate treasure.
  • If the _Level is less than 0, if the item is set (in the sidebar) to Use Party Level For Treasure, the highest level in the _Character 's party is used.
  • If the _Level is less than 0, and Use Party Level For Treasure is false, the item's Treasure Level setting is used.
  • If the Treasure Level setting is also less than 0, the level of the nearest character is used.
  • This adds the contents of the treasure to whatever is already inside the item's inventory. If it has a treasure table defined in the sidebar, it will get both. The treasure defined in the sidebar is generated whenever the first of the following occurs:
    • The item is destroyed
    • The item is used (e.g. opened)
    • The item is picked up
    • The item is unlocked
    • The item is moved
    • Something is added to the item's inventory (this can happen if an item is added e.g. through Story).
Notes
See Also