Hi, I'm making an item building system and everything works fine, it's just that it gives the wrong item for some reason I fail to see. It seems so obvious to me that it should work, but clearly I'm wrong. Can someone please help me with this?
-
Build Items Variables
-

Events
-


Time - Elapsed game time is 0.00 seconds
-
-

Conditions
-

Actions
-


-------- -------------------------------------------------------------------------------------- --------
-


-------- This is the finishing product of the recipe --------
-


Set Items_BuildItem[1] = |cFFFF9E00Book of the Ancients|r
-


-------- --------
-


Set Items_IngredientsAmount[1] = 4
-


Set Items_BuildIntStart[1] = 1
-


-------- --------
-


Set Items_Ingredients[1] = |cFF14CD00Robin's Hood|r
-


Set Items_Ingredients[2] = |cFF14CD00Talisman of Agility|r
-


Set Items_Ingredients[3] = |cFF14CD00Maul of Strength|r
-


Set Items_Ingredients[4] = |cFFFFCC99Recipe: Book of the Ancients|r
-


-------- -------------------------------------------------------------------------------------- --------
-


Set Items_BuildItem[2] = |cFFFF9E00Heart of Vitality|r
-


-------- --------
-


Set Items_IngredientsAmount[2] = 4
-


Set Items_BuildIntStart[2] = 5
-


-------- --------
-


Set Items_Ingredients[5] = |cFF14CD00Robin's Hood|r
-


Set Items_Ingredients[6] = |cFF14CD00Talisman of Agility|r
-


Set Items_Ingredients[7] = |cFF14CD00Periapt of Vitality|r
-


Set Items_Ingredients[8] = |cFFFFCC99Recipe: Heart of Vitality|r
-


Set Items_IngredientNumber[6] = 2
-


-------- -------------------------------------------------------------------------------------- --------
-


Set Items_BuildItem[3] = |cFFFF9E00Holzpfeife|r
-


-------- --------
-


Set Items_IngredientsAmount[3] = 4
-


Set Items_BuildIntStart[3] = 9
-


-------- --------
-


Set Items_Ingredients[9] = |cFF14CD00Robin's Hood|r
-


Set Items_Ingredients[10] = |cFF14CD00Manteau Doux|r
-


Set Items_Ingredients[11] = |cFF14CD00Claws of Attack|r
-


Set Items_Ingredients[12] = |cFFFFCC99Recipe: Holzpfeife|r
-


-------- -------------------------------------------------------------------------------------- --------
-


-------- --------
-


-------- This is the number of buildable items --------
-


Set Items_BuildableAmount = 3
-
-
-
Build Items
-

Events
-


Unit - A unit Acquires an item
-
-

Conditions
-

Actions
-


Set unit = (Hero manipulating item)
-


Set item = (Item being manipulated)
-


-------- From 1 to last item --------
-


For each (Integer A) from 1 to Items_BuildableAmount, do (Actions)
-



Loop - Actions
-




-------- Set end ingredient --------
-




Set int = (Items_BuildIntStart[(Integer A)] + (Items_IngredientsAmount[(Integer A)] - 1))
-




For each (Integer B) from Items_BuildIntStart[(Integer A)] to int, do (Actions)
-





Loop - Actions
-






-------- If acquired item is an ingredient --------
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(Item-type of item) Equal to Items_Ingredients[(Integer B)]
-
-







Then - Actions
-








-------- Check for all ingredients --------
-








Set int3 = 0
-








For each (Integer Integer_C) from Items_BuildIntStart[(Integer A)] to int, do (Actions)
-









Loop - Actions
-










If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-











If - Conditions
-












(unit has an item of type Items_Ingredients[Integer_C]) Equal to True
-
-











Then - Actions
-












Set int2 = 0
-












For each (Integer Integer_D) from 1 to 6, do (Actions)
-













Loop - Actions
-














-------- Count number of ingredients of type --------
-














If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-















If - Conditions
-
















(Item-type of (Item carried by unit in slot Integer_D)) Equal to Items_Ingredients[Integer_C]
-
-















Then - Actions
-
















Set int2 = (int2 + 1)
-
-















Else - Actions
-
-
-
-












-------- Count how many ingredients have correct number of items --------
-












If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-













If - Conditions
-














int2 Greater than or equal to Items_IngredientNumber[Integer_C]
-
-













Then - Actions
-














Set int3 = (int3 + 1)
-
-













Else - Actions
-
-
-











Else - Actions
-
-
-
-








-------- If all ingredients have correct number of items --------
-








If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-









If - Conditions
-










int3 Equal to Items_IngredientsAmount[(Integer A)]
-
-









Then - Actions
-










-------- Remove items and give new item --------
-










For each (Integer Integer_C) from Items_BuildIntStart[(Integer A)] to int, do (Actions)
-











Loop - Actions
-












For each (Integer Integer_D) from 1 to Items_IngredientNumber[Integer_C], do (Actions)
-













Loop - Actions
-














Item - Remove (Item carried by unit of type Items_Ingredients[Integer_C])
-
-
-
-
-










-------- This is where it gets weird with creating the item --------
-










Hero - Create Items_Build[(Integer A)] and give it to unit
-










Special Effect - Create a special effect attached to the origin of unit using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
-










Special Effect - Destroy (Last created special effect)
-
-









Else - Actions
-
-
-







Else - Actions
-
-
-
-
-
-
-
Last edited:



