Name | Type | is_array | initial_value |
adfg | string | No | |
DifficultyDialog | dialog | No | |
Hard | button | No | |
Normal | button | No | |
RESTART_AcquisitionRange | real | Yes | |
RESTART_Locations | location | Yes | |
RESTART_MaxUnits | integer | No | |
RESTART_Types | unitcode | Yes | |
tempeffect | effect | No | |
tempint | integer | No | |
tempunit | unit | No |
function Trig_Dragon_Whelp_Ressurection_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'nrdk' ) ) then
return false
endif
return true
endfunction
function Trig_Dragon_Whelp_Ressurection_Func013C takes nothing returns boolean
if ( not ( IsUnitAliveBJ(udg_tempunit) == true ) ) then
return false
endif
return true
endfunction
function dragonWhelp takes nothing returns boolean
if (GetUnitTypeId(GetFilterUnit()) != 'nrdk') then
return false
elseif (IsUnitDeadBJ(GetFilterUnit()) == true) then
return false
elseif (GetUnitLifePercent(GetFilterUnit()) <= 50) then
return false
elseif (GetUnitUserData(GetFilterUnit()) != 0) then
return false
elseif (IsUnitInRange(GetFilterUnit(), GetDyingUnit(), 600) == false) then
return false
endif
return true
endfunction
function Trig_Dragon_Whelp_Ressurection_Actions takes nothing returns nothing
local unit u = null
local effect e = null
set udg_tempunit = GroupPickRandomUnit(GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function dragonWhelp)))
set u = udg_tempunit
call SetUnitUserData(u, 1)
call PauseUnitBJ( true, udg_tempunit )
call AddSpecialEffectTargetUnitBJ( "origin", udg_tempunit, "Abilities\\Spells\\Orc\\Voodoo\\VoodooAuraTarget.mdl" )
set udg_tempeffect = GetLastCreatedEffectBJ()
set e = udg_tempeffect
call TriggerSleepAction( 3.50 )
set udg_tempeffect = e
set udg_tempunit = u
call DestroyEffectBJ( udg_tempeffect )
if ( Trig_Dragon_Whelp_Ressurection_Func013C() ) then
call CreateNUnitsAtLoc( 1, 'nrdk', Player(PLAYER_NEUTRAL_AGGRESSIVE), GetUnitLoc(udg_tempunit), bj_UNIT_FACING )
call AddSpecialEffectTargetUnitBJ( "overhead", GetLastCreatedUnit(), "Abilities\\Spells\\Undead\\RaiseSkeletonWarrior\\RaiseSkeleton.mdl" )
call SetUnitUserData(u, 0)
call PauseUnitBJ( false, udg_tempunit )
// Take damage for reviving mate
call SetUnitLifeBJ(udg_tempunit, GetUnitState(udg_tempunit, UNIT_STATE_LIFE)/2)
else
endif
set u = null
set e = null
endfunction
//===========================================================================
function InitTrig_Dragon_Whelp_Ressurection takes nothing returns nothing
set gg_trg_Dragon_Whelp_Ressurection = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dragon_Whelp_Ressurection, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Dragon_Whelp_Ressurection, Condition( function Trig_Dragon_Whelp_Ressurection_Conditions ) )
call TriggerAddAction( gg_trg_Dragon_Whelp_Ressurection, function Trig_Dragon_Whelp_Ressurection_Actions )
endfunction