//A000 = your ability
function Sprout_Spell takes nothing returns boolean
return GetSpellAbilityId()=='A000'
endfunction
function Sprout_Main takes nothing returns nothing
local destructable array ldx
local integer lEq
local integer lEQ
local fogmodifier loB
local unit lJV=GetTriggerUnit()
local unit lFB=GetSpellTargetUnit()
local location ln3=GetUnitLoc(lFB)
set loB=CreateFogModifierRadiusLocBJ(true,GetOwningPlayer(lJV),FOG_OF_WAR_VISIBLE,ln3,1000.)
set lEq=1
set lEQ=8
loop
exitwhen lEq>lEQ
set ldx[lEq]=CreateDestructableLoc('LTlt',PolarProjectionBJ(ln3,150.,(I2R(lEq)*45.)),GetRandomReal(0,360),1,0)
set lEq=lEq+1
endloop
call PolledWait((2.25+(.75*I2R(GetUnitAbilityLevelSwapped('A000,lJV)))))
set lEq=1
set lEQ=8
loop
exitwhen lEq>lEQ
call KillDestructable(ldx[lEq])
set lEq=lEq+1
endloop
call DestroyFogModifier(loB)
call PolledWait(4.)
set lEq=1
set lEQ=8
loop
exitwhen lEq>lEQ
call RemoveDestructable(ldx[lEq])
set lEq=lEq+1
endloop
call RemoveLocation(ln3)
endfunction
function Sprout_CheckHelp takes nothing returns nothing
if GetSpellAbilityId()=='A06Q'and IsUnitAlly(GetSpellTargetUnit(),GetOwningPlayer(GetTriggerUnit()))and GetBoolean(H2Tx(GetOwningPlayer(GetSpellTargetUnit())),"L6")then
call DropOrder(GetTriggerUnit())
call SimError(GetOwningPlayer(GetTriggerUnit()),"This target has disablehelp on")
endif
endfunction
function Sprout_Init takes nothing returns nothing
local trigger ltt
set udg_triggerl097=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(udg_triggerl097,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(udg_triggerl097,Condition(function Sprout_Spell))
call TriggerAddAction(udg_triggerl097,function Sprout_Main)
set ltt=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(ltt,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddAction(ltt,function Sprout_CheckHelp)
endfunction