• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Spell] Flash Attack skill help

Level 7
Joined
Oct 6, 2022
Messages
146
Hello Good morning/afternoon/evening, I would like to know how to make "Flash attack" skill. It's base ability is anything that is no target such as wind walk.
the skill is it picks and moves to the target unit location that has the lowest hp within 600 AoE. Now if there's only 1 unit it moves to the target unit location. If there's more than 1 unit around her and there's none of it has the lowest hp like both have 1000 hp for example, It picks random units to it instead.

hope you guys understand what u meant, thank you as always :peasant-bowing:
 

Uncle

Warcraft Moderator
Level 66
Joined
Aug 10, 2018
Messages
6,729
Hello Good morning/afternoon/evening, I would like to know how to make "Flash attack" skill. It's base ability is anything that is no target such as wind walk.
the skill is it picks and moves to the target unit location that has the lowest hp within 600 AoE. Now if there's only 1 unit it moves to the target unit location. If there's more than 1 unit around her and there's none of it has the lowest hp like both have 1000 hp for example, It picks random units to it instead.

hope you guys understand what u meant, thank you as always :peasant-bowing:
I believe this is what you wanted:
  • Flash Attack Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Flash Attack
    • Actions
      • Set VariableSet FA_Caster = (Triggering unit)
      • Set VariableSet FA_Point[0] = (Position of FA_Caster)
      • Set VariableSet FA_Group = (Units within 600.00 of FA_Point[0].)
      • -------- --------
      • Special Effect - Create a special effect attached to the origin of FA_Caster using Abilities\Spells\Orc\MirrorImage\MirrorImageCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • -------- --------
      • Unit Group - Pick every unit in FA_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet FA_Picked_Unit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (FA_Picked_Unit is alive) Equal to True
              • (FA_Picked_Unit belongs to an enemy of (Owner of FA_Caster).) Equal to True
              • (FA_Picked_Unit is A ground unit) Equal to True
              • (FA_Picked_Unit is invulnerable) Equal to False
            • Then - Actions
              • -------- It's a valid target, keep it in the unit group. --------
            • Else - Actions
              • -------- It's dead or an ally or something we don't want, get rid of it! --------
              • Unit Group - Remove FA_Picked_Unit from FA_Group.
      • -------- --------
      • -------- Find the lowest hp target: --------
      • Set VariableSet FA_Lowest_HP = 1000000000.00
      • Set VariableSet FA_Target = No unit
      • Unit Group - Pick every unit in FA_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet FA_Picked_Unit = (Picked unit)
          • Set VariableSet FA_Current_HP = (Life of FA_Picked_Unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • FA_Current_HP Less than FA_Lowest_HP
            • Then - Actions
              • Set VariableSet FA_Target = FA_Picked_Unit
              • Set VariableSet FA_Lowest_HP = FA_Current_HP
            • Else - Actions
      • -------- --------
      • -------- Only attempt to attack the target if we actually found a target: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FA_Target Not equal to No unit
        • Then - Actions
          • Set VariableSet FA_Point[1] = (Position of FA_Target)
          • Set VariableSet FA_Point[2] = (FA_Point[1] offset by -128.00 towards (Facing of FA_Target) degrees.)
          • -------- --------
          • -------- This will attempt to put you behind the target and will also ensure that you never flash "in place": --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between FA_Point[0] and FA_Point[2]) Less than or equal to 20.00
            • Then - Actions
              • Custom script: call RemoveLocation( udg_FA_Point[2] )
              • Set VariableSet FA_Point[2] = (FA_Point[1] offset by 128.00 towards (Facing of FA_Target) degrees.)
              • Unit - Make FA_Caster face ((Facing of FA_Target) - 180.00)
            • Else - Actions
              • Unit - Make FA_Caster face (Facing of FA_Target)
          • -------- --------
          • Custom script: call SetUnitX( udg_FA_Caster, GetLocationX( udg_FA_Point[2] ) )
          • Custom script: call SetUnitY( udg_FA_Caster, GetLocationY( udg_FA_Point[2] ) )
          • -------- --------
          • Unit - Order FA_Caster to Attack FA_Target
          • -------- --------
          • Custom script: call RemoveLocation( udg_FA_Point[1] )
          • Custom script: call RemoveLocation( udg_FA_Point[2] )
        • Else - Actions
      • -------- --------
      • Custom script: call RemoveLocation( udg_FA_Point[0] )
      • Custom script: call DestroyGroup( udg_FA_Group )
 

Attachments

  • Flash Attack 1.w3m
    20.9 KB · Views: 2
Last edited:
Top