There is only 1 unit type of every unit inside these unit groups, so it's okay if the unit groups are nested, right? Other wise, how would I set this up without nested unit groups? What would be most efficient? And is this leakless as well?
-
Change Job - Ninja
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Ninja
- (Owner of (Triggering unit)) Equal to Player 1 (Red)
- (Triggering unit) Equal to SoldierRED[1]
-
Actions
- Set TempUnit = (Triggering unit)
- Set TempAttribute_STR = (Strength of TempUnit (Exclude bonuses))
- Set TempAttribute_AGI = (Agility of TempUnit (Exclude bonuses))
- Set TempAttribute_INT = (Intelligence of TempUnit (Exclude bonuses))
- Unit - Remove Change Job from TempUnit
- Set TempPoint = (Position of TempUnit)
- Set TempPoint2 = (Center of JOBS RED GROUP1 <gen>)
- Unit - Move TempUnit instantly to TempPoint2, facing 270.00 degrees
- Custom script: call RemoveLocation( udg_TempPoint2)
- Set TempUnitGroup = (Units in JOBS RED GROUP1 <gen> matching ((Unit-type of (Matching unit)) Equal to Thief))
-
Unit Group - Pick every unit in TempUnitGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Hero level of (Picked unit)) Greater than or equal to 4
-
Then - Actions
- Set TempUnitGroup2 = (Units in JOBS RED GROUP1 <gen> matching ((Unit-type of (Matching unit)) Equal to Archer))
-
Unit Group - Pick every unit in TempUnitGroup2 and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Hero level of (Picked unit)) Greater than or equal to 3
-
Then - Actions
- Set TempUnitGroup3 = (Units in JOBS RED GROUP1 <gen> matching ((Unit-type of (Matching unit)) Equal to Oracle))
-
Unit Group - Pick every unit in TempUnitGroup3 and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Hero level of (Picked unit)) Greater than or equal to 2
-
Then - Actions
- Set TempUnitGroup4 = (Units in JOBS RED GROUP1 <gen> matching ((Unit-type of (Matching unit)) Equal to Ninja))
-
Unit Group - Pick every unit in TempUnitGroup4 and do (Actions)
-
Loop - Actions
- Set SoldierRED[1] = (Picked unit)
- Hero - Modify Strength of SoldierRED[1]: Set to TempAttribute_STR
- Hero - Modify Agility of SoldierRED[1]: Set to TempAttribute_AGI
- Hero - Modify Intelligence of SoldierRED[1]: Set to TempAttribute_INT
- Unit - Move SoldierRED[1] instantly to TempPoint, facing 270.00 degrees
- Selection - Select SoldierRED[1] for (Owner of TempUnit)
- Special Effect - Create a special effect attached to the origin of SoldierRED[1] using Abilities\Spells\Undead\DeathPact\DeathPactTarget.mdl
- Special Effect - Destroy (Last created special effect)
-
Loop - Actions
- Custom script: call DestroyGroup(udg_TempUnitGroup4)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: call DestroyGroup(udg_TempUnitGroup3)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: call DestroyGroup(udg_TempUnitGroup2)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of SoldierRED[1]) Equal to Ninja
-
Then - Actions
- Unit - Add Change Job to TempUnit
-
Else - Actions
- Unit - Move TempUnit instantly to TempPoint, facing 270.00 degrees
- Set TempPlayerGroup = (Player group((Owner of TempUnit)))
- Game - Display to TempPlayerGroup for 0.50 seconds the text: |cffffcc00You don't...
- Game - Display to TempPlayerGroup for 0.50 seconds the text:
- Custom script: call DestroyForce(udg_TempPlayerGroup)
-
If - Conditions
- Custom script: call RemoveLocation( udg_TempPoint)
- Custom script: call DestroyGroup(udg_TempUnitGroup)
-
Events