Code:
MA Settings
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to (==) Mystical Axe
((Triggering unit) is A Hero) Equal to (==) True
Actions
Set MA_Caster = (Triggering unit)
Set MA_CasterOwner = (Owner of MA_Caster)
Set MA_CasterPosition = (Position of MA_Caster)
Set MA_RandomNumber = (Random integer number between 1 and 100)
Set MA_RandomNumberOfAxes = (Random integer number between 2 and 3)
Set MA_Chance = (33 x (Level of Mystical Axe for MA_Caster))
Set MA_Range = 700.00
Trigger - Run MA Effects <gen> (ignoring conditions)
Code:
MA Effects
Events
Conditions
Actions
Do Multiple ActionsFor each (Integer MA_Loop) from 1 to MA_RandomNumberOfAxes, do (Actions)
Loop - Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MA_RandomNumber Less than or equal to (<=) MA_Chance
Then - Actions
Unit Group - Pick every unit in (Units within MA_Range of MA_CasterPosition matching ((((Matching unit) belongs to an enemy of MA_CasterOwner) Equal to (==) True) and (((Matching unit) is alive) Equal to (==) True))) and do (Actions)
Loop - Actions
Unit Group - Add (Picked unit) to MA_PossibleTargets
Unit - Create 1 Dummy Unit for MA_CasterOwner at MA_CasterPosition facing 0.00 degrees
Set MA_Dummy = (Last created unit)
Unit - Add a 2.00 second Generic expiration timer to MA_Dummy
Unit - Add Mystical Axe to MA_Dummy
Unit - Set level of Mystical Axe for MA_Dummy to (Level of Mystical Axe for MA_Caster)
Unit - Order MA_Dummy to Human Mountain King - Storm Bolt (Random unit from MA_PossibleTargets)
Else - Actions
Do nothing
I am with this problem for 2 days and can't solve it T.T