• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Problem with item recipe.

Status
Not open for further replies.
Level 1
Joined
Feb 7, 2015
Messages
1
Hi, I'm having trouble with an item recipe. What's confusing me is it is an exact clone of one that works.

The trigger which correctly removes exactly one Sword 1 and replaces it with Sword 2 even if the hero has multiple Sword 1s:

  • Sword2a
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Sword 2 (Recipe)
    • Actions
      • 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 Sword 1
            • Then - Actions
              • Item - Remove (Item being manipulated)
              • Item - Remove (Item carried by (Hero manipulating item) in slot (Integer A))
              • Hero - Create Sword 2 and give it to (Hero manipulating item)
            • Else - Actions
Then this trigger for some reason if you have multiple Sword 2s will remove them all and replace them all with Sword 3.


  • Sword3a
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Sword 3 (Recipe)
    • Actions
      • 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 Sword 2
            • Then - Actions
              • Item - Remove (Item being manipulated)
              • Item - Remove (Item carried by (Hero manipulating item) in slot (Integer A))
              • Hero - Create Sword 3 and give it to (Hero manipulating item)
            • Else - Actions
They're near identical apart from the items being bought/replaced. Does anyone have any ideas?
 
Status
Not open for further replies.
Top