Damage based on distance.

exzeta

New Member
Reaction score
1
Hey, could you tell me how to do a spell that deals damage based on distance.
Like A units casts a spell that has 1000 AoE units around 1000 AoE get damaged for 1000 damage, and the ones that are in 999 AoE get damaged for 999 damage and so on.
GUI please.

Note: I am not asking for you to do the spell for me, just giving me a guide or something similar.
 

RangerX

I am justice!
Reaction score
69
well you must trigger it and use this action
Trigger:
  • Unit-cause [this unit] to damage [that unit] dealing [distance between [pos of this unit] and [position of that unit] of type chaos and dmg type univrsal


hand written
 

exzeta

New Member
Reaction score
1
So...
Trigger:
  • Events
    • Unit - an unit starts the effect of an ability
    • Conditions
    • Actions
    • Unit Group - Pick (all units) in (1000 AoE) of (triggering unit) and do (Actions)
    • Actions
    • Order UnitA to damage UnitB for (distance between (pos of this unit))
    • Is that correct?
 

Leazy

You can change this now in User CP.
Reaction score
50
Trigger:
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Set Point[1] = (Position of (Triggering unit))
      • Unit Group - Pick every unit in Unitgroup[1] and do (Actions)
        • Loop - Actions
          • Set Point[2] = (Position of (Picked unit))
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (1000.00 - (Distance between Point[1] and Point[2])) damage of attack type Spells and damage type Normal


Something like this I belive.

Scenario: Unit is 800 range away from the caster, it takes 1000-800=200 damage. Unit is 1000 or more range away from the caster, it takes 0 damage.

Edit: Or did you want to deal less damage the closer you got?
 

exzeta

New Member
Reaction score
1
Trigger:
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Set Point[1] = (Position of (Triggering unit))
      • Unit Group - Pick every unit in Unitgroup[1] and do (Actions)
        • Loop - Actions
          • Set Point[2] = (Position of (Picked unit))
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (1000.00 - (Distance between Point[1] and Point[2])) damage of attack type Spells and damage type Normal


Something like this I belive.

Scenario: Unit is 800 range away from the caster, it takes 1000-800=200 damage. Unit is 1000 or more range away from the caster, it takes 0 damage.

Edit: Or did you want to deal less damage the closer you got?
Yes.
Actually both. (like, in different triggers)
:D
 

Leazy

You can change this now in User CP.
Reaction score
50
For dealing more damage for a greater distance the trigger you made yourself above works :)
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
please keep in mind the trigger by leazy leaks unit groups and points. if you are not familiar with memory leaks you should read some turtorials about them cause they are serious threats in wc3 map making.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top