• 🏆 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!

Ability help

Status
Not open for further replies.
Level 3
Joined
Aug 12, 2008
Messages
34
Hey again guys :grin:!

This may seem simple, but I just cannot figure it out, so I hoped any experienced could help me out :D

Okay, a unit is supposed to gain more / less life regeneration and movement speed depending on distance from enemy units. Be aware of that I would like at max distance (2000 range), the movement speed would be at top (30 % increase) and life regen. at 1.00 per. second. At 150 range (closest distance), this has switched and the life regen is now at top with 10.00 per. second and movement at -30 %.

For instance, a footman is 2000 range away from any enemy unit (not allied), it will then receive a buff according to the distance, with x amount of life regen and movement speed. If it moves down to 1500, this buff will change according to this distance.

Any help appreciated, thanks :D

~Razorwind~
 
Level 23
Joined
Oct 18, 2008
Messages
938
make an unholy aura with levels (change it to hero ability, change level field, change it back to unit ability).

  • Events
    • Every X seconds
  • Conditions
  • Actions
    • pick every unit in (units of type X) and do actions:
      • Set TempUnit = Picked Unit
      • Set TempReal = 9001
      • pick every unit in 2000 range matching ((Matching Unit) belongs to an ally of (owner of (TempUnit)) equal to false and (Matching Unit) is alive equal to true)
        • if, then, else
          • if - conditions:
            • Distance between (Picked Unit) and TempUnit less than TempReal
          • then - actions:
            • Set TempReal = Distance between (Picked Unit) and TempUnit
        • if, then, else
          • if - conditions:
            • TempReal not equal to 9001
          • then - actions:
            • Set level of YourAbility for TempUnit = ((integer)Tempreal / 100)
the level of the ability will be distance of closest unit / 100. so for a 2000 max range, the unit would need an ability with 20 levels.
 
Status
Not open for further replies.
Top