first I explain what i want to do:
I want to make a spell, that sucks out 20 life from all nearby Units and add it to the caster, but if the caster reaches full Health the life grows still, by adding instead of each 25life 1 strength. And that happens (5+lvlofability)times. Here is the Trigger:
my Problem is:
at the end it shows me, that the variable "absorbiertesleben" is 260 (cause there were 13 Units near) but when I add the Variable to Life i always got far to much (3250), and when the Hero got his Life full he gets always 130 strength. I noticed, that 130x25= 3250 so it looks that everything looks well except, that the trigger thinks when adding the variable as life, that the variable is 3250 instead of 260
Does anybody know why too much life is added? How can I fix that?
I want to make a spell, that sucks out 20 life from all nearby Units and add it to the caster, but if the caster reaches full Health the life grows still, by adding instead of each 25life 1 strength. And that happens (5+lvlofability)times. Here is the Trigger:
-
ability4lebensaugen
-
Events
- Unit - A unit starts the effect of a ability
-
Conditions
- (Ability being cast) like Leben entziehen
-
Actions
-
For each (Integer A) from 1 to (5 + (3 x (Level of Leben entziehen for (Triggering unit)))), do (Actions)
-
Loop - Actions
- Wait 1.00 seconds
-
Unitgroup - Pick every unit in (Units within 1024.00 of (Position of (Triggering unit)) matching ((Matching unit) unlike (Triggering unit))) and do (Actions)
-
Loop - Actions
- Unit - Cause (Triggering unit) to damage (Picked unit), dealing (20.00 + (Real ((Level of Leben entziehen for (Triggering unit))))) damage of attack type spell and damage type Normal
- Set absorbiertesleben = ((Number of units in (Units within 1024.00 of (Position of (Triggering unit)) matching ((Matching unit) unlike (Triggering unit)))) x (20 + 0))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
- (Life of (Triggering unit)) like (Max. Life of (Triggering unit))
-
'THEN'-Actions
- Hero - Modify strength of (Triggering unit): add (absorbiertesleben / 25)
-
'ELSE'-Actions
- Unit - Set life of (Triggering unit) to ((life of (Triggering unit)) + (Real(absorbiertesleben)))
-
'IF'-Conditions
- Floating Text - Create floating text that reads (String(absorbiertesleben)) at (Position of (Triggering unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
-
Loop - Actions
-
Loop - Actions
-
For each (Integer A) from 1 to (5 + (3 x (Level of Leben entziehen for (Triggering unit)))), do (Actions)
-
Events
my Problem is:
at the end it shows me, that the variable "absorbiertesleben" is 260 (cause there were 13 Units near) but when I add the Variable to Life i always got far to much (3250), and when the Hero got his Life full he gets always 130 strength. I noticed, that 130x25= 3250 so it looks that everything looks well except, that the trigger thinks when adding the variable as life, that the variable is 3250 instead of 260
Does anybody know why too much life is added? How can I fix that?