• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Explode Skeletons Ability

Status
Not open for further replies.
Level 7
Joined
Feb 23, 2020
Messages
253
Hello guys how do i make this trigger only damage the enemy and not my allies?

Thanks in advance! :)

  • Skeleton Explosion
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Explode Skeletons
    • Actions
      • Unit Group - Pick every unit in (Units within 9999999.00 of (Position of (Triggering unit)).) 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
              • (Unit-type of (Picked unit)) Equal to Exploding Skeleton
            • Then - Actions
              • Unit - Kill (Picked unit)
              • Unit - Cause (Picked unit) to damage circular area after 0.00 seconds of radius 200.00 at (Position of (Picked unit)), dealing (Real(SkeletonExplosion_DMG[(Level of Explode Skeletons for (Triggering unit))])) damage of attack type Spells and damage type Normal
            • Else - Actions
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,534
Variables:
TempGroup1 = Unit Group
TempGroup2 = Unit Group
TempUnit1 = Unit
TempUnit2= Unit
TempPoint = Point
  • Explode Skeletons
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Explode Skeletons
    • Actions
      • Set VariableSet TempGroup1 = (Units owned by (Triggering player) of type Exploding Skeleton)
      • -------- --------
      • -------- Pick All Skeletons Owned By Player --------
      • Unit Group - Pick every unit in TempGroup1 and do (Actions)
        • Loop - Actions
          • Set VariableSet TempUnit1 = (Picked unit)
          • Set VariableSet TempPoint = (Position of TempUnit1)
          • Set VariableSet TempGroup2 = (Units within 200.00 of TempPoint.)
          • -------- --------
          • -------- Kill Skeleton --------
          • Unit - Kill TempUnit1
          • -------- --------
          • -------- Explosion Sfx --------
          • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
          • Special Effect - Set Scale of (Last created special effect) to 0.80
          • Special Effect - Destroy (Last created special effect)
          • -------- --------
          • -------- Deal AoE Damage --------
          • Unit Group - Pick every unit in TempGroup2 and do (Actions)
            • Loop - Actions
              • Set VariableSet TempUnit2 = (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (TempUnit2 belongs to an enemy of (Triggering player).) Equal to True
                  • (TempUnit2 is alive) Equal to True
                  • (TempUnit2 is A structure) Equal to False
                  • (TempUnit2 is hidden) Equal to False
                • Then - Actions
                  • Unit - Cause (Triggering unit) to damage TempUnit2, dealing 100.00 damage of attack type Spells and damage type Normal
                • Else - Actions
          • -------- --------
          • -------- Clean Up Leaks --------
          • Custom script: call RemoveLocation (udg_TempPoint)
          • Custom script: call DestroyGroup (udg_TempGroup2)
      • -------- --------
      • -------- Clean Up Leaks --------
      • Custom script: call DestroyGroup (udg_TempGroup1)
Note that the example in my map was done rather quickly based on another map I had, so you'll see that the trigger is based on the Roar ability and using Archers. If you copy and paste the trigger make sure to adjust the ability/archer to match your ability and skeletons.

Also, you can edit the conditions in the If Then Else to choose which units are targeted. At the moment I filter out dead units, structures, and hidden units as well as damaging only enemy units.
 

Attachments

  • Skeleton Explode.w3m
    18.6 KB · Views: 17
Last edited:
Level 7
Joined
Feb 23, 2020
Messages
253
Variables:
TempGroup1 = Unit Group
TempGroup2 = Unit Group
TempUnit1 = Unit
TempUnit2= Unit
TempPoint = Point
  • Explode Skeletons
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Explode Skeletons
    • Actions
      • Set VariableSet TempGroup1 = (Units owned by (Triggering player) of type Exploding Skeleton)
      • -------- --------
      • -------- Pick All Skeletons Owned By Player --------
      • Unit Group - Pick every unit in TempGroup1 and do (Actions)
        • Loop - Actions
          • Set VariableSet TempUnit1 = (Picked unit)
          • Set VariableSet TempPoint = (Position of TempUnit1)
          • Set VariableSet TempGroup2 = (Units within 200.00 of TempPoint.)
          • -------- --------
          • -------- Kill Skeleton --------
          • Unit - Kill TempUnit1
          • -------- --------
          • -------- Explosion Sfx --------
          • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
          • Special Effect - Set Scale of (Last created special effect) to 0.80
          • Special Effect - Destroy (Last created special effect)
          • -------- --------
          • -------- Deal AoE Damage --------
          • Unit Group - Pick every unit in TempGroup2 and do (Actions)
            • Loop - Actions
              • Set VariableSet TempUnit2 = (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (TempUnit2 belongs to an enemy of (Triggering player).) Equal to True
                  • (TempUnit2 is alive) Equal to True
                  • (TempUnit2 is A structure) Equal to False
                  • (TempUnit2 is hidden) Equal to False
                • Then - Actions
                  • Unit - Cause (Triggering unit) to damage TempUnit2, dealing 100.00 damage of attack type Spells and damage type Normal
                • Else - Actions
          • -------- --------
          • -------- Clean Up Leaks --------
          • Custom script: call RemoveLocation (udg_TempPoint)
          • Custom script: call DestroyGroup (udg_TempGroup2)
      • -------- --------
      • -------- Clean Up Leaks --------
      • Custom script: call DestroyGroup (udg_TempGroup1)
Note that the example in my map was done rather quickly based on another map I had, so you'll see it's based on the Roar ability and working with Archers. If you copy and paste the trigger make sure to adjust the ability/archer to match your ability and skeletons.

Also, you can edit the conditions in the If Then Else to choose which units are targeted. At the moment I filter out dead units, structures, and hidden units as well as damaging only enemy units.

Thank you very much man!! This works just the way i intended it too!
 
Status
Not open for further replies.
Top