Scriptname aaBAGet
float fQuestDelayTime
float Weight
short i
short j
short asked
short choice
short choice2
short n
short n0
short n1
short n2
short n3
short n4
short n5
short n6
short n7
short Alchemy
short Effects
long effect
long e0
long e1
long e2
long e3
long e4
long e5
long e6
long e7
short attribute
short a0
short a1
short a2
short a3
short a4
short a5
short a6
short a7
ref Bag
ref item
Begin GameMode
if fQuestDelayTime != 0.001
set fQuestDelayTime to 0.001
Set Bag to BAContainerRef
EndIf
set alchemy to Player.GetBaseActorValue Alchemy
if asked == 1
Set choice to GetButtonPressed
If choice == -1
return
ElseIf choice == 0
Set e0 to 1313100354 ;Burden
Set e1 to 1280133187 ;Chameleon
Set e2 to 1229215043 ;Cure Disease
Set e3 to 1095783747 ;Cure Paralysis
Set e4 to 1330664771 ;Cure Poison
Set e5 to 1413564228 ;Damage Agility
Set a5 to 3
Set e6 to 1413564228 ;Damage Endurance
Set a6 to 5
Set e7 to 1095124804 ;Damage Fatigue
ElseIf choice == 1
Set e0 to 1162364740 ;Damage Health
Set e1 to 1413564228 ;Damage Intelligence
Set a1 to 1
Set e2 to 1413564228 ;Damage Luck
Set a2 to 7
Set e3 to 1347635012 ;Damage Magicka
Set e4 to 1413564228 ;Damage Personality
Set a4 to 6
Set e5 to 1413564228 ;Damage Speed
Set a5 to 4
Set e6 to 1413564228 ;Damage Strength
Set a6 to 0
Set e7 to 1413564228 ;Damage Willpower
Set a7 to 2
ElseIf choice == 2
Set e0 to 1413698628 ;Detect Life
Set e1 to 1280332612 ;Dispel
Set e2 to 1380471878 ;Feather
Set e3 to 1195657542 ;Fire Damage
Set e4 to 1213417798 ;Fire Shield
Set e5 to 1413566278 ;Fortify Agility
Set a5 to 3
Set e6 to 1413566278 ;Fortify Endurance
Set a6 to 5
Set e7 to 1095126854 ;Fortify Fatigue
ElseIf choice == 3
Set e0 to 1162366790 ;Fortify Health
Set e1 to 1413566278 ;Fortify Intelligence
Set a1 to 1
Set e2 to 1413566278 ;Fortify Luck
Set a2 to 7
Set e3 to 1347637062 ;Fortify Magicka
Set e4 to 1413566278 ;Fortify Personality
Set a4 to 6
Set e5 to 1413566278 ;Fortify Speed
Set a5 to 4
Set e6 to 1413566278 ;Fortify Strength
Set a6 to 0
Set e7 to 1413566278 ;Fortify Willpower
Set a7 to 2
ElseIf choice == 4
Set e0 to 1195659846 ;Frost Damage
Set e1 to 1213420102 ;Frost Shield
Set e2 to 1230392905 ;Invisibility
Set e3 to 1414022988 ;Light
Set e4 to 1163478350 ;Night-Eye
Set e5 to 1095909712 ;Paralyze
Set e6 to 1195656530 ;Reflect Damage
Set e7 to 1129072210 ;Reflect Spell
ElseIf choice == 5
Set e0 to 1229214546 ;Resist Disease
Set e1 to 1229345618 ;Resist Fire
Set e2 to 1380340562 ;Resist Frost
Set e3 to 1095783250 ;Resist Paralysis
Set e4 to 1330664274 ;Resist Poison
Set e5 to 1213420370 ;Resist Shock
Set e6 to 1413563730 ;Restore Agility
Set a6 to 3
Set e7 to 1413563730 ; Restore Endurance
Set a7 to 5
ElseIf choice == 6
Set e0 to 1095124306 ; Restore Fatigue
Set e1 to 1162364242 ; Restore Health
Set e2 to 1413563730 ; Restore Intelligence
Set a2 to 1
Set e3 to 1413563730 ; Restore Luck
Set a3 to 7
Set e4 to 1347634514 ; Restore Magicka
Set e5 to 1413563730 ; Restore Personality
Set a5 to 6
Set e6 to 1413563730 ; Restore Speed
Set a6 to 4
Set e7 to 1413563730 ; Restore Strength
Set a7 to 0
ElseIf choice == 7
Set e0 to 1413563730 ; Restore Willpower
Set a0 to 2
Set e1 to 1145849939 ;Shield
Set e2 to 1195657299 ;Shock Damage
Set e3 to 1213417804 ;Shock Shield
Set e4 to 1129204819 ;Silence
Set e5 to 1380073815 ;Water Breathing
Set e6 to 1096237399 ;Water Walking
ElseIf choice == 8
Set asked to 99
return
EndIf
set i to Bag.GetNumItems - 1
Set n0 to 0
Set n1 to 0
Set n2 to 0
Set n3 to 0
Set n4 to 0
Set n5 to 0
Set n6 to 0
Set n7 to 0
Label 1
If i >= 0
set item to Bag.GetInventoryObject i
set Effects to GetMagicItemEffectCount item
set j to 0
If Effects > 0
Label
set effect to GetNthEICode item j
If effect == 1413564228 || effect == 1413566278 || effect == 1413563730
Set attribute to GetNthEIAV item j
Else
Set attribute to -1
EndIf
If effect == e0 && attribute == a0 || attribute == -1
Set n0 to n0 + 1
EndIf
If effect == e1 && attribute == a1 || attribute == -1
Set n1 to n1 + 1
EndIf
If effect == e2 && attribute == a2 || attribute == -1
Set n2 to n2 + 1
EndIf
If effect == e3 && attribute == a3 || attribute == -1
Set n3 to n3 + 1
EndIf
If effect == e4 && attribute == a4 || attribute == -1
Set n4 to n4 + 1
EndIf
If effect == e5 && attribute == a5 || attribute == -1
Set n5 to n5 + 1
EndIf
If effect == e6 && attribute == a6 || attribute == -1
Set n6 to n6 + 1
EndIf
If effect == e7 && attribute == a7 || attribute == -1
Set n7 to n7 + 1
EndIf
If j < Effects && j <= Alchemy / 25 - 1
set j to j + 1
Goto
EndIf
EndIf
set i to i - 1
Goto 1
Else
If choice == 0
MessageBox "Retrieve by which effect?
Burden : %.0f
Chameleon : %.0f
Cure Disease : %.0f
Cure Paralysis : %.0f
Cure Poison : %.0f
Damage Agility : %.0f
Damage Endurance : %.0f
Damage Fatigue : %.0f", n0, n1, n2, n3, n4, n5, n6, n7, "Burden", "Chameleon", "Cure Disease", "Cure Paralysis", "Cure Poison", "Damage Agility", "Damage Endurance", "Damage Fatigue", "Back"
ElseIf choice == 1
MessageBox "Retrieve by which effect?
Damage Health : %.0f
Damage Intelligence : %.0f
Damage Luck : %.0f
Damage Magicka : %.0f
Damage Personality : %.0f
Damage Speed : %.0f
Damage Strength : %.0f
Damage Willpower : %.0f", n0, n1, n2, n3, n4, n5, n6, n7, "Damage Health", "Damage Intelligence", "Damage Luck", "Damage Magicka", "Damage Personality", "Damage Speed", "Damage Strength", "Damage Willpower", "Back"
ElseIf choice == 2
MessageBox "Retrieve by which effect?
Detect Life : %.0f
Dispel : %.0f
Feather : %.0f
Fire Damage : %.0f
Fire Shield : %.0f
Fortify Agility : %.0f
Fortify Endurance : %.0f
Fortify Fatigue : %.0f", n0, n1, n2, n3, n4, n5, n6, n7, "Detect Life", "Dispel", "Feather", "Fire Damage", "Fire Shield", "Fortify Agility", "Fortify Endurance", "Fortify Fatigue", "Back"
ElseIf choice == 3
MessageBox "Retrieve by which effect?
Fortify Health : %.0f
Fortify Intelligence : %.0f
Fortify Luck : %.0f
Fortify Magicka : %.0f
Fortify Personality : %.0f
Fortify Speed : %.0f
Fortify Strength : %.0f
Fortify Willpower : %.0f", n0, n1, n2, n3, n4, n5, n6, n7, "Fortify Health", "Fortify Intelligence", "Fortify Luck", "Fortify Magicka", "Fortify Personality", "Fortify Speed", "Fortify Strength", "Fortify Willpower", "Back"
ElseIf choice == 4
MessageBox "Retrieve by which effect?
Frost Damage : %.0f
Frost Shield : %.0f
Invisibility : %.0f
Light : %.0f
Night-Eye : %.0f
Paralyze : %.0f
Reflect Damage : %.0f
Reflect Spell : %.0f", n0, n1, n2, n3, n4, n5, n6, n7, "Frost Damage", "Frost Shield", "Invisibility", "Light", "Night-Eye", "Paralyze", "Reflect Damage", "Reflect Spell", "Back"
ElseIf choice == 5
MessageBox "Retrieve by which effect?
Resist Disease : %.0f
Resist Fire : %.0f
Resist Frost : %.0f
Resist Paralysis : %.0f
Resist Poison : %.0f
Resist Shock : %.0f
Restore Agility : %.0f
Restore Endurance : %.0f", n0, n1, n2, n3, n4, n5, n6, n7, "Resist Disease", "Resist Fire", "Resist Frost", "Resist Paralysis", "Resist Poison", "Resist Shock", "Restore Agility", "Restore Endurance", "Back"
ElseIf choice == 6
MessageBox "Retrieve by which effect?
Restore Fatigue : %.0f
Restore Health : %.0f
Restore Intelligence : %.0f
Restore Luck : %.0f
Restore Magicka : %.0f
Restore Personality : %.0f
Restore Speed : %.0f
Restore Strength : %.0f", n0, n1, n2, n3, n4, n5, n6, n7, "Restore Fatigue", "Restore Health", "Restore Intelligence", "Restore Luck", "Restore Magicka", "Restore Personality", "Restore Speed", "Restore Strength", "Back"
ElseIf choice == 7
MessageBox "Retrieve by which effect?
Restore Willpower : %.0f
Shield : %.0f
Shock Damage : %.0f
Shock Shield : %.0f
Silence : %.0f
Water Breathing : %.0f
Water Walking : %.0f", n0, n1, n2, n3, n4, n5, n6, "Restore Willpower", "Shield", "Shock Damage", "Shock Shield", "Silence", "Water Breathing", "Water Walking", "Back"
EndIf
Set asked to 2
EndIf
ElseIf asked == 2
Set choice2 to GetButtonPressed
If choice2 == -1
return
ElseIf choice2 == 0
Set effect to e0
Set attribute to a0
ElseIf choice2 == 1
Set effect to e1
Set attribute to a1
ElseIf choice2 == 2
Set effect to e2
Set attribute to a2
ElseIf choice2 == 3
Set effect to e3
Set attribute to a3
ElseIf choice2 == 4
Set effect to e4
Set attribute to a4
ElseIf choice2 == 5
Set effect to e5
Set attribute to a5
ElseIf choice2 == 6
Set effect to e6
Set attribute to a6
ElseIf choice2 == 7 && choice != 7
Set effect to e7
Set attribute to a7
Else
Set asked to 0
return
EndIf
set i to Bag.GetNumItems - 1
Label 1
Set BAAutoMove to 0
If i >= 0
set item to Bag.GetInventoryObject i
set Effects to GetMagicItemEffectCount item
If Effects > 0
Set j to 0
Label
If GetNthEICode item j == effect && ((effect != 1413564228 && effect != 1413566278 && effect != 1413563730) || attribute == GetNthEIAV item j)
Set n to Bag.GetItemCount item
Player.AddItem item n
Bag.RemoveItem item n
Set Weight to Weight + (GetWeight item) * n
ElseIf j < Effects && j <= Alchemy / 25 - 1
Set j to j + 1
Goto
EndIf
EndIf
set i to i - 1
Goto 1
Else
Set BAWeight to BAWeight - Weight / BAWeightDiv
Set Weight to 0
Set asked to 99
EndIf
ElseIf asked == 99
Set asked to 0
StopQuest BAGet
Else
MessageBox "Choose a submenu:", "Burden - Damage Fatigue", "Damage Health - Damage Willpower", "Detect Life - Fortify Fatigue", "Fortify Health - Fortify Willpower", "Frost Damage - Reflect Spell", "Resist Disease - Restore Endurance", "Restore Fatigue - Restore Strength", "Restore Willpower - Water Walking", "Cancel"
set asked to 1
EndIf
End
Begin MenuMode 1002
if fQuestDelayTime != 0.001
set fQuestDelayTime to 0.001
Set Bag to BAContainerRef
EndIf
set alchemy to Player.GetBaseActorValue Alchemy
if asked == 1
Set choice to GetButtonPressed
If choice == -1
return
ElseIf choice == 0
Set e0 to 1313100354 ;Burden
Set e1 to 1280133187 ;Chameleon
Set e2 to 1229215043 ;Cure Disease
Set e3 to 1095783747 ;Cure Paralysis
Set e4 to 1330664771 ;Cure Poison
Set e5 to 1413564228 ;Damage Agility
Set a5 to 3
Set e6 to 1413564228 ;Damage Endurance
Set a6 to 5
Set e7 to 1095124804 ;Damage Fatigue
ElseIf choice == 1
Set e0 to 1162364740 ;Damage Health
Set e1 to 1413564228 ;Damage Intelligence
Set a1 to 1
Set e2 to 1413564228 ;Damage Luck
Set a2 to 7
Set e3 to 1347635012 ;Damage Magicka
Set e4 to 1413564228 ;Damage Personality
Set a4 to 6
Set e5 to 1413564228 ;Damage Speed
Set a5 to 4
Set e6 to 1413564228 ;Damage Strength
Set a6 to 0
Set e7 to 1413564228 ;Damage Willpower
Set a7 to 2
ElseIf choice == 2
Set e0 to 1413698628 ;Detect Life
Set e1 to 1280332612 ;Dispel
Set e2 to 1380471878 ;Feather
Set e3 to 1195657542 ;Fire Damage
Set e4 to 1213417798 ;Fire Shield
Set e5 to 1413566278 ;Fortify Agility
Set a5 to 3
Set e6 to 1413566278 ;Fortify Endurance
Set a6 to 5
Set e7 to 1095126854 ;Fortify Fatigue
ElseIf choice == 3
Set e0 to 1162366790 ;Fortify Health
Set e1 to 1413566278 ;Fortify Intelligence
Set a1 to 1
Set e2 to 1413566278 ;Fortify Luck
Set a2 to 7
Set e3 to 1347637062 ;Fortify Magicka
Set e4 to 1413566278 ;Fortify Personality
Set a4 to 6
Set e5 to 1413566278 ;Fortify Speed
Set a5 to 4
Set e6 to 1413566278 ;Fortify Strength
Set a6 to 0
Set e7 to 1413566278 ;Fortify Willpower
Set a7 to 2
ElseIf choice == 4
Set e0 to 1195659846 ;Frost Damage
Set e1 to 1213420102 ;Frost Shield
Set e2 to 1230392905 ;Invisibility
Set e3 to 1414022988 ;Light
Set e4 to 1163478350 ;Night-Eye
Set e5 to 1095909712 ;Paralyze
Set e6 to 1195656530 ;Reflect Damage
Set e7 to 1129072210 ;Reflect Spell
ElseIf choice == 5
Set e0 to 1229214546 ;Resist Disease
Set e1 to 1229345618 ;Resist Fire
Set e2 to 1380340562 ;Resist Frost
Set e3 to 1095783250 ;Resist Paralysis
Set e4 to 1330664274 ;Resist Poison
Set e5 to 1213420370 ;Resist Shock
Set e6 to 1413563730 ;Restore Agility
Set a6 to 3
Set e7 to 1413563730 ; Restore Endurance
Set a7 to 5
ElseIf choice == 6
Set e0 to 1095124306 ; Restore Fatigue
Set e1 to 1162364242 ; Restore Health
Set e2 to 1413563730 ; Restore Intelligence
Set a2 to 1
Set e3 to 1413563730 ; Restore Luck
Set a3 to 7
Set e4 to 1347634514 ; Restore Magicka
Set e5 to 1413563730 ; Restore Personality
Set a5 to 6
Set e6 to 1413563730 ; Restore Speed
Set a6 to 4
Set e7 to 1413563730 ; Restore Strength
Set a7 to 0
ElseIf choice == 7
Set e0 to 1413563730 ; Restore Willpower
Set a0 to 2
Set e1 to 1145849939 ;Shield
Set e2 to 1195657299 ;Shock Damage
Set e3 to 1213417804 ;Shock Shield
Set e4 to 1129204819 ;Silence
Set e5 to 1380073815 ;Water Breathing
Set e6 to 1096237399 ;Water Walking
ElseIf choice == 8
Set asked to 99
return
EndIf
set i to Bag.GetNumItems - 1
Set n0 to 0
Set n1 to 0
Set n2 to 0
Set n3 to 0
Set n4 to 0
Set n5 to 0
Set n6 to 0
Set n7 to 0
Label 1
If i >= 0
set item to Bag.GetInventoryObject i
set Effects to GetMagicItemEffectCount item
set j to 0
If Effects > 0
Label
set effect to GetNthEICode item j
If effect == 1413564228 || effect == 1413566278 || effect == 1413563730
Set attribute to GetNthEIAV item j
Else
Set attribute to -1
EndIf
If effect == e0 && attribute == a0 || attribute == -1
Set n0 to n0 + 1
EndIf
If effect == e1 && attribute == a1 || attribute == -1
Set n1 to n1 + 1
EndIf
If effect == e2 && attribute == a2 || attribute == -1
Set n2 to n2 + 1
EndIf
If effect == e3 && attribute == a3 || attribute == -1
Set n3 to n3 + 1
EndIf
If effect == e4 && attribute == a4 || attribute == -1
Set n4 to n4 + 1
EndIf
If effect == e5 && attribute == a5 || attribute == -1
Set n5 to n5 + 1
EndIf
If effect == e6 && attribute == a6 || attribute == -1
Set n6 to n6 + 1
EndIf
If effect == e7 && attribute == a7 || attribute == -1
Set n7 to n7 + 1
EndIf
If j < Effects && j <= Alchemy / 25 - 1
set j to j + 1
Goto
EndIf
EndIf
set i to i - 1
Goto 1
Else
If choice == 0
MessageBox "Retrieve by which effect?
Burden : %.0f
Chameleon : %.0f
Cure Disease : %.0f
Cure Paralysis : %.0f
Cure Poison : %.0f
Damage Agility : %.0f
Damage Endurance : %.0f
Damage Fatigue : %.0f", n0, n1, n2, n3, n4, n5, n6, n7, "Burden", "Chameleon", "Cure Disease", "Cure Paralysis", "Cure Poison", "Damage Agility", "Damage Endurance", "Damage Fatigue", "Back"
ElseIf choice == 1
MessageBox "Retrieve by which effect?
Damage Health : %.0f
Damage Intelligence : %.0f
Damage Luck : %.0f
Damage Magicka : %.0f
Damage Personality : %.0f
Damage Speed : %.0f
Damage Strength : %.0f
Damage Willpower : %.0f", n0, n1, n2, n3, n4, n5, n6, n7, "Damage Health", "Damage Intelligence", "Damage Luck", "Damage Magicka", "Damage Personality", "Damage Speed", "Damage Strength", "Damage Willpower", "Back"
ElseIf choice == 2
MessageBox "Retrieve by which effect?
Detect Life : %.0f
Dispel : %.0f
Feather : %.0f
Fire Damage : %.0f
Fire Shield : %.0f
Fortify Agility : %.0f
Fortify Endurance : %.0f
Fortify Fatigue : %.0f", n0, n1, n2, n3, n4, n5, n6, n7, "Detect Life", "Dispel", "Feather", "Fire Damage", "Fire Shield", "Fortify Agility", "Fortify Endurance", "Fortify Fatigue", "Back"
ElseIf choice == 3
MessageBox "Retrieve by which effect?
Fortify Health : %.0f
Fortify Intelligence : %.0f
Fortify Luck : %.0f
Fortify Magicka : %.0f
Fortify Personality : %.0f
Fortify Speed : %.0f
Fortify Strength : %.0f
Fortify Willpower : %.0f", n0, n1, n2, n3, n4, n5, n6, n7, "Fortify Health", "Fortify Intelligence", "Fortify Luck", "Fortify Magicka", "Fortify Personality", "Fortify Speed", "Fortify Strength", "Fortify Willpower", "Back"
ElseIf choice == 4
MessageBox "Retrieve by which effect?
Frost Damage : %.0f
Frost Shield : %.0f
Invisibility : %.0f
Light : %.0f
Night-Eye : %.0f
Paralyze : %.0f
Reflect Damage : %.0f
Reflect Spell : %.0f", n0, n1, n2, n3, n4, n5, n6, n7, "Frost Damage", "Frost Shield", "Invisibility", "Light", "Night-Eye", "Paralyze", "Reflect Damage", "Reflect Spell", "Back"
ElseIf choice == 5
MessageBox "Retrieve by which effect?
Resist Disease : %.0f
Resist Fire : %.0f
Resist Frost : %.0f
Resist Paralysis : %.0f
Resist Poison : %.0f
Resist Shock : %.0f
Restore Agility : %.0f
Restore Endurance : %.0f", n0, n1, n2, n3, n4, n5, n6, n7, "Resist Disease", "Resist Fire", "Resist Frost", "Resist Paralysis", "Resist Poison", "Resist Shock", "Restore Agility", "Restore Endurance", "Back"
ElseIf choice == 6
MessageBox "Retrieve by which effect?
Restore Fatigue : %.0f
Restore Health : %.0f
Restore Intelligence : %.0f
Restore Luck : %.0f
Restore Magicka : %.0f
Restore Personality : %.0f
Restore Speed : %.0f
Restore Strength : %.0f", n0, n1, n2, n3, n4, n5, n6, n7, "Restore Fatigue", "Restore Health", "Restore Intelligence", "Restore Luck", "Restore Magicka", "Restore Personality", "Restore Speed", "Restore Strength", "Back"
ElseIf choice == 7
MessageBox "Retrieve by which effect?
Restore Willpower : %.0f
Shield : %.0f
Shock Damage : %.0f
Shock Shield : %.0f
Silence : %.0f
Water Breathing : %.0f
Water Walking : %.0f", n0, n1, n2, n3, n4, n5, n6, "Restore Willpower", "Shield", "Shock Damage", "Shock Shield", "Silence", "Water Breathing", "Water Walking", "Back"
EndIf
Set asked to 2
EndIf
ElseIf asked == 2
Set choice2 to GetButtonPressed
If choice2 == -1
return
ElseIf choice2 == 0
Set effect to e0
Set attribute to a0
ElseIf choice2 == 1
Set effect to e1
Set attribute to a1
ElseIf choice2 == 2
Set effect to e2
Set attribute to a2
ElseIf choice2 == 3
Set effect to e3
Set attribute to a3
ElseIf choice2 == 4
Set effect to e4
Set attribute to a4
ElseIf choice2 == 5
Set effect to e5
Set attribute to a5
ElseIf choice2 == 6
Set effect to e6
Set attribute to a6
ElseIf choice2 == 7 && choice != 7
Set effect to e7
Set attribute to a7
Else
Set asked to 0
return
EndIf
set i to Bag.GetNumItems - 1
Label 1
Set BAAutoMove to 0
If i >= 0
set item to Bag.GetInventoryObject i
set Effects to GetMagicItemEffectCount item
If Effects > 0
Set j to 0
Label
If GetNthEICode item j == effect && ((effect != 1413564228 && effect != 1413566278 && effect != 1413563730) || attribute == GetNthEIAV item j)
Set n to Bag.GetItemCount item
Player.AddItem item n
Bag.RemoveItem item n
Set Weight to Weight + (GetWeight item) * n
ElseIf j < Effects && j <= Alchemy / 25 - 1
Set j to j + 1
Goto
EndIf
EndIf
set i to i - 1
Goto 1
Else
Set BAWeight to BAWeight - Weight / BAWeightDiv
Set Weight to 0
Set asked to 99
EndIf
ElseIf asked == 99
Set asked to 0
StopQuest BAGet
Else
MessageBox "Choose a submenu:", "Burden - Damage Fatigue", "Damage Health - Damage Willpower", "Detect Life - Fortify Fatigue", "Fortify Health - Fortify Willpower", "Frost Damage - Reflect Spell", "Resist Disease - Restore Endurance", "Restore Fatigue - Restore Strength", "Restore Willpower - Water Walking", "Cancel"
set asked to 1
EndIf
End