Вот код спелла из доты Nevermore Shadow Fiend способность Shawodraze, когда я использую способность она просто не действует
Code
function TrigShadowraze200_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'AUtc'
endfunction
function TrigShadowraze200_Actions takes nothing returns nothing
local unit Shadowraze = GetSpellAbilityUnit ()
local location Loc
local real x1 = GetLocationX(Loc) + 200 * Cos(GetUnitFacing(Shadowraze))
local real y1 = GetLocationX(Loc) + 200 * Sin(GetUnitFacing(Shadowraze))
set Loc = Location(x1,y1)
call SaveUnitHandle(udg_hash, 2 , 2 , Shadowraze)
call SaveLocationHandle(udg_hash, 4, 4, Loc)
call SaveReal(udg_hash , 5 , 5 , x1)
call SaveReal(udg_hash , 6 , 6 , y1)
call CreateUnit (GetOwningPlayer(LoadUnitHandle(udg_hash, 2, 2)), 'h000' ,LoadReal(udg_hash,5 ,5),LoadReal(udg_hash , 6, 6), bj_UNIT_FACING)
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 1.00 )
call IssueImmediateOrder( bj_lastCreatedUnit, "thunderclap" )
call RemoveLocation(LoadLocationHandle(udg_hash , 4 , 4))
set Shadowraze = null
endfunction
//===========================================================================
function InitTrig_Shadowraze_200 takes nothing returns nothing
local trigger Shadowraze200 = CreateTrigger( )
local integer SW200 = 0
loop
call TriggerRegisterPlayerUnitEvent( Shadowraze200, Player(SW200), EVENT_PLAYER_UNIT_SPELL_EFFECT, null )
exitwhen SW200 == 15
set SW200 = SW200 + 1
endloop
call TriggerAddCondition( Shadowraze200, Condition( function TrigShadowraze200_Conditions ) )
call TriggerAddAction( Shadowraze200, function TrigShadowraze200_Actions )
endfunction