What do you mean by better
That should work fine
It would be like custom hero survival
If you wanted something more like custom hero line wars or custom footies it would be pretty much the same
- Code:
-
Events
Unit - A unit Acquires an item
Conditions
(Item-type of (Item being manipulated)) Equal to Value
Actions
Set skill[(Player number of (Triggering player))] = Value
Wait 0.20 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of skill[(Player number of (Triggering player))] for (Triggering unit)) Less than 1
Then - Actions
Unit - Add skill[(Player number of (Triggering player))] to (Triggering unit)
Else - Actions
Player - Add 1 to (Triggering player) Current lumber
The skill would cost 1 lumber (you could use gold if you want) and you would start them out with 4 lumber (or however many skills you want them to have)
If you want to seperate ults from normal skills so that they could only have 1 ult you would need to give them 3 lumber to start then once they got 3 normal skills move them to where the ults are sold
Both of those would need 1 trigger for each skill
If you wanted 1 trigger for all the skills
Make an array called items[] of type item with a size of however many skills you have in the game
And an array called abilities[] of type ability with the same size as items[]
Then set all the skills and items you use to give the skills to those arrays in the same order at map init
So if the item you use to give the crit strike skill is item[1]
The skill for crit strike would be ability[1]
If the trueshot item is item[2] then trueshot has to be ability[2]
Then the trigger would be
- Code:
-
Events
Unit - A unit Acquires an item
Conditions
Actions
For each (Integer A)from 1 to (however many skills you have in your game), 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 item[(Integer A)]
Then - Actions
Set skill[(Player number of (Triggering player))] = ability[(Integer A)]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of skill[(Player number of (Triggering player))] for (Triggering unit)) Less than 1
Then - Actions
Unit - Add skill[(Player number of (Triggering player))] to (Triggering unit)
Else - Actions
Player - Add 1 to (Triggering player) Current lumber
And you would only need 1 trigger for all the skills
Its the same for the custom survival type trigger if you want to use that kind with 1 trigger for all your skills