ref npcRefref itemRefshort itemCountshort items...; assuming npcRef holds the NPC refset itemCount to npcRef.GetNumItemsWhile itemCount > 0 set itemCount to itemCount - 1 set itemRef to GetInventoryObject itemCount ; itemRef now refers to one item type in NPC's inventory, letting you do things like: set items to npcRef.GetItemCount itemRef PrintC "%n has %.0f items of type %n", npcRef, items, itemRef npcRef.RemoveItemNS itemRef 1 PrintC "Removed one item of type %n from %n", itemRef, npcRef if (GetObjectType itemRef) == 33 PrintC "%n is a weapon", itemRef endifLoop
scn ACgriusscriptshort ShareBegin Gamemodeif Share == 1 set Share to 2 ACgriusref.removeallitems ACchestref acchestref.moveto Player ACchestref.Activate Player ACchestref.moveto ACgriuschestmarker return elseif Share == 2 set Share to 0 ACchestref.RemoveAllItems ACgriusref return endifend
scn ACgriusscriptshort ShareBegin Gamemodeif Share == 1 set Share to 2 ACgriusref.removeallitems ACchestref acchestref.moveto Player ACchestref.Activate Player ACchestref.moveto ACgriuschestmarker return elseif Share == 2 set Share to 0 ACchestref.RemoveAllItems ACgriusref return endifend
scn acgriussharescriptshort share;share is initiated through dialougeBegin Gamemodeif Share == 1 set Share to 2 ACgriusref.removeallitems ACchestref ACchestref.Activate Player returnelseif Share == 2 set Share to 0 ACchestref.RemoveAllItems ACgriusref ACgriusref.additem daedricboots 1 ACgriusref.equipitem daedricboots ACgriusref.removeitem daedricboots 1 returnendifend