Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function TrySellStorage(ObjectReference akSourceContainer = None, Int aiIndex = 0, Form akForm = None)
- aiIndex = akSourceContainer.GetNumItems()
- If (aiIndex >= 1) ;Objects exist in storage container
- While (aiIndex > 0)
- aiIndex -= 1
- akForm = akSourceContainer.GetNthForm(aiIndex)
- Int counter = akSourceContainer.GetItemCount(akForm)
- While (counter >= 1) ;same object type still exists
- counter -= 1
- If (akForm.GetGoldValue() <= 5)
- If (Utility.RandomInt(1,100) <= 95)
- SeptimsSold += akForm.GetGoldValue()
- akSourceContainer.RemoveItem(akForm, 1)
- EndIf
- ElseIf ((akForm.GetGoldValue() >= 6) && (akForm.GetGoldValue() <= 20))
- If (Utility.RandomInt(1,100) <= 90)
- SeptimsSold += akForm.GetGoldValue()
- akSourceContainer.RemoveItem(akForm, 1)
- EndIf
- ElseIf ((akForm.GetGoldValue() >= 21) && (akForm.GetGoldValue() <= 50))
- If (Utility.RandomInt(1,100) <= 75)
- SeptimsSold += akForm.GetGoldValue()
- akSourceContainer.RemoveItem(akForm, 1)
- EndIf
- ElseIf ((akForm.GetGoldValue() >= 51) && (akForm.GetGoldValue() <= 100))
- If (Utility.RandomInt(1,100) <= 50)
- SeptimsSold += akForm.GetGoldValue()
- akSourceContainer.RemoveItem(akForm, 1)
- EndIf
- ElseIf ((akForm.GetGoldValue() >= 101) && (akForm.GetGoldValue() <= 250))
- If (Utility.RandomInt(1,100) <= 40)
- SeptimsSold += akForm.GetGoldValue()
- akSourceContainer.RemoveItem(akForm, 1)
- EndIf
- ElseIf ((akForm.GetGoldValue() >= 251) && (akForm.GetGoldValue() <= 500))
- If (Utility.RandomInt(1,100) <= 30)
- SeptimsSold += akForm.GetGoldValue()
- akSourceContainer.RemoveItem(akForm, 1)
- EndIf
- ElseIf ((akForm.GetGoldValue() >= 501) && (akForm.GetGoldValue() <= 750))
- If (Utility.RandomInt(1,100) <= 20)
- SeptimsSold += akForm.GetGoldValue()
- akSourceContainer.RemoveItem(akForm, 1)
- EndIf
- ElseIf ((akForm.GetGoldValue() >= 751) && (akForm.GetGoldValue() <= 1000))
- If (Utility.RandomInt(1,100) <= 10)
- SeptimsSold += akForm.GetGoldValue()
- akSourceContainer.RemoveItem(akForm, 1)
- EndIf
- ElseIf (akForm.GetGoldValue() >= 1001)
- If (Utility.RandomInt(1,100) <= 5)
- SeptimsSold += akForm.GetGoldValue()
- akSourceContainer.RemoveItem(akForm, 1)
- EndIf
- EndIf
- ;
- ;If (akForm.GetType() == 23) ;if object is scroll
- ; ; calc scroll shit
- ;ElseIf (akForm.GetType() == 26) ;if object is armor
- ; ;Armor TestArmor = akForm as Armor
- ;
- ; If ((akForm as Armor).IsJewelry())
- ; If (Utility.RandomInt(1,100) <= 30)
- ; akSourceContainer.RemoveItem(akForm, 1)
- ; EndIf
- ; EndIf
- ;EndIf
- EndWhile
- EndWhile
- EndIf
- EndFunction
Advertisement
Add Comment
Please, Sign In to add comment