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

[JASS] Second attack with ranged unit?

Status
Not open for further replies.
Level 5
Joined
Jul 1, 2008
Messages
46
Say I had something like this. That looped once or twice giving the appearance of firing off multiple arrows...

JASS:
            call PauseUnit( attacker, true )
            call SetUnitTimeScale( guy, 1.5)
            call SetUnitAnimation( guy, "attack" )
            call PauseUnit( attacker, false )

The problem is no arrows fly from the unit. Is there an easy way to create the arrows? I need something that would work for any type of ranged attack.

I don't want to use the attack target command because it interferes with some other things I have going on, but I'm thinking I might have to. Perhaps with a dummy unit? That would double the amount of ranged units I have though, would it not? Since I would have to make a dummy version of each.
 
Level 5
Joined
Jul 1, 2008
Messages
46
Allright, well just to throw more wood on the fire. Is there a way to get a unit's attack range?

[EDIT:] I thought I could do this in a roundabout way by using some other property of the unit (custom point value) etc. then just setting that equal to the attack range.
 
I dont think you can make dummy projectiles. They only send projectiles when a unit actually attacks. if you play the animation it will just pluck its bowstring. What you need is an ability that sends a projectile but doesnt do any damage. Then do something like this.

  • Events
  • Some unit attacks something
  • Conditions
  • Its 'this' unit
  • 'this' unit has ability 'multishot'
  • Actions
  • Unit - Give unit 'dumshot' ability
  • Unit - make the unit use 'dumshot' on (Event Response - Get attacked unit)
  • Unit - Remove 'dumshot' ability from the attacking unit.
As you can see these arent real triggers but they get the point across. Make an ability that doesnt do any damage, sends a projectile of your choice, and makes the caster use the attack animation. This ability will be your 'dumshot' then the other dummy ability will be the one you use to check if the unit has your version of multi shot, you could also make it do damage. The MultiShot ability should do nothing and should just be a variable mainly. Then you could do stuff like
  • Multishot spell
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of SuperShot for (Attacking unit)) Greater than 0
    • Actions
      • Unit - Add DummyAbility to (Attacking unit)
      • For each (Integer A) from 1 to (Level of Acid Bomb for (Attacking unit)), do (Actions)
        • Loop - Actions
          • Unit - Order (Attacking unit) to Special Malganis - Dark Conversion (Attacked unit)
          • Wait 0.50 seconds
      • Unit - Remove DummyAbility from (Attacking unit)
Then just make sure your DummyAbility has the text orderstring of darkconversion
 
Status
Not open for further replies.
Top