Spoiler:
Code: Select all
Damage Up
Events
Unit - A unit Gains a level
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Leveling Hero)) Equal to Phantom Assassin
(Unit-type of (Leveling Hero)) Equal to Master Stalker
(Unit-type of (Leveling Hero)) Equal to Professional Witcher
(Unit-type of (Leveling Hero)) Equal to Grand Inquisitor
Then - Actions
Player - Set the current research level of Damage Up 15 to ((Current research level of Damage Up 15 for (Owner of (Leveling Hero))) + 1) for (Owner of (Leveling Hero))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Leveling Hero)) Equal to Sniper
(Unit-type of (Leveling Hero)) Equal to invalid Hunter
(Unit-type of (Leveling Hero)) Equal to Grand Templar
(Unit-type of (Leveling Hero)) Equal to Dark ArchTemplar
Then - Actions
Player - Set the current research level of Damage Up 20 to ((Current research level of Damage Up 20 for (Owner of (Leveling Hero))) + 1) for (Owner of (Leveling Hero))
Else - Actions
Spoiler:
Code: Select all
function Trig_Damage_Up_Func001Func002Func001C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetLevelingUnit()) == 'H02M' ) ) then
return false
endif
return true
endfunction
function Trig_Damage_Up_Func001Func002Func003C takes nothing returns boolean
if ( ( GetUnitTypeId(GetLevelingUnit()) == 'H02E' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetLevelingUnit()) == 'H02F' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetLevelingUnit()) == 'H02L' ) ) then
return true
endif
return false
endfunction
function Trig_Damage_Up_Func001Func002C takes nothing returns boolean
if ( not Trig_Damage_Up_Func001Func002Func003C() ) then
return false
endif
return true
endfunction
function Trig_Damage_Up_Func001Func003C takes nothing returns boolean
if ( ( GetUnitTypeId(GetLevelingUnit()) == 'H02N' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetLevelingUnit()) == 'H02O' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetLevelingUnit()) == 'H02P' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetLevelingUnit()) == 'H02Q' ) ) then
return true
endif
return false
endfunction
function Trig_Damage_Up_Func001C takes nothing returns boolean
if ( not Trig_Damage_Up_Func001Func003C() ) then
return false
endif
return true
endfunction
function Trig_Damage_Up_Actions takes nothing returns nothing
if ( Trig_Damage_Up_Func001C() ) then
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = GetUnitLevel(GetLevelingUnit())
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call SetPlayerTechResearchedSwap( 'R00G', GetUnitLevel(GetLevelingUnit()), GetOwningPlayer(GetLevelingUnit()) )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
else
if ( Trig_Damage_Up_Func001Func002C() ) then
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = GetUnitLevel(GetLevelingUnit())
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call SetPlayerTechResearchedSwap( 'Remk', GetUnitLevel(GetLevelingUnit()), GetOwningPlayer(GetLevelingUnit()) )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
else
if ( Trig_Damage_Up_Func001Func002Func001C() ) then
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = GetUnitLevel(GetLevelingUnit())
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call SetPlayerTechResearchedSwap( 'R00F', GetUnitLevel(GetLevelingUnit()), GetOwningPlayer(GetLevelingUnit()) )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
else
endif
endif
endif
endfunction
//===========================================================================
function InitTrig_Damage_Up takes nothing returns nothing
set gg_trg_Damage_Up = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Damage_Up, EVENT_PLAYER_HERO_LEVEL )
call TriggerAddAction( gg_trg_Damage_Up, function Trig_Damage_Up_Actions )
endfunction