Difference between revisions of "AddItem"
no edit summary
imported>Cipscis (Fixed CS link to fit template; added note about adding items via OnEquip blocks in Object Scripts - thanks Tarrant for pointing this out) |
imported>Ez0n3 |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
|CSWikiPage = AddItem | |CSWikiPage = AddItem | ||
|origin = GECK1 | |origin = GECK1 | ||
|summary = Adds Count items of object ObjectID to the calling container's inventory. It has two required parameters (the object to add and the quantity) and one optional parameter (whether to display a message on screen). | |summary = Adds Count items of object ObjectID to the calling container's inventory. It has two required parameters (the object to add and the quantity) and one optional parameter (whether to display a message on screen). | ||
|referenceType = <nowiki>ActorID|ContainerID</nowiki> | |name = AddItem | ||
|arguments = {{FunctionArgument | |referenceType = <nowiki>ActorID|ContainerID</nowiki> | ||
|arguments = {{FunctionArgument | |||
|Name = ObjectID | |Name = ObjectID | ||
|Type = ref | |Type = ref | ||
Line 15: | Line 16: | ||
|Optional = y | |Optional = y | ||
}} | }} | ||
|example = buddyref.additem Stimpack 11 | |||
= | |||
Adds 11 stimpacks to Buddy's inventory | Adds 11 stimpacks to Buddy's inventory | ||
player.additem SuperStimpak 10 | player.additem SuperStimpak 10 | ||
Line 23: | Line 22: | ||
player.additem SuperStimpak 10 1 | player.additem SuperStimpak 10 1 | ||
Adds 10 super stimpacks to the player's inventory and no message is displayed | Adds 10 super stimpacks to the player's inventory and no message is displayed | ||
}} | |||
==Notes== | ==Notes== | ||
Line 36: | Line 36: | ||
End</pre></li></ul> | End</pre></li></ul> | ||
*Executing [[AddItem]] function on [[NPC]]s will cause them to review their inventory and equip the best armor and weapon they have. If [[NPC]] already has an armor with [[Object Effect]]s equipped adding an item will make them reequip it, not really unequipping it first. As a result [[Object Effect]]s of the armor will stack after each use of the [[AddItem]] function. Unequipping the armor will revert everything back to normal removing all stacked [[Object Effect]]s. | *Executing [[AddItem]] function on [[NPC]]s will cause them to review their inventory and equip the best armor and weapon they have. If [[NPC]] already has an armor with [[Object Effect]]s equipped adding an item will make them reequip it, not really unequipping it first. As a result [[Object Effect]]s of the armor will stack after each use of the [[AddItem]] function. Unequipping the armor will revert everything back to normal removing all stacked [[Object Effect]]s. | ||
==See Also== | ==See Also== |