how to correct this loop

Mezion

New Member
Reaction score
0
It's working properly but I can target more thant 1 unit, else it fanish from the first :( I was able to do it with an other spell but not this one, what should be changed?

Trigger:
  • Leech Seed
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Leech Seed
    • Actions
      • Custom script: local unit e = GetSpellTargetUnit()
      • Custom script: set udg_Temp_Unit = e
      • For each (Integer B) from 1 to 30, do (Actions)
        • Loop - Actions
          • Wait 1.00 seconds
          • Set intLifeMax[0] = (Integer((Life of Temp_Unit)))
          • Unit - Cause (Triggering unit) to damage Temp_Unit, dealing 3.00 damage of attack type Chaos and damage type Normal
          • Set intLifeMin[0] = (Integer((Life of Temp_Unit)))
          • Set intLifeAfter = (Integer((Life of (Triggering unit))))
          • Unit - Set life of (Triggering unit) to ((Real(intLifeAfter)) + (1.00 x ((Real(intLifeMax[0])) - (Real(intLifeMin[0])))))
          • Special Effect - Create a special effect attached to the overhead of Temp_Unit using Abilities\Spells\Human\Slow\SlowCaster.mdl
      • Custom script: set e = null


Note: I know my special effect leaks, I just put it there for a visual while testing
 

BlueMirage

Trust, but doubt.
Reaction score
39
Trigger:
  • Custom script: set udg_Temp_Unit = e

Move this line to after the 1 second wait.
Also, you can simplify the heal mechanism. You only need one variable, a "Real" variable, since damage is counted in real values.
Save TempReal before damage.
Set life of (Triggering Unit) to (Life of Triggering Unit) + (TempReal - Life of TempUnit)
 

Mezion

New Member
Reaction score
0
Trigger:
  • Custom script: set udg_Temp_Unit = e

Move this line to after the 1 second wait.
Also, you can simplify the heal mechanism. You only need one variable, a "Real" variable, since damage is counted in real values.
Save TempReal before damage.
Set life of (Triggering Unit) to (Life of Triggering Unit) + (TempReal - Life of TempUnit)

Ty it works great now ^^

but I'm not sure I get the `save TempReal`part <_<
What do I set it to?
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
Wow bogrim that just taught me some new shit. Thanks a lot
and +rep
 
General chit-chat
Help Users

      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