function Trig_Shield_Dummy_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
return true
endfunction
function SizeIncreaser takes unit dummy, real size, real stime returns nothing
local integer LoopQuiter = 0
loop
exitwhen LoopQuiter == stime // 5 second duration, adjust as needed
call SetUnitScalePercent( dummy, size , size , size )
call TriggerSleepAction(0.10) // minimum wait time
set LoopQuiter = LoopQuiter + 1
endloop
set LoopQuiter = 0
set dummy = null
set size = 0.00
set stime = 0
endfunction
function Trig_Shield_Dummy_Actions takes nothing returns nothing
// A000 represents your spell, H000 represents the dummy
local unit ShieldDummy
local unit Caster = GetSpellAbilityUnit()
local unit Target = GetSpellTargetUnit()
local real Size = 101.00
local real DLife = 6.00
local integer SizeTime = ((R2I(DLife) - 1) * 10)
// Caster and Target included if you apply some effects to either of them, I'm not sure what your ability does
call CreateNUnitsAtLocFacingLocBJ( 1, 'h000', GetOwningPlayer(GetSpellAbilityUnit()), GetUnitLoc(GetSpellAbilityUnit()), GetUnitLoc(GetEventTargetUnit()) )
call UnitApplyTimedLifeBJ( DLife, 'BTLF', ShieldDummy )
set ShieldDummy = GetLastCreatedUnit()
//Insert other effects here
call SizeIncreaser( ShieldDummy, Size, SizeTime )
set ShieldDummy = null
set Caster =null
set Target = null
set Size = 0.00
set DLife = 0.00
set SizeTime = 0
endfunction
//===========================================================================
function InitTrig_Shield_Dummy takes nothing returns nothing
set gg_trg_Shield_Dummy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shield_Dummy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Shield_Dummy, Condition( function Trig_Shield_Dummy_Conditions ) )
call TriggerAddAction( gg_trg_Shield_Dummy, function Trig_Shield_Dummy_Actions )
endfunction