I'm working on my footmen war and I wanna have a trigger that detects the primary attribute of the killing hero and gives them +1 to that attribute. Does anyone know if this can be done in GUI or do I have to resort to Jass to get this done?
hmm, check this out
Unit - Entering Playable Area
Condition - Entering Unit is [Skeleton King]
Action
Set variable STR Attribute(Player numbers of owner of entering unit)] = 1
Then,
Unit - Dies
Condition - STR Attribute (Player numbers of owner of killing unit) = 1
Action
Add 1 Str to killing unit
hmm, check this out
Unit - Entering Playable Area
Condition - Entering Unit is [Skeleton King]
Action
Set variable STR Attribute(Player numbers of owner of entering unit)] = 1
Then,
Unit - Dies
Condition - STR Attribute (Player numbers of owner of killing unit) = 1
Action
Add 1 Str to killing unit
hmm, check this out
- Unit - Entering Playable Area
- Condition - Entering Unit is [Skeleton King]
- Action
- Set variable STR Attribute(Player numbers of owner of entering unit)] = 1
- Then,
- Unit - Dies
- Condition - STR Attribute (Player numbers of owner of killing unit) = 1
- Action
- Add 1 Str to killing unit
hmm, check this out
Unit - Entering Playable Area
Condition - Entering Unit is [Skeleton King]
Action
Set variable STR Attribute(Player numbers of owner of entering unit)] = 1
Then,
Unit - Dies
Condition - STR Attribute (Player numbers of owner of killing unit) = 1
Action
Add 1 Str to killing unit
Yeah, you right, though I was thinking more along the lines of operator's trigger. Assuming that primary attribute was highest of all attributes, you could also use:
...of course, adding own conditions etc.
- Events
- Unit - A unit Dies
- Conditions
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Strength of (Killing unit) (Exclude bonuses)) Greater than (Agility of (Killing unit) (Exclude bonuses))
- (Strength of (Killing unit) (Exclude bonuses)) Greater than (Intelligence of (Killing unit) (Exclude bonuses))
- Then - Actions
- Hero - Modify Strength of (Killing unit): Add 1
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Agility of (Killing unit) (Exclude bonuses)) Greater than (Strength of (Killing unit) (Exclude bonuses))
- (Agility of (Killing unit) (Exclude bonuses)) Greater than (Intelligence of (Killing unit) (Exclude bonuses))
- Then - Actions
- Hero - Modify Agility of (Killing unit): Add 1
- Else - Actions
- Hero - Modify Intelligence of (Killing unit): Add 1
That would at least limit to one trigger...
This would not work if during some time in the gameplay the unit got a higher secondary attribute than his/her primary. Then the secondary attribute would go higher. My trigger doesn't take long. You just copy and paste most of the stuff and edit a bit, and it's done. Plus it's not buggy (I think) so it's overall better in the end.