Website: http://mesogea.spruz.com/Default.asp?
) to go along with them and some neat-o ranger-y abilities, such as summonable animal companions, as rewards for the quests. Think D&D style Ranger class. I'm hoping to eventually include a total wildlife / hunting system overhaul... I might also include some goodies like craftable arrows and maybe some neat utility arrows.

) to go along with them and some neat-o ranger-y abilities, such as summonable animal companions, as rewards for the quests. ..... I am open to suggestions!
ScriptName BagOfHoldingContainerScript extends ObjectReference ConditionalBool bSorting = FalseInt bMessageInt bShownOnceInt iButtonInt iCountActor Property Player AutoArmor Property BagOfHoldingARMO AutoArmor Property BagOfHoldingSortApparelARMO AutoArmor Property DecapitatedHead AutoBook Property BagOfHoldingSortBooksBOOK AutoEffectShader Property GhostFXShader AutoFormList Property BagOfHoldingSortApparelFLST AutoFormList Property BagOfHoldingSortApparelAllFLST AutoFormList Property BagOfHoldingSortArcheryFLST AutoFormList Property BagOfHoldingSortArmorFLST AutoFormList Property BagOfHoldingSortArrowsFLST AutoFormList Property BagOfHoldingSortBookFLST AutoFormList Property BagOfHoldingSortBooksFLST AutoFormList Property BagOfHoldingSortBowsFLST AutoFormList Property BagOfHoldingSortClothingFLST AutoFormList Property BagOfHoldingSortFoodFLST AutoFormList Property BagOfHoldingSortIngredientsFLST AutoFormList Property BagOfHoldingSortJewelryFLST AutoFormList Property BagOfHoldingSortKeysFLST AutoFormList Property BagOfHoldingSortMiscFLST AutoFormList Property BagOfHoldingSortNotesFLST AutoFormList Property BagOfHoldingSortOneHandedFLST AutoFormList Property BagOfHoldingSortPoisonFLST AutoFormList Property BagOfHoldingSortPotionFLST AutoFormList Property BagOfHoldingSortPotionsFLST AutoFormList Property BagOfHoldingSortScrollsFLST AutoFormList Property BagOfHoldingSortSkillBooksFLST AutoFormList Property BagOfHoldingSortSmithingFLST AutoFormList Property BagOfHoldingSortSoulGemsFLST AutoFormList Property BagOfHoldingSortSpellTomesFLST AutoFormList Property BagOfHoldingSortStavesFLST AutoFormList Property BagOfHoldingSortTwoHandedFLST AutoFormList Property BagOfHoldingSortWeaponsFLST AutoFormList Property BagOfHoldingSortWeaponsAllFLST AutoFormList Property BagOfHoldingSortingItemsFLST AutoGlobalVariable Property BagOfHoldingSortingItemsGLOB AutoIngredient Property BagOfHoldingSortIngredientsINGR AutoKey Property BagOfHoldingSortKeysKEYM AutoKeyword Property BagOfHoldingSortingItemKYWD AutoMessage Property BagOfHoldingMESG AutoMessage Property BagOfHoldingGrabMESG AutoMessage Property BagOfHoldingMainMenuMESG AutoMessage Property BagOfHoldingOptions01MESG AutoMessage Property BagOfHoldingOptions02MESG AutoMessage Property BagOfHoldingSortApparelMESG AutoMessage Property BagOfHoldingSortArcheryMESG AutoMessage Property BagOfHoldingSortArmorMESG AutoMessage Property BagOfHoldingSortBookMESG AutoMessage Property BagOfHoldingSortBooksAllMESG AutoMessage Property BagOfHoldingSortBooksMESG AutoMessage Property BagOfHoldingSortFoodMESG AutoMessage Property BagOfHoldingSortingMESG AutoMessage Property BagOfHoldingSortIngredientsMESG AutoMessage Property BagOfHoldingSortJewelryMESG AutoMessage Property BagOfHoldingSortKeysMESG AutoMessage Property BagOfHoldingSortMiscMESG AutoMessage Property BagOfHoldingSortNotesMESG AutoMessage Property BagOfHoldingSortOneHandedMESG AutoMessage Property BagOfHoldingSortPotionsMESG AutoMessage Property BagOfHoldingSortScrollsMESG AutoMessage Property BagOfHoldingSortSkillBooksMESG AutoMessage Property BagOfHoldingSortSmithingGoodsMESG AutoMessage Property BagOfHoldingSortSoulGemsMESG AutoMessage Property BagOfHoldingSortSpellTomesMESG AutoMessage Property BagOfHoldingSortStavesMESG AutoMessage Property BagOfHoldingSortTwoHandedMESG AutoMessage Property BagOfHoldingSortWeaponsMESG AutoMiscObject Property BagOfHoldingSortMiscMISC AutoPotion Property BagOfHoldingSortFoodALCH AutoPotion Property BagOfHoldingSortPotionsALCH AutoScroll Property BagOfHoldingSortScrollsSCRL AutoWeapon Property BagOfHoldingSortWeaponsWEAP Auto;===============================================Event OnLoad() bMessage = 1 GhostFXShader.Play(Self) BlockActivation()EndEvent;===============================================Event OnUnload() If IsDisabled() If Player.GetItemCount(BagOfHoldingARMO) MoveToMyEditorLocation() EndIf EndIfEndEvent;===============================================Event OnGrab() bMessage = 1 BlockActivation()EndEvent;===============================================Event OnActivate(ObjectReference akActionRef) If akActionRef == Player If (Player.GetItemCount(BagOfHoldingARMO)) BlockActivation(False) Menu() ElseIf bMessage Menu() EndIf EndIfEndEvent;===============================================Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) If bSorting ElseIf akBaseItem == BagOfHoldingARMO iCount = Player.GetItemCount(BagOfHoldingARMO) Player.RemoveItem(BagOfHoldingARMO, iCount, True) RemoveItem(akBaseItem, 1, True, Player) Menu() ElseIf akBaseItem.HasKeyword(BagOfHoldingSortingItemKYWD) If akBaseItem == BagOfHoldingSortWeaponsWEAP If GetItemCount(BagOfHoldingSortWeaponsFLST) ElseIf !Player.GetItemCount(BagOfHoldingSortWeaponsFLST) RemoveItem(akBaseItem) EndIf ElseIf akBaseItem == BagOfHoldingSortApparelARMO If GetItemCount(BagOfHoldingSortApparelFLST) ElseIf !Player.GetItemCount(BagOfHoldingSortApparelFLST) RemoveItem(akBaseItem) EndIf ElseIf akBaseItem == BagOfHoldingSortPotionsALCH If GetItemCount(BagOfHoldingSortPotionsFLST) ElseIf !Player.GetItemCount(BagOfHoldingSortPotionsFLST) RemoveItem(akBaseItem) EndIf ElseIf akBaseItem == BagOfHoldingSortScrollsSCRL If GetItemCount(BagOfHoldingSortScrollsFLST) ElseIf !Player.GetItemCount(BagOfHoldingSortScrollsFLST) RemoveItem(akBaseItem) EndIf ElseIf akBaseItem == BagOfHoldingSortFoodALCH If GetItemCount(BagOfHoldingSortFoodFLST) ElseIf !Player.GetItemCount(BagOfHoldingSortFoodFLST) RemoveItem(akBaseItem) EndIf ElseIf akBaseItem == BagOfHoldingSortIngredientsINGR If GetItemCount(BagOfHoldingSortIngredientsFLST) ElseIf !Player.GetItemCount(BagOfHoldingSortIngredientsFLST) RemoveItem(akBaseItem) EndIf ElseIf akBaseItem == BagOfHoldingSortBooksBOOK If GetItemCount(BagOfHoldingSortBooksFLST) ElseIf !Player.GetItemCount(BagOfHoldingSortBooksFLST) RemoveItem(akBaseItem) EndIf ElseIf akBaseItem == BagOfHoldingSortKeysKEYM If GetItemCount(BagOfHoldingSortKeysFLST) ElseIf !Player.GetItemCount(BagOfHoldingSortKeysFLST) RemoveItem(akBaseItem) EndIf ElseIf akBaseItem == BagOfHoldingSortMiscMISC If GetItemCount(BagOfHoldingSortMiscFLST) ElseIf !Player.GetItemCount(BagOfHoldingSortMiscFLST) RemoveItem(akBaseItem) EndIf EndIf iCount = GetItemCount(akBaseItem) If (iCount > 1) iCount -= 1 RemoveItem(akBaseItem, iCount) EndIf EndIfEndEvent;===============================================Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) If bSorting ElseIf akBaseItem.HasKeyword(BagOfHoldingSortingItemKYWD) If akDestContainer.GetItemCount(BagOfHoldingSortingItemsFLST) > 1 iCount = akDestContainer.GetItemCount(BagOfHoldingSortingItemsFLST) akDestContainer.RemoveItem(BagOfHoldingSortingItemsFLST, iCount, True, Self) Else akDestContainer.RemoveItem(akBaseItem, 1, True, Self) Int iListIndex = 1 While akBaseItem != BagOfHoldingSortingItemsFLST.GetAt(iListIndex) iListIndex += 1 EndWhile Menu(iListIndex) EndIf EndIfEndEvent;*************************************************Function Menu(Int aiMessage = 0, Int aiButton = 0, Bool abMenu = True) While abMenu If bSorting ElseIf (aiButton == -1) ElseIf (aiMessage == -3) ; Sorting aiButton = BagOfHoldingSortingMESG.Show() If (aiButton == 9) ; Back aiMessage = 0 Else aiMessage = aiButton + 1 EndIf ElseIf (aiMessage == -2) ; Options 02 aiButton = BagOfHoldingOptions02MESG.Show() If (aiButton == 0) ; ElseIf (aiButton == 1) ; ElseIf (aiButton == 2) ; ElseIf (aiButton == 3) ; ElseIf (aiButton == 4) ; ElseIf (aiButton == 5) ; ElseIf (aiButton == 6) ; ElseIf (aiButton == 7) ; ElseIf (aiButton == 8) ; Back aiMessage = -1 ElseIf (aiButton == 9) ; Done abMenu = False EndIf ElseIf (aiMessage == -1) ; Options 01 aiButton = BagOfHoldingOptions01MESG.Show() If (aiButton == 0) ; Default Access Mode ElseIf (aiButton == 1) || (aiButton == 2) ; Sorting Items On/Off iCount = GetItemCount(BagOfHoldingSortingItemsFLST) RemoveItem(BagOfHoldingSortingItemsFLST, iCount, True) If (aiButton == 1) ; On BagOfHoldingSortingItemsGLOB.SetValue(0) ElseIf (aiButton == 2) ; Off BagOfHoldingSortingItemsGLOB.SetValue(100) EndIf ElseIf (aiButton == 3) ; ElseIf (aiButton == 4) ; ElseIf (aiButton == 5) ; ElseIf (aiButton == 6) ; ElseIf (aiButton == 7) ; Back aiMessage = 0 ElseIf (aiButton == 8) ; More aiMessage = -2 ElseIf (aiButton == 9) ; Done abMenu = False EndIf ElseIf (aiMessage == 0) ; Main Menu aiButton = BagOfHoldingMainMenuMESG.Show() If (aiButton == 0) ; Open BlockActivation(False) Activate(Player) bMessage = 0 If !bShownOnce bShownOnce = 1 BagOfHoldingGrabMESG.Show() EndIf abMenu = False ElseIf (aiButton == 1) ; Sort aiMessage = -3 ElseIf (aiButton == 2) ; Take Disable() bMessage = 1 Player.AddItem(BagOfHoldingARMO, 1) BlockActivation(False) abMenu = False ElseIf (aiButton == 3) ; ElseIf (aiButton == 4) ; ElseIf (aiButton == 5) ; ElseIf (aiButton == 6) ; ElseIf (aiButton == 7) ; ElseIf (aiButton == 8) ; Options aiMessage = -1 ElseIf (aiButton == 9) ; Done abMenu = !abMenu EndIf ElseIf (aiMessage == 1) ; Weapons aiButton = BagOfHoldingSortWeaponsMESG.Show() If (aiButton < 2) ; All Sort(BagOfHoldingSortWeaponsFLST, aiButton As Bool, 1, aiButton As Bool) ElseIf (aiButton == 2) ; Archery aiButton = BagOfHoldingSortArcheryMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortBowsFLST, aiButton As Bool, 1) ElseIf (aiButton < 4) Sort(BagOfHoldingSortArrowsFLST, aiButton - 2 As Bool, 1) EndIf ElseIf (aiButton == 3) ; One Handed aiButton = BagOfHoldingSortOneHandedMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortOneHandedFLST, aiButton As Bool, 1) EndIf ElseIf (aiButton == 4) ; Two Handed aiButton = BagOfHoldingSortTwoHandedMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortTwoHandedFLST, aiButton As Bool, 1) EndIf ElseIf (aiButton == 5) ; Staves aiButton = BagOfHoldingSortStavesMESG.Show() If (aiButton < 2) ; Take Sort(BagOfHoldingSortStavesFLST, aiButton As Bool, 1) EndIf ElseIf (aiButton == 6) ; ElseIf (aiButton == 7) ; ElseIf (aiButton == 8) ; Back aiMessage = -3 ElseIf (aiButton == 9) ; Done abMenu = False EndIf ElseIf (aiMessage == 2) ; Apparel aiButton = BagOfHoldingSortApparelMESG.Show() If (aiButton == 0) ; Armor aiButton = BagOfHoldingSortArmorMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortArmorFLST, aiButton As Bool, 2, aiButton As Bool) EndIf ElseIf (aiButton == 1) ; Clothing aiButton = BagOfHoldingSortJewelryMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortClothingFLST, aiButton As Bool, 2) EndIf ElseIf (aiButton == 2) ; Jewelry aiButton = BagOfHoldingSortJewelryMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortJewelryFLST, aiButton As Bool, 2) EndIf ElseIf (aiButton == 3) ; ElseIf (aiButton == 4) ; ElseIf (aiButton == 5) ; ElseIf (aiButton == 6) ; ElseIf (aiButton == 7) ; ElseIf (aiButton == 8) ; Back aiMessage = -3 ElseIf (aiButton == 9) ; Done abMenu = False EndIf ElseIf (aiMessage == 3) ; Potions aiButton = BagOfHoldingSortPotionsMESG.Show() If (aiButton < 2) ; Take/Stash All Sort(BagOfHoldingSortPotionsFLST, aiButton As Bool) ElseIf (aiButton == 2) ; Take Potions Sort(BagOfHoldingSortPotionFLST) ElseIf (aiButton == 3) ; Stash Potions Sort(BagOfHoldingSortPotionFLST, True) ElseIf (aiButton == 4) ; Take Poisons Sort(BagOfHoldingSortPoisonFLST) ElseIf (aiButton == 5) ; Stash Poisons Sort(BagOfHoldingSortPoisonFLST, True) ElseIf (aiButton == 8) ; Back aiMessage = -3 ElseIf (aiButton == 9) ; Done abMenu = False EndIf ElseIf (aiMessage == 4) ; Scrolls aiButton = BagOfHoldingSortScrollsMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortScrollsFLST, aiButton As Bool) ElseIf (aiButton == 8) ; Back aiMessage = -3 ElseIf (aiButton == 9) ; Done abMenu = False EndIf ElseIf (aiMessage == 5) ; Food aiButton = BagOfHoldingSortFoodMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortFoodFLST, aiButton As Bool) ElseIf (aiButton == 8) ; Back aiMessage = -3 ElseIf (aiButton == 9) ; Done abMenu = False EndIf ElseIf (aiMessage == 6) ; Ingredients aiButton = BagOfHoldingSortIngredientsMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortIngredientsFLST, aiButton As Bool) ElseIf (aiButton == 8) ; Back aiMessage = -3 ElseIf (aiButton == 9) ; Done abMenu = False EndIf ElseIf (aiMessage == 7) ; Books aiButton = BagOfHoldingSortBooksMESG.Show() If (aiButton == 0) ; All aiButton = BagOfHoldingSortBooksAllMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortBooksFLST, aiButton As Bool) EndIf ElseIf (aiButton == 1) ; Books aiButton = BagOfHoldingSortBookMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortBookFLST, aiButton As Bool) EndIf ElseIf (aiButton == 2) ; Notes aiButton = BagOfHoldingSortNotesMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortNotesFLST, aiButton As Bool) EndIf ElseIf (aiButton == 3) ; Skill Books aiButton = BagOfHoldingSortSkillBooksMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortSkillBooksFLST, aiButton As Bool) EndIf ElseIf (aiButton == 4) ; Spell Tomes aiButton = BagOfHoldingSortSpellTomesMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortSpellTomesFLST, aiButton As Bool) EndIf ElseIf (aiButton == 8) ; Back aiMessage = -3 ElseIf (aiButton == 9) ; Done abMenu = False EndIf ElseIf (aiMessage == 8) ; Keys aiButton = BagOfHoldingSortKeysMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortKeysFLST, aiButton As Bool) ElseIf (aiButton == 8) ; Back aiMessage = -3 ElseIf (aiButton == 9) ; Done abMenu = False EndIf ElseIf (aiMessage == 9) ; Misc aiButton = BagOfHoldingSortMiscMESG.Show() If (aiButton == 0) ; All ElseIf (aiButton == 1) ; Clutter ElseIf (aiButton == 2) ; Gems ElseIf (aiButton == 3) ; Soul Gemss ElseIf (aiButton == 4) ; Smiting Goods ElseIf (aiButton == 5) ; ElseIf (aiButton == 6) ; ElseIf (aiButton == 7) ; ElseIf (aiButton == 8) ; Back aiMessage = -3 ElseIf (aiButton == 9) ; Done abMenu = False EndIf EndIf EndWhile EndFunction;**************************************************Function Sort(FormList akCurrentList = None, Bool abStashing = False, Int aiMode = 0, Bool abStashingAll = False, ObjectReference akDonor = None, ObjectReference akRecipient = None, Form akCurrentForm = None, Int aiListIndex = 0, Int aiListOfListsIndex = 0, Int aiCount = 0) bSorting = True If abStashing akDonor = Player akRecipient = Self If aiMode If !Player.IsEquipped(akCurrentList) aiMode = 0 EndIf EndIf Else aiMode = 0 akDonor = Self akRecipient = Player EndIf If (aiMode == 0); Normal sorting While akDonor.GetItemCount(akCurrentList) aiCount = akDonor.GetItemCount(akCurrentList) akDonor.RemoveItem(akCurrentList, aiCount, True, akRecipient) EndWhile ElseIf (aiMode == 1) ; Weapon sorting If abStashingAll aiListOfListsIndex = (BagOfHoldingSortWeaponsAllFLST.GetSize() - 1) While (aiListOfListsIndex > -1) akCurrentList = BagOfHoldingSortWeaponsAllFLST.GetAt(aiListOfListsIndex) As FormList If Player.GetItemCount(akCurrentList) If Player.IsEquipped(akCurrentList) aiListIndex = (akCurrentList.GetSize() - 1) While (aiListIndex > -1) akCurrentForm = akCurrentList.GetAt(aiListIndex) As Weapon aiCount = Player.GetItemCount(akCurrentForm) If Player.GetEquippedWeapon(True) == akCurrentForm aiCount -= 1 EndIf If Player.GetEquippedWeapon() == akCurrentForm aiCount -= 1 EndIf Player.RemoveItem(akCurrentForm, aiCount, True, Self) If Player.GetItemCount(akCurrentList) aiListIndex -= 1 Else aiListIndex = -1 EndIf EndWhile aiListOfListsIndex -= 1 Else aiCount = Player.GetItemCount(akCurrentList) Player.RemoveItem(akCurrentList, iCount, True, Self) aiListOfListsIndex -= 1 EndIf Else aiListOfListsIndex -= 1 EndIf EndWhile Else aiListIndex = (akCurrentList.GetSize() - 1) While (aiListIndex > -1) akCurrentForm = akCurrentList.GetAt(aiListIndex) As Weapon aiCount = Player.GetItemCount(akCurrentForm) If Player.GetEquippedWeapon(True) == akCurrentForm aiCount -= 1 EndIf If Player.GetEquippedWeapon() == akCurrentForm aiCount -= 1 EndIf Player.RemoveItem(akCurrentForm, aiCount, True, Self) If Player.GetItemCount(akCurrentList) aiListIndex -= 1 Else aiListIndex = -1 EndIf EndWhile EndIf ElseIf (aiMode == 2) ; Apparel sorting If abStashingAll aiListOfListsIndex = (BagOfHoldingSortApparelAllFLST.GetSize() - 1) While (aiListOfListsIndex > -1) akCurrentList = BagOfHoldingSortWeaponsAllFLST.GetAt(aiListOfListsIndex) As FormList If Player.GetItemCount(akCurrentList) If Player.IsEquipped(akCurrentList) aiListIndex = (akCurrentList.GetSize() - 1) While (aiListIndex > -1) akCurrentForm = akCurrentList.GetAt(aiListIndex) As Armor aiCount = Player.GetItemCount(akCurrentForm) If Player.IsEquipped(akCurrentForm) aiCount -= 1 EndIf Player.RemoveItem(akCurrentForm, aiCount, True, Self) If Player.GetItemCount(akCurrentList) aiListIndex -= 1 Else aiListIndex = -1 EndIf EndWhile aiListOfListsIndex -= 1 Else aiCount = Player.GetItemCount(akCurrentList) Player.RemoveItem(akCurrentList, iCount, True, Self) aiListOfListsIndex -= 1 EndIf Else aiListOfListsIndex -= 1 EndIf EndWhile Else aiListIndex = (akCurrentList.GetSize() - 1) While (aiListIndex > -1) akCurrentForm = akCurrentList.GetAt(aiListIndex) As Armor aiCount = Player.GetItemCount(akCurrentForm) If Player.IsEquipped(akCurrentForm) aiCount -= 1 EndIf Player.RemoveItem(akCurrentForm, aiCount, True, Self) If Player.GetItemCount(akCurrentList) aiListIndex -= 1 Else aiListIndex = -1 EndIf EndWhile EndIf EndIf bSorting = False AddItem(DecapitatedHead) Player.AddItem(DecapitatedHead, 1, True) RemoveItem(DecapitatedHead) Player.RemoveItem(DecapitatedHead, 1, True) Debug.Notification("Sorting done.")EndFunction
ScriptName BagOfHoldingContainerScript extends ObjectReference ConditionalBool bMessage = FalseBool bGrabMessageShown = FalseBool bVar = FalseForm FormVar = NoneFormList FormListVar = NoneInt iVar = 0Actor Property Player AutoArmor Property BagOfHoldingARMO AutoArmor Property DecapitatedHead AutoBool Property bBagAcquired Auto ConditionalBool Property bMenu Auto ConditionalBool Property bSorting Auto ConditionalBool Property bSortingItems = True Auto ConditionalBool Property bTesting Auto ConditionalEffectShader Property GhostFXShader AutoFormList Property BagOfHoldingCategoryFLST AutoFormList Property BagOfHoldingItemFLST AutoFormList Property BagOfHoldingSortApparelAllFLST AutoFormList Property BagOfHoldingSortApparelFLST AutoFormList Property BagOfHoldingSortArcheryFLST AutoFormList Property BagOfHoldingSortArmorFLST AutoFormList Property BagOfHoldingSortArrowsFLST AutoFormList Property BagOfHoldingSortBookFLST AutoFormList Property BagOfHoldingSortBooksFLST AutoFormList Property BagOfHoldingSortBowsFLST AutoFormList Property BagOfHoldingSortClothingFLST AutoFormList Property BagOfHoldingSortClutterFLST AutoFormList Property BagOfHoldingSortFoodFLST AutoFormList Property BagOfHoldingSortGemsFLST AutoFormList Property BagOfHoldingSortHeavyArmorFLST AutoFormList Property BagOfHoldingSortIngredientsFLST AutoFormList Property BagOfHoldingSortJewelryFLST AutoFormList Property BagOfHoldingSortKeysFLST AutoFormList Property BagOfHoldingSortLightArmorFLST AutoFormList Property BagOfHoldingSortMiscFLST AutoFormList Property BagOfHoldingSortNotesFLST AutoFormList Property BagOfHoldingSortOneHandedFLST AutoFormList Property BagOfHoldingSortPoisonFLST AutoFormList Property BagOfHoldingSortPotionFLST AutoFormList Property BagOfHoldingSortPotionAndPoisonFLST AutoFormList Property BagOfHoldingSortScrollsFLST AutoFormList Property BagOfHoldingSortShieldsFLST AutoFormList Property BagOfHoldingSortSkillBooksFLST AutoFormList Property BagOfHoldingSortSmithingFLST AutoFormList Property BagOfHoldingSortSoulGemsFLST AutoFormList Property BagOfHoldingSortSpellTomesFLST AutoFormList Property BagOfHoldingSortStavesFLST AutoFormList Property BagOfHoldingSortTwoHandedFLST AutoFormList Property BagOfHoldingSortWeaponsAllFLST AutoFormList Property BagOfHoldingSortWeaponsFLST AutoInt Property iAccessMode Auto ConditionalLeveledItem Property BagOfHoldingLVLI AutoMessage Property BagOfHoldingConfirmationMESG AutoMessage Property BagOfHoldingDeliveryMESG AutoMessage Property BagOfHoldingDefaultActivationMESG AutoMessage Property BagOfHoldingGrabMESG AutoMessage Property BagOfHoldingMainMenuMESG AutoMessage Property BagOfHoldingOptionsMESG AutoMessage Property BagOfHoldingTestingMESG AutoMessage Property BagOfHoldingSortApparelMESG AutoMessage Property BagOfHoldingSortArcheryMESG AutoMessage Property BagOfHoldingSortArmorMESG AutoMessage Property BagOfHoldingSortBookMESG AutoMessage Property BagOfHoldingSortBooksMESG AutoMessage Property BagOfHoldingSortClothingMESG AutoMessage Property BagOfHoldingSortClutterMESG AutoMessage Property BagOfHoldingSortFoodMESG AutoMessage Property BagOfHoldingSortGemsMESG AutoMessage Property BagOfHoldingSortHeavyArmorMESG AutoMessage Property BagOfHoldingSortIngredientsMESG AutoMessage Property BagOfHoldingSortJewelryMESG AutoMessage Property BagOfHoldingSortKeysMESG AutoMessage Property BagOfHoldingSortLightArmorMESG AutoMessage Property BagOfHoldingSortMiscMESG AutoMessage Property BagOfHoldingSortNotesMESG AutoMessage Property BagOfHoldingSortOneHandedMESG AutoMessage Property BagOfHoldingSortPotionsMESG AutoMessage Property BagOfHoldingSortScrollsMESG AutoMessage Property BagOfHoldingSortShieldsMESG AutoMessage Property BagOfHoldingSortSkillBooksMESG AutoMessage Property BagOfHoldingSortSmithingMESG AutoMessage Property BagOfHoldingSortSoulGemsMESG AutoMessage Property BagOfHoldingSortSpellTomesMESG AutoMessage Property BagOfHoldingSortStavesMESG AutoMessage Property BagOfHoldingSortTwoHandedMESG AutoMessage Property BagOfHoldingSortWeaponsMESG AutoMessage Property BagOfHoldingSortingMESG AutoMessage Property BagOfHoldingSpoilerMESG AutoMessage Property BagOfHoldingSpoilerOptMESG AutoObjectReference Property MapMarkerAnsilvundREF AutoQuest Property BagOfHoldingQUST AutoEvent OnLoad() bMessage = 1 GhostFXShader.Play(Self) BlockActivation()EndEventEvent OnUnload() If IsDisabled() If Player.GetItemCount(BagOfHoldingARMO) MoveToMyEditorLocation() EndIf EndIfEndEventEvent OnGrab() bMessage = 1 BlockActivation()EndEventEvent OnActivate(ObjectReference akActionRef) If akActionRef == Player AddItem(DecapitatedHead) If Player.GetItemCount(BagOfHoldingARMO) If iAccessMode == 2 If !bMenu Menu() EndIf ElseIf IsActivationBlocked() != iAccessMode As Bool If !iAccessMode If !bMenu Menu() EndIf Utility.Wait(0.1) BlockActivation(False) EndIf ElseIf IsActivationBlocked() If !bMenu Menu() EndIf EndIf ElseIf bMessage If !bMenu Menu() EndIf ElseIf !bGrabMessageShown bGrabMessageShown = 1 BagOfHoldingGrabMESG.Show() EndIf EndIfEndEventEvent OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) If akBaseItem == BagOfHoldingARMO Player.RemoveItem(akBaseItem, Player.GetItemCount(BagOfHoldingARMO), True) RemoveItem(akBaseItem, 1, True, Player) If !bMenu Menu() EndIf ElseIf akBaseItem == DecapitatedHead RemoveItem(akBaseItem) Player.AddItem(akBaseItem, 1, True) Player.RemoveItem(akBaseItem, 1, True) If bSortingItems iVar = 1 While (iVar < 10) FormListVar = BagOfHoldingCategoryFLST.GetAt(iVar) As FormList FormVar = BagOfHoldingItemFLST.GetAt(iVar) As Form Player.RemoveItem(FormVar, Player.GetItemCount(FormVar), True) RemoveItem(FormVar, GetItemCount(FormVar) - 1) If GetItemCount(FormVar) As Bool != (GetItemCount(FormListVar) || Player.GetItemCount(FormListVar)) As Bool If GetItemCount(FormVar) RemoveItem(FormVar) Else AddItem(FormVar) EndIf EndIf iVar += 1 EndWhile EndIf EndIfEndEventEvent OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) If bSortingItems If BagOfHoldingItemFLST.HasForm(akBaseItem) If Player.GetItemCount(BagOfHoldingItemFLST) > 2 Player.RemoveItem(akBaseItem, akDestContainer.GetItemCount(akBaseItem), True) If !Player.GetItemCount(BagOfHoldingARMO) Player.AddItem(BagOfHoldingARMO, 1, True) EndIf Else iVar = 1 AddItem(akBaseItem) Player.RemoveItem(akBaseItem, Player.GetItemCount(akBaseItem), True) While akBaseItem != BagOfHoldingItemFLST.GetAt(iVar) iVar += 1 EndWhile Menu(iVar) EndIf EndIf EndIfEndEventFunction Menu(Int aiMessage = 0, Int aiButton = 0) bMenu = True While bMenu If bSorting ElseIf (aiButton == -1) ElseIf (aiMessage == -3) ; Sorting aiButton = BagOfHoldingSortingMESG.Show() If (aiButton == 9) ; Back aiMessage = 0 Else aiMessage = aiButton + 1 EndIf ElseIf (aiMessage == -2) ; Testing aiButton = BagOfHoldingTestingMESG.Show() If (aiButton == 9) ; Back aiMessage = -1 Else TestList(BagOfHoldingCategoryFLST.GetAt(aiButton + 1) As FormList, GetItemCount(BagOfHoldingCategoryFLST.GetAt(aiButton + 1) As FormList) As Bool) EndIf ElseIf (aiMessage == -1) ; Options aiButton = BagOfHoldingOptionsMESG.Show() If (aiButton == 0) ; Default Access Mode aiButton = BagOfHoldingDefaultActivationMESG.Show() iAccessMode = aiButton ElseIf (aiButton < 3) ; Sorting Items On/Off RemoveItem(BagOfHoldingItemFLST, GetItemCount(BagOfHoldingItemFLST)) If (aiButton == 1) ; On bSortingItems = True ElseIf (aiButton == 2) ; Off bSortingItems = False EndIf AddItem(DecapitatedHead) ElseIf (aiButton == 3) ; Forfeit to find as quest reward aiButton = BagOfHoldingDeliveryMESG.Show() If (aiButton == 2) aiButton = BagOfHoldingConfirmationMESG.Show() If (aiButton == 0) ; Yes bMenu = False bBagAcquired = False BagOfHoldingQUST.Stop() RemoveItem(BagOfHoldingItemFLST, GetItemCount(BagOfHoldingItemFLST)) RemoveAllItems(Player, True, True) Player.RemoveItem(BagOfHoldingARMO, Player.GetItemCount(BagOfHoldingARMO), True) BlockActivation() aiButton = BagOfHoldingSpoilerOptMESG.Show() If (aiButton == 0) ; Yes aiButton = BagOfHoldingSpoilerMESG.Show() If (aiButton == 0) MapMarkerAnsilvundREF.AddToMap() EndIf EndIf Utility.Wait(0.1) RemoveAllItems(Player, True, True) AddItem(BagOfHoldingLVLI) EndIf EndIf; ElseIf (aiButton == 4) ; ; ElseIf (aiButton == 5) ; ; ElseIf (aiButton == 6) ; ElseIf (aiButton == 7) ; Testing aiMessage = -2 ElseIf (aiButton == 8) ; Back aiMessage = 0 ElseIf (aiButton == 9) ; Done bMenu = False EndIf ElseIf (aiMessage == 0) ; Main Menu aiButton = BagOfHoldingMainMenuMESG.Show() If (aiButton < 2) ; Open/Access BlockActivation(False) If !Player.GetItemCount(BagOfHoldingARMO) bMessage = 0 BlockActivation(False) EndIf Activate(Player) Utility.WaitMenuMode(0.1) bMenu = False ElseIf (aiButton == 2) ; Sort aiMessage = -3 ElseIf (aiButton == 3) ; Take Disable() bMessage = 1 Player.AddItem(BagOfHoldingARMO, 1) BlockActivation(iAccessMode As Bool) bMenu = False; ElseIf (aiButton == 4) ; ; ElseIf (aiButton == 5) ; ; ElseIf (aiButton == 6) ; ; ElseIf (aiButton == 7) ; ElseIf (aiButton == 8) ; Options aiMessage = -1 ElseIf (aiButton == 9) ; Done bMenu = False EndIf ElseIf (aiMessage == 1) ; Weapons aiButton = BagOfHoldingSortWeaponsMESG.Show() If (aiButton < 2) ; All Sort(BagOfHoldingSortWeaponsFLST, aiButton As Bool, 1, aiButton As Bool) ElseIf (aiButton == 2) ; Archery aiButton = BagOfHoldingSortArcheryMESG.Show() If (aiButton < 2) ; All Sort(BagOfHoldingSortArcheryFLST, aiButton As Bool, 1, aiButton As Bool) ElseIf (aiButton == 2) ; Take Bows Sort(BagOfHoldingSortBowsFLST, False, 1) ElseIf (aiButton == 3) ; Stash Bows Sort(BagOfHoldingSortBowsFLST, True, 1, True) ElseIf (aiButton == 4) ; Take Arrows Sort(BagOfHoldingSortArrowsFLST, False, 1) ElseIf (aiButton == 5) ; Stash Arrows Sort(BagOfHoldingSortArrowsFLST, True, 1, True); ElseIf (aiButton == 6) ; ; ElseIf (aiButton == 7) ; ElseIf (aiButton == 8) ; Back aiMessage = -3 ElseIf (aiButton == 9) ; Done bMenu = False EndIf ElseIf (aiButton == 3) ; One Handed aiButton = BagOfHoldingSortOneHandedMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortOneHandedFLST, aiButton As Bool, 1) EndIf ElseIf (aiButton == 4) ; Two Handed aiButton = BagOfHoldingSortTwoHandedMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortTwoHandedFLST, aiButton As Bool, 1) EndIf ElseIf (aiButton == 5) ; Staves aiButton = BagOfHoldingSortStavesMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortStavesFLST, aiButton As Bool, 1) EndIf; ElseIf (aiButton == 6) ; ; ElseIf (aiButton == 7) ; ElseIf (aiButton == 8) ; Back aiMessage = -3 ElseIf (aiButton == 9) ; Done bMenu = False EndIf ElseIf (aiMessage == 2) ; Apparel aiButton = BagOfHoldingSortApparelMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortApparelFLST, aiButton As Bool, 2, aiButton As Bool) ElseIf (aiButton == 2) ; Armor aiButton = BagOfHoldingSortArmorMESG.Show() If (aiButton < 2) ; All Sort(BagOfHoldingSortArmorFLST, aiButton As Bool, 2) ElseIf (aiButton == 2) ; Light Armor aiButton = BagOfHoldingSortLightArmorMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortLightArmorFLST, aiButton As Bool, 2) EndIf ElseIf (aiButton == 3) ; Heavy Armor aiButton = BagOfHoldingSortHeavyArmorMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortHeavyArmorFLST, aiButton As Bool, 2) EndIf ElseIf (aiButton == 4) ; Shields aiButton = BagOfHoldingSortShieldsMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortShieldsFLST, aiButton As Bool, 2) EndIf EndIf ElseIf (aiButton == 3) ; Clothing aiButton = BagOfHoldingSortClothingMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortClothingFLST, aiButton As Bool, 2) EndIf ElseIf (aiButton == 4) ; Jewelry aiButton = BagOfHoldingSortJewelryMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortJewelryFLST, aiButton As Bool, 2) EndIf; ElseIf (aiButton == 5) ; ; ElseIf (aiButton == 6) ; ; ElseIf (aiButton == 7) ; ElseIf (aiButton == 8) ; Back aiMessage = -3 ElseIf (aiButton == 9) ; Done bMenu = False EndIf ElseIf (aiMessage == 3) ; Potions aiButton = BagOfHoldingSortPotionsMESG.Show() If (aiButton < 2) ; Take/Stash All Sort(BagOfHoldingSortPotionAndPoisonFLST, aiButton As Bool) ElseIf (aiButton == 2) ; Take Potions Sort(BagOfHoldingSortPotionFLST) ElseIf (aiButton == 3) ; Stash Potions Sort(BagOfHoldingSortPotionFLST, True) ElseIf (aiButton == 4) ; Take Potions Sort(BagOfHoldingSortPoisonFLST) ElseIf (aiButton == 5) ; Stash Poisons Sort(BagOfHoldingSortPoisonFLST, True); ElseIf (aiButton == 6) ; ; ElseIf (aiButton == 7) ; ElseIf (aiButton == 8) ; Back aiMessage = -3 ElseIf (aiButton == 9) ; Done bMenu = False EndIf ElseIf (aiMessage == 4) ; Scrolls aiButton = BagOfHoldingSortScrollsMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortScrollsFLST, aiButton As Bool); ElseIf (aiButton == 2) ; ; ElseIf (aiButton == 3) ; ; ElseIf (aiButton == 4) ; ; ElseIf (aiButton == 5) ; ; ElseIf (aiButton == 6) ; ; ElseIf (aiButton == 7) ; ElseIf (aiButton == 8) ; Back aiMessage = -3 ElseIf (aiButton == 9) ; Done bMenu = False EndIf ElseIf (aiMessage == 5) ; Food aiButton = BagOfHoldingSortFoodMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortFoodFLST, aiButton As Bool); ElseIf (aiButton == 2) ; ; ElseIf (aiButton == 3) ; ; ElseIf (aiButton == 4) ; ; ElseIf (aiButton == 5) ; ; ElseIf (aiButton == 6) ; ; ElseIf (aiButton == 7) ; ElseIf (aiButton == 8) ; Back aiMessage = -3 ElseIf (aiButton == 9) ; Done bMenu = False EndIf ElseIf (aiMessage == 6) ; Ingredients aiButton = BagOfHoldingSortIngredientsMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortIngredientsFLST, aiButton As Bool); ElseIf (aiButton == 2) ; ; ElseIf (aiButton == 3) ; ; ElseIf (aiButton == 4) ; ; ElseIf (aiButton == 5) ; ; ElseIf (aiButton == 6) ; ; ElseIf (aiButton == 7) ; ElseIf (aiButton == 8) ; Back aiMessage = -3 ElseIf (aiButton == 9) ; Done bMenu = False EndIf ElseIf (aiMessage == 7) ; Books aiButton = BagOfHoldingSortBooksMESG.Show() If (aiButton < 2) ; All Sort(BagOfHoldingSortBooksFLST, aiButton As Bool) ElseIf (aiButton == 2) ; Books aiButton = BagOfHoldingSortBookMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortBookFLST, aiButton As Bool) EndIf ElseIf (aiButton == 3) ; Notes aiButton = BagOfHoldingSortNotesMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortNotesFLST, aiButton As Bool) EndIf ElseIf (aiButton == 4) ; Skill Books aiButton = BagOfHoldingSortSkillBooksMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortSkillBooksFLST, aiButton As Bool) EndIf ElseIf (aiButton == 5) ; Spell Tomes aiButton = BagOfHoldingSortSpellTomesMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortSpellTomesFLST, aiButton As Bool) EndIf; ElseIf (aiButton == 6) ; ; ElseIf (aiButton == 7) ; ElseIf (aiButton == 8) ; Back aiMessage = -3 ElseIf (aiButton == 9) ; Done bMenu = False EndIf ElseIf (aiMessage == 8) ; Keys aiButton = BagOfHoldingSortKeysMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortKeysFLST, aiButton As Bool); ElseIf (aiButton == 2) ; ; ElseIf (aiButton == 3) ; ; ElseIf (aiButton == 4) ; ; ElseIf (aiButton == 5) ; ; ElseIf (aiButton == 6) ; ; ElseIf (aiButton == 7) ; ElseIf (aiButton == 8) ; Back aiMessage = -3 ElseIf (aiButton == 9) ; Done bMenu = False EndIf ElseIf (aiMessage == 9) ; Misc aiButton = BagOfHoldingSortMiscMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortMiscFLST, aiButton As Bool) ElseIf (aiButton == 2) ; Clutter aiButton = BagOfHoldingSortClutterMESG.Show() If (aiButton < 2) ; Sort(BagOfHoldingSortClutterFLST, aiButton As Bool) EndIf ElseIf (aiButton == 3) ; Gems aiButton = BagOfHoldingSortGemsMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortGemsFLST, aiButton As Bool) EndIf ElseIf (aiButton == 4) ; Soul Gems aiButton = BagOfHoldingSortSoulGemsMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortSoulGemsFLST, aiButton As Bool) EndIf ElseIf (aiButton == 5) ; Smiting Goods aiButton = BagOfHoldingSortSmithingMESG.Show() If (aiButton < 2) Sort(BagOfHoldingSortSmithingFLST, aiButton As Bool) EndIf; ElseIf (aiButton == 5) ; ; ElseIf (aiButton == 6) ; ; ElseIf (aiButton == 7) ; ElseIf (aiButton == 8) ; Back aiMessage = -3 ElseIf (aiButton == 9) ; Done bMenu = False EndIf EndIf EndWhileEndFunctionFunction Sort(FormList akCurrentList = None, Bool abStashing = False, Int aiMode = 0, Bool abStashingAll = False, ObjectReference akDonor = None, ObjectReference akRecipient = None, Form akCurrentForm = None, Int aiListIndex = 0, Int aiListOfListsIndex = 0) bSorting = True GoToState("SortingState") If abStashing akDonor = Player akRecipient = Self If aiMode If !Player.IsEquipped(akCurrentList) aiMode = 0 EndIf EndIf Else aiMode = 0 akDonor = Self akRecipient = Player EndIf If (aiMode == 0); Normal sorting akDonor.RemoveItem(akCurrentList, akDonor.GetItemCount(akCurrentList), True, akRecipient) ElseIf (aiMode == 1) ; Weapon sorting If abStashingAll aiListOfListsIndex = (BagOfHoldingSortWeaponsAllFLST.GetSize() - 1) While (aiListOfListsIndex > -1) akCurrentList = BagOfHoldingSortWeaponsAllFLST.GetAt(aiListOfListsIndex) As FormList If Player.GetEquippedItemType(0) == 1 ElseIf Player.GetEquippedItemType(1) == 1 EndIf If Player.GetItemCount(akCurrentList) If Player.IsEquipped(akCurrentList) aiListIndex = (akCurrentList.GetSize() - 1) While (aiListIndex > -1) akCurrentForm = akCurrentList.GetAt(aiListIndex) As Weapon If Player.IsEquipped(akCurrentForm) If Player.GetEquippedWeapon() == akCurrentForm If Player.GetEquippedWeapon(True) == akCurrentForm Player.RemoveItem(akCurrentForm, Player.GetItemCount(akCurrentForm) - 2, True, Self) EndIf ElseIf Player.GetEquippedWeapon(True) == akCurrentForm Player.RemoveItem(akCurrentForm, Player.GetItemCount(akCurrentForm) - 1, True, Self) EndIf Else Player.RemoveItem(akCurrentForm, Player.GetItemCount(akCurrentForm), True, Self) EndIf If Player.GetItemCount(akCurrentList) aiListIndex -= 1 Else aiListIndex = -1 EndIf EndWhile aiListOfListsIndex -= 1 Else Player.RemoveItem(akCurrentList, Player.GetItemCount(akCurrentList), True, Self) aiListOfListsIndex -= 1 EndIf Else aiListOfListsIndex -= 1 EndIf EndWhile Else aiListIndex = (akCurrentList.GetSize() - 1) While (aiListIndex > -1) akCurrentForm = akCurrentList.GetAt(aiListIndex) As Weapon If Player.IsEquipped(akCurrentForm) If Player.GetEquippedWeapon() == akCurrentForm If Player.GetEquippedWeapon(True) == akCurrentForm Player.RemoveItem(akCurrentForm, Player.GetItemCount(akCurrentForm) - 2, True, Self) EndIf ElseIf Player.GetEquippedWeapon(True) == akCurrentForm Player.RemoveItem(akCurrentForm, Player.GetItemCount(akCurrentForm) - 1, True, Self) EndIf Else Player.RemoveItem(akCurrentForm, Player.GetItemCount(akCurrentForm), True, Self) EndIf If Player.GetItemCount(akCurrentList) aiListIndex -= 1 Else aiListIndex = -1 EndIf EndWhile EndIf ElseIf (aiMode == 2) ; Apparel sorting If abStashingAll aiListOfListsIndex = (BagOfHoldingSortApparelAllFLST.GetSize() - 1) While (aiListOfListsIndex > -1) akCurrentList = BagOfHoldingSortWeaponsAllFLST.GetAt(aiListOfListsIndex) As FormList If Player.GetItemCount(akCurrentList) If Player.IsEquipped(akCurrentList) aiListIndex = (akCurrentList.GetSize() - 1) While (aiListIndex > -1) akCurrentForm = akCurrentList.GetAt(aiListIndex) As Armor If Player.IsEquipped(akCurrentForm) Player.RemoveItem(akCurrentForm, Player.GetItemCount(akCurrentForm) - 1, True, Self) Else Player.RemoveItem(akCurrentForm, Player.GetItemCount(akCurrentForm), True, Self) EndIf If Player.GetItemCount(akCurrentList) aiListIndex -= 1 Else aiListIndex = -1 EndIf EndWhile aiListOfListsIndex -= 1 Else Player.RemoveItem(akCurrentList, Player.GetItemCount(akCurrentList), True, Self) aiListOfListsIndex -= 1 EndIf Else aiListOfListsIndex -= 1 EndIf EndWhile Else aiListIndex = (akCurrentList.GetSize() - 1) While (aiListIndex > -1) akCurrentForm = akCurrentList.GetAt(aiListIndex) As Armor If Player.IsEquipped(akCurrentForm) Player.RemoveItem(akCurrentForm, Player.GetItemCount(akCurrentForm) - 1, True, Self) Else Player.RemoveItem(akCurrentForm, Player.GetItemCount(akCurrentForm), True, Self) EndIf If Player.GetItemCount(akCurrentList) aiListIndex -= 1 Else aiListIndex = -1 EndIf EndWhile EndIf EndIf bSorting = False GoToState("") AddItem(DecapitatedHead) Debug.Notification("Sorting done.")EndFunctionFunction TestList(FormList akList = None, Bool abRemove = False, Int aiIndex = 0, Form akForm = None) aiIndex = akList.GetSize() - 1 While (aiIndex > -1) akForm = akList.GetAt(aiIndex) As Form If abRemove RemoveItem(akList, aiIndex) AddItem(DecapitatedHead) aiIndex = -1 Else AddItem(akForm) aiIndex -= 1 EndIf EndWhile Debug.Notification("List added/removed")EndFunction State SortingState Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) EndEvent Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) EndEventEndState