• 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] Pick units within region but check contains the caster

Status
Not open for further replies.
Level 18
Joined
Jun 2, 2009
Messages
1,233
Hello everyone. I have created spell but i have to check something extra.
Spell works in 2 ways. X range of target point of ability being cast contains the caster or not.
Example: You are casting Blizzard and enemies takes damage. But if your caster into the region, i wand to add another action.

  • Unit Group - Pick every unit in (Units within 350.00 of TempPoint matching (((Matching unit) belongs to an enemy of (Owner of Blood Mage 0076 <gen>)) Equal to True)) and do (Actions)
    • Loop - Actions
      • bla bla bla...
Maybe i am asking easy question but i am tired now. I cannot think properly.

Update: Ok it seems i found it but i believe this trigger will not gonna work properly. I can see "Then" text but i cannot see "Else" text when cast it on myself or ground. I will check this when i woke.

  • Events
    • Time - BloodStrikeTimer expires
  • Conditions
  • Actions
    • Set TempGroup = (Units within 350.00 of TempPointBloodstrike)
    • Special Effect - Create a special effect at TempPointBloodstrike using war3mapImported\Flamestrike Blood I.mdx
    • Unit Group - Pick every unit in TempGroup and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Picked unit) belongs to an enemy of (Owner of HeroOoO[17])) Equal to True
            • ((Picked unit) is alive) Equal to True
            • ((Picked unit) is in NNN) Equal to True
          • Then - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Blood Mage 0009 <gen> is in TempGroup) Equal to True
              • Then - Actions
                • Unit - Cause HeroOoO[17] to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Magic
                • Game - Display to (All players) for 1.00 seconds the text: Then
              • Else - Actions
                • Game - Display to (All players) for 1.00 seconds the text: else
                • Unit - Cause HeroOoO[17] to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Magic
          • Else - Actions
    • Custom script: call RemoveLocation(udg_TempPointBloodstrike)
Then is not works at the moment.
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Checking if a Unit is in a Unit Group requires the game to Loop over that Unit Group which you're already doing in the first place.

Instead, check if the Blood Mage is in the Unit Group first, then decide what to do based on that:
  • Events
    • Time - BloodStrikeTimer expires
  • Conditions
  • Actions
    • Set TempGroup = (Units within 350.00 of TempPointBloodstrike)
    • Special Effect - Create a special effect at TempPointBloodstrike using war3mapImported\Flamestrike Blood I.mdx
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Blood Mage 0009 <gen> is in TempGroup) Equal to True
      • Then - Actions
        • Unit Group - Pick every unit in TempGroup and do (Actions)
          • Loop - Actions
      • Else - Actions
        • Unit Group - Pick every unit in TempGroup and do (Actions)
          • Loop - Actions
    • Custom script: call RemoveLocation(udg_TempPointBloodstrike)
 
Status
Not open for further replies.
Top