troylowyee
Active Member
- Reaction score
- 0
how do i cr8 a skill that if you kill 5 units you will get 50 health.
Untitled Trigger 001
Events
Unit - A unit Dies
Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Equal to your_unit
Actions
Set creepkills = (creepkills + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
creepkills Equal to 5
Then - Actions
Unit - Set life of <your unit> to ((Life of (<yourunit>)) + 50.00)
Else - Actions
Untitled Trigger 001
Events
Unit - A unit Dies
Conditions
Optional
Actions
Set KillCount[Player number(owner of (killing unit))] = (KillCount[Player number(owner of (killing unit))] + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
KillCount[Player number(owner of (killing unit))] Equal to 5
Then - Actions
Unit - Set life of (Event response - Killing Unit) to ((Life of (Event response - Killing Unit)) + 50.00)
Set KillCount[Player number(owner of (killing unit))] = 0
Else - Actions
Do Nothing
Code:Untitled Trigger 001 Events Unit - A unit Dies Conditions Optional Actions Set KillCount[Player number(owner of (killing unit))] = (KillCount[Player number(owner of (killing unit))] + 1) If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions KillCount[Player number(owner of (killing unit))] Equal to 5 Then - Actions Unit - Set life of (Event response - Killing Unit) to ((Life of (Event response - Killing Unit)) + 50.00) Set KillCount[Player number(owner of (killing unit))] = 0 Else - Actions Do Nothing
You work with an array. This should work flawless.
EDIT: Actually, this will only work if each player has only one unit. Else you should make a complete unit array at the map initialization, or a picked unit array if there are multiple units of the same type in the map. If that is the case, let me know and I'll make the correct trigger for you.