• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Damaging Nearest Enemy

Status
Not open for further replies.
Level 10
Joined
Mar 19, 2010
Messages
622
Ok so I'm working on a spell that will spawn a unit which, after 15 seconds, damages 7 enemy nearest to it.

In the trigger below I can't seems to get the 7 closest one correctly, it sometimes chooses the one that is further away.

  • B1 Resonating Crystal Loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set Boss1_RC_Timer1 = (Boss1_RC_Timer1 + 1)
      • Set Boss1_RC_TempPos1 = (Position of Boss1_RC_Crystal1)
      • Cinematic - Ping minimap for (All players) at Boss1_RC_TempPos1 for 0.10 seconds, using a Warning ping of color (100.00%, 100.00%, 100.00%)
      • For each (Integer A) from 1 to 7, do (Actions)
        • Loop - Actions
          • Set Boss1_RC_Real1[(Integer A)] = 99999.00
      • Unit Group - Pick every unit in Game_HeroGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Set Boss1_RC_TempPos2 = (Position of (Picked unit))
              • Set Boss1_RC_Real1[0] = (Distance between Boss1_RC_TempPos1 and Boss1_RC_TempPos2)
              • Set Boss1_RC_Index = 1
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Boss1_RC_Real1[0] Less than Boss1_RC_Real1[Boss1_RC_Index]
                  • Boss1_RC_Target1[Boss1_RC_Index] Not equal to (Picked unit)
                • Then - Actions
                  • Set Boss1_RC_Real1[Boss1_RC_Index] = Boss1_RC_Real1[0]
                  • Set Boss1_RC_Target1[Boss1_RC_Index] = (Picked unit)
                • Else - Actions
                  • Set Boss1_RC_Index = 2
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Boss1_RC_Real1[0] Less than Boss1_RC_Real1[Boss1_RC_Index]
                      • Boss1_RC_Target1[Boss1_RC_Index] Not equal to (Picked unit)
                    • Then - Actions
                      • Set Boss1_RC_Real1[Boss1_RC_Index] = Boss1_RC_Real1[0]
                      • Set Boss1_RC_Target1[Boss1_RC_Index] = (Picked unit)
                    • Else - Actions
                      • Set Boss1_RC_Index = 3
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Boss1_RC_Real1[0] Less than Boss1_RC_Real1[Boss1_RC_Index]
                          • Boss1_RC_Target1[Boss1_RC_Index] Not equal to (Picked unit)
                        • Then - Actions
                          • Set Boss1_RC_Real1[Boss1_RC_Index] = Boss1_RC_Real1[0]
                          • Set Boss1_RC_Target1[Boss1_RC_Index] = (Picked unit)
                        • Else - Actions
                          • Set Boss1_RC_Index = 4
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Boss1_RC_Real1[0] Less than Boss1_RC_Real1[Boss1_RC_Index]
                              • Boss1_RC_Target1[Boss1_RC_Index] Not equal to (Picked unit)
                            • Then - Actions
                              • Set Boss1_RC_Real1[Boss1_RC_Index] = Boss1_RC_Real1[0]
                              • Set Boss1_RC_Target1[Boss1_RC_Index] = (Picked unit)
                            • Else - Actions
                              • Set Boss1_RC_Index = 5
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • Boss1_RC_Real1[0] Less than Boss1_RC_Real1[Boss1_RC_Index]
                                  • Boss1_RC_Target1[Boss1_RC_Index] Not equal to (Picked unit)
                                • Then - Actions
                                  • Set Boss1_RC_Real1[Boss1_RC_Index] = Boss1_RC_Real1[0]
                                  • Set Boss1_RC_Target1[Boss1_RC_Index] = (Picked unit)
                                • Else - Actions
                                  • Set Boss1_RC_Index = 6
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • Boss1_RC_Real1[0] Less than Boss1_RC_Real1[Boss1_RC_Index]
                                      • Boss1_RC_Target1[Boss1_RC_Index] Not equal to (Picked unit)
                                    • Then - Actions
                                      • Set Boss1_RC_Real1[Boss1_RC_Index] = Boss1_RC_Real1[0]
                                      • Set Boss1_RC_Target1[Boss1_RC_Index] = (Picked unit)
                                    • Else - Actions
                                      • Set Boss1_RC_Index = 7
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • Boss1_RC_Real1[0] Less than Boss1_RC_Real1[Boss1_RC_Index]
                                          • Boss1_RC_Target1[Boss1_RC_Index] Not equal to (Picked unit)
                                        • Then - Actions
                                          • Set Boss1_RC_Real1[Boss1_RC_Index] = Boss1_RC_Real1[0]
                                          • Set Boss1_RC_Target1[Boss1_RC_Index] = (Picked unit)
                                        • Else - Actions
            • Else - Actions
          • Custom script: call RemoveLocation(udg_Boss1_RC_TempPos2)
      • Custom script: call RemoveLocation(udg_Boss1_RC_TempPos1)
      • For each (Integer B) from 1 to 7, do (Actions)
        • Loop - Actions
          • Set Boss1_RC_Real1[(Integer B)] = 0.00
          • Unit Group - Add Boss1_RC_Target1[(Integer B)] to Boss1_RC_Group1
      • Set Boss1_RC_Int = 0
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boss1_RC_Timer1 Equal to 150
        • Then - Actions
          • Set Boss1_RC_TempPos1 = (Position of Boss1_RC_Crystal1)
          • Special Effect - Create a special effect at Boss1_RC_TempPos1 using war3mapImported\Arcane Explosion.mdx
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at Boss1_RC_TempPos1 using war3mapImported\NewDirtEXNofire.mdx
          • Special Effect - Destroy (Last created special effect)
          • Unit Group - Pick every unit in Boss1_RC_Group1 and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using war3mapImported\NewDirtEXNofire.mdx
              • Special Effect - Destroy (Last created special effect)
              • Set Boss1_RC_TempPos2 = (Position of (Picked unit))
              • Set Boss1_RC_Real1[0] = (Distance between Boss1_RC_TempPos1 and Boss1_RC_TempPos2)
              • Unit - Cause Morchok 0026 <gen> to damage (Picked unit), dealing (23000.00 + (180.00 x Boss1_RC_Real1[0])) damage of attack type Spells and damage type Normal
              • Custom script: call RemoveLocation(udg_Boss1_RC_TempPos2)
          • For each (Integer B) from 1 to 7, do (Actions)
            • Loop - Actions
              • Custom script: set udg_Boss1_RC_Target1[bj_forLoopBIndex] = null
          • Unit - Remove Boss1_RC_Crystal1 from the game
          • Custom script: call RemoveLocation(udg_Boss1_RC_TempPos1)
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in Boss1_RC_Group1 and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
              • Special Effect - Destroy (Last created special effect)
      • Unit Group - Remove all units from Boss1_RC_Group1
Please help me check if I made any mistakes or done anything wrong.

Thanks in advance
 
I'd suggest using this form of method to get hold of closest units


  • Set CurrentDistance = DistanceIncrement
  • Set CurrentTargetCounter = 0
  • Set TempInteger = (Integer((MaxDistance / DistanceIncrement)))
  • For each (Integer Indexer) from 1 to TempInteger, do (Actions)
    • Loop - Actions
      • Set TempGroup = (Units within CurrentDistance of TempPoint)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempUnit is in HeroGroup) Equal to True
              • CurrentTargetCounter Less than or equal to 7
            • Then - Actions
              • Set CurrentTargetCounter = (CurrentTargetCounter + 1)
              • Set SelectedTargets[CurrentTargetCounter] = TempUnit
            • Else - Actions
          • Set CurrentDistance = (CurrentDistance + DistanceIncrement)
      • Custom script: call DestroyGroup(udg_TempGroup)


Note I'm using my own variable names (TempPoint is set prior and removed afterward) distance increment is basically how big the area it scans for increasingly and maxdistance is the total AOE of the spell) the loop is so that we loop as few times as possible as to not generate too much lag, distance increment should be about 90-120 since making it bigger increases scan inaccuracy for closer units, I can explain on a more step-by-step method if you have difficulty understanding the concept. I've pretty much reduced it to only key parts to making the method work, so discluded any other conditions and the like that you may want to add to it
 
Level 10
Joined
Mar 19, 2010
Messages
622
Thanks Tank Commander, but I can't seems to get the trigger to pick any units after i modified my trigger using your method.

  • B1 Resonating Crystal Loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set Boss1_RC_Timer1 = (Boss1_RC_Timer1 + 1)
      • Set Boss1_RC_TempPos1 = (Position of Boss1_RC_Crystal1)
      • Cinematic - Ping minimap for (All players) at Boss1_RC_TempPos1 for 0.10 seconds, using a Warning ping of color (100.00%, 100.00%, 100.00%)
      • Set Boss1_RC_Real1[0] = 90.00
      • Set Boss1_RC_TargetCounter = 0
      • Set Boss1_RC_TempInt = (8000 / (Integer(Boss1_RC_Real1[0])))
      • For each (Integer B) from 1 to Boss1_RC_TempInt, do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within Boss1_RC_Real1[0] of Boss1_RC_TempPos1) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is in Game_HeroGroup) Equal to True
                  • Boss1_RC_TargetCounter Less than or equal to 7
                • Then - Actions
                  • Set Boss1_RC_TargetCounter = (Boss1_RC_TargetCounter + 1)
                  • Set Boss1_RC_Target1[Boss1_RC_TargetCounter] = (Picked unit)
                • Else - Actions
              • Set Boss1_RC_Real1[0] = (Boss1_RC_Real1[0] + 90.00)
      • Custom script: call RemoveLocation(udg_Boss1_RC_TempPos1)
      • Set Boss1_RC_TargetCounter = 0
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boss1_RC_Timer1 Equal to 150
        • Then - Actions
          • Set Boss1_RC_TempPos1 = (Position of Boss1_RC_Crystal1)
          • Special Effect - Create a special effect at Boss1_RC_TempPos1 using war3mapImported\Arcane Explosion.mdx
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at Boss1_RC_TempPos1 using war3mapImported\NewDirtEXNofire.mdx
          • Special Effect - Destroy (Last created special effect)
          • For each (Integer B) from 1 to Boss1_RC_TargetCounter, do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the origin of Boss1_RC_Target1[(Integer B)] using war3mapImported\NewDirtEXNofire.mdx
              • Special Effect - Destroy (Last created special effect)
              • Set Boss1_RC_TempPos2 = (Position of Boss1_RC_Target1[(Integer B)])
              • Set Boss1_RC_Real1[0] = (Distance between Boss1_RC_TempPos1 and Boss1_RC_TempPos2)
              • Unit - Cause Morchok 0026 <gen> to damage Boss1_RC_Target1[(Integer B)], dealing (23000.00 + (180.00 x Boss1_RC_Real1[0])) damage of attack type Spells and damage type Normal
              • Custom script: call RemoveLocation(udg_Boss1_RC_TempPos2)
              • Custom script: set udg_Boss1_RC_Target1[bj_forLoopBIndex] = null
          • Unit - Remove Boss1_RC_Crystal1 from the game
          • Custom script: call RemoveLocation(udg_Boss1_RC_TempPos1)
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • For each (Integer B) from 1 to Boss1_RC_TargetCounter, do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the origin of Boss1_RC_Target1[(Integer B)] using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
              • Special Effect - Destroy (Last created special effect)
 
Last edited:
Level 10
Joined
Mar 19, 2010
Messages
622
I've Fixed(perhaps) all the mistakes you stated above, but nothing changed, still no one are picked.

  • B1 Resonating Crystal Loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set Boss1_RC_Timer1 = (Boss1_RC_Timer1 + 1)
      • Set Boss1_RC_TempPos1 = (Position of Boss1_RC_Crystal1)
      • Cinematic - Ping minimap for (All players) at Boss1_RC_TempPos1 for 0.10 seconds, using a Warning ping of color (100.00%, 100.00%, 100.00%)
      • Set Boss1_RC_Real1 = 90.00
      • Set Boss1_RC_TargetCounter = 0
      • Set Boss1_RC_TempInt = (8000 / (Integer(Boss1_RC_Real1)))
      • For each (Integer Boss1_RC_LoopInt) from 1 to Boss1_RC_TempInt, do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within Boss1_RC_Real1 of Boss1_BBotE_TempPos1) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is in Game_HeroGroup) Equal to True
                  • Boss1_RC_TargetCounter Less than or equal to 7
                • Then - Actions
                  • Game - Display to (All players) the text: yes
                  • Set Boss1_RC_TargetCounter = (Boss1_RC_TargetCounter + 1)
                  • Set Boss1_RC_Target1[Boss1_RC_TargetCounter] = (Picked unit)
                  • Game - Display to (All players) the text: (Name of Boss1_RC_Target1[Boss1_RC_TargetCounter])
                • Else - Actions
                  • Game - Display to (All players) the text: no
                  • Set Boss1_RC_Real1 = (Boss1_RC_Real1 + 90.00)
                  • Game - Display to (All players) the text: (increase range to: + (String(Boss1_RC_Real1)))
      • Custom script: call RemoveLocation(udg_Boss1_RC_TempPos1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boss1_RC_Timer1 Equal to 150
        • Then - Actions
          • Set Boss1_RC_TempPos1 = (Position of Boss1_RC_Crystal1)
          • Special Effect - Create a special effect at Boss1_RC_TempPos1 using war3mapImported\Arcane Explosion.mdx
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at Boss1_RC_TempPos1 using war3mapImported\NewDirtEXNofire.mdx
          • Special Effect - Destroy (Last created special effect)
          • Set Boss1_RC_LoopInt = 0
          • For each (Integer Boss1_RC_LoopInt) from 1 to 7, do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the origin of Boss1_RC_Target1[Boss1_RC_LoopInt] using war3mapImported\NewDirtEXNofire.mdx
              • Special Effect - Destroy (Last created special effect)
              • Set Boss1_RC_TempPos2 = (Position of Boss1_RC_Target1[Boss1_RC_LoopInt])
              • Set Boss1_RC_Real1 = (Distance between Boss1_RC_TempPos1 and Boss1_RC_TempPos2)
              • Unit - Cause Morchok 0026 <gen> to damage Boss1_RC_Target1[Boss1_RC_LoopInt], dealing (23000.00 + (Boss1_RC_Real1 x 180.00)) damage of attack type Hero and damage type Normal
              • Custom script: call RemoveLocation(udg_Boss1_RC_TempPos2)
              • Custom script: set udg_Boss1_RC_Target1[udg_Boss1_RC_LoopInt] = null
          • Unit - Remove Boss1_RC_Crystal1 from the game
          • Custom script: call RemoveLocation(udg_Boss1_RC_TempPos1)
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Set Boss1_RC_LoopInt = 0
          • For each (Integer Boss1_RC_LoopInt) from 1 to 7, do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the origin of Boss1_RC_Target1[Boss1_RC_LoopInt] using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
              • Special Effect - Destroy (Last created special effect)
As you can see I added some debug messages to it, but when i launch this trigger none of them are showed.

This trigger is to check and update every 0.1 seconds, and indicates which 7 units is the nearest one to the crystal. And when the timer reach 150(15 sec passed), the crystal explode damaging the 7 units based on how far they are from the crystal. So maybe we should try comparing the range of all unit in the Hero Group?
 
Hmm, well I noted a few improvements which "might as well" be done, such as putting the loop finding in after the timer (since nothing is done with them up to that point, setting targets prior is relatively pointless, as well as where to put in a few more debug messages, I'm understanding the loop just isn't running from the basis of neither debug message shows which leads me to believe

  • Set Boss1_RC_TempInt = (8000 / (Integer(Boss1_RC_Real1)))
Just isn't doing anything, may I suggest using two real values and converting both of them like this:

  • Set Boss1_RC_TempInt = (Integer(8000.00.00 / Boss1_RC_Real1))
  • B1 Resonating Crystal Loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set Boss1_RC_Timer1 = (Boss1_RC_Timer1 + 1)
      • Set Boss1_RC_TempPos1 = (Position of Boss1_RC_Crystal1)
      • Cinematic - Ping minimap for (All players) at Boss1_RC_TempPos1 for 0.10 seconds, using a Warning ping of color (100.00%, 100.00%, 100.00%)
      • Custom script: call RemoveLocation(udg_Boss1_RC_TempPos1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boss1_RC_Timer1 Equal to 150
        • Then - Actions
          • <<Add debug message here>>
          • Set Boss1_RC_Real1 = 90.00
          • Set Boss1_RC_TargetCounter = 0
          • Set Boss1_RC_TempInt = (8000 / (Integer(Boss1_RC_Real1)))
          • <<Add debug message displaying value of TempInt>>
          • For each (Integer Boss1_RC_LoopInt) from 1 to Boss1_RC_TempInt, do (Actions)
            • Loop - Actions
              • <<Add debug message here>>
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within Boss1_RC_Real1 of Boss1_BBotE_TempPos1) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is in Game_HeroGroup) Equal to True
                      • Boss1_RC_TargetCounter Less than or equal to 7
                    • Then - Actions
                      • Game - Display to (All players) the text: yes
                      • Set Boss1_RC_TargetCounter = (Boss1_RC_TargetCounter + 1)
                      • Set Boss1_RC_Target1[Boss1_RC_TargetCounter] = (Picked unit)
                      • Game - Display to (All players) the text: (Name of Boss1_RC_Target1[Boss1_RC_TargetCounter])
                    • Else - Actions
                      • Game - Display to (All players) the text: no
                      • Set Boss1_RC_Real1 = (Boss1_RC_Real1 + 90.00)
                      • Game - Display to (All players) the text: (increase range to: + (String(Boss1_RC_Real1)))
          • Set Boss1_RC_TempPos1 = (Position of Boss1_RC_Crystal1)
          • Special Effect - Create a special effect at Boss1_RC_TempPos1 using war3mapImported\Arcane Explosion.mdx
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at Boss1_RC_TempPos1 using war3mapImported\NewDirtEXNofire.mdx
          • Special Effect - Destroy (Last created special effect)
          • Set Boss1_RC_LoopInt = 0
          • For each (Integer Boss1_RC_LoopInt) from 1 to 7, do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the origin of Boss1_RC_Target1[Boss1_RC_LoopInt] using war3mapImported\NewDirtEXNofire.mdx
              • Special Effect - Destroy (Last created special effect)
              • Set Boss1_RC_TempPos2 = (Position of Boss1_RC_Target1[Boss1_RC_LoopInt])
              • Set Boss1_RC_Real1 = (Distance between Boss1_RC_TempPos1 and Boss1_RC_TempPos2)
              • Unit - Cause Morchok 0026 <gen> to damage Boss1_RC_Target1[Boss1_RC_LoopInt], dealing (23000.00 + (Boss1_RC_Real1 x 180.00)) damage of attack type Hero and damage type Normal
              • Custom script: call RemoveLocation(udg_Boss1_RC_TempPos2)
              • Custom script: set udg_Boss1_RC_Target1[udg_Boss1_RC_LoopInt] = null
            • Unit - Remove Boss1_RC_Crystal1 from the game
            • Custom script: call RemoveLocation(udg_Boss1_RC_TempPos1)
            • Trigger - Turn off (This trigger)
        • Else - Actions
          • Set Boss1_RC_LoopInt = 0
          • For each (Integer Boss1_RC_LoopInt) from 1 to 7, do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the origin of Boss1_RC_Target1[Boss1_RC_LoopInt] using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
              • Special Effect - Destroy (Last created special effect)
Edit: Personally, I can't really think of any else that could be wrong with that section of the triggering, but using the debug messages if there's another problem you should be able to pinpoint it yourself
 
Level 10
Joined
Mar 19, 2010
Messages
622
I've fixed much of the trigger, I think it looks nice now, but strangely it isnt working as well, and it causes a lot a lot pf lag when the crystal appears, the lag fades after the crystal disappear.
  • B1 Resonating Crystal Loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set Boss1_RC_Timer1 = (Boss1_RC_Timer1 + 1)
      • Set Boss1_RC_TempPos1 = (Position of Boss1_RC_Crystal1)
      • Set Boss1_RC_Real1 = 90.00
      • Set Boss1_RC_TargetCounter1 = 0
      • Set Boss1_RC_TempInt = (Integer(9000 / (Boss1_RC_Real1)))
      • For each (Integer Boss1_RC_LoopInt) from 1 to Boss1_RC_TempInt, do (Actions)
        • Loop - Actions
          • Set Boss1_RC_TempGroup = (Units within Boss1_RC_Real1 of Boss1_RC_TempPos1 matching ((((Matching unit) belongs to an enemy of Player 12 (Brown)) Equal to True) and (((Matching unit) is in Game_HeroGroup) Equal to True)))
          • Unit Group - Pick every unit in Boss1_RC_TempGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Boss1_RC_TargetCounter1 Less than or equal to 7
                • Then - Actions
                  • Set Boss1_RC_TargetCounter1 = (Boss1_RC_TargetCounter1 + 1)
                  • Set Boss1_RC_Target1[Boss1_RC_TargetCounter1] = (Picked unit)
                • Else - Actions
          • Set Boss1_RC_Real1 = (Boss1_RC_Real1 + 90.00)
          • Custom script: call DestroyGroup(udg_Boss1_RC_TempGroup)
      • Custom script: call RemoveLocation(udg_Boss1_RC_TempPos1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boss1_RC_Timer1 Equal to 150
        • Then - Actions
          • Set Boss1_RC_TempPos1 = (Position of Boss1_RC_Crystal1)
          • Special Effect - Create a special effect at Boss1_RC_TempPos1 using war3mapImported\Arcane Explosion.mdx
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at Boss1_RC_TempPos1 using war3mapImported\NewDirtEXNofire.mdx
          • Special Effect - Destroy (Last created special effect)
          • Set Boss1_RC_LoopInt = 0
          • For each (Integer Boss1_RC_LoopInt) from 1 to 7, do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the origin of Boss1_RC_Target1[Boss1_RC_LoopInt] using war3mapImported\NewDirtEXNofire.mdx
              • Special Effect - Destroy (Last created special effect)
              • Set Boss1_RC_TempPos2 = (Position of Boss1_RC_Target1[Boss1_RC_LoopInt])
              • Set Boss1_RC_Real1 = (Distance between Boss1_RC_TempPos1 and Boss1_RC_TempPos2)
              • Unit - Cause Morchok 0026 <gen> to damage Boss1_RC_Target1[Boss1_RC_LoopInt], dealing (23000.00 + (Boss1_RC_Real1 x 180.00)) damage of attack type Hero and damage type Normal
              • Custom script: call RemoveLocation(udg_Boss1_RC_TempPos2)
              • Custom script: set udg_Boss1_RC_Target1[udg_Boss1_RC_LoopInt] = null
          • Unit - Remove Boss1_RC_Crystal1 from the game
          • Custom script: call RemoveLocation(udg_Boss1_RC_TempPos1)
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Set Boss1_RC_LoopInt = 0
          • For each (Integer Boss1_RC_LoopInt) from 1 to 7, do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the origin of Boss1_RC_Target1[Boss1_RC_LoopInt] using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
              • Special Effect - Destroy (Last created special effect)
 
Level 10
Joined
Mar 19, 2010
Messages
622
I increased the search radius to 150 per increment, and it wont lag that much now, but the problem is, the searching is bugged again @.@

It don't seems to pick the 7 units again.

Edit: Just some though, wont it be like picking random units when there are too much unit within the search area?

Edit2: Ok found what's the problem that is causing all these problem, thread solved. Thanks Tank Commander. +rep
 
Last edited:
Status
Not open for further replies.
Top