short counted ; a switchshort numberitems ; number of unique items in chestshort itemcount ; number of items in stackshort itemtype ; variable for item typeshort firetotal ; running total of fire effectslong effecttype ; variable for effect typeref itemref ; reference varible for items in chestref effectref ; variable for magic effect on itemif (counted == 0) set numberitems to containerref.getnumitems set counted to 1 set effecttype to GetMagicEffectCode FIDG ; set effect type to fire damage, in this case.endifif (numberitems >= 0) set itemref to containerref.getinventoryobject numberitems set itemtype to itemref.getobjecttype set itemcount to containerref.getitemcount itemref if (itemtype == 25) ; if it is an ingredient if (effecttype == GetNthEffectItemCode itemref 1) ; if it has the right effect in the first spot set firetotal to (firetotal + (itemcount * multiplier)) ; multiplier is whatever you had it set to. set numberitems to (numberitems - 1) return endif if (effecttype == GetNthEffectItemCode itemref 2) set firetotal to (firetotal + (itemcount * multiplier)) ; multiplier is whatever you had it set to. set numberitems to (numberitems - 1) return endif if (effecttype == GetNthEffectItemCode itemref 3) set firetotal to (firetotal + (itemcount * multiplier)) ; multiplier is whatever you had it set to. set numberitems to (numberitems - 1) return endif if (effecttype == GetNthEffectItemCode itemref 4) set firetotal to (firetotal + (itemcount * multiplier)) ; multiplier is whatever you had it set to. set numberitems to (numberitems - 1) return endif endifendif