It doesn't work.
I think event i used doesn't work on illusions
say what's wrong?
PS: miss is not in func. calling in map..
I think event i used doesn't work on illusions
say what's wrong?
Code:
//udg_I_Units : array of unit
//udg_I_UNum : integer
//udg_I_Buf : integer
//udg_I_Triggers : array of trigger
function I_Func takes nothing returns nothing
if (IsUnitIllusion(GetEnumUnit())) then
set udg_I_Units[udg_I_Buf] = GetEnumUnit()
call DisplayTimedTextToForce( GetPlayersAll(), 10.00, "Êëîí:" + GetUnitName(GetEnumUnit()) )
set udg_I_Buf = udg_I_Buf + 1
set udg_I_UNum = udg_I_UNum + 1
else
endif
call DisplayTimedTextToForce( GetPlayersAll(), 10.00, "Êîëè÷åñòâî: " + I2S(udg_I_UNum))
endfunction
function I_Damaged takes nothing returns nothing
local effect e
call SetUnitLifeBJ( udg_I_Units[13] , ( GetUnitStateSwap(UNIT_STATE_LIFE, udg_I_Units[13]) + GetEventDamage() ) )
call AddSpecialEffectTargetUnitBJ( "chest", udg_I_Units[13], "Abilities\\Spells\\Other\\Silence\\SilenceAreaBirth.mdl" )
set e = GetLastCreatedEffectBJ()
call PolledWait( 0.50 )
call DestroyEffectBJ( e )
call DisplayTimedTextToForce( GetPlayersAll(), 10.00, "Ñîáûòèå îáðàáîòàíî")
endfunction
function I_CTriggers takes nothing returns nothing
local integer a = 0
loop
exitwhen (a > udg_I_UNum)
set udg_I_Triggers[a] = CreateTrigger()
call TriggerRegisterUnitEvent( udg_I_Triggers[a], udg_I_Units[a], EVENT_UNIT_DAMAGED )
call TriggerAddAction( udg_I_Triggers[a], function I_Damaged )
call DisplayTimedTextToForce( GetPlayersAll(), 10.00, "Ñîáûòèå çàðåãèñòðèðîâàíî")
set a = a + 1
endloop
set a = 0
call DisplayTimedTextToForce( GetPlayersAll(), 10.00, "Òðèããåðû ñîçäàíû")
endfunction
function I_Search4I takes nothing returns nothing
set udg_I_Units[13] = GetTriggerUnit()
call DisplayTimedTextToForce( GetPlayersAll(), 10.00, "Ãåðîé:" + GetUnitName(udg_I_Units[13]) )
set udg_I_Buf = 0
set udg_I_UNum = 0
call ForGroupBJ( GetUnitsInRangeOfLocAll(900.00, GetUnitLoc(udg_I_Units[13])), function I_Func )
call I_CTriggers()
set udg_I_Buf = 0
call DestroyGroup(GetLastCreatedGroup())
endfunction
PS: miss is not in func. calling in map..