Можно ли их задействовать сразу в 2 тригеррах?
например : ГУИ
юнит применяет способность
Равная то то...
cast unit=применяющий юнит
Fire=0
то сделать дамми
дать жизнь на 10 сек
запустить след триггер (естественно со всеми переменными)
след триггер*
каждую 0.01 сек
Fire=Fire+5
дамми переместить в точку cast unit со смещением 200 градусы Fire.
Как такое сделать на Jass?
Я начал делать 1 триггер сделал успешно без косяков)
а соединить со вторым не могу (так как локальные переменные)
первый триггер Jass:
Код: Выделить всё
function Trig_fire_____________________u_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00V' ) ) then
return false
endif
return true
endfunction
function Trig_fire_____________________u_Actions takes nothing returns nothing
local real ICE2 = 0
local real ICE3 = 90
local real ICE4 = 180
local real ICE5 = 270
local unit Ice_arrow1
local unit Ice_arrow2
local unit Ice_arrow3
local unit Ice_arrow4
local unit Ice_arrow_Cast2 = GetSpellAbilityUnit()
set udg_ICE2 = 0.00
set ICE2 = udg_ICE2 (соединяю с глобальными для переноса в след триггер)
set udg_ICE2 = 90.00
set ICE3 = udg_ICE3(соединяю с глобальными для переноса в след триггер)
set udg_ICE2 = 180.00
set ICE4 = udg_ICE4(соединяю с глобальными для переноса в след триггер)
set udg_ICE2 = 270.00
set ICE5 = udg_ICE5(соединяю с глобальными для переноса в след триггер)
set udg_Ice_arrow_Cast2 = GetSpellAbilityUnit()(соединяю с глобальными для переноса в след триггер)
set Ice_arrow_Cast2 = udg_Ice_arrow_Cast2(соединяю с глобальными для переноса в след триггер)
call TriggerSleepAction( 1.00 )
call CreateNUnitsAtLoc( 1, 'h008', GetOwningPlayer(Ice_arrow_Cast2), GetUnitLoc(Ice_arrow_Cast2), GetUnitFacing(Ice_arrow_Cast2) )
set Ice_arrow1 = GetLastCreatedUnit()
set udg_Ice_arrow1 = GetLastCreatedUnit()(соединяю с глобальными для переноса в след триггер)
set Ice_arrow1 = udg_Ice_arrow1
call UnitApplyTimedLifeBJ( 11.00, 'BTLF', Ice_arrow1 )
call CreateNUnitsAtLoc( 1, 'h008', GetOwningPlayer(Ice_arrow_Cast2), GetUnitLoc(Ice_arrow_Cast2), GetUnitFacing(Ice_arrow_Cast2) )
set Ice_arrow2 = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 11.00, 'BTLF', Ice_arrow2 )
call CreateNUnitsAtLoc( 1, 'h008', GetOwningPlayer(Ice_arrow_Cast2), GetUnitLoc(Ice_arrow_Cast2), GetUnitFacing(Ice_arrow_Cast2) )
set Ice_arrow3 = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 11.00, 'BTLF', Ice_arrow3 )
call CreateNUnitsAtLoc( 1, 'h008', GetOwningPlayer(Ice_arrow_Cast2), GetUnitLoc(Ice_arrow_Cast2), GetUnitFacing(Ice_arrow_Cast2) )
set Ice_arrow4 = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 11.00, 'BTLF', Ice_arrow4 )
call EnableTrigger( gg_trg_fire1 )
call EnableTrigger( gg_trg_fire2 )
call EnableTrigger( gg_trg_fire3 )
call EnableTrigger( gg_trg_fire4 )
call TriggerSleepAction( 11.00 )
call DisableTrigger( gg_trg_fire1 )
call DisableTrigger( gg_trg_fire2 )
call DisableTrigger( gg_trg_fire3 )
call DisableTrigger( gg_trg_fire4 )
endfunction
//===========================================================================
function InitTrig_fire_____________________u takes nothing returns nothing
set gg_trg_fire_____________________u = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_fire_____________________u, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_fire_____________________u, Condition( function Trig_fire_____________________u_Conditions ) )
call TriggerAddAction( gg_trg_fire_____________________u, function Trig_fire_____________________u_Actions )
endfunction
Триггер 2
function Trig_fire1_Func005Func001C takes nothing returns boolean
if ( not ( GetOwningPlayer(GetEnumUnit()) == Player(11) ) ) then
return false
endif
return true
endfunction
function Trig_fire1_Func005A takes nothing returns nothing
if ( Trig_fire1_Func005Func001C() ) then
call SetUnitFacingToFaceUnitTimed( GetEnumUnit(), Ice_arrow_Cast2, 0 )
call SetUnitFacingToFaceUnitTimed( GetEnumUnit(), 0, 0 )
call SetUnitPositionLoc( GetEnumUnit(), PolarProjectionBJ(GetUnitLoc(GetEnumUnit()), -10.00, GetUnitFacing(GetEnumUnit()))
else
endif
endfunction
function Trig_fire1_Actions takes nothing returns nothing
local unit Ice_arrow1
local real ICE2
local location Ice_arrow_Cast_target1
local unit Ice_arrow_Cast2
local integer GetEnumUnit = 0
set udg_Ice_arrow_Cast2 = Ice_arrow_Cast2
set udg_Ice_arrow1 = Ice_arrow1
set udg_ICE2 = ICE2
set udg_Ice_arrow_Cast_target1 = Ice_arrow_Cast_target1
set Ice_arrow_Cast_target1 = GetUnitLoc(Ice_arrow1)
set ICE2 = ( ICE2 + 5.00 )
call SetUnitPositionLoc( Ice_arrow1, PolarProjectionBJ(GetUnitLoc(Ice_arrow_Cast2), 150.00, ICE2) )
call IssuePointOrderLocBJ( Ice_arrow1, "move", PolarProjectionBJ(GetUnitLoc(Ice_arrow_Cast2), 500.00, ( ICE2 + 1.00 )) )
call ForGroupBJ( GetUnitsInRangeOfLocAll(150.00, Ice_arrow_Cast_target1), function Trig_fire1_Func005A )
endfunction
//===========================================================================
function InitTrig_fire1 takes nothing returns nothing
set gg_trg_fire1 = CreateTrigger( )
call DisableTrigger( gg_trg_fire1 )
call TriggerRegisterTimerEventPeriodic( gg_trg_fire1, 0.01 )
call TriggerAddAction( gg_trg_fire1, function Trig_fire1_Actions )
endfunction