So i am trying to make a Unit Takes damage kind of trigger. It doesnt work at all, i dont even regenerate the HP when attacked. Here are both triggers:
Please help, i will +rep you ^^ (what everybody wants ):
Code:
Protection
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Unholy Protection
Actions
Set unitProtected = (Triggering unit)
Set integerDamage = 0
Trigger - Add to Return damage <gen> the event (Unit - unitProtected Takes damage)
Wait 4.00 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(unitProtected has buff Unholy Protection ) Equal to True
Then - Actions
Unit Group - Pick every unit in (Units within 500.00 of (Position of unitProtected) matching (((Matching unit) belongs to an enemy of (Owner of unitProtected)) Equal to True)) and do (Actions)
Loop - Actions
Unit Group - Add (Picked unit) to DamageGroup
Set unitChosen = (Random unit from DamageGroup)
Unit - Move unitProtected instantly to (Position of unitChosen)
Special Effect - Create a special effect at (Position of unitChosen) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
Special Effect - Destroy (Last created special effect)
Unit - Cause unitProtected to damage unitChosen, dealing ((Real(integerDamage)) x (Real((Level of Unholy Protection for unitProtected)))) damage of attack type Spells and damage type Normal
Else - Actions
Do nothing
Code:
Return damage
Events
Conditions
(unitProtected has buff Unholy Protection ) Equal to True
Actions
Unit - Set life of unitProtected to ((Life of unitProtected) + (Damage taken))
Set integerDamage = (integerDamage + (Integer((Damage taken))))
Please help, i will +rep you ^^ (what everybody wants ):