Item Recipe trigger

Just_kill

New Member
Reaction score
0
Can someone please take a look at this trigger.
This trigger should do that when a hero has 2 Gloves of Haste and 1 Alchemist Bone it should create 1 item and remove the gloves and Alchemist Bone. But the problem is that the Hero gets 4 of the items that should be just 1.

Code:
Alchmst Bone
    Events
        Unit - A unit Acquires an item
    Conditions
        ((Hero manipulating item) has an item of type Glowes Of Haste) Equal to True
        ((Hero manipulating item) has an item of type Alchemist Bone Recipe) Equal to True
    Actions
        Set TempInteger = 0
        For each (Integer A) from 1 to 6, 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 Glowes Of Haste
                    Then - Actions
                        Set TempInteger = (TempInteger + 1)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                TempInteger Greater than or equal to 2
                            Then - Actions
                                Item - Remove (Item carried by (Hero manipulating item) of type Glowes Of Haste)
                                Item - Remove (Item carried by (Hero manipulating item) of type Glowes Of Haste)
                                Item - Remove (Item carried by (Hero manipulating item) of type Alchemist Bone Recipe)
                                Item - Create Alchemist Bone at (Position of (Hero manipulating item))
                                Special Effect - Create a special effect at (Position of (Hero manipulating item)) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                                Hero - Give (Last created item) to (Hero manipulating item)
                                Special Effect - Destroy (Last created special effect)
                            Else - Actions
 

HydraRancher

Truth begins in lies
Reaction score
197
Move the If/Then/Else that gives you the item OUTSIDE of the "else" functions. So after you do the (Integer A) checking.

Like this:

Trigger:
  • Alchmst Bone
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Hero manipulating item) has an item of type Glowes Of Haste) Equal to True
      • ((Hero manipulating item) has an item of type Alchemist Bone Recipe) Equal to True
    • Actions
      • Set TempInteger = 0
      • For each (Integer A) from 1 to 6, 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 Glowes Of Haste
            • Then - Actions
              • Set TempInteger = (TempInteger + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempInteger Greater than or equal to 2
        • Then - Actions
          • Item - Remove (Item carried by (Hero manipulating item) of type Glowes Of Haste)
          • Item - Remove (Item carried by (Hero manipulating item) of type Glowes Of Haste)
          • Item - Remove (Item carried by (Hero manipulating item) of type Alchemist Bone Recipe)
          • Item - Create Alchemist Bone at (Position of (Hero manipulating item))
          • Special Effect - Create a special effect at (Position of (Hero manipulating item)) using Abilities\Spells\Items\AIem\AIemTarget.mdl
          • Hero - Give (Last created item) to (Hero manipulating item)
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top