Can anyone help me find an easier way to make a trigger that;
-When unit x uses an item then an ability will be added to that unit x and the item removed.
- To remove the ability, there's another unit y with an ability that removes the ability from unit x and adds the item to unit x's inventory that the ability originally came from.
-I need unit x to be able to have 4 abilities in the following button positions;
0,2 1,2 2,2 3,2. All of them removable.
-unit y also has 4 abilities (in the same button position as unit x) but these are to remove each of unit x's abilities.
I've tried it for one ability and it works fine, but as soon as i try to add a second ability from an item nothing happens.
Here are my triggers so far
TO ADD THE ABILITY
- Code:
-
Bowgun add
Events
Unit - A unit Uses an item
Conditions
Actions
For each (Integer A) from 1 to 15, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to Bowgun[(Integer A)]
Then - Actions
Unit - Add Bowguns[(Integer A)] to (Triggering unit)
Else - Actions
TO REMOVER THE ABILITY
TO REMOVE THE ABILITY
- Code:
-
Bowgun remove
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Weapon to Item
Actions
For each (Integer A) from 1 to 15, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
Unit - Remove Bowguns[(Integer A)] from Heros[(Player number of (Owner of (Triggering unit)))]
Hero - Create Bowgun[(Integer A)] and give it to Heros[(Player number of (Owner of (Triggering unit)))]
Else - Actions
Let me know if you need anymore information :O.