Name | Type | is_array | initial_value |
AffectedRegion | rect | No | |
AfterDamageEvent | real | No | |
AMSAmount | real | Yes | |
AMSReal | real | No | |
ClearDamageEvent | trigger | No | |
DAMAGE_FACTOR_BRACERS | real | No | |
DAMAGE_FACTOR_ELUNES | real | No | |
DAMAGE_FACTOR_ETHEREAL | real | No | |
DamageBlockingAbility | abilcode | No | |
DamageEvent | real | No | |
DamageEventAmount | real | No | |
DamageEventOverride | boolean | No | |
DamageEventPrevAmt | real | No | |
DamageEventSource | unit | No | |
DamageEventsWasted | integer | No | |
DamageEventTarget | unit | No | |
DamageEventTrigger | trigger | No | |
DamageEventType | integer | No | |
DamageModifierEvent | real | No | |
DamageTypeBlocked | integer | No | |
DamageTypeCriticalStrike | integer | No | |
DamageTypeExplosive | integer | No | |
DamageTypeHeal | integer | No | |
DamageTypeReduced | integer | No | |
Destructables | destructablecode | Yes | |
Dif_Dialog | dialog | No | |
Dif_Dialog_B_1 | button | No | |
Dif_Dialog_B_2 | button | No | |
Dif_Dialog_B_3 | button | No | |
Dif_Dialog_B_4 | button | No | |
Dif_Real_1 | real | No | |
Dif_Real_2 | real | No | |
Dif_Real_3 | real | No | |
DmgEvBracers | itemcode | No | |
DmgEvMana | real | No | |
DmgEvManaMult | real | No | |
DmgEvMSlvl | integer | No | |
DmgEvRecursionN | integer | No | |
DmgEvRunning | boolean | No | |
DmgEvStarted | boolean | No | |
DmgEvTimer | timer | No | |
DmgEvTrig | trigger | No | |
GeneratorSeed | integer | No | |
Gold | integer | No | |
HideDamageFrom | boolean | Yes | |
IsDamageSpell | boolean | No | |
Item_For_Heroes | integer | No | 1 |
Item_Remove | timer | No | |
Kills | integer | No | |
Kills_Leaderboard | leaderboard | No | |
LastDamageHP | real | No | |
LastDmgPrevAmount | real | Yes | |
LastDmgPrevType | integer | Yes | |
LastDmgSource | unit | Yes | |
LastDmgTarget | unit | Yes | |
LastDmgValue | real | Yes | |
LastDmgWasSpell | boolean | Yes | |
Leaderboard_Quest_1 | leaderboard | No | |
Loop | integervar | No | |
NextDamageOverride | boolean | No | |
NextDamageType | integer | No | |
Quest_Kill_Count | integer | No | |
Quest_Kill_Count_Ok | real | No | |
Quest_Killing_Point | location | No | |
Quest_Killing_Reward_1 | integer | No | |
Quest_Killing_Reward_2 | integer | No | |
Quest_Unit | unitcode | No | |
Quest_Unit_Integer | integer | No | |
Quest_Unit_Name | string | No | |
Quest_Unit_Ok | unit | No | |
SpellDamageAbility | abilcode | No | |
TempGroup | group | No | |
TempPoint | location | No | |
TempX | real | No | |
TempY | real | No | |
TerrainTypes | terraintype | Yes | |
Time_1 | integer | No | 1200 |
UDex | integer | No | |
UDexGen | integer | No | |
UDexNext | integer | Yes | |
UDexPrev | integer | Yes | |
UDexRecycle | integer | No | |
UDexUnits | unit | Yes | |
UDexWasted | integer | No | |
UMovNext | integer | Yes | |
UMovPrev | integer | Yes | |
Unit_Group_All | group | No | |
UnitDamageRegistered | boolean | Yes | |
UnitIndexerEnabled | boolean | No | |
UnitIndexEvent | real | No | |
UnitIndexLock | integer | Yes | |
UnitMoving | boolean | Yes | |
UnitMovingEvent | real | No | |
UnitMovingX | real | Yes | |
UnitMovingY | real | Yes | |
Version | string | No | 1.08a |
Xp | real | No | |
Xp_Rate_1 | integer | No | |
Xp_Rate_Ok_1 | integer | No |
function Trig_ooooooooo_Actions takes nothing returns nothing
set udg_Xp_Rate_Ok_1 = R2I(GetPlayerHandicapXPBJ(Player(0)))
call PauseAllUnitsBJ( true )
call CinematicModeBJ( true, GetPlayersAll() )
call CinematicFilterGenericBJ( 0.00, BLEND_MODE_MODULATE, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 100, 100, 100, 100, 0, 0, 0, 0 )
set udg_Xp = 135.00
set udg_Xp_Rate_1 = R2I(GetPlayerHandicapXPBJ(Player(0)))
call SetPlayerHandicapXPBJ( Player(0), udg_Xp )
call SetPlayerFlagBJ( PLAYER_STATE_GIVES_BOUNTY, true, Player(PLAYER_NEUTRAL_AGGRESSIVE) )
call SetPlayerFlagBJ( PLAYER_STATE_GIVES_BOUNTY, true, Player(0) )
call DisplayTimedTextToForce( GetPlayersAll(), 120.00, "TRIGSTR_666" )
call DisplayTimedTextToForce( GetPlayersAll(), 11.00, ( "|c0018EBF5" + (udg_Version) ) )
call CreateFogModifierRectBJ( true, Player(0), FOG_OF_WAR_VISIBLE, gg_rct_Region_001 )
call FogModifierStart( GetLastCreatedFogModifier() )
call CameraSetSmoothingFactorBJ( 1.20 )
set udg_Destructables[1] = 'LTlt'
set udg_Destructables[2] = 'FTtw'
set udg_Destructables[3] = 'WTtw'
set udg_Destructables[4] = 'ATtr'
set udg_Destructables[5] = 'ATtc'
set udg_TerrainTypes[1] = 'Lgrd'
set udg_TerrainTypes[2] = 'Lgrs'
set udg_TerrainTypes[3] = 'Lrok'
set udg_TerrainTypes[4] = 'Ldrg'
set udg_TerrainTypes[5] = 'Ldro'
set udg_GeneratorSeed = 160
set udg_AffectedRegion = GetPlayableMapRect()
call TriggerSleepAction( 0.50 )
call DisplayTimedTextToForce( GetPlayersAll(), 3600.00, "TRIGSTR_652" )
endfunction
//===========================================================================
function InitTrig_Generate_1 takes nothing returns nothing
set gg_trg_Generate_1 = CreateTrigger( )
call TriggerAddAction( gg_trg_Generate_1, function Trig_ooooooooo_Actions )
endfunction
function Trig_ooooooooooooooo_Func002Func001C takes nothing returns boolean
if ( not ( GetOwningPlayer(GetEnumUnit()) == Player(1) ) ) then
return false
endif
return true
endfunction
function Trig_ooooooooooooooo_Func002A takes nothing returns nothing
if ( Trig_ooooooooooooooo_Func002Func001C() ) then
call UnitAddItemByIdSwapped( 'I000', GetEnumUnit() )
else
endif
endfunction
function Trig_ooooooooooooooo_Actions takes nothing returns nothing
call SetPlayerHandicapBJ( Player(1), ( GetPlayerHandicapBJ(Player(1)) + 7.50 ) )
call ForGroupBJ( GetUnitsInRectAll(GetPlayableMapRect()), function Trig_ooooooooooooooo_Func002A )
set udg_Xp = ( udg_Xp + 7.50 )
set udg_Gold = ( udg_Gold + 1 )
endfunction
//===========================================================================
function InitTrig_Generate_2 takes nothing returns nothing
set gg_trg_Generate_2 = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Generate_2, 500.00 )
call TriggerAddAction( gg_trg_Generate_2, function Trig_ooooooooooooooo_Actions )
endfunction
function Trig_oo_Func003Func001Func002C takes nothing returns boolean
if ( not ( GetTerrainTypeBJ(udg_TempPoint) == 'Ldrt' ) ) then
return false
endif
if ( not ( RectContainsLoc(udg_AffectedRegion, udg_TempPoint) == true ) ) then
return false
endif
return true
endfunction
function Trig_oo_Func003Func001Func005C takes nothing returns boolean
if ( not ( GetTerrainTypeBJ(udg_TempPoint) == 'Ldrt' ) ) then
return false
endif
if ( not ( RectContainsLoc(udg_AffectedRegion, udg_TempPoint) == true ) ) then
return false
endif
return true
endfunction
function Trig_oo_Func003Func001Func008C takes nothing returns boolean
if ( not ( GetTerrainTypeBJ(udg_TempPoint) == 'Ldrt' ) ) then
return false
endif
if ( not ( RectContainsLoc(udg_AffectedRegion, udg_TempPoint) == true ) ) then
return false
endif
return true
endfunction
function Trig_oo_Func003Func001Func011C takes nothing returns boolean
if ( not ( GetTerrainTypeBJ(udg_TempPoint) == 'Ldrt' ) ) then
return false
endif
if ( not ( RectContainsLoc(udg_AffectedRegion, udg_TempPoint) == true ) ) then
return false
endif
return true
endfunction
function Trig_oo_Actions takes nothing returns nothing
set udg_Loop = 1
loop
exitwhen udg_Loop > R2I(( GetRectWidthBJ(GetPlayableMapRect()) / I2R(udg_GeneratorSeed) ))
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = R2I(( GetRectHeightBJ(GetPlayableMapRect()) / I2R(udg_GeneratorSeed) ))
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_TempPoint = Location(( I2R(udg_Loop) * I2R(udg_GeneratorSeed) ), ( I2R(GetForLoopIndexA()) * I2R(udg_GeneratorSeed) ))
if ( Trig_oo_Func003Func001Func002C() ) then
call SetTerrainTypeBJ( udg_TempPoint, udg_TerrainTypes[GetRandomInt(1, 5)], -1, GetRandomInt(1, 5), 0 )
else
endif
call RemoveLocation(udg_TempPoint)
set udg_TempPoint = Location(( I2R(udg_Loop) * ( -1.00 * I2R(udg_GeneratorSeed) ) ), ( I2R(GetForLoopIndexA()) * I2R(udg_GeneratorSeed) ))
if ( Trig_oo_Func003Func001Func005C() ) then
call SetTerrainTypeBJ( udg_TempPoint, udg_TerrainTypes[GetRandomInt(1, 5)], -1, GetRandomInt(1, 5), 0 )
else
endif
call RemoveLocation(udg_TempPoint)
set udg_TempPoint = Location(( I2R(udg_Loop) * I2R(udg_GeneratorSeed) ), ( I2R(GetForLoopIndexA()) * ( -1.00 * I2R(udg_GeneratorSeed) ) ))
if ( Trig_oo_Func003Func001Func008C() ) then
call SetTerrainTypeBJ( udg_TempPoint, udg_TerrainTypes[GetRandomInt(1, 5)], -1, GetRandomInt(1, 5), 0 )
else
endif
call RemoveLocation(udg_TempPoint)
set udg_TempPoint = Location(( I2R(udg_Loop) * ( -1.00 * I2R(udg_GeneratorSeed) ) ), ( I2R(GetForLoopIndexA()) * ( -1.00 * I2R(udg_GeneratorSeed) ) ))
if ( Trig_oo_Func003Func001Func011C() ) then
call SetTerrainTypeBJ( udg_TempPoint, udg_TerrainTypes[GetRandomInt(1, 5)], -1, GetRandomInt(1, 5), 0 )
else
endif
call RemoveLocation(udg_TempPoint)
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call PolledWait( 0.01 )
set udg_Loop = udg_Loop + 1
endloop
call ConditionalTriggerExecute( gg_trg_Generate_5 )
endfunction
//===========================================================================
function InitTrig_Generate_3 takes nothing returns nothing
set gg_trg_Generate_3 = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Generate_3, 1.00 )
call TriggerRegisterGameLoadedEventBJ( gg_trg_Generate_3 )
call TriggerAddAction( gg_trg_Generate_3, function Trig_oo_Actions )
endfunction
function Trig_oooooooooooooo_Func001Func001Func002Func001C takes nothing returns boolean
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Ldrt' ) ) then
return true
endif
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Ldro' ) ) then
return true
endif
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Ldrg' ) ) then
return true
endif
return false
endfunction
function Trig_oooooooooooooo_Func001Func001Func002Func002Func002Func002C takes nothing returns boolean
if ( not ( GetRandomInt(1, 265) < 5 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func002Func002Func002Func003C takes nothing returns boolean
if ( not ( GetRandomInt(1, 75) < 8 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func002Func002Func002C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_TempGroup) == 0 ) ) then
return false
endif
if ( not ( GetTerrainTypeBJ(udg_TempPoint) != 'Lrok' ) ) then
return false
endif
if ( not ( RectContainsLoc(udg_AffectedRegion, udg_TempPoint) == true ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func002Func002C takes nothing returns boolean
if ( not ( GetRandomInt(1, 100) <= 15 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func002C takes nothing returns boolean
if ( not Trig_oooooooooooooo_Func001Func001Func002Func001C() ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func003Func001C takes nothing returns boolean
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Lgrs' ) ) then
return true
endif
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Lgrd' ) ) then
return true
endif
return false
endfunction
function Trig_oooooooooooooo_Func001Func001Func003Func002Func002Func002C takes nothing returns boolean
if ( not ( GetRandomInt(1, 275) < 5 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func003Func002Func002Func003C takes nothing returns boolean
if ( not ( GetRandomInt(1, 80) < 8 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func003Func002Func002C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_TempGroup) == 0 ) ) then
return false
endif
if ( not ( GetTerrainTypeBJ(udg_TempPoint) != 'Lrok' ) ) then
return false
endif
if ( not ( RectContainsLoc(udg_AffectedRegion, udg_TempPoint) == true ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func003Func002C takes nothing returns boolean
if ( not ( GetRandomInt(1, 100) <= 25 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func003C takes nothing returns boolean
if ( not Trig_oooooooooooooo_Func001Func001Func003Func001C() ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func006Func001C takes nothing returns boolean
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Ldrt' ) ) then
return true
endif
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Ldro' ) ) then
return true
endif
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Ldrg' ) ) then
return true
endif
return false
endfunction
function Trig_oooooooooooooo_Func001Func001Func006Func002Func002Func002C takes nothing returns boolean
if ( not ( GetRandomInt(1, 275) < 5 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func006Func002Func002Func003C takes nothing returns boolean
if ( not ( GetRandomInt(1, 80) < 8 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func006Func002Func002C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_TempGroup) == 0 ) ) then
return false
endif
if ( not ( GetTerrainTypeBJ(udg_TempPoint) != 'Lrok' ) ) then
return false
endif
if ( not ( RectContainsLoc(udg_AffectedRegion, udg_TempPoint) == true ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func006Func002C takes nothing returns boolean
if ( not ( GetRandomInt(1, 100) <= 15 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func006C takes nothing returns boolean
if ( not Trig_oooooooooooooo_Func001Func001Func006Func001C() ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func007Func001C takes nothing returns boolean
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Lgrs' ) ) then
return true
endif
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Lgrd' ) ) then
return true
endif
return false
endfunction
function Trig_oooooooooooooo_Func001Func001Func007Func002Func002Func002C takes nothing returns boolean
if ( not ( GetRandomInt(1, 275) < 5 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func007Func002Func002Func003C takes nothing returns boolean
if ( not ( GetRandomInt(1, 78) < 8 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func007Func002Func002C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_TempGroup) == 0 ) ) then
return false
endif
if ( not ( GetTerrainTypeBJ(udg_TempPoint) != 'Lrok' ) ) then
return false
endif
if ( not ( RectContainsLoc(udg_AffectedRegion, udg_TempPoint) == true ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func007Func002C takes nothing returns boolean
if ( not ( GetRandomInt(1, 100) <= 25 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func007C takes nothing returns boolean
if ( not Trig_oooooooooooooo_Func001Func001Func007Func001C() ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func010Func001C takes nothing returns boolean
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Ldrt' ) ) then
return true
endif
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Ldro' ) ) then
return true
endif
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Ldrg' ) ) then
return true
endif
return false
endfunction
function Trig_oooooooooooooo_Func001Func001Func010Func002Func002Func002C takes nothing returns boolean
if ( not ( GetRandomInt(1, 275) < 5 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func010Func002Func002Func003C takes nothing returns boolean
if ( not ( GetRandomInt(1, 79) < 8 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func010Func002Func002C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_TempGroup) == 0 ) ) then
return false
endif
if ( not ( GetTerrainTypeBJ(udg_TempPoint) != 'Lrok' ) ) then
return false
endif
if ( not ( RectContainsLoc(udg_AffectedRegion, udg_TempPoint) == true ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func010Func002C takes nothing returns boolean
if ( not ( GetRandomInt(1, 100) <= 15 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func010C takes nothing returns boolean
if ( not Trig_oooooooooooooo_Func001Func001Func010Func001C() ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func011Func001C takes nothing returns boolean
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Lgrs' ) ) then
return true
endif
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Lgrd' ) ) then
return true
endif
return false
endfunction
function Trig_oooooooooooooo_Func001Func001Func011Func002Func002Func002C takes nothing returns boolean
if ( not ( GetRandomInt(1, 275) < 5 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func011Func002Func002Func003C takes nothing returns boolean
if ( not ( GetRandomInt(1, 80) < 8 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func011Func002Func002C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_TempGroup) == 0 ) ) then
return false
endif
if ( not ( GetTerrainTypeBJ(udg_TempPoint) != 'Lrok' ) ) then
return false
endif
if ( not ( RectContainsLoc(udg_AffectedRegion, udg_TempPoint) == true ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func011Func002C takes nothing returns boolean
if ( not ( GetRandomInt(1, 100) <= 25 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func011C takes nothing returns boolean
if ( not Trig_oooooooooooooo_Func001Func001Func011Func001C() ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func014Func001C takes nothing returns boolean
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Ldrt' ) ) then
return true
endif
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Ldro' ) ) then
return true
endif
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Ldrg' ) ) then
return true
endif
return false
endfunction
function Trig_oooooooooooooo_Func001Func001Func014Func002Func002Func002C takes nothing returns boolean
if ( not ( GetRandomInt(1, 275) < 5 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func014Func002Func002Func003C takes nothing returns boolean
if ( not ( GetRandomInt(1, 78) < 8 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func014Func002Func002C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_TempGroup) == 0 ) ) then
return false
endif
if ( not ( GetTerrainTypeBJ(udg_TempPoint) != 'Lrok' ) ) then
return false
endif
if ( not ( RectContainsLoc(udg_AffectedRegion, udg_TempPoint) == true ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func014Func002C takes nothing returns boolean
if ( not ( GetRandomInt(1, 100) <= 15 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func014C takes nothing returns boolean
if ( not Trig_oooooooooooooo_Func001Func001Func014Func001C() ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func015Func001C takes nothing returns boolean
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Lgrs' ) ) then
return true
endif
if ( ( GetTerrainTypeBJ(udg_TempPoint) == 'Lgrd' ) ) then
return true
endif
return false
endfunction
function Trig_oooooooooooooo_Func001Func001Func015Func002Func002Func002C takes nothing returns boolean
if ( not ( GetRandomInt(1, 275) < 5 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func015Func002Func002Func003C takes nothing returns boolean
if ( not ( GetRandomInt(1, 81) < 8 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func015Func002Func002C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_TempGroup) == 0 ) ) then
return false
endif
if ( not ( GetTerrainTypeBJ(udg_TempPoint) != 'Lrok' ) ) then
return false
endif
if ( not ( RectContainsLoc(udg_AffectedRegion, udg_TempPoint) == true ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func015Func002C takes nothing returns boolean
if ( not ( GetRandomInt(1, 100) <= 25 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func001Func001Func015C takes nothing returns boolean
if ( not Trig_oooooooooooooo_Func001Func001Func015Func001C() ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func008Func001C takes nothing returns boolean
if ( not ( GetOwningPlayer(GetEnumUnit()) == Player(1) ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooooo_Func008A takes nothing returns nothing
if ( Trig_oooooooooooooo_Func008Func001C() ) then
call UnitAddAbilityBJ( 'AInv', GetEnumUnit() )
else
endif
endfunction
function Trig_oooooooooooooo_Actions takes nothing returns nothing
set udg_Loop = 1
loop
exitwhen udg_Loop > R2I(( GetRectWidthBJ(GetPlayableMapRect()) / I2R(udg_GeneratorSeed) ))
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = R2I(( GetRectHeightBJ(GetPlayableMapRect()) / I2R(udg_GeneratorSeed) ))
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_TempPoint = Location(( I2R(udg_Loop) * I2R(udg_GeneratorSeed) ), ( I2R(GetForLoopIndexA()) * I2R(udg_GeneratorSeed) ))
if ( Trig_oooooooooooooo_Func001Func001Func002C() ) then
if ( Trig_oooooooooooooo_Func001Func001Func002Func002C() ) then
set udg_TempGroup = GetUnitsInRangeOfLocAll(400.00, udg_TempPoint)
if ( Trig_oooooooooooooo_Func001Func001Func002Func002Func002C() ) then
call CreateDestructableLoc( udg_Destructables[GetRandomInt(1, 5)], udg_TempPoint, GetRandomDirectionDeg(), 1, 0 )
if ( Trig_oooooooooooooo_Func001Func001Func002Func002Func002Func002C() ) then
call CreateNUnitsAtLoc( 1, 'ngme', Player(PLAYER_NEUTRAL_PASSIVE), udg_TempPoint, bj_UNIT_FACING )
call AddItemToStockBJ( ChooseRandomItemBJ(1), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(2), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(3), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(4), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(5), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(6), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(7), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(8), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(9), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(10), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(11), GetLastCreatedUnit(), 1, 1 )
else
endif
if ( Trig_oooooooooooooo_Func001Func001Func002Func002Func002Func003C() ) then
call CreateNUnitsAtLoc( 1, ChooseRandomCreepBJ(GetRandomInt(1, 10)), Player(1), udg_TempPoint, bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Unit_Group_All )
else
endif
else
endif
call DestroyGroup(udg_TempGroup)
else
endif
else
endif
if ( Trig_oooooooooooooo_Func001Func001Func003C() ) then
if ( Trig_oooooooooooooo_Func001Func001Func003Func002C() ) then
set udg_TempGroup = GetUnitsInRangeOfLocAll(400.00, udg_TempPoint)
if ( Trig_oooooooooooooo_Func001Func001Func003Func002Func002C() ) then
call CreateDestructableLoc( udg_Destructables[GetRandomInt(1, 5)], udg_TempPoint, GetRandomDirectionDeg(), 1, 0 )
if ( Trig_oooooooooooooo_Func001Func001Func003Func002Func002Func002C() ) then
call CreateNUnitsAtLoc( 1, 'ngme', Player(PLAYER_NEUTRAL_PASSIVE), udg_TempPoint, bj_UNIT_FACING )
call AddItemToStockBJ( ChooseRandomItemBJ(1), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(2), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(3), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(4), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(5), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(6), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(7), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(8), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(9), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(10), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(11), GetLastCreatedUnit(), 1, 1 )
else
endif
if ( Trig_oooooooooooooo_Func001Func001Func003Func002Func002Func003C() ) then
call CreateNUnitsAtLoc( 1, ChooseRandomCreepBJ(GetRandomInt(1, 10)), Player(1), udg_TempPoint, bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Unit_Group_All )
else
endif
else
endif
call DestroyGroup(udg_TempGroup)
else
endif
else
endif
call RemoveLocation(udg_TempPoint)
set udg_TempPoint = Location(( I2R(udg_Loop) * ( -1.00 * I2R(udg_GeneratorSeed) ) ), ( I2R(GetForLoopIndexA()) * I2R(udg_GeneratorSeed) ))
if ( Trig_oooooooooooooo_Func001Func001Func006C() ) then
if ( Trig_oooooooooooooo_Func001Func001Func006Func002C() ) then
set udg_TempGroup = GetUnitsInRangeOfLocAll(400.00, udg_TempPoint)
if ( Trig_oooooooooooooo_Func001Func001Func006Func002Func002C() ) then
call CreateDestructableLoc( udg_Destructables[GetRandomInt(1, 5)], udg_TempPoint, GetRandomDirectionDeg(), 1, 0 )
if ( Trig_oooooooooooooo_Func001Func001Func006Func002Func002Func002C() ) then
call CreateNUnitsAtLoc( 1, 'ngme', Player(PLAYER_NEUTRAL_PASSIVE), udg_TempPoint, bj_UNIT_FACING )
call AddItemToStockBJ( ChooseRandomItemBJ(1), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(2), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(3), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(4), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(5), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(6), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(7), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(8), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(9), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(10), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(11), GetLastCreatedUnit(), 1, 1 )
else
endif
if ( Trig_oooooooooooooo_Func001Func001Func006Func002Func002Func003C() ) then
call CreateNUnitsAtLoc( 1, ChooseRandomCreepBJ(GetRandomInt(1, 10)), Player(1), udg_TempPoint, bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Unit_Group_All )
else
endif
else
endif
call DestroyGroup(udg_TempGroup)
else
endif
else
endif
if ( Trig_oooooooooooooo_Func001Func001Func007C() ) then
if ( Trig_oooooooooooooo_Func001Func001Func007Func002C() ) then
set udg_TempGroup = GetUnitsInRangeOfLocAll(400.00, udg_TempPoint)
if ( Trig_oooooooooooooo_Func001Func001Func007Func002Func002C() ) then
call CreateDestructableLoc( udg_Destructables[GetRandomInt(1, 5)], udg_TempPoint, GetRandomDirectionDeg(), 1, 0 )
if ( Trig_oooooooooooooo_Func001Func001Func007Func002Func002Func002C() ) then
call CreateNUnitsAtLoc( 1, 'ngme', Player(PLAYER_NEUTRAL_PASSIVE), udg_TempPoint, bj_UNIT_FACING )
call AddItemToStockBJ( ChooseRandomItemBJ(1), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(2), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(3), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(4), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(5), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(6), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(7), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(8), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(9), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(10), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(11), GetLastCreatedUnit(), 1, 1 )
else
endif
if ( Trig_oooooooooooooo_Func001Func001Func007Func002Func002Func003C() ) then
call CreateNUnitsAtLoc( 1, ChooseRandomCreepBJ(GetRandomInt(1, 11)), Player(1), udg_TempPoint, bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Unit_Group_All )
else
endif
else
endif
call DestroyGroup(udg_TempGroup)
else
endif
else
endif
call RemoveLocation(udg_TempPoint)
set udg_TempPoint = Location(( I2R(udg_Loop) * I2R(udg_GeneratorSeed) ), ( I2R(GetForLoopIndexA()) * ( -1.00 * I2R(udg_GeneratorSeed) ) ))
if ( Trig_oooooooooooooo_Func001Func001Func010C() ) then
if ( Trig_oooooooooooooo_Func001Func001Func010Func002C() ) then
set udg_TempGroup = GetUnitsInRangeOfLocAll(400.00, udg_TempPoint)
if ( Trig_oooooooooooooo_Func001Func001Func010Func002Func002C() ) then
call CreateDestructableLoc( udg_Destructables[GetRandomInt(1, 5)], udg_TempPoint, GetRandomDirectionDeg(), 1, 0 )
if ( Trig_oooooooooooooo_Func001Func001Func010Func002Func002Func002C() ) then
call CreateNUnitsAtLoc( 1, 'ngme', Player(PLAYER_NEUTRAL_PASSIVE), udg_TempPoint, bj_UNIT_FACING )
call AddItemToStockBJ( ChooseRandomItemBJ(1), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(2), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(3), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(4), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(5), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(6), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(7), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(8), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(9), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(10), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(11), GetLastCreatedUnit(), 1, 1 )
else
endif
if ( Trig_oooooooooooooo_Func001Func001Func010Func002Func002Func003C() ) then
call CreateNUnitsAtLoc( 1, ChooseRandomCreepBJ(GetRandomInt(1, 10)), Player(1), udg_TempPoint, bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Unit_Group_All )
else
endif
else
endif
call DestroyGroup(udg_TempGroup)
else
endif
else
endif
if ( Trig_oooooooooooooo_Func001Func001Func011C() ) then
if ( Trig_oooooooooooooo_Func001Func001Func011Func002C() ) then
set udg_TempGroup = GetUnitsInRangeOfLocAll(400.00, udg_TempPoint)
if ( Trig_oooooooooooooo_Func001Func001Func011Func002Func002C() ) then
call CreateDestructableLoc( udg_Destructables[GetRandomInt(1, 5)], udg_TempPoint, GetRandomDirectionDeg(), 1, 0 )
if ( Trig_oooooooooooooo_Func001Func001Func011Func002Func002Func002C() ) then
call CreateNUnitsAtLoc( 1, 'ngme', Player(PLAYER_NEUTRAL_PASSIVE), udg_TempPoint, bj_UNIT_FACING )
call AddItemToStockBJ( ChooseRandomItemBJ(1), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(2), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(3), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(4), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(5), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(6), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(7), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(8), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(9), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(10), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(11), GetLastCreatedUnit(), 1, 1 )
else
endif
if ( Trig_oooooooooooooo_Func001Func001Func011Func002Func002Func003C() ) then
call CreateNUnitsAtLoc( 1, ChooseRandomCreepBJ(GetRandomInt(1, 10)), Player(1), udg_TempPoint, bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Unit_Group_All )
else
endif
else
endif
call DestroyGroup(udg_TempGroup)
else
endif
else
endif
call RemoveLocation(udg_TempPoint)
set udg_TempPoint = Location(( I2R(udg_Loop) * ( -1.00 * I2R(udg_GeneratorSeed) ) ), ( I2R(GetForLoopIndexA()) * ( -1.00 * I2R(udg_GeneratorSeed) ) ))
if ( Trig_oooooooooooooo_Func001Func001Func014C() ) then
if ( Trig_oooooooooooooo_Func001Func001Func014Func002C() ) then
set udg_TempGroup = GetUnitsInRangeOfLocAll(400.00, udg_TempPoint)
if ( Trig_oooooooooooooo_Func001Func001Func014Func002Func002C() ) then
call CreateDestructableLoc( udg_Destructables[GetRandomInt(1, 5)], udg_TempPoint, GetRandomDirectionDeg(), 1, 0 )
if ( Trig_oooooooooooooo_Func001Func001Func014Func002Func002Func002C() ) then
call CreateNUnitsAtLoc( 1, 'ngme', Player(PLAYER_NEUTRAL_PASSIVE), udg_TempPoint, bj_UNIT_FACING )
call AddItemToStockBJ( ChooseRandomItemBJ(1), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(2), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(3), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(4), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(5), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(6), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(7), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(8), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(9), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(10), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(11), GetLastCreatedUnit(), 1, 1 )
else
endif
if ( Trig_oooooooooooooo_Func001Func001Func014Func002Func002Func003C() ) then
call CreateNUnitsAtLoc( 1, ChooseRandomCreepBJ(GetRandomInt(1, 11)), Player(1), udg_TempPoint, bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Unit_Group_All )
else
endif
else
endif
call DestroyGroup(udg_TempGroup)
else
endif
else
endif
if ( Trig_oooooooooooooo_Func001Func001Func015C() ) then
if ( Trig_oooooooooooooo_Func001Func001Func015Func002C() ) then
set udg_TempGroup = GetUnitsInRangeOfLocAll(400.00, udg_TempPoint)
if ( Trig_oooooooooooooo_Func001Func001Func015Func002Func002C() ) then
call CreateDestructableLoc( udg_Destructables[GetRandomInt(1, 5)], udg_TempPoint, GetRandomDirectionDeg(), 1, 0 )
if ( Trig_oooooooooooooo_Func001Func001Func015Func002Func002Func002C() ) then
call CreateNUnitsAtLoc( 1, 'ngme', Player(PLAYER_NEUTRAL_PASSIVE), udg_TempPoint, bj_UNIT_FACING )
call AddItemToStockBJ( ChooseRandomItemBJ(1), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(2), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(3), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(4), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(5), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(6), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(7), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(8), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(9), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(10), GetLastCreatedUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(11), GetLastCreatedUnit(), 1, 1 )
else
endif
if ( Trig_oooooooooooooo_Func001Func001Func015Func002Func002Func003C() ) then
call CreateNUnitsAtLoc( 1, ChooseRandomCreepBJ(GetRandomInt(1, 10)), Player(1), udg_TempPoint, bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Unit_Group_All )
else
endif
else
endif
call DestroyGroup(udg_TempGroup)
else
endif
else
endif
call RemoveLocation(udg_TempPoint)
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call PolledWait( 0.01 )
set udg_Loop = udg_Loop + 1
endloop
call SuspendHeroXPBJ( false, gg_unit_Huth_0000 )
call ConditionalTriggerExecute( gg_trg_Heroes_Items_2 )
call SetUnitOwner( gg_unit_Huth_0000, Player(0), true )
call ConditionalTriggerExecute( gg_trg_Random_Quest_1 )
call ClearTextMessagesBJ( GetPlayersAll() )
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_650" )
call PauseAllUnitsBJ( false )
call PauseUnitBJ( false, gg_unit_Huth_0000 )
call CinematicModeBJ( false, GetPlayersAll() )
call DisplayCineFilterBJ( false )
call PanCameraToTimedLocForPlayer( Player(0), GetUnitLoc(gg_unit_Eevi_0003), 0 )
call ForGroupBJ( GetUnitsInRectAll(GetPlayableMapRect()), function Trig_oooooooooooooo_Func008A )
endfunction
//===========================================================================
function InitTrig_Generate_4 takes nothing returns nothing
set gg_trg_Generate_4 = CreateTrigger( )
call TriggerAddAction( gg_trg_Generate_4, function Trig_oooooooooooooo_Actions )
endfunction
function Trig_ooooo_Actions takes nothing returns nothing
set udg_Loop = 1
loop
exitwhen udg_Loop > R2I(( GetRectWidthBJ(GetPlayableMapRect()) / I2R(udg_GeneratorSeed) ))
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = R2I(( GetRectHeightBJ(GetPlayableMapRect()) / I2R(udg_GeneratorSeed) ))
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_TempPoint = Location(( I2R(udg_Loop) * I2R(udg_GeneratorSeed) ), ( I2R(GetForLoopIndexA()) * I2R(udg_GeneratorSeed) ))
call TerrainDeformationCraterBJ( 0.10, true, udg_TempPoint, GetRandomReal(64.00, 512.00), ( -1.00 * GetRandomReal(-32.00, 32.00) ) )
call RemoveLocation(udg_TempPoint)
set udg_TempPoint = Location(( I2R(udg_Loop) * I2R(( -1 * udg_GeneratorSeed )) ), ( I2R(GetForLoopIndexA()) * I2R(udg_GeneratorSeed) ))
call TerrainDeformationCraterBJ( 0.10, true, udg_TempPoint, GetRandomReal(64.00, 512.00), ( -1.00 * GetRandomReal(-32.00, 32.00) ) )
call RemoveLocation(udg_TempPoint)
set udg_TempPoint = Location(( I2R(udg_Loop) * I2R(udg_GeneratorSeed) ), ( I2R(GetForLoopIndexA()) * I2R(( -1 * udg_GeneratorSeed )) ))
call TerrainDeformationCraterBJ( 0.10, true, udg_TempPoint, GetRandomReal(64.00, 512.00), ( -1.00 * GetRandomReal(-32.00, 32.00) ) )
call RemoveLocation(udg_TempPoint)
set udg_TempPoint = Location(( I2R(udg_Loop) * I2R(( -1 * udg_GeneratorSeed )) ), ( I2R(GetForLoopIndexA()) * I2R(( -1 * udg_GeneratorSeed )) ))
call TerrainDeformationCraterBJ( 0.10, true, udg_TempPoint, GetRandomReal(64.00, 512.00), ( -1.00 * GetRandomReal(-32.00, 32.00) ) )
call RemoveLocation(udg_TempPoint)
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call PolledWait( 0.01 )
set udg_Loop = udg_Loop + 1
endloop
call ConditionalTriggerExecute( gg_trg_Generate_4 )
endfunction
//===========================================================================
function InitTrig_Generate_5 takes nothing returns nothing
set gg_trg_Generate_5 = CreateTrigger( )
call TriggerAddAction( gg_trg_Generate_5, function Trig_ooooo_Actions )
endfunction
function Trig_oooooooooooo_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetDyingUnit(), UNIT_TYPE_HERO) == false ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetDyingUnit()) == Player(1) ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooo_Func002C takes nothing returns boolean
if ( not ( GetRandomInt(1, 100) < 17 ) ) then
return false
endif
return true
endfunction
function Trig_oooooooooooo_Actions takes nothing returns nothing
call AdjustPlayerStateBJ( ( GetUnitLevel(GetDyingUnit()) * 9 ), Player(0), PLAYER_STATE_RESOURCE_GOLD )
call CreateTextTagUnitBJ( I2S(( ( GetUnitLevel(GetDyingUnit()) * 8 ) + S2I("|c00EFF933 Gold!") )), GetDyingUnit(), 0, 7.75, 100, 100, 100, 0 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), GetRandomReal(55.00, 75.00), 90 )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), GetRandomReal(5.00, 4.00) )
call SetTextTagFadepointBJ( GetLastCreatedTextTag(), GetRandomReal(4.00, 3.00) )
if ( Trig_oooooooooooo_Func002C() ) then
call CreateItemLoc( ChooseRandomItemBJ(GetUnitLevel(GetDyingUnit())), GetUnitLoc(GetDyingUnit()) )
else
endif
call TriggerSleepAction( 90.00 )
call CreateNUnitsAtLoc( 1, GetUnitTypeId(GetDyingUnit()), Player(1), GetUnitLoc(GetDyingUnit()), bj_UNIT_FACING )
endfunction
//===========================================================================
function InitTrig_Generate_6 takes nothing returns nothing
set gg_trg_Generate_6 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Generate_6, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Generate_6, Condition( function Trig_oooooooooooo_Conditions ) )
call TriggerAddAction( gg_trg_Generate_6, function Trig_oooooooooooo_Actions )
endfunction
function Trig_s_Actions takes nothing returns nothing
call AdjustPlayerStateBJ( 1500, Player(0), PLAYER_STATE_RESOURCE_GOLD )
call CreateNUnitsAtLoc( 1, 'Nalc', Player(1), GetRandomLocInRect(GetPlayableMapRect()), bj_UNIT_FACING )
call SetHeroLevelBJ( GetLastCreatedUnit(), 5, false )
call CreateNUnitsAtLoc( 1, 'Nngs', Player(1), GetRandomLocInRect(GetPlayableMapRect()), bj_UNIT_FACING )
call SetHeroLevelBJ( GetLastCreatedUnit(), 5, false )
call CreateNUnitsAtLoc( 1, 'Ntin', Player(1), GetRandomLocInRect(GetPlayableMapRect()), bj_UNIT_FACING )
call SetHeroLevelBJ( GetLastCreatedUnit(), 5, false )
call CreateNUnitsAtLoc( 1, 'Nbst', Player(1), GetRandomLocInRect(GetPlayableMapRect()), bj_UNIT_FACING )
call SetHeroLevelBJ( GetLastCreatedUnit(), 5, false )
call CreateNUnitsAtLoc( 1, 'Nbrn', Player(1), GetRandomLocInRect(GetPlayableMapRect()), bj_UNIT_FACING )
call SetHeroLevelBJ( GetLastCreatedUnit(), 5, false )
call CreateNUnitsAtLoc( 1, 'Npbm', Player(1), GetRandomLocInRect(GetPlayableMapRect()), bj_UNIT_FACING )
call SetHeroLevelBJ( GetLastCreatedUnit(), 5, false )
call CreateNUnitsAtLoc( 1, 'Nplh', Player(1), GetRandomLocInRect(GetPlayableMapRect()), bj_UNIT_FACING )
call SetHeroLevelBJ( GetLastCreatedUnit(), 5, false )
call CreateNUnitsAtLoc( 1, 'Nfir', Player(1), GetRandomLocInRect(GetPlayableMapRect()), bj_UNIT_FACING )
call SetHeroLevelBJ( GetLastCreatedUnit(), 5, false )
endfunction
//===========================================================================
function InitTrig_Heroes takes nothing returns nothing
set gg_trg_Heroes = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Heroes, 13.00 )
call TriggerAddAction( gg_trg_Heroes, function Trig_s_Actions )
endfunction
function Trig_ss_Func001Func001C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnumUnit()) == 'ngme' ) ) then
return false
endif
return true
endfunction
function Trig_ss_Func001Func002C takes nothing returns boolean
if ( not ( IsUnitType(GetEnumUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetEnumUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) ) ) then
return false
endif
return true
endfunction
function Trig_ss_Func001A takes nothing returns nothing
if ( Trig_ss_Func001Func001C() ) then
call AddItemToStockBJ( ChooseRandomItemBJ(1), GetEnumUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(2), GetEnumUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(3), GetEnumUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(4), GetEnumUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(5), GetEnumUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(6), GetEnumUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(7), GetEnumUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(8), GetEnumUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(9), GetEnumUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(10), GetEnumUnit(), 1, 1 )
call AddItemToStockBJ( ChooseRandomItemBJ(11), GetEnumUnit(), 1, 1 )
else
endif
if ( Trig_ss_Func001Func002C() ) then
call AddHeroXPSwapped( ( 2500 * ( GetHeroLevel(GetEnumUnit()) / 5 ) ), GetTriggerUnit(), false )
call ModifyHeroStat( bj_HEROSTAT_STR, GetEnumUnit(), bj_MODIFYMETHOD_ADD, 10 )
call ModifyHeroStat( bj_HEROSTAT_AGI, GetEnumUnit(), bj_MODIFYMETHOD_ADD, 5 )
call ModifyHeroStat( bj_HEROSTAT_INT, GetEnumUnit(), bj_MODIFYMETHOD_ADD, 5 )
else
endif
endfunction
function Trig_ss_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRectAll(GetPlayableMapRect()), function Trig_ss_Func001A )
endfunction
//===========================================================================
function InitTrig_Items_Generate_1 takes nothing returns nothing
set gg_trg_Items_Generate_1 = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Items_Generate_1, 500.00 )
call TriggerAddAction( gg_trg_Items_Generate_1, function Trig_ss_Actions )
endfunction
function Trig_sss_Func002Func001C takes nothing returns boolean
if ( not ( IsUnitType(GetEnumUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetEnumUnit()) == Player(1) ) ) then
return false
endif
return true
endfunction
function Trig_sss_Func002A takes nothing returns nothing
if ( Trig_sss_Func002Func001C() ) then
call IssuePointOrderLocBJ( GetEnumUnit(), "attack", GetRandomLocInRect(GetPlayableMapRect()) )
else
endif
endfunction
function Trig_sss_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRectAll(GetPlayableMapRect()), function Trig_sss_Func002A )
endfunction
//===========================================================================
function InitTrig_Items_Generate_2 takes nothing returns nothing
set gg_trg_Items_Generate_2 = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Items_Generate_2, 15.00 )
call TriggerAddAction( gg_trg_Items_Generate_2, function Trig_sss_Actions )
endfunction
function Trig_ssss_Actions takes nothing returns nothing
call CustomDefeatBJ( Player(0), "TRIGSTR_653" )
endfunction
//===========================================================================
function InitTrig_Items_Generate_3 takes nothing returns nothing
set gg_trg_Items_Generate_3 = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Items_Generate_3, gg_unit_Eevi_0003, EVENT_UNIT_DEATH )
call TriggerAddAction( gg_trg_Items_Generate_3, function Trig_ssss_Actions )
endfunction
function Trig_sssss_Func007C takes nothing returns boolean
if ( not ( GetRandomInt(1, 100) < 75 ) ) then
return false
endif
return true
endfunction
function Trig_sssss_Actions takes nothing returns nothing
call AddWeatherEffectSaveLast( GetPlayableMapRect(), 'RAhr' )
call TriggerSleepAction( 300.00 )
call EnableWeatherEffect( GetLastCreatedWeatherEffect(), false )
call AddWeatherEffectSaveLast( GetPlayableMapRect(), 'WOlw' )
call TriggerSleepAction( 225.00 )
call EnableWeatherEffect( GetLastCreatedWeatherEffect(), false )
if ( Trig_sssss_Func007C() ) then
call AddWeatherEffectSaveLast( GetPlayableMapRect(), 'SNls' )
else
endif
call TriggerSleepAction( 250.00 )
call EnableWeatherEffect( GetLastCreatedWeatherEffect(), false )
endfunction
//===========================================================================
function InitTrig_Items_Generate_4 takes nothing returns nothing
set gg_trg_Items_Generate_4 = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Items_Generate_4, 1500.00 )
call TriggerAddAction( gg_trg_Items_Generate_4, function Trig_sssss_Actions )
endfunction
function Trig_ssssss_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetDyingUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetDyingUnit()) == Player(1) ) ) then
return false
endif
return true
endfunction
function Trig_ssssss_Actions takes nothing returns nothing
call AdjustPlayerStateBJ( ( GetHeroLevel(GetDyingUnit()) * 25 ), GetOwningPlayer(GetKillingUnitBJ()), PLAYER_STATE_RESOURCE_GOLD )
call TriggerSleepAction( 120.00 )
call ReviveHeroLoc( GetDyingUnit(), GetRandomLocInRect(GetPlayableMapRect()), false )
endfunction
//===========================================================================
function InitTrig_Items_Generate_5 takes nothing returns nothing
set gg_trg_Items_Generate_5 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Items_Generate_5, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Items_Generate_5, Condition( function Trig_ssssss_Conditions ) )
call TriggerAddAction( gg_trg_Items_Generate_5, function Trig_ssssss_Actions )
endfunction
function Trig_sssssss_Func002A takes nothing returns nothing
call UnitAddAbilityBJ( 'Avul', GetEnumUnit() )
endfunction
function Trig_sssssss_Func004A takes nothing returns nothing
call UnitRemoveAbilityBJ( 'Avul', GetEnumUnit() )
endfunction
function Trig_sssssss_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRectAll(GetPlayableMapRect()), function Trig_sssssss_Func002A )
call TriggerSleepAction( 120.00 )
call ForGroupBJ( GetUnitsInRectAll(GetPlayableMapRect()), function Trig_sssssss_Func004A )
endfunction
//===========================================================================
function InitTrig_Items_Generate_6 takes nothing returns nothing
set gg_trg_Items_Generate_6 = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Items_Generate_6, 0.00 )
call TriggerAddAction( gg_trg_Items_Generate_6, function Trig_sssssss_Actions )
endfunction
//TESH.scrollpos=148
//TESH.alwaysfold=0
//===========================================================================
// Damage Engine lets you detect, amplify, block or nullify damage. It even
// lets you detect if the damage was physical or from a spell. Just reference
// DamageEventAmount/Source/Target or the boolean IsDamageSpell, to get the
// necessary damage event data.
//
// - Detect damage: use the event "DamageEvent Equal to 1.00"
// - To change damage before it's dealt: use the event "DamageModifierEvent Equal to 1.00"
// - Detect damage after it was applied, use the event "AfterDamageEvent Equal to 1.00"
// - Detect spell damage: use the condition "IsDamageSpell Equal to True"
// - Detect zero-damage: use the event "DamageEvent Equal to 2.00" (an AfterDamageEvent will not fire for this)
//
// You can specify the DamageEventType before dealing triggered damage. To prevent an already-improbable error, I recommend running the trigger "ClearDamageEvent (Checking Conditions)" after dealing triggered damage from within a damage event:
// - Set NextDamageType = DamageTypeWhatever
// - Unit - Cause...
// - Trigger - Run ClearDamageEvent (Checking Conditions)
//
// You can modify the DamageEventAmount and the DamageEventType from a "DamageModifierEvent Equal to 1.00" trigger.
// - If the amount is modified to negative, it will count as a heal.
// - If the amount is set to 0, no damage will be dealt.
//
// If you need to reference the original in-game damage, use the variable "DamageEventPrevAmt".
//
//===========================================================================
// Programming note about "integer i" and "udg_DmgEvRecursionN": integer i
// ranges from -1 upwards. "udg_DmgEvRecursionN" ranges from 0 upwards.
// "integer i" is always 1 less than "udg_DmgEvRecursionN"
//
function DmgEvResetVars takes nothing returns nothing
local integer i = udg_DmgEvRecursionN - 2
set udg_DmgEvRecursionN = i + 1
if i >= 0 then
set udg_DamageEventPrevAmt = udg_LastDmgPrevAmount[i]
set udg_DamageEventAmount = udg_LastDmgValue[i]
set udg_DamageEventSource = udg_LastDmgSource[i]
set udg_DamageEventTarget = udg_LastDmgTarget[i]
set udg_IsDamageSpell = udg_LastDmgWasSpell[i]
set udg_DamageEventType = udg_LastDmgPrevType[i]
endif
endfunction
function CheckDamagedLifeEvent takes boolean clear returns nothing
if clear then
set udg_NextDamageOverride = false
set udg_NextDamageType = 0
endif
if udg_DmgEvTrig != null then
call DestroyTrigger(udg_DmgEvTrig)
set udg_DmgEvTrig = null
if udg_IsDamageSpell then
call SetWidgetLife(udg_DamageEventTarget, RMaxBJ(udg_LastDamageHP, 0.41))
if udg_LastDamageHP <= 0.405 then
if udg_DamageEventType < 0 then
call SetUnitExploded(udg_DamageEventTarget, true)
endif
//Kill the unit
call DisableTrigger(udg_DamageEventTrigger)
call UnitDamageTarget(udg_DamageEventSource, udg_DamageEventTarget, -999, false, false, null, DAMAGE_TYPE_UNIVERSAL, null)
call EnableTrigger(udg_DamageEventTrigger)
endif
elseif GetUnitAbilityLevel(udg_DamageEventTarget, udg_DamageBlockingAbility) > 0 then
call UnitRemoveAbility(udg_DamageEventTarget, udg_DamageBlockingAbility)
call SetWidgetLife(udg_DamageEventTarget, udg_LastDamageHP)
endif
if udg_DamageEventAmount != 0.00 and not udg_HideDamageFrom[GetUnitUserData(udg_DamageEventSource)] then
set udg_AfterDamageEvent = 0.00
set udg_AfterDamageEvent = 1.00
set udg_AfterDamageEvent = 0.00
endif
call DmgEvResetVars()
endif
endfunction
function DmgEvOnExpire takes nothing returns nothing
set udg_DmgEvStarted = false
call CheckDamagedLifeEvent(true)
endfunction
function PreCheckDamagedLifeEvent takes nothing returns boolean
call CheckDamagedLifeEvent(true)
return false
endfunction
function OnUnitDamage takes nothing returns boolean
local boolean override = udg_DamageEventOverride
local integer i = udg_DmgEvRecursionN - 1
local string s
local real prevAmount
local real life
local real prevLife
local unit u
call CheckDamagedLifeEvent(false) //in case the unit state event failed and the 0.00 second timer hasn't yet expired
if i >= 0 then
if i < 16 then
set udg_LastDmgPrevAmount[i]= udg_DamageEventPrevAmt
set udg_LastDmgValue[i] = udg_DamageEventAmount
set udg_LastDmgSource[i] = udg_DamageEventSource
set udg_LastDmgTarget[i] = udg_DamageEventTarget
set udg_LastDmgWasSpell[i] = udg_IsDamageSpell
set udg_LastDmgPrevType[i] = udg_DamageEventType
else
set s = "WARNING: Recursion error when dealing damage! Make sure when you deal damage from within a DamageEvent trigger, do it like this:\n\n"
set s = s + "Trigger - Turn off (This Trigger)\n"
set s = s + "Unit - Cause...\n"
set s = s + "Trigger - Turn on (This Trigger)"
//Delete the next couple of lines to disable the in-game recursion crash warnings
call ClearTextMessages()
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0.00, 0.00, 999.00, s)
return false
endif
endif
set udg_DmgEvRecursionN = i + 2
set u = GetTriggerUnit()
set prevAmount = GetEventDamage()
set udg_DamageEventSource = GetEventDamageSource()
set udg_DamageEventAmount = prevAmount
set udg_DamageEventTarget = u
set udg_DamageEventType = udg_NextDamageType
set udg_NextDamageType = 0
set udg_DamageEventOverride = udg_NextDamageOverride
set udg_NextDamageOverride = false
if prevAmount == 0.00 then
if not udg_HideDamageFrom[GetUnitUserData(udg_DamageEventSource)] then
set udg_DamageEventPrevAmt = 0.00
set udg_DamageEvent = 0.00
set udg_DamageEvent = 2.00
set udg_DamageEvent = 0.00
endif
call DmgEvResetVars()
else
if not udg_DmgEvStarted then
set udg_DmgEvStarted = true
call TimerStart(udg_DmgEvTimer, 0.00, false, function DmgEvOnExpire)
endif
set udg_IsDamageSpell = prevAmount < 0.00
if udg_IsDamageSpell then
set prevAmount = -udg_DamageEventAmount
set life = 1.00
if IsUnitType(u, UNIT_TYPE_ETHEREAL) and not IsUnitType(u, UNIT_TYPE_HERO) then
set life = life*udg_DAMAGE_FACTOR_ETHEREAL //1.67
endif
if GetUnitAbilityLevel(u, 'Aegr') > 0 then
set life = life*udg_DAMAGE_FACTOR_ELUNES //0.80
endif
if udg_DmgEvBracers != 0 and IsUnitType(u, UNIT_TYPE_HERO) then
//Inline of UnitHasItemOfTypeBJ without the potential handle ID leak.
set i = 6
loop
set i = i - 1
if GetItemTypeId(UnitItemInSlot(u, i)) == udg_DmgEvBracers then
set life = life*udg_DAMAGE_FACTOR_BRACERS //0.67
exitwhen true
endif
exitwhen i == 0
endloop
endif
set udg_DamageEventAmount = prevAmount*life
endif
set udg_DamageEventPrevAmt = prevAmount
set udg_DamageModifierEvent = 0.00
if not udg_DamageEventOverride then
set udg_DamageModifierEvent = 1.00
if not udg_DamageEventOverride then
set udg_DamageModifierEvent = 2.00
set udg_DamageModifierEvent = 3.00
endif
endif
set udg_DamageEventOverride = override
if udg_DamageEventAmount > 0.00 then
set udg_DamageModifierEvent = 4.00
endif
set udg_DamageModifierEvent = 0.00
if not udg_HideDamageFrom[GetUnitUserData(udg_DamageEventSource)] then
set udg_DamageEvent = 0.00
set udg_DamageEvent = 1.00
set udg_DamageEvent = 0.00
endif
call CheckDamagedLifeEvent(true) //in case the unit state event failed from a recursive damage event
//All events have run and the damage amount is finalized.
set life = GetWidgetLife(u)
set udg_DmgEvTrig = CreateTrigger()
call TriggerAddCondition(udg_DmgEvTrig, Filter(function PreCheckDamagedLifeEvent))
if not udg_IsDamageSpell then
if udg_DamageEventAmount != prevAmount then
set life = life + prevAmount - udg_DamageEventAmount
if GetUnitState(u, UNIT_STATE_MAX_LIFE) < life then
set udg_LastDamageHP = life - prevAmount
call UnitAddAbility(u, udg_DamageBlockingAbility)
endif
call SetWidgetLife(u, RMaxBJ(life, 0.42))
endif
call TriggerRegisterUnitStateEvent(udg_DmgEvTrig, u, UNIT_STATE_LIFE, LESS_THAN, RMaxBJ(0.41, life - prevAmount/2.00))
else
set udg_LastDamageHP = GetUnitState(u, UNIT_STATE_MAX_LIFE)
set prevLife = life
if life + prevAmount*0.75 > udg_LastDamageHP then
set life = RMaxBJ(udg_LastDamageHP - prevAmount/2.00, 1.00)
call SetWidgetLife(u, life)
set life = (life + udg_LastDamageHP)/2.00
else
set life = life + prevAmount*0.50
endif
set udg_LastDamageHP = prevLife - (prevAmount - (prevAmount - udg_DamageEventAmount))
call TriggerRegisterUnitStateEvent(udg_DmgEvTrig, u, UNIT_STATE_LIFE, GREATER_THAN, life)
endif
set u = null
endif
return false
endfunction
function CreateDmgEvTrg takes nothing returns nothing
set udg_DamageEventTrigger = CreateTrigger()
call TriggerAddCondition(udg_DamageEventTrigger, Filter(function OnUnitDamage))
endfunction
function SetupDmgEv takes nothing returns boolean
local integer i = udg_UDex
local unit u
if udg_UnitIndexEvent == 1.00 then
set u = udg_UDexUnits[i]
if GetUnitAbilityLevel(u, 'Aloc') == 0 and TriggerEvaluate(gg_trg_Damage_Engine_Config) then
set udg_UnitDamageRegistered[i] = true
call TriggerRegisterUnitEvent(udg_DamageEventTrigger, u, EVENT_UNIT_DAMAGED)
call UnitAddAbility(u, udg_SpellDamageAbility)
call UnitMakeAbilityPermanent(u, true, udg_SpellDamageAbility)
endif
set u = null
else
set udg_HideDamageFrom[i] = false
if udg_UnitDamageRegistered[i] then
set udg_UnitDamageRegistered[i] = false
set udg_DamageEventsWasted = udg_DamageEventsWasted + 1
if udg_DamageEventsWasted == 32 then //After 32 registered units have been removed...
set udg_DamageEventsWasted = 0
//Rebuild the mass EVENT_UNIT_DAMAGED trigger:
call DestroyTrigger(udg_DamageEventTrigger)
call CreateDmgEvTrg()
set i = udg_UDexNext[0]
loop
exitwhen i == 0
if udg_UnitDamageRegistered[i] then
call TriggerRegisterUnitEvent(udg_DamageEventTrigger, udg_UDexUnits[i], EVENT_UNIT_DAMAGED)
endif
set i = udg_UDexNext[i]
endloop
endif
endif
endif
return false
endfunction
//===========================================================================
function InitTrig_Damage_Engine takes nothing returns nothing
local unit u = CreateUnit(Player(15), 'uloc', 0, 0, 0)
local integer i = 16
//Create this trigger with UnitIndexEvents in order add and remove units
//as they are created or removed.
local trigger t = CreateTrigger()
call TriggerRegisterVariableEvent(t, "udg_UnitIndexEvent", EQUAL, 1.00)
call TriggerRegisterVariableEvent(t, "udg_UnitIndexEvent", EQUAL, 2.00)
call TriggerAddCondition(t, Filter(function SetupDmgEv))
set t = null
//Run the configuration trigger to set all configurables:
if gg_trg_Damage_Engine_Config == null then
//It's possible this InitTrig_ function ran first, in which case use ExecuteFunc.
call ExecuteFunc("Trig_Damage_Engine_Config_Actions")
else
call TriggerExecute(gg_trg_Damage_Engine_Config)
endif
//Create trigger for storing all EVENT_UNIT_DAMAGED events.
call CreateDmgEvTrg()
//Create GUI-friendly trigger for cleaning up after UnitDamageTarget.
set udg_ClearDamageEvent = CreateTrigger()
call TriggerAddCondition(udg_ClearDamageEvent, Filter(function PreCheckDamagedLifeEvent))
//Disable SpellDamageAbility for every player.
loop
set i = i - 1
call SetPlayerAbilityAvailable(Player(i), udg_SpellDamageAbility, false)
exitwhen i == 0
endloop
//Preload abilities.
call UnitAddAbility(u, udg_DamageBlockingAbility)
call UnitAddAbility(u, udg_SpellDamageAbility)
call RemoveUnit(u)
set u = null
endfunction
function Trig_Dif_3_Actions takes nothing returns nothing
call CinematicModeBJ( false, bj_FORCE_PLAYER[0] )
endfunction
//===========================================================================
function InitTrig_Dif_3 takes nothing returns nothing
set gg_trg_Dif_3 = CreateTrigger( )
call TriggerAddAction( gg_trg_Dif_3, function Trig_Dif_3_Actions )
endfunction
function Trig_Dif_4_Actions takes nothing returns nothing
call CinematicModeBJ( true, bj_FORCE_PLAYER[0] )
call DisplayTimedTextToForce( GetPlayersAll(), 3600.00, "TRIGSTR_652" )
endfunction
//===========================================================================
function InitTrig_Dif_4 takes nothing returns nothing
set gg_trg_Dif_4 = CreateTrigger( )
call TriggerAddAction( gg_trg_Dif_4, function Trig_Dif_4_Actions )
endfunction