ScriptName NNWMaterialSortierSkript Extends ObjectReference

Import Utility

Keyword Property NNWErz Auto
Keyword Property NNWBarren Auto
Keyword Property NNWMaterial Auto
ObjectReference Property ErzKiste Auto Hidden
ObjectReference Property BarrenKiste Auto Hidden
ObjectReference Property MaterialKiste Auto Hidden
MiscObject[] Property MaterialListe Auto
Actor Property PlayerRef Auto

int Menge = 0

Function MaterialEinlagern()

ErzKiste = GetLinkedRef(NNWErz)
BarrenKiste = GetLinkedRef(NNWBarren)
MaterialKiste = GetLinkedRef(NNWMaterial)

Menge = PlayerRef.GetItemCount(MaterialListe[0])
if(Menge >0)
ErzKiste.Additem(MaterialListe[0], Menge)
PlayerRef.RemoveItem(MaterialListe[0], Menge)
endif

Menge = PlayerRef.GetItemCount(MaterialListe[1])
if(Menge > 0)
ErzKiste.Additem(MaterialListe[1], Menge)
PlayerRef.RemoveItem(MaterialListe[1], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[2])
if(Menge > 0)
ErzKiste.Additem(MaterialListe[2], Menge)
PlayerRef.RemoveItem(MaterialListe[2], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[3])
if(Menge > 0)
ErzKiste.Additem(MaterialListe[3], Menge)
PlayerRef.RemoveItem(MaterialListe[3], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[4])
if(Menge > 0)
ErzKiste.Additem(MaterialListe[4], Menge)
PlayerRef.RemoveItem(MaterialListe[4], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[5])
if(Menge > 0)
ErzKiste.Additem(MaterialListe[5], Menge)
PlayerRef.RemoveItem(MaterialListe[5], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[6])
if(Menge > 0)
ErzKiste.Additem(MaterialListe[6], Menge)
PlayerRef.RemoveItem(MaterialListe[6], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[7])
if(Menge > 0)
ErzKiste.Additem(MaterialListe[7], Menge)
PlayerRef.RemoveItem(MaterialListe[7], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[8])
if(Menge > 0)
ErzKiste.Additem(MaterialListe[8], Menge)
PlayerRef.RemoveItem(MaterialListe[8], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[9])
if(Menge > 0)
BarrenKiste.Additem(MaterialListe[9], Menge)
PlayerRef.RemoveItem(MaterialListe[9], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[10])
if(Menge > 0)
BarrenKiste.Additem(MaterialListe[10], Menge)
PlayerRef.RemoveItem(MaterialListe[10], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[11])
if(Menge > 0)
BarrenKiste.Additem(MaterialListe[11], Menge)
PlayerRef.RemoveItem(MaterialListe[11], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[12])
if(Menge > 0)
BarrenKiste.Additem(MaterialListe[12], Menge)
PlayerRef.RemoveItem(MaterialListe[12], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[13])
if(Menge > 0)
BarrenKiste.Additem(MaterialListe[13], Menge)
PlayerRef.RemoveItem(MaterialListe[13], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[14])
if(Menge > 0)
BarrenKiste.Additem(MaterialListe[14], Menge)
PlayerRef.RemoveItem(MaterialListe[14], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[14])
if(Menge > 0)
BarrenKiste.Additem(MaterialListe[14], Menge)
PlayerRef.RemoveItem(MaterialListe[14], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[15])
if(Menge > 0)
BarrenKiste.Additem(MaterialListe[15], Menge)
PlayerRef.RemoveItem(MaterialListe[15], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[16])
if(Menge > 0)
BarrenKiste.Additem(MaterialListe[16], Menge)
PlayerRef.RemoveItem(MaterialListe[16], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[17])
if(Menge > 0)
BarrenKiste.Additem(MaterialListe[17], Menge)
PlayerRef.RemoveItem(MaterialListe[17], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[18])
if(Menge > 0)
BarrenKiste.Additem(MaterialListe[18], Menge)
PlayerRef.RemoveItem(MaterialListe[18], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[19])
if(Menge > 0)
BarrenKiste.Additem(MaterialListe[19], Menge)
PlayerRef.RemoveItem(MaterialListe[19], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[20])
if(Menge > 0)
MaterialKiste.Additem(MaterialListe[20], Menge)
PlayerRef.RemoveItem(MaterialListe[20], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[21])
if(Menge > 0)
MaterialKiste.Additem(MaterialListe[21], Menge)
PlayerRef.RemoveItem(MaterialListe[21], Menge)
EndIf

Menge = PlayerRef.GetItemCount(MaterialListe[22])
if(Menge > 0)
MaterialKiste.Additem(MaterialListe[22], Menge)
PlayerRef.RemoveItem(MaterialListe[22], Menge)
EndIf
EndFunction
Event OnActivate(ObjectReference akActionRef)
	MaterialEinlagern()
EndEvent