• 🏆 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!

[Trigger] Problem combining items of the same type.

Status
Not open for further replies.
Level 2
Joined
Jan 31, 2011
Messages
7
Hi! I tried to make a trigger that combines items of the same type. For example, if you buy or pick a "Broadsword" and you already have a "Broadsword" in your inventory it will combine into "Broadsword +1." But my trigger doesn't work properly, because when I buy or pick an item it automatically tranforms into the same item +1 even if I don't have the same item in my inventory.
This is the trigger I made:

  • Combine item
    • Events
      • Unit - A unit acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to BROADSWORD
      • ((Triggering unit) has an item of type BROADSWORD) Equal to True
    • Actions
      • Item - Remove (Item carried by (Triggering unit) of type BROADSWORD)
      • Item - Remove (Item carried by (Triggering unit) of type BROADSWORD)
      • Hero - Create BROADSWORD+1 and give it to (Triggering unit)
Thanks in advance.
 
Last edited by a moderator:
Level 2
Joined
Jan 31, 2011
Messages
7
  • Untitled Trigger 001
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
    • Actions
      • For each (Integer A) from 1 to 6, do (If ((Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Claws of Attack +15) then do (Set ItemAmount = (ItemAmount + 1)) else do (Do nothing))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ItemAmount Equal to 2
          • Then - Actions
            • Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +15) from (Hero manipulating item)
            • Item - Remove (Last dropped item)
            • Hero - Drop (Item carried by (Hero manipulating item) of type Claws of Attack +15) from (Hero manipulating item)
            • Item - Remove (Last dropped item)
            • Hero - Create Crown of Kings +5 and give it to (Hero manipulating item)
          • Else - Actions
            • Set ItemAmount = 0

I've found this in the links you gave me, and I was about to use it but I don't know how to put the variable ItemAmount. Can you tell me what type of variable is it? I'm sorry, I'm newbie at triggering...
 
Last edited by a moderator:
Level 2
Joined
Jan 31, 2011
Messages
7
  • Problem combining items of the same type.[/b]
  • That system is useless because if you buy and drop for example "sword +1" and you buy another "sword +1" and pick up the dropped "sword +1" they don't combine into "sword +2." You will have 2 "sword +1" in your inventory. The trigger only works if you buy certain item, for example "sword +1 (dummy)" and then it transforms into "sword +1/2, etc"
    • Anyone has another answer? At least can you tell me what type of variable is ItemAmount?
 
Status
Not open for further replies.
Top