i was wondering if u can make a dummy unit increase in time over a few seconds, but make it so the targeted unit is inside the dummy unit eg. like a peon inside a chain lightining missle the orb, gets bigger.
Ahh I see the problem, as far as I know you can't aquire the current size of something. I would suggest doing this:. create new variable called SizePercent or some such, and make its defult value 101.00. then input this script:
if you want this to be MUI you would use one trigger that looks something like this:
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
edit: forgot expiration timer and I made it so you can change all time related things by manipulating 1 variable.
//=========================================================================== function InitTrig_time takes nothing returns nothing set gg_trg_time = CreateTrigger( ) call DisableTrigger( gg_trg_time ) call TriggerRegisterTimerEventPeriodic( gg_trg_time, 0.01 ) call TriggerAddAction( gg_trg_time, function Trig_time_Actions ) endfunction
is that how iam supposed to do it. i tried the other one copying the custom script in and changes the A000 to the right thing and the dummy to the right value but when i saved it says there was 5 errors and i dont really now jass.