Array_var invItems
Array_var invTemp
Array_var invRefs
ref rItem
ref refItem
ref plsRef
Short weaponAusgabe
Short enchantedAusgabe
int zzzTestVal1
float zzzTestVal2
float zzzTestVal3
Begin GameMode
let invTemp := ar_Construct Array
let invItems := Player.GetItems 33
Set weaponAusgabe to 0
Set enchantedAusgabe to 0
Set zzzTestVal1 to 0
Set zzzTestVal2 to 0
ForEach invTemp<- invItems
let rItem := invTemp["value"]
let refItem := *invTemp
Set weaponAusgabe to weaponAusgabe + 1
let invRefs := player.GetInvRefsForItem rItem
let plsRef := invRefs[0]
if GetObjectCharge rItem != zzzTestVal1
Set zzzTestVal1 to GetObjectCharge rItem
EndIf
if plsRef.GetCurrentCharge > 0
Set zzzTestVal2 to plsRef.GetCurrentCharge
plsRef.ModCurrentCharge 20
Set zzzTestVal3 to plsRef.GetCurrentCharge
EndIf
Loop
Message "%.0f waffen! %0.f enchanted! TestVal1 %.0f. TestVal2 %0.f. TestVal3 %0.f", weaponAusgabe, enchantedAusgabe, zzzTestVal1, zzzTestVal2, zzzTestVal3, 2
let invTemp := ar_Null
let invItems := ar_Null
End
That's what i used for 1. As i said, i could see the value changing for the plsRef-variable/reference, but it didnt reflect ingame (i tested with a weapon with 856/1600 charge, which stayed at 856).