• 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.

[General] How to pick each unit in line or like fire breath?

Status
Not open for further replies.
I was thinking something like to pick units in range from point athen set point a in from of where i was before and just repeat action until I finish full long of line, something same like for picking uunits like for breath of fire pick first in big cicrcle in mid and then smaller circles on side until I get all units,
BUT is there betteer way.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
It would be something like this:

  • Carrion Swarm
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Carrion Swarm
    • Actions
      • Set Temp_Group = (Units within 400.00 of (Position of (Casting unit)) matching (((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit))) Equal to True))
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Set Caster = (Position of (Casting unit))
          • Set Picked = (Position of (Picked unit))
          • Set Temp_Point = (Target point of ability being cast)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Angle from Caster to Picked) Less than or equal to ((Angle from Caster to Temp_Point) + 30.00)
              • (Angle from Caster to Picked) Greater than or equal to ((Angle from Caster to Temp_Point) - 30.00)
            • Then - Actions
              • Unit - Cause (Casting unit) to damage (Picked unit), dealing ((Real((Agility of (Casting unit) (Include bonuses)))) x 5.00) damage of attack type Spells and damage type Normal
            • Else - Actions
          • Custom script: call RemoveLocation(udg_Caster)
          • Custom script: call RemoveLocation(udg_Picked)
      • Custom script: call DestroyGroup (udg_Temp_Group)
But try doing it yourself first.


PS: Oh my, quotes doesnt count even for single character :grin:
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
You still need to adjust for when close to 360 degrees.

Here's how my footman defend works:
  • Defend Actual
    • Events
    • Conditions
    • Actions
      • Set tempLoc1 = (Position of DamageEventTarget)
      • Set tempLoc2 = (Position of DamageEventSource)
      • -------- check angle --------
      • Set defendArc = (70.00 + (20.00 x (Real((Level of Defend for DamageEventTarget)))))
      • Set defendArc = (defendArc x 0.50)
      • Set defendFacing = (Facing of DamageEventTarget)
      • Set defendSource = (Angle from tempLoc2 to tempLoc1)
      • Set defendSource = (defendSource + 180.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (defendFacing - defendSource) Less than or equal to defendArc
                  • (defendFacing - defendSource) Greater than or equal to (defendArc x -1.00)
              • (defendFacing - defendSource) Greater than or equal to (360.00 - defendArc)
        • Then - Actions
          • -------- get damage reduction --------
          • Set DamageEventAmount = (DamageEventAmount x (0.70 - (0.10 x (Real((Level of Defend for DamageEventTarget))))))
          • Floating Text - Create floating text that reads blocked above DamageEventTarget with Z offset 0.00, using font size 6.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 96.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 0.75 seconds
        • Else - Actions
      • -------- clean leaks --------
      • Custom script: call RemoveLocation(udg_tempLoc1)
      • Custom script: call RemoveLocation(udg_tempLoc2)
 
Status
Not open for further replies.
Top