• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

"REVERSE" Immolation?

Status
Not open for further replies.
Level 4
Joined
Feb 25, 2010
Messages
73
Hello all. I Want to do a spell like immolation, where you can turn on or off, but with a difference: the most far away the enemies are from the hero, the most the damage.

So, for the sake of example: if the hero actives the ability, so any enemy units up to 200 range will take 10 damage per second, while units from 201 up to 400 range will take 20 damage per second.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Still leaks, do it like this:

  • immolation
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Damage_group and do (Actions)
        • Loop - Actions
          • Set hero = (Picked unit)
          • Set Temp_point[1] = (Position of hero)
          • Set Victim_group = (Units within 500.00 of Temp_point[1] matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True)))
          • Unit Group - Pick every unit in Victim_group and do (Actions)
            • Loop - Actions
              • Set Temp_point[2] = (Position of (Picked unit))
              • Unit - Cause hero to damage (Picked unit), dealing (((Distance between Temp_point[1] and Temp_point[2]) / 100.00) x 5.00) damage of attack type Spells and damage type Normal
              • Custom script: call RemoveLocation(udg_Temp_point[2])
          • Custom script: call DestroyGroup(udg_Victim_group)
          • Custom script: call RemoveLocation(udg_Temp_point[1])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Damage_group is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off immolation <gen>
        • Else - Actions
 
Status
Not open for further replies.
Top