sentrywiz
S
sentrywiz
Found a few resources regarding combining same items. I can say I had success understanding this, but I do not get why it doesn't work for another pair of items. Here is the GUI code and the explanation below, hopefully you can help me.
I think it was Razorbrain who made the triggers. Don't remember. In anycase, these are bit modified for my use but they combine two jawbreakers to create claws. The thing that doesn't work is another trigger like this one, trying to combine two claws into one rapier.
The only way this worked is when I put the second trigger in the first and when you would buy another jawbreaker and you have two claws in inventory, then they get fused. But I want it instantly. This is what I want the trigger to do:
- You buy Jawbreaker.
- You buy another Jawbreaker, and instead of having them both - the triggers remove two Jawbreakers and give you Claws.
- You buy another Jawbreaker.
- When you try to buy the second Jawbreaker, and them two to fuse in claws, the triggers are supposed to notice you have two claws in inventory and remove all jawbreaker and claws then just give you a Rapier.
-
Claws
-
Events
- Unit - A unit Acquires an item
-
Conditions
- (Item-type of (Item being manipulated)) Equal to |c0099CCFFJawbreaker|r
-
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 |c0099CCFFJawbreaker|r) then do (Set SameItems = (SameItems + 1)) else do (Do nothing))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- SameItems Equal to 2
-
Then - Actions
- Hero - Drop (Item carried by (Hero manipulating item) of type |c0099CCFFJawbreaker|r) from (Hero manipulating item)
- Item - Remove (Last dropped item)
- Hero - Drop (Item carried by (Hero manipulating item) of type |c0099CCFFJawbreaker|r) from (Hero manipulating item)
- Item - Remove (Last dropped item)
- Hero - Create |c0099CCFFClaws|r and give it to (Hero manipulating item)
- Special Effect - Create a special effect attached to the overhead of (Hero manipulating item) using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
- Special Effect - Destroy (Last created special effect)
-
Else - Actions
- Set SameItems = 0
-
If - Conditions
-
Events
-
Rapier
-
Events
- Unit - A unit Acquires an item
-
Conditions
- (Item-type of (Item being manipulated)) Equal to |c0099CCFFClaws|r
-
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 |c0099CCFFClaws|r) then do (Set SameItems = (SameItems + 1)) else do (Do nothing))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- SameItems Equal to 2
-
Then - Actions
- Hero - Drop (Item carried by (Hero manipulating item) of type |c0099CCFFClaws|r) from (Hero manipulating item)
- Item - Remove (Last dropped item)
- Hero - Drop (Item carried by (Hero manipulating item) of type |c0099CCFFClaws|r) from (Hero manipulating item)
- Item - Remove (Last dropped item)
- Hero - Create |c0099CCFFRapier|r and give it to (Hero manipulating item)
- Special Effect - Create a special effect attached to the overhead of (Hero manipulating item) using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
- Special Effect - Destroy (Last created special effect)
-
Else - Actions
- Set SameItems = 0
-
If - Conditions
-
Events
- You buy Jawbreaker.
- You buy another Jawbreaker, and instead of having them both - the triggers remove two Jawbreakers and give you Claws.
- You buy another Jawbreaker.
- When you try to buy the second Jawbreaker, and them two to fuse in claws, the triggers are supposed to notice you have two claws in inventory and remove all jawbreaker and claws then just give you a Rapier.
Last edited by a moderator: