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

[Trigger] Attack Ability

Status
Not open for further replies.
Level 13
Joined
Sep 29, 2008
Messages
672
how about when the unit casts an ability you pick the units in front of it

  • Attack
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Attack (Ability)
    • Actions
      • Animation - Play (Casting unit)'s attack animation
      • Set Leak_Point[1] = (Position of Triggering unit)
      • Set Leak_Point[2] = (Leak_Point[1]) offset by 100.00 towards (Facing of (Triggering unit)) degrees)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 200.00 of Leak_Point[2] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of Leak_Unit)) Equal to True))) and do (Actions)
        • Loop - Actions
          • Unit - Cause Leak_Unit to damage (Picked unit), dealing 100.00 damage of attack type Hero and damage type Normal
      • Custom script: call RemoveLocation(udg_Leak_Point[1])
      • Custom script: call RemoveLocation(udg_Leak_Point[2])
something like that.
 
Last edited:
Level 16
Joined
Oct 12, 2008
Messages
1,570
That would attack every unit in 100 range, even BEHIND the unit,,
A question: Should it attack the closest unit? Or all units in a range in front of it?

Oh and: Nerovesper, though you set the point in a variable, it still leaks (no, not cause you didnt remove it)
You use (Position of Leak_Unit) in it, this leaks, you should set THAT into a variable, and use the variable in the other variable,
Then remove Both,,
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,255
Be warned that such systems will put a lot of people off your map. Even in diablo II you could hold the button and it would keep attacking, but having to click per attack is going backwards and gets boring and very repetitive fast.

Thus I would strongly advise that such a system might not be as good as you plan.
 
Level 11
Joined
May 31, 2008
Messages
698
You could just make the casting unit play atk animation and make it damage a random unit that is in range via triggers. Just set units within 100 range of 50 in front of caster (that wud be 100 range in front of the caster) to a group and make caster damage a random unit from that group. Just remember to clean up any leaks.

Also Dr. Super Good is right. Having to use an ability every time you attack and also making sure you are directly facing the unit you are attacking will be quite gay and would get very frustrating because it would be too hard to hit someone.
 
Status
Not open for further replies.
Top