• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Create Item Recipes Using Item Stacking


--------------------------------------------------------------------------------------
BEFORE YOU READ THIS TUTORIAL, YOU MUST READ THIS TUTORIAL FIRST:
http://www.hiveworkshop.com/forums/f279/rdzs-incredible-item-stacking-system-doom-20961/
--------------------------------------------------------------------------------------
Introduction:
Hello, all. In this tutorial, I will show you how to make item recipes using item stacking. You must first read RDZ's Incredible Item Stacking System of Doom before you read on.
--------------------------------------------------------------------------------------
What You Need:
Warcraft 3: TFT World Editor
A moderate knowledge of GUI triggering
Knowledge from RDZ's Incredible Item Stacking System of Doom
--------------------------------------------------------------------------------------
Variables:
ItemMerge1 = Item-Type
ItemMerge2 = Item-Type
ItemMerge3 = Item-Type
ItemMergeCharge1 = Integer
ItemMergeCharge2 = Integer
ItemMergeCharge3 = Integer
--------------------------------------------------------------------------------------
Step One:
  • Makrura Shell Armor
    • Events
      • Unit - A unit Acquires an item
The first step to creating the trigger is to set the event to "Unit - A unit Acquires an item."

Step Two:
On to the conditions:
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • (Item-type of (Item being manipulated)) Equal to Makrura Shell Armor Recipe
        • (Charges remaining in (Item carried by (Hero manipulating item) of type Makrura Shell Armor Recipe)) Greater than or equal to 1
        • (Item-type of (Item being manipulated)) Equal to |c007d7d7dMakrura Shell|r
        • (Charges remaining in (Item carried by (Hero manipulating item) of type |c007d7d7dMakrura Shell|r)) Greater than or equal to 1
        • (Item-type of (Item being manipulated)) Equal to |c007d7d7dBronze Ingot|r
        • (Charges remaining in (Item carried by (Hero manipulating item) of type |c007d7d7dBronze Ingot|r)) Greater than or equal to 1
The conditions checks to see if any of the non-runic items are owned inside the unit's inventory or if it is picked up. The recipe for the item being made needs to have a charge (recommended unless you can find another way to make it work without a charge). It also needs to check for the charges because if it does not, it will not implement properly if you pick up the recipe first, hence why I said to set it to have a charge.

Step Three:
The actions:
  • Actions
    • Set ItemMerge1 = |c007d7d7dMakrura Shell|r
    • Set ItemMerge2 = |c007d7d7dBronze Ingot|r
    • Set ItemMerge3 = Makrura Shell Armor Recipe
    • Set ItemMergeCharge1 = (Charges remaining in (Item carried by (Hero manipulating item) of type |c007d7d7dMakrura Shell|r))
    • Set ItemMergeCharge2 = (Charges remaining in (Item carried by (Hero manipulating item) of type |c007d7d7dBronze Ingot|r))
    • Set ItemMergeCharge3 = (Charges remaining in (Item carried by (Hero manipulating item) of type Makrura Shell Armor Recipe))
Here for the first actions, you set up the variables. Set the first three variables to the items being combined. Set the last three variables to the charges remaining on the items being combined. I will explain why later on in the tutorial.

Step Four:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Hero has an item of type ItemMerge1) Equal to True
          • (Hero has an item of type ItemMerge2) Equal to True
          • (Hero has an item of type ItemMerge3) Equal to True
          • ItemMergeCharge1 Greater than or equal to 3
          • ItemMergeCharge2 Greater than or equal to 2
          • ItemMergeCharge3 Greater than or equal to 1
    • Then - Actions
    • Else - Actions
Here in step four, the action checks if the items are owned for assurance and to see if the items have enough charges on them to continue the rest of the trigger. The first item, which is the Makrura shells, will require 3 of them in the charges or above. The bronze ingots require 2 charges or above and the recipe requires 1 or above.

Step Five:
  • Then - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ItemMergeCharge1 Equal to 3
      • Then - Actions
        • Item - Remove (Item carried by Hero of type ItemMerge1)
      • Else - Actions
        • Item - Set charges remaining in (Item carried by Hero of type ItemMerge1) to (ItemMergeCharge1 - 3)
The first action in the first "Then" of the first "If" action will check to see if the Makrura shells have exactly enough charges in them to be removed from the unit's inventory. If there is more than enough, it will subtract 3 from the charges on the Makrura shells and set the new charges to the difference.
Step Six:
  • Then - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ItemMergeCharge1 Equal to 3
      • Then - Actions
        • Item - Remove (Item carried by Hero of type ItemMerge1)
      • Else - Actions
        • Item - Set charges remaining in (Item carried by Hero of type ItemMerge1) to (ItemMergeCharge1 - 3)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ItemMergeCharge2 Equal to 2
      • Then - Actions
        • Item - Remove (Item carried by Hero of type ItemMerge2)
      • Else - Actions
        • Item - Set charges remaining in (Item carried by Hero of type ItemMerge1) to (ItemMergeCharge2 - 2)
The second action does the same thing as the step five.
Step Seven:
  • Then - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ItemMergeCharge1 Equal to 3
      • Then - Actions
        • Item - Remove (Item carried by Hero of type ItemMerge1)
      • Else - Actions
        • Item - Set charges remaining in (Item carried by Hero of type ItemMerge1) to (ItemMergeCharge1 - 3)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ItemMergeCharge2 Equal to 2
      • Then - Actions
        • Item - Remove (Item carried by Hero of type ItemMerge2)
      • Else - Actions
        • Item - Set charges remaining in (Item carried by Hero of type ItemMerge2) to (ItemMergeCharge2 - 2)
    • Item - Remove (Item carried by Hero of type ItemMerge3)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ItemMergeCharge3 Equal to 1
      • Then - Actions
        • Item - Remove (Item carried by Hero of type ItemMerge3)
      • Else - Actions
        • Item - Set charges remaining in (Item carried by Hero of type ItemMerge3) to (ItemMergeCharge3 - 1)
Again, it does the same action as step five and six.

Step Eight:
  • Then - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ItemMergeCharge1 Equal to 3
      • Then - Actions
        • Item - Remove (Item carried by Hero of type ItemMerge1)
      • Else - Actions
        • Item - Set charges remaining in (Item carried by Hero of type ItemMerge1) to (ItemMergeCharge1 - 3)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ItemMergeCharge2 Equal to 2
      • Then - Actions
        • Item - Remove (Item carried by Hero of type ItemMerge2)
      • Else - Actions
        • Item - Set charges remaining in (Item carried by Hero of type ItemMerge2) to (ItemMergeCharge2 - 2)
    • Item - Remove (Item carried by Hero of type ItemMerge3)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ItemMergeCharge3 Equal to 1
      • Then - Actions
        • Item - Remove (Item carried by Hero of type ItemMerge3)
      • Else - Actions
        • Item - Set charges remaining in (Item carried by Hero of type ItemMerge3) to (ItemMergeCharge3 - 1)
    • Hero - Create Makrura Shell Armor and give it to (Hero manipulating item)
    • Special Effect - Create a special effect attached to the overhead of (Hero manipulating item) using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
    • Set SpecialEffect = (Last created special effect)
    • Floating Text - Create floating text that reads You made |c006969FF... above (Hero manipulating item) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Set the velocity of (Last created floating text) to 80.00 towards 90.00 degrees
    • Floating Text - Change (Last created floating text): Disable permanence
    • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
    • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
    • Wait 2.00 seconds
    • Special Effect - Destroy SpecialEffect
After checking and removing the items/item charges, we move on the the part of the trigger where it makes the target item being created. (The special effects and floating text is optional)
--------------------------------------------------------------------------------------
Conclusion:
After all that work on the trigger, it should come out like this:
  • Makrura Shell Armor
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Makrura Shell Armor Recipe
          • (Charges remaining in (Item carried by (Hero manipulating item) of type Makrura Shell Armor Recipe)) Greater than or equal to 1
          • (Item-type of (Item being manipulated)) Equal to |c007d7d7dMakrura Shell|r
          • (Charges remaining in (Item carried by (Hero manipulating item) of type |c007d7d7dMakrura Shell|r)) Greater than or equal to 1
          • (Item-type of (Item being manipulated)) Equal to |c007d7d7dBronze Ingot|r
          • (Charges remaining in (Item carried by (Hero manipulating item) of type |c007d7d7dBronze Ingot|r)) Greater than or equal to 1
    • Actions
      • Set ItemMerge1 = |c007d7d7dMakrura Shell|r
      • Set ItemMerge2 = |c007d7d7dBronze Ingot|r
      • Set ItemMerge3 = Makrura Shell Armor Recipe
      • Set ItemMergeCharge1 = (Charges remaining in (Item carried by (Hero manipulating item) of type |c007d7d7dMakrura Shell|r))
      • Set ItemMergeCharge2 = (Charges remaining in (Item carried by (Hero manipulating item) of type |c007d7d7dBronze Ingot|r))
      • Set ItemMergeCharge3 = (Charges remaining in (Item carried by (Hero manipulating item) of type Makrura Shell Armor Recipe))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Hero has an item of type ItemMerge1) Equal to True
              • (Hero has an item of type ItemMerge2) Equal to True
              • (Hero has an item of type ItemMerge3) Equal to True
              • ItemMergeCharge1 Greater than or equal to 3
              • ItemMergeCharge2 Greater than or equal to 2
              • ItemMergeCharge3 Greater than or equal to 1
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ItemMergeCharge1 Equal to 3
            • Then - Actions
              • Item - Remove (Item carried by Hero of type ItemMerge1)
            • Else - Actions
              • Item - Set charges remaining in (Item carried by Hero of type ItemMerge1) to (ItemMergeCharge1 - 3)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ItemMergeCharge2 Equal to 2
            • Then - Actions
              • Item - Remove (Item carried by Hero of type ItemMerge2)
            • Else - Actions
              • Item - Set charges remaining in (Item carried by Hero of type ItemMerge2) to (ItemMergeCharge2 - 2)
            • If - Conditions
              • ItemMergeCharge3 Equal to 1
            • Then - Actions
              • Item - Remove (Item carried by Hero of type ItemMerge3)
            • Else - Actions
              • Item - Set charges remaining in (Item carried by Hero of type ItemMerge2) to (ItemMergeCharge3 - 1)
          • Hero - Create Makrura Shell Armor and give it to (Hero manipulating item)
          • Special Effect - Create a special effect attached to the overhead of Hero using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
          • Set SpecialEffect = (Last created special effect)
          • Floating Text - Create floating text that reads You made |c006969FF... above Hero with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 80.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
          • Wait 2.00 seconds
          • Special Effect - Destroy SpecialEffect
        • Else - Actions
          • Do nothing
For those who are too lazy and just wants to get to the point, here's the complete trigger. In short, here is what it does:
1. You pick up the item and the conditions check to see if you either own it or to see if you just acquired it.
2. The actions either removes the item or sets the item charge depending if the item has the exact amount required or has more than is needed.
3. The actions then creates the target item and makes some awesome special effects and floating text.
--------------------------------------------------------------------------------------
Credits:
Me, onisaiyan808, of course. :3
And Rao Dao Zao, the person who inspired this tutorial to come into fruition.
--------------------------------------------------------------------------------------
 
Top