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

Damage first unit on the way to target

Status
Not open for further replies.
Level 9
Joined
Jan 23, 2008
Messages
384
Hi ! its have been a while from my last post in this section ...
So my question is ... i make an ability that fires a missile in a random direction and the first unit that it hits it gets stunned and damaged ... how can i do this ... tell me pls if i can do it via GUI cuz i am 0 at JASS -.-'

Ty for all yer time !
 
Level 13
Joined
Mar 16, 2008
Messages
941
Yes you can in GUI, bit I think it requires very good GUI skills to make this MUI.
The idea is to create a missle (dummy unit) and move it with a timer/trigger every 0.02-0.04 seconds (50-25 times per second in this case, 25 is fast enough). Whenever you move your missle forwards, you pick all units in range of... 50, 100? your choice :p and damage one. As soon as one is damaged, kill the missle.
 
Level 14
Joined
Nov 23, 2008
Messages
187
When your trigger moves projectile (aka missile), pick all units in small range within it, and if there is any unit, deal damage, stun him and remove projectile.

  • SpellRun
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • -------- moving stuff here --------
      • Custom script: call MoveLocation(udg_MissileLoc, GetUnitX(udg_Missile), GetUnitY(udg_Missile))
      • Set MissileGroup = (Units within 128.00 of MissileLoc matching (((Matching unit) belongs to an enemy of MissileOwner) equal to True))
      • Group - Pick every unit in MissileGroup and do (Actions)
        • Actions
          • Unit - Cause Missile to damage (Picked unit), dealing 100.00 damage of attack type Spell and damage type Normal
          • -------- dummy cast (stun) here --------
          • Unit - Remove Missile from the game
          • Trigger - Turn off SpellRun <gen>
However, this will be not MUI, you should use arrays for missile data and one timer (or periodic trigger) for doing actions.
 
Status
Not open for further replies.
Top