Hi, I made an ability based of Command Aura (but the ability isn't an aura anymore) that makes that everytime a unit hit something, friendly unit beside the hero (which have the command aura buff named "Divine Hammer") get healed, but I tryed my trigger and it isn't working. Here it is :
I'd appreciate if you could tell me what's wrong and if there is any leak,
RedSword
JASS:
Divine Hammer
Events
Unit - A unit Is attacked
Conditions
((Attacking unit) has buff Divine Hammer ) Equal to True
((Attacked unit) is A ground unit) Equal to True
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Divine Hammer for (Attacking unit)) Equal to 1
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Less than or equal to 100
Then - Actions
Set Temp_Point = (Position of (Attacking unit))
Set Temp_Group = (Units within 200.00 of Temp_Point matching (((Matching unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True))
Unit Group - Pick every unit in Temp_Group and do (Actions)
Loop - Actions
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 50.00)
Unit - Set life of (Attacking unit) to ((Life of (Attacking unit)) + 10.00)
Set Temp_Point2 = (Position of (Picked unit))
Special Effect - Create a special effect at Temp_Point2 using Abilities\Spells\Human\Heal\HealTarget.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation(udg_Temp_Point2)
Unit - Set life of (Attacking unit) to ((Life of (Attacking unit)) - 60.00)
Custom script: call DestroyGroup(udg_Temp_Group)
Custom script: call RemoveLocation(udg_Temp_Point)
Else - Actions
Do nothing
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Less than or equal to 100
Then - Actions
Set Temp_Point = (Position of (Attacking unit))
Set Temp_Group = (Units within ((Real((Level of Divine Hammer for (Attacking unit)))) + 125.00) of Temp_Point matching (((Matching unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True))
Unit Group - Pick every unit in Temp_Group and do (Actions)
Loop - Actions
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (((Real((Level of Divine Hammer for (Attacking unit)))) x 50.00) - 50.00))
Unit - Set life of (Attacking unit) to ((Life of (Attacking unit)) + 10.00)
Set Temp_Point2 = (Position of (Picked unit))
Special Effect - Create a special effect at Temp_Point2 using Abilities\Spells\Human\Heal\HealTarget.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation(udg_Temp_Point2)
Unit - Set life of (Attacking unit) to ((Life of (Attacking unit)) - (((Real((Level of Divine Hammer for (Attacking unit)))) x 50.00) - 40.00))
Custom script: call DestroyGroup(udg_Temp_Group)
Custom script: call RemoveLocation(udg_Temp_Point)
Else - Actions
Do nothing
I'd appreciate if you could tell me what's wrong and if there is any leak,
RedSword