У меня есть спелл раскинутый на несколько триггеров. Надо сделать 1 триггер, максимум 2. В одном из триггеров добавляется событие Юнит Получает Урон. Разбит он изза таймеров и событий с маленьким периодом. Я хочу сделать его в одном триггере, используя желательно только локальные таймеры.
Вот спелл. Он делает так, что пока он активен, если героя убивают, то он падает, проигрывается анимация смерти, но потом встаёт, а убивший его юнит умирает. Естественно время действия скилла очень маленькое, что бы это не было имбой, и поэтому его стоит включать когда героя вот вот убьют. Октат скилла тоже большой... Но не в этом щас дело.
Вот триггеры. Переменная TDCaster задана заранее ещё при выборе героя в таверне. Тип переменной - Юнит. Ею отмечается сам герой.
Code
Transfer Death
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Transfer Death Leoric
Actions
Trigger - Turn on Transfer Death Loop <gen>
Set TD_Active = True
Set TDTime = (((Real((Level of Transfer Death Leoric for TDCaster))) x 2.00) + 10.00)
Unit - Add Belial to TDCaster
Player - Disable Belial for (Owner of TDCaster)
Sound - Play SargerasLaugh <gen> at 100.00% volume, attached to TDCaster
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TDCaster is in TDGroup) Equal to False
Then - Actions
Trigger - Add to Transfer Damage <gen> the event (Unit - TDCaster Takes damage)
Unit Group - Add TDCaster to TDGroup
Else - Actions
Countdown Timer - Start TimerTD1 as a One-shot timer that will expire in TDTime seconds
Code
Transfer Death 2
Events
Time - TimerTD1 expires
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TD_Done Equal to True
Then - Actions
Countdown Timer - Start TimerTD2 as a One-shot timer that will expire in 3.60 seconds
Else - Actions
Cinematic - Enable user control for (Player group((Owner of TDCaster)))
Unit - Make TDCaster Vulnerable
Trigger - Turn off Transfer Death Loop <gen>
Unit - Remove Spell Immunity Belial from TDCaster
Unit - Remove Belial from TDCaster
Unit - Remove Cargo Hold (Orc Burrow) from TDCaster
Animation - Play TDCaster's stand animation
Set TDTaker = No unit
Custom script: call RemoveUnit(udg_TDTaker)
Set TD_Done = False
Set TD_Active = False
Code
Transfer Death 3
Events
Time - TimerTD2 expires
Conditions
Actions
Cinematic - Enable user control for (Player group((Owner of TDCaster)))
Unit - Make TDCaster Vulnerable
Trigger - Turn off Transfer Death Loop <gen>
Unit - Remove Spell Immunity Belial from TDCaster
Unit - Remove Belial from TDCaster
Unit - Remove Cargo Hold (Orc Burrow) from TDCaster
Animation - Play TDCaster's stand animation
Set TDTaker = No unit
Custom script: call RemoveUnit(udg_TDTaker)
Set TD_Done = False
Set TD_Active = False
Code
Transfer Death Loop
Events
Time - Every 0.02 seconds of game time
Conditions
Actions
Unit - Remove Slow Poison (Info) buff from TDCaster
Unit - Remove Venom (Non-stacking) buff from TDCaster
Unit - Remove Venom (Stacking) buff from TDCaster
Unit - Remove Burn (Non-stacking) buff from TDCaster
Unit - Remove Burn (Stacking) buff from TDCaster
Unit - Remove Explode buff from TDCaster
Unit - Remove Stunned (Pause) buff from TDCaster
Unit - Make TDCaster Die normally on death
Code
Transfer Damage (в этот триггер добавляется событие Юнит Получает Урон)
Events
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TD_Active Equal to True
Then - Actions
Set TDDamage = ((Damage taken) x 1.00)
Set TDTaker = (Damage source)
-------- _____________________________________________________________________________ --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of TDTaker) Not equal to |c00EFDA3DTyrael|r
(Unit-type of TDTaker) Not equal to |c00EFDA3DDiablo|r
TDDamage Greater than or equal to (Life of TDCaster)
Then - Actions
Set TD_Done = True
Unit - Set life of TDCaster to (TDDamage + (0.25 x (Max life of TDCaster)))
Unit - Make TDCaster Invulnerable
Unit - Make TDTaker Invulnerable
Unit - Order TDCaster to Stop
Unit - Add Cargo Hold (Orc Burrow) to TDCaster
Cinematic - Disable user control for (Player group((Owner of TDCaster)))
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Selection - Remove TDCaster from selection for (Picked player)
Unit - Order TDCaster to Stop
Unit - Remove Transfer Death buff from TDCaster
Sound - Play SargerasLaugh <gen> at 100.00% volume, attached to TDCaster
Animation - Play TDCaster's death animation
Countdown Timer - Start TimerTD3 as a One-shot timer that will expire in 2.35 seconds
Else - Actions
Set TDTaker = No unit
Custom script: call RemoveUnit(udg_TDTaker)
Else - Actions
Code
Transfer Damage 2
Events
Time - TimerTD3 expires
Conditions
Actions
Special Effect - Create a special effect attached to the origin of TDTaker using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
Special Effect - Destroy (Last created special effect)
Countdown Timer - Start TimerTD4 as a One-shot timer that will expire in 0.85 seconds
Code
Transfer Damage 3
Events
Time - TimerTD4 expires
Conditions
Actions
Special Effect - Create a special effect attached to the origin of TDCaster using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
Special Effect - Destroy (Last created special effect)
Unit - Make TDTaker Vulnerable
Unit - Kill TDTaker
Animation - Play TDCaster's attack - 2 animation
Cinematic - Enable user control for (Player group((Owner of TDCaster)))
Selection - Select TDCaster for (Owner of TDCaster)
Unit - Make TDCaster Vulnerable
Unit - Remove Spell Immunity Belial from TDCaster
Unit - Remove Belial from TDCaster
Unit - Remove Cargo Hold (Orc Burrow) from TDCaster
Animation - Play TDCaster's stand animation
Trigger - Turn off Transfer Death Loop <gen>
Set TDTaker = No unit
Custom script: call RemoveUnit(udg_TDTaker)
Set TD_Done = False
Set TD_Active = False