More trigger questions...

S

Shoadowshift

Guest
How do i make a unit get damaged by a % of the distance he moves in a certain time, would like it done as he moves not after the timer runs out.
also, i would like this effect only if a unit has a certain buff at the time a certain spell is cast on him. It sounds possible, though i dont no how to make it.
Cheers for any help
 

Light Alkmst

New Member
Reaction score
20
Do you mean that he gets damaged each interval that he's moving, or at the end, based on how far he was from his initial location?

JASS:

local unit u = GetTriggerUnit()
local unit t = GetSpellTargetOrder()
local location l = GetUnitLoc(t)

loop
     exitwhen // I think its GetUnitEffectLevel(t, BUFF_CODE) == 0

     call UnitDamageTarget(u, t, PERCENTAGE * DistanceBetweenPoints(l, GetUnitLoc(t)), false, false, ATTACK_TYPE_SPELLS, DAMAGE_TYPE_UNKNOWN, null)
     // Replace the damage and attack types with w/e you want
     set l = GetUnitLoc(t)
endloop
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top