Ok, guys... So, i made this code to order all selected units to blink together, to the same spot, once any of them(selected units) blinks.
In a breath, if one blinks, everybody blinks.
this next trigger prevents recursive calls from " gg_trg_Group_Blink_Stalker" trigger:
Do I have a group leak or something else?
Will the second trigger respond in time for another player trying to blink?
thx for reply.
In a breath, if one blinks, everybody blinks.
JASS:
function Group_Blink_Stalker_Order takes nothing returns nothing
local unit U = GetEnumUnit()
local location L = GetSpellTargetLoc()
local real X = GetLocationX(L)
local real Y = GetLocationY(L)
if ( GetUnitTypeId(U) == 039;n00U039; ) then
call IssuePointOrder( U, "blink", X,Y )
set U = null
call RemoveLocation(L)
set L = null
set udg_RecursiveUnit = GetEnumUnit()
call DisableTrigger( GetTriggeringTrigger() )
endif
endfunction
function Group_Blink_Stalker_Actions takes nothing returns nothing
local unit U = GetTriggerUnit()
set udg_ALLMAP = GetUnitsSelectedAll(GetOwningPlayer(U))
call GroupRemoveUnit(udg_ALLMAP, U)
if ( ( GetUnitTypeId(U) == 039;n00U039; ) and ( GetSpellAbilityId() == 039;A004039; ) ) then
call ForGroupBJ( udg_ALLMAP, function Group_Blink_Stalker_Order)
endif
call DisplayTextToForce( GetPlayersAll(), "aaaaaaaaaa" )
call DestroyGroup(udg_ALLMAP)
set U = null
endfunction
//===========================================================================
function InitTrig_Group_Blink_Stalker takes nothing returns nothing
set gg_trg_Group_Blink_Stalker = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Group_Blink_Stalker, EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddAction( gg_trg_Group_Blink_Stalker, function Group_Blink_Stalker_Actions )
endfunction
this next trigger prevents recursive calls from " gg_trg_Group_Blink_Stalker" trigger:
JASS:
function Group_Blink_Stalker_On_Actions takes nothing returns nothing
local unit U = GetTriggerUnit()
if ( ( U == udg_RecursiveUnit) and ( GetSpellAbilityId() == 039;A004039; ) ) then
call EnableTrigger( gg_trg_Group_Blink_Stalker )
set udg_RecursiveUnit = null
endif
set U = null
endfunction
//===========================================================================
function InitTrig_Group_Blink_Stalker_On takes nothing returns nothing
set gg_trg_Group_Blink_Stalker_On = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Group_Blink_Stalker_On, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddAction( gg_trg_Group_Blink_Stalker_On, function Group_Blink_Stalker_On_Actions )
endfunction
Do I have a group leak or something else?
Will the second trigger respond in time for another player trying to blink?
thx for reply.