- Joined
- Mar 26, 2008
- Messages
- 239
I've read that custom stun (stunning any unit by triggers anywhere for any duration) can be made by adding remade "Aerial Shackles" ability (removed animations,added animation of stun,infinite duration) to a dummy and adding expiration timer to it,then ordering to use it to unit which should be stunned.
I tried to do such system,but it doesn't work,I think because I missed something in the system,but cannot find what...
"e00A" is dummy id, 'A019' is id of ability, "magicleash" - order
I tried to do such system,but it doesn't work,I think because I missed something in the system,but cannot find what...
JASS:
function StunUnit takes unit target, real duration returns nothing
local unit T = target
local unit D
local location L = GetUnitLoc(T)
local real R = duration
if ( IsUnitIdType(GetUnitTypeId(T), UNIT_TYPE_MAGIC_IMMUNE) == false ) then
set D = CreateUnitAtLoc(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'e00A' , L, bj_UNIT_FACING )
call UnitAddAbility(D,'A019')
call IssueTargetOrder(D, "magicleash",T)
call UnitApplyTimedLife(D,'BTLF',R)
else
endif
set D = null
set T = null
call RemoveLocation(L)
set L = null
endfunction