Difference between revisions of "Osiris/API/GenerateItems"
From Divinity Engine Wiki
(Documented GenerateItems) |
m |
||
Line 5: | Line 5: | ||
===== Notes ===== | ===== Notes ===== | ||
* When a character dies, only the five most expensive items from its inventory are kept, in addition to story items. The rest is discarded by code. This discarding happens right before the [[Osiris/API/CharacterDying|CharacterDying]] event. | * When a character dies, only the five most expensive items from its inventory are kept, in addition to story items. The rest is discarded by code. This discarding happens right before the [[Osiris/API/CharacterDying|CharacterDying]] event. | ||
+ | * The equivalent call for items is [[Osiris/API/GenerateTreasure|GenerateTreasure]]. | ||
===== See Also ===== | ===== See Also ===== | ||
* [[Osiris/API/ActivateTrade|ActivateTrade]] | * [[Osiris/API/ActivateTrade|ActivateTrade]] | ||
− | |||
* [[Osiris/API/CharacterClearTradeGeneratedItems|CharacterClearTradeGeneratedItems]] | * [[Osiris/API/CharacterClearTradeGeneratedItems|CharacterClearTradeGeneratedItems]] | ||
* [[Osiris/API/CharacterGiveReward|CharacterGiveReward]] | * [[Osiris/API/CharacterGiveReward|CharacterGiveReward]] | ||
− | |||
* [[Osiris/API/CharacterSetCustomTradeTreasure|CharacterSetCustomTradeTreasure]] | * [[Osiris/API/CharacterSetCustomTradeTreasure|CharacterSetCustomTradeTreasure]] | ||
* [[Osiris/API/GenerateTreasure|GenerateTreasure]] | * [[Osiris/API/GenerateTreasure|GenerateTreasure]] | ||
* [[Osiris/API/ItemAddedToCharacter|ItemAddedToCharacter]] | * [[Osiris/API/ItemAddedToCharacter|ItemAddedToCharacter]] | ||
* [[Osiris/API/ItemTemplateAddedToCharacter|ItemTemplateAddedToCharacter]] | * [[Osiris/API/ItemTemplateAddedToCharacter|ItemTemplateAddedToCharacter]] | ||
− | |||
− | |||
* [[Osiris/API/TradeGenerationEnded|TradeGenerationEnded]] | * [[Osiris/API/TradeGenerationEnded|TradeGenerationEnded]] | ||
* [[Osiris/API/TradeGenerationStarted|TradeGenerationStarted]] | * [[Osiris/API/TradeGenerationStarted|TradeGenerationStarted]] | ||
+ | * [[Treasure_Tables|Treasure Table]] | ||
[[Category:Osiris Calls|GenerateItems]] | [[Category:Osiris Calls|GenerateItems]] |
Latest revision as of 10:24, 19 August 2018
Full Definition(s)
- call GenerateItems((CHARACTERGUID)_Player, (CHARACTERGUID)_Trader)
Description
First throws a TradeGenerationStarted event. Next, existing trade treasure in _Trader's inventory is removed (see that call for details). Then new trade treasure gets generated using the level of _Player and potentially based on the game's current difficulty level. These generated items are immediately added to the trader's inventory and are identified. If a custom trade treasure table is set for the trader, this one is used, otherwise the default one(s) set for the trader character in the sidebar is/are used. If the used trade treasure table(s) is invalid/does not exist, no new items get generated. Finally, a TradeGenerationEnded event is thrown.
Notes
- When a character dies, only the five most expensive items from its inventory are kept, in addition to story items. The rest is discarded by code. This discarding happens right before the CharacterDying event.
- The equivalent call for items is GenerateTreasure.