Hey guys
I need to do so, when I buy an item "Craft", it checks if the Working Bench (selling unit) has 2 Oakwoods and the recipe in it.
How do I check if a Hero carries 2 of the same item in its inventory?
I still don't know my way all around the conditions, so I have a hard time finding the right ones.
What I've made so far:
Thanks for dropping by!
I need to do so, when I buy an item "Craft", it checks if the Working Bench (selling unit) has 2 Oakwoods and the recipe in it.
How do I check if a Hero carries 2 of the same item in its inventory?
I still don't know my way all around the conditions, so I have a hard time finding the right ones.
What I've made so far:
-
Working Bench Craft Craftsmanship
-
Events
- Unit - A unit Sells an item (from shop)
-
Conditions
- (Item-type of (Sold Item)) Equal to Crafting: Craft
-
Actions
- Set ItemCounter_Limiter = 0
- Set ItemCounter_PickUpUnit = (Triggering unit)
- Set ItemCounter_Inventory = (Size of inventory for ItemCounter_PickUpUnit)
-
For each (Integer ItemCounter_Loop) from 1 to ItemCounter_Inventory, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Item level of (Item carried by ItemCounter_PickUpUnit in slot ItemCounter_Loop)) Equal to 7
- (ItemCounter_PickUpUnit has an item of type Oakwood) Equal to True
-
Then - Actions
- Set ItemCounter_Limiter = (ItemCounter_Limiter + 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ItemCounter_Limiter Equal to 2
-
Then - Actions
-
For each (Integer ItemCounter_Loop) from 1 to ItemCounter_Inventory, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ItemCounter_Limiter Not equal to 0
-
Then - Actions
- Item - Remove (Item carried by ItemCounter_PickUpUnit of type Oakwood)
- Set ItemCounter_Limiter = (ItemCounter_Limiter - 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Hero - Create Oakwood Craftsmanship and give it to ItemCounter_PickUpUnit
-
For each (Integer ItemCounter_Loop) from 1 to ItemCounter_Inventory, do (Actions)
- Else - Actions
-
If - Conditions
-
Events
- (Item level of (Item carried by ItemCounter_PickUpUnit in slot ItemCounter_Loop)) Equal to 7
Thanks for dropping by!
Last edited: