Using the code above this post, you could add a stacking
trigger. This stacking trigger goes like this
Code:
item Stacking
Event
A unit aciqure an item
condition
(item multi something) = Gold bars
(Note you can add other stackable items here but don't forget the OR, this trigger is my universal item stacker)
Action
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
For each (Integer B) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Integer A) Not equal to (Integer B)
(Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to (Item-type of (Item carried by (Hero manipulating item) in slot (Integer B)))
Then - Action
Item - Set charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A)) to ((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) + (Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer B))))
Item - Remove (Item carried by (Hero manipulating item) in slot (Integer B))
Else - Actions
Do nothing
Now with this stacking trigger with can see if they have 2 of the same item. Now add this condition to the combining code
Code:
(Charges remaining in (Item carried by (Hero) of type Item)) Equal to 2
so in result you get
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Dagger
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Casting unit) has an item of type Steel Sword) Equal to True
((Casting unit) has an item of type Emerald) Equal to True
(Charges remaining in (Item carried by (Hero) of type Item)) Equal to 2
Then - Actions
Hero - Create Poisoner's Dagger and give it to (Casting unit)
Item - Remove (Item carried by (Casting unit) of type Steel Sword)
Item - Remove (Item carried by (Casting unit) of type Emerald)
Item - Remove (Item carried by (Casting unit) of type Poisoner's Dagger)
Else - Actions
Game - Display to (Player group((Owner of (Casting unit)))) the text: You do not hav...[/b]
i think you are able to remodify these trigger to your map.