Hello guys I made a Unit Target Spell that will damage target, heals the caster and stuns the target on the 3rd cast of the ability. Here's the trigger.
Right now I'm having a couple of bugs from the Maul Trigger.
1) It stuns the target forever in 1st cast, (the Hero ability is based on a hurl boulder ability and the Dummy ability too, both of them are set to 0 stun duration).
2) It doesn't heal the hero.
3) Somehow this Fury Trigger below stacks with Maul Trigger.
This trigger heals the hero on his 3rd basic attack. The problem is that when the hero attacked 2 times and cast the Maul Ability, he heals himself. Same as when the hero cast the Maul Ability 2 times, his next attack will heal himself. Need help guys on pointing out what's causing the bugs 
-
Maul
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Maul
-
-
Actions
-
-------- ------------------------------------------------------------------------------------------------- --------
-
-------- Getting the Spell constants --------
-
-------- ------------------------------------------------------------------------------------------------- --------
-
Set Temp_Unit = (Triggering unit)
-
Set Temp_Target = (Target unit of ability being cast)
-
Set TempPlayer = (Owner of Temp_Unit)
-
Set Temp_Location = (Position of Temp_Target)
-
Set TempAbility = Maul Stun (Dummy Ability)
-
-------- ------------------------------------------------------------------------------------------------- --------
-
-------- Setting the Spell values --------
-
-------- ------------------------------------------------------------------------------------------------- --------
-
Set Temp_Stats = (Strength of Temp_Unit (Include bonuses))
-
Set Temp_Ability_Level = (Level of (Ability being cast) for Temp_Unit)
-
Set Temp_Value = (40.00 x (Real(Temp_Ability_Level)))
-
Set Temp_Value_2 = (10.00 x (Real(Temp_Ability_Level)))
-
Set Temp_Total_Value = (Temp_Value + (0.25 x (Real(Temp_Stats))))
-
-------- ------------------------------------------------------------------------------------------------- --------
-
-------- Damage the target and heals the caster --------
-
-------- ------------------------------------------------------------------------------------------------- --------
-
Unit - Cause Temp_Unit to damage Temp_Target, dealing Temp_Total_Value damage of attack type Normal and damage type Normal
-
Unit - Set life of Temp_Unit to (Real(((Integer((Life of Temp_Unit))) + (Integer(Temp_Total_Value_2)))))
-
-------- ------------------------------------------------------------------------------------------------- --------
-
-------- Stuns the target at 3rd cast --------
-
-------- ------------------------------------------------------------------------------------------------- --------
-
Set TempInteger2 = 2
-
Set Maul_Count[TempInteger2] = (Maul_Count[TempInteger2] + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Maul_Count[TempInteger2] Equal to 3
-
-
Then - Actions
-
Unit - Create 1 Dummy Unit for TempPlayer at Temp_Location facing Default building facing degrees
-
Set Temp_Dummy = (Last created unit)
-
Unit - Add a 1.50 second Generic expiration timer to Temp_Dummy
-
Unit - Add TempAbility to Temp_Dummy
-
Unit - Set level of TempAbility for Temp_Dummy to Temp_Ability_Level
-
Unit - Order Temp_Dummy to Neutral - Hurl Boulder Temp_Target
-
Set Maul_Count[TempInteger1] = 0
-
Custom script: call RemoveLocation(udg_Temp_Location)
-
-
Else - Actions
-
-
-
1) It stuns the target forever in 1st cast, (the Hero ability is based on a hurl boulder ability and the Dummy ability too, both of them are set to 0 stun duration).
2) It doesn't heal the hero.
3) Somehow this Fury Trigger below stacks with Maul Trigger.
-
Fury
-
Events
-
Game - DamageEvent becomes Equal to 1.00
-
-
Conditions
-
IsDamageSpell Equal to False
-
(Level of Fury or DamageEventSource) Greater than 0
-
-
Actions
-
Set Temp_Stats = (Intelligence of DamageEventSource (Include bonuses))
-
Set Temp_Ability_Level = (Level of Fury for DamageEventSource)
-
Set Temp_Value = (10.00 x (Real(Temp_Ability_Level)))
-
Set Temp_Total_Value = (Temp_Value + (0.00 x (Real(Temp_Stats))))
-
Set TempInteger1 = 1
-
Set Fury_Count[TempInteger1] = (Fury_Count[TempInteger1] + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Fury_Count[TempInteger1] Equal to 3
-
-
Then - Actions
-
Unit - Set life of DamageEventSource to (Real(((Integer((Life of DamageEventSource))) + (Integer(Temp_Total_Value)))))
-
Set Fury_Count[TempInteger1] = 0
-
-
Else - Actions
-
-
-
