Name | Type | is_array | initial_value |
ArmyHero | unit | Yes | |
ArmyMen | group | Yes | |
DeadLakeCreep | boolean | No | |
DragonSoul | item | No | |
ItemTaker | unit | No | |
NumberOfHeros | integer | No | |
PlayerKills | real | Yes | |
Powered | force | No | |
Random | integer | No | |
Selectionated | group | No |
function Trig_NewOrcshireMan_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTrainedUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( GetPlayerRace(GetOwningPlayer(GetTrainedUnit())) == RACE_ORC ) ) then
return false
endif
return true
endfunction
function Trig_NewOrcshireMan_Func004001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'O001' )
endfunction
function Trig_NewOrcshireMan_Func005001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'O002' )
endfunction
function Trig_NewOrcshireMan_Func006001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'O004' )
endfunction
function Trig_NewOrcshireMan_Func007001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'O003' )
endfunction
function Trig_NewOrcshireMan_Func008001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'O005' )
endfunction
function Trig_NewOrcshireMan_Func009001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'O006' )
endfunction
function Trig_NewOrcshireMan_Func010001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'O000' )
endfunction
function Trig_NewOrcshireMan_Func011001002001 takes nothing returns boolean
return ( GetUnitUserData(GetFilterUnit()) == 0 )
endfunction
function Trig_NewOrcshireMan_Func011001002002 takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == GetUnitTypeId(GetLastCreatedUnit()) )
endfunction
function Trig_NewOrcshireMan_Func011001002 takes nothing returns boolean
return GetBooleanAnd( Trig_NewOrcshireMan_Func011001002001(), Trig_NewOrcshireMan_Func011001002002() )
endfunction
function Trig_NewOrcshireMan_Func011A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_ArmyMen[udg_NumberOfHeros] )
call SetUnitUserData( GetEnumUnit(), udg_NumberOfHeros )
call SetUnitColor( GetEnumUnit(), PLAYER_COLOR_RED )
endfunction
function Trig_NewOrcshireMan_Actions takes nothing returns nothing
set udg_NumberOfHeros = ( udg_NumberOfHeros + 1 )
call SetUnitUserData( GetTrainedUnit(), udg_NumberOfHeros )
set udg_ArmyHero[udg_NumberOfHeros] = GetTrainedUnit()
if ( Trig_NewOrcshireMan_Func004001() ) then
call CreateNUnitsAtLoc( ( R2I(GetUnitStateSwap(UNIT_STATE_LIFE, GetTrainedUnit())) / 10 ), 'ogru', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyOrc), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_NewOrcshireMan_Func005001() ) then
call CreateNUnitsAtLoc( ( R2I(GetUnitStateSwap(UNIT_STATE_LIFE, GetTrainedUnit())) / 10 ), 'ohun', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyOrc), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_NewOrcshireMan_Func006001() ) then
call CreateNUnitsAtLoc( ( R2I(GetUnitStateSwap(UNIT_STATE_LIFE, GetTrainedUnit())) / 10 ), 'okod', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyOrc), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_NewOrcshireMan_Func007001() ) then
call CreateNUnitsAtLoc( ( R2I(GetUnitStateSwap(UNIT_STATE_LIFE, GetTrainedUnit())) / 10 ), 'orai', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyOrc), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_NewOrcshireMan_Func008001() ) then
call CreateNUnitsAtLoc( ( R2I(GetUnitStateSwap(UNIT_STATE_LIFE, GetTrainedUnit())) / 10 ), 'otbr', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyOrc), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_NewOrcshireMan_Func009001() ) then
call CreateNUnitsAtLoc( 1, 'odoc', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyOrc), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_NewOrcshireMan_Func010001() ) then
call CreateNUnitsAtLoc( 1, 'otau', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyOrc), bj_UNIT_FACING )
else
call DoNothing( )
endif
call ForGroupBJ( GetUnitsInRectMatching(gg_rct_ArmyOrc, Condition(function Trig_NewOrcshireMan_Func011001002)), function Trig_NewOrcshireMan_Func011A )
call SetUnitPositionLoc( GetTrainedUnit(), GetRandomLocInRect(gg_rct_Region_000) )
endfunction
//===========================================================================
function InitTrig_NewOrcshireMan takes nothing returns nothing
set gg_trg_NewOrcshireMan = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_NewOrcshireMan, EVENT_PLAYER_UNIT_TRAIN_FINISH )
call TriggerAddCondition( gg_trg_NewOrcshireMan, Condition( function Trig_NewOrcshireMan_Conditions ) )
call TriggerAddAction( gg_trg_NewOrcshireMan, function Trig_NewOrcshireMan_Actions )
endfunction
function Trig_NewApocalyptoMan_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTrainedUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( GetPlayerRace(GetOwningPlayer(GetTrainedUnit())) == RACE_UNDEAD ) ) then
return false
endif
return true
endfunction
function Trig_NewApocalyptoMan_Func004001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'U005' )
endfunction
function Trig_NewApocalyptoMan_Func005001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'U004' )
endfunction
function Trig_NewApocalyptoMan_Func006001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'U006' )
endfunction
function Trig_NewApocalyptoMan_Func007001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'U003' )
endfunction
function Trig_NewApocalyptoMan_Func008001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'U002' )
endfunction
function Trig_NewApocalyptoMan_Func009001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'U001' )
endfunction
function Trig_NewApocalyptoMan_Func010001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'U000' )
endfunction
function Trig_NewApocalyptoMan_Func011001002001 takes nothing returns boolean
return ( GetUnitUserData(GetFilterUnit()) == 0 )
endfunction
function Trig_NewApocalyptoMan_Func011001002002 takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == GetUnitTypeId(GetLastCreatedUnit()) )
endfunction
function Trig_NewApocalyptoMan_Func011001002 takes nothing returns boolean
return GetBooleanAnd( Trig_NewApocalyptoMan_Func011001002001(), Trig_NewApocalyptoMan_Func011001002002() )
endfunction
function Trig_NewApocalyptoMan_Func011A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_ArmyMen[udg_NumberOfHeros] )
call SetUnitUserData( GetEnumUnit(), udg_NumberOfHeros )
call SetUnitColor( GetEnumUnit(), PLAYER_COLOR_PURPLE )
endfunction
function Trig_NewApocalyptoMan_Actions takes nothing returns nothing
set udg_NumberOfHeros = ( udg_NumberOfHeros + 1 )
call SetUnitUserData( GetTrainedUnit(), udg_NumberOfHeros )
set udg_ArmyHero[udg_NumberOfHeros] = GetTrainedUnit()
if ( Trig_NewApocalyptoMan_Func004001() ) then
call CreateNUnitsAtLoc( ( R2I(GetUnitStateSwap(UNIT_STATE_LIFE, GetTrainedUnit())) / 10 ), 'ugar', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyPeopleDed), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_NewApocalyptoMan_Func005001() ) then
call CreateNUnitsAtLoc( ( R2I(GetUnitStateSwap(UNIT_STATE_LIFE, GetTrainedUnit())) / 10 ), 'uabo', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyPeopleDed), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_NewApocalyptoMan_Func007001() ) then
call CreateNUnitsAtLoc( ( R2I(GetUnitStateSwap(UNIT_STATE_LIFE, GetTrainedUnit())) / 10 ), 'ucry', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyPeopleDed), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_NewApocalyptoMan_Func008001() ) then
call CreateNUnitsAtLoc( ( R2I(GetUnitStateSwap(UNIT_STATE_LIFE, GetTrainedUnit())) / 10 ), 'ugho', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyPeopleDed), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_NewApocalyptoMan_Func009001() ) then
call CreateNUnitsAtLoc( ( R2I(GetUnitStateSwap(UNIT_STATE_LIFE, GetTrainedUnit())) / 10 ), 'uban', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyPeopleDed), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_NewApocalyptoMan_Func010001() ) then
call CreateNUnitsAtLoc( 1, 'uobs', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyPeopleDed), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_NewApocalyptoMan_Func006001() ) then
call CreateNUnitsAtLoc( 1, 'unec', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyPeopleDed), bj_UNIT_FACING )
else
call DoNothing( )
endif
call ForGroupBJ( GetUnitsInRectMatching(gg_rct_ArmyPeopleDed, Condition(function Trig_NewApocalyptoMan_Func011001002)), function Trig_NewApocalyptoMan_Func011A )
call SetUnitPositionLoc( GetTrainedUnit(), GetRandomLocInRect(gg_rct_Region_000) )
endfunction
//===========================================================================
function InitTrig_NewApocalyptoMan takes nothing returns nothing
set gg_trg_NewApocalyptoMan = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_NewApocalyptoMan, EVENT_PLAYER_UNIT_TRAIN_FINISH )
call TriggerAddCondition( gg_trg_NewApocalyptoMan, Condition( function Trig_NewApocalyptoMan_Conditions ) )
call TriggerAddAction( gg_trg_NewApocalyptoMan, function Trig_NewApocalyptoMan_Actions )
endfunction
function Trig_NewMysteriumMan_Copy_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTrainedUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( GetPlayerRace(GetOwningPlayer(GetTrainedUnit())) == RACE_NIGHTELF ) ) then
return false
endif
return true
endfunction
function Trig_NewMysteriumMan_Copy_Func004001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'E003' )
endfunction
function Trig_NewMysteriumMan_Copy_Func005001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'E004' )
endfunction
function Trig_NewMysteriumMan_Copy_Func006001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'E002' )
endfunction
function Trig_NewMysteriumMan_Copy_Func007001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'E006' )
endfunction
function Trig_NewMysteriumMan_Copy_Func008001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'E005' )
endfunction
function Trig_NewMysteriumMan_Copy_Func009001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'E000' )
endfunction
function Trig_NewMysteriumMan_Copy_Func010001 takes nothing returns boolean
return ( GetUnitTypeId(GetTrainedUnit()) == 'E001' )
endfunction
function Trig_NewMysteriumMan_Copy_Func011001002001 takes nothing returns boolean
return ( GetUnitUserData(GetFilterUnit()) == 0 )
endfunction
function Trig_NewMysteriumMan_Copy_Func011001002002 takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == GetUnitTypeId(GetLastCreatedUnit()) )
endfunction
function Trig_NewMysteriumMan_Copy_Func011001002 takes nothing returns boolean
return GetBooleanAnd( Trig_NewMysteriumMan_Copy_Func011001002001(), Trig_NewMysteriumMan_Copy_Func011001002002() )
endfunction
function Trig_NewMysteriumMan_Copy_Func011A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_ArmyMen[udg_NumberOfHeros] )
call SetUnitUserData( GetEnumUnit(), udg_NumberOfHeros )
call SetUnitColor( GetEnumUnit(), PLAYER_COLOR_CYAN )
endfunction
function Trig_NewMysteriumMan_Copy_Actions takes nothing returns nothing
set udg_NumberOfHeros = ( udg_NumberOfHeros + 1 )
call SetUnitUserData( GetTrainedUnit(), udg_NumberOfHeros )
set udg_ArmyHero[udg_NumberOfHeros] = GetTrainedUnit()
if ( Trig_NewMysteriumMan_Copy_Func004001() ) then
call CreateNUnitsAtLoc( ( R2I(GetUnitStateSwap(UNIT_STATE_LIFE, GetTrainedUnit())) / 10 ), 'esen', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyWood), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_NewMysteriumMan_Copy_Func005001() ) then
call CreateNUnitsAtLoc( ( R2I(GetUnitStateSwap(UNIT_STATE_LIFE, GetTrainedUnit())) / 10 ), 'edoc', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyWood), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_NewMysteriumMan_Copy_Func006001() ) then
call CreateNUnitsAtLoc( ( R2I(GetUnitStateSwap(UNIT_STATE_LIFE, GetTrainedUnit())) / 10 ), 'earc', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyWood), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_NewMysteriumMan_Copy_Func007001() ) then
call CreateNUnitsAtLoc( 1, 'edot', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyWood), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_NewMysteriumMan_Copy_Func008001() ) then
call CreateNUnitsAtLoc( 1, 'echm', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyWood), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_NewMysteriumMan_Copy_Func009001() ) then
call CreateNUnitsAtLoc( 1, 'edry', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyWood), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_NewMysteriumMan_Copy_Func010001() ) then
call CreateNUnitsAtLoc( 1, 'emtg', GetOwningPlayer(GetTrainedUnit()), GetRectCenter(gg_rct_ArmyWood), bj_UNIT_FACING )
else
call DoNothing( )
endif
call ForGroupBJ( GetUnitsInRectMatching(gg_rct_ArmyWood, Condition(function Trig_NewMysteriumMan_Copy_Func011001002)), function Trig_NewMysteriumMan_Copy_Func011A )
call SetUnitPositionLoc( GetTrainedUnit(), GetRandomLocInRect(gg_rct_Region_000) )
endfunction
//===========================================================================
function InitTrig_NewMysteriumMan takes nothing returns nothing
set gg_trg_NewMysteriumMan = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_NewMysteriumMan, EVENT_PLAYER_UNIT_TRAIN_FINISH )
call TriggerAddCondition( gg_trg_NewMysteriumMan, Condition( function Trig_NewMysteriumMan_Copy_Conditions ) )
call TriggerAddAction( gg_trg_NewMysteriumMan, function Trig_NewMysteriumMan_Copy_Actions )
endfunction