• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Item Recipe - Combining two same items with one different items

Status
Not open for further replies.
Level 4
Joined
May 1, 2011
Messages
81
Hello there, people. I was planning to make a GUI trigger regarding the item recipes like we saw at the DotA maps, whereby it will form a new item once several items were purchased.

Here's how I learn the basic combination of item recipes from this link:

http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/how-make-item-recipes-33931/


If we could take an example, like Wraith Band from the Gateway Relics, the trigger I made would be like this:

(A) This is how you convert the item icons displayed in the shops to a recipe scroll.

  • Wraith Band Scroll
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Wraith Band (Exhibition Only)
    • Actions
      • Item - Remove (Item being manipulated)
      • Hero - Create Wraith Band (Recipe Scroll) and give it to (Hero manipulating item)
(B) After getting the Wraith Band's recipe scroll, now do the combination when this scroll mentioned above combines with the Slippers of Agility and Circlet of Nobility:

  • Wraith Band Combine
    • Events
      • Unit - A unit acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Circlet of Nobility
          • (Item-type of (Item being manipulated)) Equal to Slippers of Agility
          • (Item-type of (Item being manipulated)) Equal to Wraith Band (Recipe Scroll)
      • ((Hero manipulating item) has an item of type Circlet of Nobility) Equal to True
      • ((Hero manipulating item) has an item of type Slippers of Agility) Equal to True
      • ((Hero manipulating item) has an item of type Wraith Band [Recipe Scroll]) Equal to True
    • Actions
      • Set Ingredients = 3
      • Set Recipe Factor[1] = Circlet of Nobility
      • Set Recipe Factor[2] = Slippers of Agility
      • Set Recipe Factor[3] = Wraith Band (Recipe Scroll)
      • For each (Integer A) from 1 to Ingredients, do (Actions)
        • Loop - Actions
          • Set FactorCleared[(Integer A)] = False
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • For each (Integer B) from 1 to Ingredients, do (Actions)
            • Loop - Actions
              • If (All conditions are true) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to RecipeFactor[(Integer B)]
                  • FactorCleared[(Integer B)] = False
                • Then - Actions
                  • Item - Remove (Item carried by (Hero manipulating item) in slot (Integer A))
                  • Set FactorCleared[(Integer B)] = True
                • Else - Actions
      • Hero - Create Wraith Band and give it to (Hero manipulating item)
      • Special Effect - Create a special effect attached to the origin of (Hero manipulating item) using Abilities\Spells\Items\Alem\AlemTarget.mdl

Variables:

- Ingredients (Integer)
* Initital Value - 0

- RecipeFactor (Item-Type Array 6)
* Initial Value - None

- FactorCleared (Boolean Array 6)
* Initial Value - False

By conclusion, this will only works on different items which ONE quantity only. Now my questions is, with using the trigger above, how to combine TWO Mithril Hammers and ONE Stygian Desolator Recipe Scroll to form a Stygian Desolator?

NOTE - Its best if you send me a link for a map.
 
Level 4
Joined
May 1, 2011
Messages
81
Mr_Bean987, thanks for the demo map you sent. But unfortunately it appears that there was a little flaw from what you did. Here, if I buy a recipe scroll, it automatically gives me another Mithril Hammer, as if people says 'Buy one get one free' slogan for purchasing or picking up the item. which I don't want it that way. All items must be bought separately regardless of what you think. Do you think you could do that?
 
Status
Not open for further replies.
Top