function PrepareMap takes nothing returns nothing
// Player 6
call SetPlayerStartLocation( Player(6), 6 )
call SetPlayerColor( Player(6), ConvertPlayerColor(6) )
call SetPlayerRacePreference( Player(6), RACE_PREF_HUMAN )
call SetPlayerRaceSelectable( Player(6), false )
call SetPlayerController( Player(6), MAP_CONTROL_COMPUTER )
// Player 7
call SetPlayerStartLocation( Player(7), 7 )
call SetPlayerColor( Player(7), ConvertPlayerColor(7) )
call SetPlayerRacePreference( Player(7), RACE_PREF_ORC )
call SetPlayerRaceSelectable( Player(7), false )
call SetPlayerController( Player(7), MAP_CONTROL_COMPUTER )
// Player 8
call SetPlayerStartLocation( Player(8), 8 )
call SetPlayerColor( Player(8), ConvertPlayerColor(8) )
call SetPlayerRacePreference( Player(8), RACE_PREF_UNDEAD )
call SetPlayerRaceSelectable( Player(8), false )
call SetPlayerController( Player(8), MAP_CONTROL_COMPUTER )
// Player 9
call SetPlayerStartLocation( Player(9), 9 )
call SetPlayerColor( Player(9), ConvertPlayerColor(9) )
call SetPlayerRacePreference( Player(9), RACE_PREF_NIGHTELF )
call SetPlayerRaceSelectable( Player(9), false )
call SetPlayerController( Player(9), MAP_CONTROL_COMPUTER )
// Player 10
call SetPlayerStartLocation( Player(10), 10 )
call SetPlayerColor( Player(10), ConvertPlayerColor(10) )
call SetPlayerRacePreference( Player(10), RACE_PREF_NIGHTELF )
call SetPlayerRaceSelectable( Player(10), false )
call SetPlayerController( Player(10), MAP_CONTROL_COMPUTER )
// Player 11
call SetPlayerStartLocation( Player(11), 11 )
call SetPlayerColor( Player(11), ConvertPlayerColor(11) )
call SetPlayerRacePreference( Player(11), RACE_PREF_ORC )
call SetPlayerRaceSelectable( Player(11), false )
call SetPlayerController( Player(11), MAP_CONTROL_COMPUTER )
call DefineStartLocation( 6, -13760.0, 11712.0 )
call DefineStartLocation( 7, -12736.0, -1536.0 )
call DefineStartLocation( 8, -2304.0, -12864.0 )
call DefineStartLocation( 9, 12928.0, -11712.0 )
call DefineStartLocation( 10, 10624.0, 3520.0 )
call DefineStartLocation( 11, 1152.0, 11904.0 )
call SetPlayerSlotAvailable( Player(6), MAP_CONTROL_COMPUTER )
call SetPlayerSlotAvailable( Player(7), MAP_CONTROL_COMPUTER )
call SetPlayerSlotAvailable( Player(8), MAP_CONTROL_COMPUTER )
call SetPlayerSlotAvailable( Player(9), MAP_CONTROL_COMPUTER )
call SetPlayerSlotAvailable( Player(10), MAP_CONTROL_COMPUTER )
call SetPlayerSlotAvailable( Player(11), MAP_CONTROL_COMPUTER )
call SetPlayerTeam( Player(6), 0 )
call SetPlayerTeam( Player(7), 0 )
call SetPlayerTeam( Player(8), 0 )
call SetPlayerTeam( Player(9), 0 )
call SetPlayerTeam( Player(10), 0 )
call SetPlayerTeam( Player(11), 0 )
endfunction
function RefreshUnit takes unit u returns nothing
if GetUnitUserData(u)!=0 then
if ( udg_UnitRallyAsUnit[GetUnitUserData(u)] != null ) then
if ( IsUnitEnemy(udg_UnitRallyAsUnit[GetUnitUserData(u)], GetOwningPlayer(u)) == true ) then
call IssueTargetOrderBJ( u, "attack", udg_UnitRallyAsUnit[GetUnitUserData(u)] )
else
call IssueTargetOrderBJ( u, "move", udg_UnitRallyAsUnit[GetUnitUserData(u)] )
endif
else
set udg_PointTMP = GetUnitRallyPoint(udg_UnitBarracks[GetUnitUserData(u)])
call IssuePointOrderLocBJ( u, "attack", udg_PointTMP )
call RemoveLocation( udg_PointTMP )
endif
endif
endfunction
function ResurrectTree takes destructable a returns nothing
call PolledWait( 30.00 )
call DestructableRestoreLife( a, GetDestructableMaxLife(a), true )
endfunction
function IsAltar takes nothing returns boolean
return ( GetUnitAbilityLevelSwapped('A00O', GetFilterUnit()) == 1 )
endfunction
function FriendlyAltar takes nothing returns boolean
return((IsAltar()) and (IsUnitAlly(GetFilterUnit(),udg_PlrTMP)))
endfunction
function ResurrectHero takes unit h returns nothing
local integer count
local leaderboard t
local string a
local integer p
local unit altar
set a = "Resurrection"
set count = 6 * GetHeroLevel(h)
set t = CreateLeaderboardBJ( GetForceOfPlayer(GetOwningPlayer(h)), a )
set a = GetHeroProperName(h)
set p = CountUnitsInGroup(GetUnitsOfPlayerMatching(ConvertedPlayer(GetConvertedPlayerId(GetOwningPlayer(h))+6), Condition(function IsAltar))) + 1
call LeaderboardAddItemBJ( GetOwningPlayer(h), t, a, count/p )
call LeaderboardSetLabelColorBJ( t, 100, 100, 100, 0 )
call LeaderboardSetValueColorBJ( t, 100, 100, 100, 0 )
loop
exitwhen count < 0
call PolledWait( 1.00 )
set p = CountUnitsInGroup(GetUnitsOfPlayerMatching(ConvertedPlayer(GetConvertedPlayerId(GetOwningPlayer(h))+6), Condition(function IsAltar))) + 1
set count = count - p
call LeaderboardSetPlayerItemValueBJ( GetOwningPlayer(h), t, count/p )
endloop
call DestroyLeaderboardBJ(t)
set altar = udg_UnitCurrentAltar[GetConvertedPlayerId(GetOwningPlayer(h))]
if ((altar==null) or (IsUnitEnemy(h,GetOwningPlayer(altar)))) then
set udg_PlrTMP = GetOwningPlayer(h)
set altar = GroupPickRandomUnit(GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function FriendlyAltar)))
set udg_UnitCurrentAltar[GetConvertedPlayerId(GetOwningPlayer(h))] = altar
if altar == null then
call CustomDefeatBJ( GetOwningPlayer(h), "You have defeated!" )
call CustomDefeatBJ( ConvertedPlayer(GetConvertedPlayerId(GetOwningPlayer(h))+6), "You have defeated!" )
return
endif
endif
call ReviveHeroLoc( h, GetUnitLoc(altar), true )
call PanCameraToTimedLocForPlayer( GetOwningPlayer(h), GetUnitLoc(h), 0 )
call SelectUnitForPlayerSingle( h, GetOwningPlayer(h) )
endfunction
function PingAltars takes nothing returns nothing
local integer a
loop
exitwhen (CountPlayersInForceBJ(udg_PGPing) == 0)
set a = 1
loop
exitwhen a > 6
call PingMinimapLocForForce( udg_PGPing, GetUnitLoc(udg_UnitCurrentAltar[a]), 1.00 )
set a = a + 1
endloop
call PolledWait( 1.00 )
endloop
endfunction
function RandomHeroByNumber takes integer k returns integer
local integer a
local integer p
set a = k
set p = 0
loop
exitwhen a == 0
set p = p + 1
if (udg_BooleanHeroPicked[p]==false) then
set a = a - 1
endif
endloop
set udg_BooleanHeroPicked[p] = true
return udg_UTHero[p]
endfunction
function MathematicianJordansMatrixCondCheck takes nothing returns boolean
return (IsUnitAlly(GetFilterUnit(), GetOwningPlayer(GetSpellAbilityUnit())) and IsUnitAliveBJ(GetFilterUnit()) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_MECHANICAL) == false ))
endfunction
function MathematicianJordansMatrixLoop1 takes nothing returns nothing
local unit k
call UnitRemoveBuffBJ( 'Binf', GetEnumUnit() )
set k = CreateUnitAtLoc(ConvertedPlayer(GetConvertedPlayerId(udg_PlrMathematician)+6),'h00D',GetUnitLoc(GetEnumUnit()),0)
call SetUnitAbilityLevelSwapped('A00T', k, udg_IntJordansMatrixLevel)
call IssueTargetOrderBJ( k, "innerfire", GetEnumUnit() )
call GroupAddUnitSimple( k, udg_UGJordansMatrix )
endfunction
function MathematicianJordansMatrixLoop2 takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
endfunction
function MathematicianJordansMatrixCast takes location l, unit m returns nothing
local group x
set x = GetUnitsInRangeOfLocMatching(300.00, l, Condition(function MathematicianJordansMatrixCondCheck))
call GroupClear( udg_UGJordansMatrix )
call ForGroupBJ( x, function MathematicianJordansMatrixLoop1 )
call PolledWait( 0.25 )
call ForGroupBJ( udg_UGJordansMatrix, function MathematicianJordansMatrixLoop2 )
endfunction
function MathematicianFactorial takes unit t, integer l, integer CV returns nothing
local unit u
local item i
local integer c
set u = CreateUnitAtLoc(GetOwningPlayer(t), 'h001', GetUnitLoc(t), 0.00 )
call UnitAddItemByIdSwapped( 'I000', u )
set i = GetLastCreatedItem()
call SetUnitUserData(u, CV)
set c = 1
loop
exitwhen c > l
call UnitUseItemTarget( u, i, t )
call PolledWait( 0.01 )
set c = c + 1
endloop
call RemoveUnit( u )
endfunction
function SorceressAvalancheCondGroup takes nothing returns boolean
return (IsUnitEnemy(GetFilterUnit(), udg_PlrSorceress) and IsUnitAliveBJ(GetFilterUnit()) and IsUnitVisible(GetFilterUnit(),udg_PlrSorceress) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_MECHANICAL) == false ))
endfunction
function SorceressAvalancheCondition takes nothing returns boolean
return ((GetUnitTypeId(GetEventDamageSource())=='h002') and (GetEventDamage()==0.01))
endfunction
function SorceressAvalancheActions takes nothing returns nothing
local unit c0
local unit c1
local unit next0
local unit next1
local group e
local trigger t0
local trigger t1
local unit T
local integer generation
call DestroyTrigger(GetTriggeringTrigger())
set udg_IntCount = udg_IntCount + 1
set T = GetTriggerUnit()
set generation=GetUnitUserData(GetEventDamageSource())
call RemoveUnit(GetEventDamageSource())
if udg_IntCount > 31 then
set generation = 6
endif
set udg_IntJustAnArray[generation]=udg_IntJustAnArray[generation]+1
call UnitDamageTargetBJ( udg_UnitSorceress, T, udg_RealAvalancheDMG, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_LIGHTNING )
if generation < 4 then
call PolledWait(0.10)
set e = GetUnitsInRangeOfLocMatching(500.00, GetUnitLoc(T), Condition(function SorceressAvalancheCondGroup))
call GroupRemoveUnit( e, T )
set next0 = GroupPickRandomUnit(e)
if next0 != null then
set c0 = CreateUnitAtLoc(udg_PlrSorceress,'h002',GetUnitLoc(T),0.00)
call UnitApplyTimedLifeBJ(1.5, 'BTLF', c0)
call SetUnitUserData( c0, generation+1 )
set t0 = CreateTrigger( )
call TriggerRegisterUnitEvent(t0, next0, EVENT_UNIT_DAMAGED)
call TriggerAddCondition(t0, Condition(function SorceressAvalancheCondition))
call TriggerAddAction(t0, function SorceressAvalancheActions)
call IssueTargetOrderBJ( c0, "shadowstrike", next0 )
call GroupRemoveUnit( e, next0 )
set next1 = GroupPickRandomUnit(e)
if next1 != null then
set c1 = CreateUnitAtLoc(udg_PlrSorceress,'h002',GetUnitLoc(T),0.00)
call UnitApplyTimedLifeBJ(1.5, 'BTLF', c1)
call SetUnitUserData( c1, generation+1 )
set t1 = CreateTrigger( )
call TriggerRegisterUnitEvent(t1, next1, EVENT_UNIT_DAMAGED)
call TriggerAddCondition(t1, Condition(function SorceressAvalancheCondition))
call TriggerAddAction(t1, function SorceressAvalancheActions)
call IssueTargetOrderBJ( c1, "shadowstrike", next1 )
endif
endif
endif
endfunction
function SorceressAvalancheCondition2 takes nothing returns boolean
return ((GetUnitTypeId(GetEventDamageSource())=='Hjai') and (GetEventDamage()==0.01))
endfunction
function SorceressAvalancheActions2 takes nothing returns nothing
local unit c0
local unit c1
local unit next0
local unit next1
local group e
local trigger t0
local trigger t1
local unit T
call DestroyTrigger(GetTriggeringTrigger())
set udg_IntCount = 0
set T = GetTriggerUnit()
call PolledWait(0.10)
call UnitDamageTargetBJ( udg_UnitSorceress, T, udg_RealAvalancheDMG, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_LIGHTNING )
set e = GetUnitsInRangeOfLocMatching(500.00, GetUnitLoc(T), Condition(function SorceressAvalancheCondGroup))
call GroupRemoveUnit( e, T )
set next0 = GroupPickRandomUnit(e)
if next0 != null then
set c0 = CreateUnitAtLoc(udg_PlrSorceress,'h002',GetUnitLoc(T),0.00)
call UnitApplyTimedLifeBJ(1.5, 'BTLF', c0)
call SetUnitUserData( c0, 1 )
set t0 = CreateTrigger( )
call TriggerRegisterUnitEvent(t0, next0, EVENT_UNIT_DAMAGED)
call TriggerAddCondition(t0, Condition(function SorceressAvalancheCondition))
call TriggerAddAction(t0, function SorceressAvalancheActions)
call IssueTargetOrderBJ( c0, "shadowstrike", next0 )
call GroupRemoveUnit( e, next0 )
set next1 = GroupPickRandomUnit(e)
if next1 != null then
set c1 = CreateUnitAtLoc(udg_PlrSorceress,'h002',GetUnitLoc(T),0.00)
call UnitApplyTimedLifeBJ(1.5, 'BTLF', c1)
call SetUnitUserData( c1, 1 )
set t1 = CreateTrigger( )
call TriggerRegisterUnitEvent(t1, next1, EVENT_UNIT_DAMAGED)
call TriggerAddCondition(t1, Condition(function SorceressAvalancheCondition))
call TriggerAddAction(t1, function SorceressAvalancheActions)
call IssueTargetOrderBJ( c1, "shadowstrike", next1 )
endif
endif
endfunction
function SorceressAvalancheCast takes nothing returns nothing
local trigger t
set t = CreateTrigger( )
call TriggerRegisterUnitEvent(t, GetSpellTargetUnit(), EVENT_UNIT_DAMAGED)
call TriggerAddCondition(t, Condition(function SorceressAvalancheCondition2))
call TriggerAddAction(t, function SorceressAvalancheActions2)
endfunction
function GiveCityCond takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == true )
endfunction
function GiveCityLoop takes nothing returns nothing
call SetUnitOwner( GetEnumUnit(), ConvertedPlayer(GetConvertedPlayerId(udg_PlrTMP)+6), true )
endfunction
function GiveCityAltar takes nothing returns nothing
call SetUnitOwner( GetEnumUnit(), udg_PlrTMP, true )
endfunction
function GiveCity takes integer k, player p returns nothing
local rect T
set T = udg_LocCity[k]
set udg_PlrTMP = p
call ForGroupBJ( GetUnitsInRectMatching(T, Condition(function GiveCityCond)), function GiveCityLoop )
call ForGroupBJ( GetUnitsInRectMatching(T, Condition(function IsAltar)), function GiveCityAltar )
call DisplayTextToForce( GetForceOfPlayer(p), ( ( "You have been granted the city of |cffffcc00" + udg_StrCityName[k] ) + "|r." ) )
endfunction
function DivideSegment takes location a, real m, location b returns location
return Location((m*GetLocationX(a) + (1-m)*GetLocationX(b)), (m*GetLocationY(a) + (1-m)*GetLocationY(b)))
endfunction
function LordOfWarRoarOfFuryFinalize takes unit a returns nothing
loop
exitwhen (UnitHasBuffBJ(a, 'B009'))
call PolledWait( 0.05 )
endloop
call UnitRemoveAbilityBJ( 'A01M', a )
call UnitRemoveBuffBJ( 'B009', a )
endfunction
function LordOfFrostImprisonmentCondGroup takes nothing returns boolean
return (IsUnitEnemy(GetFilterUnit(), udg_PlrLordOfFrost) and IsUnitAliveBJ(GetFilterUnit()) and IsUnitVisible(GetFilterUnit(),udg_PlrLordOfFrost) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_MECHANICAL) == false ))
endfunction
function LordOfFrostImprisonmentLoop1 takes nothing returns nothing
local unit t
set t = CreateUnitAtLoc( udg_PlrLordOfFrost, 'h00A', GetUnitLoc(GetEnumUnit()), 0 )
call SetUnitAbilityLevelSwapped( 'A02Q', t, udg_IntImprisonmentLevel )
call IssueTargetOrderBJ( t, "entanglingroots", GetEnumUnit() )
call GroupAddUnitSimple( t, udg_UGImprisonment )
endfunction
function LordOfFrostImprisonmentLoop2 takes nothing returns nothing
call KillUnit( GetEnumUnit() )
endfunction
function LordOfFrostImprisonment takes unit a returns nothing
call GroupClear( udg_UGImprisonment )
call ForGroupBJ( GetUnitsInRangeOfLocMatching(800.00, GetUnitLoc(a), Condition(function LordOfFrostImprisonmentCondGroup)), function LordOfFrostImprisonmentLoop1 )
call PolledWait( 0.25 )
call ForGroupBJ( udg_UGImprisonment, function LordOfFrostImprisonmentLoop2 )
endfunction
function LordOfDeathPetrification takes unit a, integer l returns nothing
local integer t
local boolean ALoTCasts
set t = 0
set ALoTCasts = false
call UnitRemoveBuffsBJ( bj_REMOVEBUFFS_ALL, a )
call PauseUnitBJ( true, a )
call SetUnitTimeScalePercent( a, 0 )
call UnitAddAbilityBJ( 'A031', a )
call UnitAddAbilityBJ( 'A032', a )
loop
exitwhen t > 2 + l*2
call PolledWait( 1.00 )
if udg_BooleanTime then
set t = t + 1
else
set ALoTCasts = true
endif
if (udg_BooleanTime and ALoTCasts) then
set ALoTCasts = false
call PauseUnitBJ( true, a )
call SetUnitTimeScalePercent( a, 0 )
endif
endloop
call UnitRemoveAbilityBJ( 'A031', a )
call UnitRemoveAbilityBJ( 'A032', a )
call PauseUnitBJ( false, a )
call SetUnitTimeScalePercent( a, 100 )
endfunction
function WildDionydeSlumberLoop1 takes nothing returns nothing
call UnitAddAbilityBJ( 'A03Q', GetEnumUnit() )
call SetUnitAbilityLevelSwapped( 'A03Q', GetEnumUnit(), udg_IntSlumberLevel )
call IssueTargetOrderBJ( GetEnumUnit(), "sleep", GetEnumUnit() )
endfunction
function WildDionydeSlumberLoop2 takes nothing returns nothing
call UnitRemoveAbilityBJ( 'A03Q', GetEnumUnit() )
endfunction
function WildDionydeSlumber takes group a returns nothing
call ForGroupBJ( a, function WildDionydeSlumberLoop1 )
call PolledWait( 2.00 )
call ForGroupBJ( a, function WildDionydeSlumberLoop2 )
endfunction
function WildDionydeWineLustSelfLoop1 takes nothing returns nothing
local unit k
set k = CreateUnitAtLoc(ConvertedPlayer(GetConvertedPlayerId(udg_PlrWildDionyde)+6),'h00E',GetUnitLoc(GetEnumUnit()),0)
call SetUnitAbilityLevelSwapped( 'A03U', k, udg_IntWineLustLevel )
call IssueTargetOrderBJ( k, "cripple", GetEnumUnit() )
endfunction
function WildDionydeWineLustSelfLoop2 takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
endfunction
function WildDionydeWineLustSelf takes group a returns nothing
call GroupClear( udg_UGWineLust )
call ForGroupBJ( a, function WildDionydeWineLustSelfLoop1 )
call PolledWait( 0.25 )
call ForGroupBJ( udg_UGWineLust, function WildDionydeWineLustSelfLoop2 )
endfunction
function LordOfMedicineSerpentPoisonHeal takes unit a, integer k returns nothing
local integer c
set c=1
loop
exitwhen c>25
if udg_BooleanTime then
call SetUnitLifeBJ( a, GetUnitStateSwap(UNIT_STATE_LIFE, a) + I2R(7*k) )
endif
call PolledWait( 1.00 )
if UnitHasBuffBJ(a, 'B00K')==false then
set c = 26
endif
if udg_BooleanTime then
set c = c + 1
endif
endloop
endfunction
function LordOfMedicineSerpentPoisonPositive takes nothing returns nothing
local unit t
local unit p
local integer lvl
set t = GetSpellTargetUnit()
set lvl = GetUnitAbilityLevelSwapped('A03W', GetSpellAbilityUnit())
set p = CreateUnitAtLoc( ConvertedPlayer(GetConvertedPlayerId(GetOwningPlayer(GetSpellAbilityUnit())) + 6 ), 'h00C', GetUnitLoc(t), 0.00 )
call SetUnitAbilityLevelSwapped( 'A045', p, lvl )
loop
exitwhen ( UnitHasBuffBJ(t, 'B00J') )
exitwhen ( IsUnitAliveBJ(t)==false)
call TriggerSleepAction( 0.05 )
endloop
call UnitRemoveBuffBJ( 'B00J', t )
call IssueTargetOrderBJ( p, "shadowstrike", t )
loop
exitwhen ( UnitHasBuffBJ(t, 'B00K') )
exitwhen ( IsUnitAliveBJ(t)==false)
call TriggerSleepAction( 0.05 )
endloop
call RemoveUnit( p )
call LordOfMedicineSerpentPoisonHeal( t, lvl )
endfunction
function KnightWarlockSlamshock takes unit k returns nothing
local unit giver
local unit taker
set giver = CreateUnitAtLoc( ConvertedPlayer(GetConvertedPlayerId(GetOwningPlayer(k)) + 6), 'h00P', GetUnitLoc(k), 0.00 )
set taker = CreateUnitAtLoc( Player(PLAYER_NEUTRAL_AGGRESSIVE), 'h00B', GetUnitLoc(k), 0.00 )
call SetUnitAbilityLevelSwapped( 'A036', giver, GetUnitAbilityLevelSwapped('A035', k) )
call IssueTargetOrderBJ( giver, "drunkenhaze", taker )
loop
exitwhen (UnitHasBuffBJ(taker, 'B00G'))
call PolledWait(0.05)
endloop
call RemoveUnit( giver )
call RemoveUnit( taker )
endfunction
function SpiritwalkerSpiritwalk takes unit t returns nothing
call PolledWait( 0.05 )
call UnitAddAbilityBJ( 'A05T', t )
loop
exitwhen UnitHasBuffBJ(t, 'B00T')==false
call PolledWait( 0.10 )
endloop
call UnitRemoveAbilityBJ( 'A05T', t )
endfunction
function MarkVictimAction takes nothing returns nothing
if UnitHasBuffBJ( GetAttackedUnitBJ(), 'B00U' )==false then
call DestroyTrigger(GetTriggeringTrigger())
return
endif
call UnitDamageTargetBJ( GetAttacker(), GetAttackedUnitBJ(), 7.00*udg_IntMarkVictimLevel, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL )
endfunction
function PhantasmVoidDmgReturnCondition takes nothing returns boolean
return ((GetRandomInt(1, 100)<=(3*GetUnitAbilityLevelSwapped('A05V', udg_UnitPhantasm))) and IsUnitAliveBJ(udg_UnitPhantasm))
endfunction
function PhantasmVoidDmgReturnAction takes nothing returns nothing
call SetUnitLifeBJ( udg_UnitPhantasm, ( GetUnitStateSwap(UNIT_STATE_LIFE, udg_UnitPhantasm) + GetEventDamage() ) )
call UnitDamageTargetBJ( udg_UnitPhantasm, GetEventDamageSource(), GetEventDamage(), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL )
endfunction
function VoidInvisibility3 takes nothing returns boolean
return ( udg_IntVoidLevel == 3 )
endfunction
function VoidInvisibilityM3 takes nothing returns nothing
call UnitRemoveAbilityBJ( 'A061', udg_UnitPhantasm )
endfunction
function VoidInvisibilityE3 takes nothing returns nothing
call UnitAddAbilityBJ( 'A061', udg_UnitPhantasm )
endfunction
function VoidInvisibility4 takes nothing returns boolean
return ( udg_IntVoidLevel == 4 )
endfunction
function VoidInvisibilityM4 takes nothing returns nothing
call UnitRemoveAbilityBJ( 'A060', udg_UnitPhantasm )
endfunction
function VoidInvisibilityE4 takes nothing returns nothing
call UnitAddAbilityBJ( 'A060', udg_UnitPhantasm )
endfunction
function PhantasmVoidActivate takes nothing returns nothing
local trigger t
set t = CreateTrigger()
call TriggerRegisterUnitEvent( t, udg_UnitPhantasm, EVENT_UNIT_DAMAGED )
call TriggerAddCondition( t, Condition( function PhantasmVoidDmgReturnCondition ) )
call TriggerAddAction( t, function PhantasmVoidDmgReturnAction )
set udg_TrgVoidInvisibilityM3 = CreateTrigger( )
call TriggerRegisterGameStateEventTimeOfDay( udg_TrgVoidInvisibilityM3, EQUAL, 6.05 )
call TriggerAddCondition( udg_TrgVoidInvisibilityM3, Condition( function VoidInvisibility3 ) )
call TriggerAddAction( udg_TrgVoidInvisibilityM3, function VoidInvisibilityM3 )
set udg_TrgVoidInvisibilityE3 = CreateTrigger( )
call TriggerRegisterGameStateEventTimeOfDay( udg_TrgVoidInvisibilityE3, EQUAL, 18.00 )
call TriggerAddCondition( udg_TrgVoidInvisibilityE3, Condition( function VoidInvisibility3 ) )
call TriggerAddAction( udg_TrgVoidInvisibilityE3, function VoidInvisibilityE3 )
set udg_TrgVoidInvisibilityM4 = CreateTrigger( )
call TriggerRegisterGameStateEventTimeOfDay( udg_TrgVoidInvisibilityM4, EQUAL, 6.05 )
call TriggerAddCondition( udg_TrgVoidInvisibilityM4, Condition( function VoidInvisibility4 ) )
call TriggerAddAction( udg_TrgVoidInvisibilityM4, function VoidInvisibilityM4 )
set udg_TrgVoidInvisibilityE4 = CreateTrigger( )
call TriggerRegisterGameStateEventTimeOfDay( udg_TrgVoidInvisibilityE4, EQUAL, 18.00 )
call TriggerAddCondition( udg_TrgVoidInvisibilityE4, Condition( function VoidInvisibility4 ) )
endfunction
function PhantasmMortalFateStun takes unit u returns nothing
local real d
local location old
local unit s
local integer a
set d = 0
set old = GetUnitLoc(u)
set a = 0
loop
exitwhen UnitHasBuffBJ(u,'B00V')
exitwhen a > 20
call PolledWait(0.10)
set a = a + 1
endloop
loop
exitwhen UnitHasBuffBJ(u,'B00V')==false
set d = d + DistanceBetweenPoints(old, GetUnitLoc(u))
set old = GetUnitLoc(u)
if d >= udg_RealMortalFateStunDistance then
set d = 0
set s = CreateUnitAtLoc(ConvertedPlayer(GetConvertedPlayerId(GetOwningPlayer(udg_UnitPhantasm)) + 6), 'h00Q', old, 0.00)
call IssueTargetOrderBJ( s, "firebolt", u )
set a = 0
loop
exitwhen UnitHasBuffBJ(u,'BPSE')
exitwhen a > 20
call PolledWait(0.05)
set a = a + 1
endloop
call RemoveUnit(s)
endif
call PolledWait(0.01)
endloop
endfunction
function ALoTTimeStreamFromTrigger takes nothing returns nothing
local unit t
local unit s
local integer l
local integer a
set t = GetSpellTargetUnit()
set l = GetUnitAbilityLevelSwapped('A064', GetSpellAbilityUnit())
set s = CreateUnitAtLoc(ConvertedPlayer(( GetConvertedPlayerId(GetOwningPlayer(GetSpellAbilityUnit())) + 6 )), 'h00S', GetUnitLoc(t), 0)
set a = 0
if IsUnitAlly(t, GetOwningPlayer(GetSpellAbilityUnit())) then
call UnitRemoveBuffBJ( 'Bblo', t )
call UnitAddAbilityBJ( 'A065', s )
call SetUnitAbilityLevelSwapped( 'A065', s, l )
call IssueTargetOrderBJ(s, "bloodlust", t)
loop
exitwhen UnitHasBuffBJ(t, 'B00X')
exitwhen a > 10
call PolledWait( 0.05 )
set a = a + 1
endloop
else
call UnitRemoveBuffBJ( 'Bslo', t )
call UnitAddAbilityBJ( 'A066', s )
call SetUnitAbilityLevelSwapped( 'A066', s, l )
call IssueTargetOrderBJ(s, "slow", t)
loop
exitwhen UnitHasBuffBJ(t, 'B00W')
exitwhen a > 10
call PolledWait( 0.05 )
set a = a + 1
endloop
endif
call RemoveUnit(s)
endfunction
function PaladinAuraOfRedemptionCond takes nothing returns boolean
return (( UnitHasBuffBJ(GetFilterUnit(), 'B014') == true ) and (GetUnitLifePercent(GetFilterUnit()) <= 99.99))
endfunction
function PaladinAuraOfRedemptionLoop takes nothing returns nothing
call SetUnitLifeBJ( GetEnumUnit(), GetUnitStateSwap(UNIT_STATE_LIFE, GetEnumUnit()) + udg_RealTMP )
call AddSpecialEffectTargetUnitBJ( "origin", GetEnumUnit(), "Abilities\\Spells\\Human\\Heal\\HealTarget.mdl" )
endfunction
function PaladinAuraOfRedemptionAction takes nothing returns nothing
local group t
set t = GetUnitsInRangeOfLocMatching(600.00, GetUnitLoc(GetTriggerUnit()), Condition(function PaladinAuraOfRedemptionCond))
if IsUnitGroupEmptyBJ(t) then
return
endif
set udg_RealTMP = GetEventDamage() * 0.50 * GetUnitAbilityLevelSwapped('A075', GetTriggerUnit()) / CountUnitsInGroup(t)
if udg_RealTMP > 0 then
call ForGroupBJ( t, function PaladinAuraOfRedemptionLoop )
endif
endfunction
function PaladinGoreCondCheck takes nothing returns boolean
return UnitHasBuffBJ(GetAttackedUnitBJ(), 'B015')
endfunction
function PaladinGoreAction takes nothing returns nothing
local unit u
set u = GetAttackedUnitBJ()
if ( GetUnitAbilityLevelSwapped( 'A077', u ) == 100 ) then
return
endif
if ( GetUnitAbilityLevelSwapped( 'A077', u ) == 0 ) then
call UnitAddAbilityBJ( 'A077', u )
else
call IncUnitAbilityLevelSwapped( 'A077', u )
endif
call PolledWait( 6 * udg_IntGoreLevel - 2 )
if ( GetUnitAbilityLevelSwapped( 'A077', u ) == 1 ) then
call UnitRemoveAbilityBJ( 'A077', u )
else
call DecUnitAbilityLevelSwapped( 'A077', u )
endif
endfunction
function PaladinInit takes unit u returns nothing
local trigger a
local trigger b
set a = CreateTrigger( )
call TriggerRegisterUnitEvent( a, u, EVENT_UNIT_DAMAGED )
call TriggerAddAction( a, function PaladinAuraOfRedemptionAction )
set b = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( b, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( b, Condition( function PaladinGoreCondCheck ) )
call TriggerAddAction( b, function PaladinGoreAction )
endfunction
function SunLordSunstrokeStats takes unit caster, integer level, unit target returns nothing
local integer MStr
local integer MAgi
local integer MInt
loop
exitwhen UnitHasBuffBJ(target, 'B01C')
call PolledWait( 0.05 )
endloop
set MStr = IMinBJ(level, GetHeroStatBJ(bj_HEROSTAT_STR, target, false)-1)
set MAgi = IMinBJ(level, GetHeroStatBJ(bj_HEROSTAT_AGI, target, false)-1)
set MInt = IMinBJ(level, GetHeroStatBJ(bj_HEROSTAT_INT, target, false)-1)
call ModifyHeroStat( bj_HEROSTAT_STR, target, bj_MODIFYMETHOD_SUB, MStr )
call ModifyHeroStat( bj_HEROSTAT_AGI, target, bj_MODIFYMETHOD_SUB, MAgi )
call ModifyHeroStat( bj_HEROSTAT_INT, target, bj_MODIFYMETHOD_SUB, MInt )
call ModifyHeroStat( bj_HEROSTAT_STR, caster, bj_MODIFYMETHOD_ADD, MStr )
call ModifyHeroStat( bj_HEROSTAT_AGI, caster, bj_MODIFYMETHOD_ADD, MAgi )
call ModifyHeroStat( bj_HEROSTAT_INT, caster, bj_MODIFYMETHOD_ADD, MInt )
loop
exitwhen UnitHasBuffBJ(target, 'B01C')==false
call PolledWait( 1.00 )
endloop
call ModifyHeroStat( bj_HEROSTAT_STR, target, bj_MODIFYMETHOD_ADD, MStr )
call ModifyHeroStat( bj_HEROSTAT_AGI, target, bj_MODIFYMETHOD_ADD, MAgi )
call ModifyHeroStat( bj_HEROSTAT_INT, target, bj_MODIFYMETHOD_ADD, MInt )
call ModifyHeroStat( bj_HEROSTAT_STR, caster, bj_MODIFYMETHOD_SUB, MStr )
call ModifyHeroStat( bj_HEROSTAT_AGI, caster, bj_MODIFYMETHOD_SUB, MAgi )
call ModifyHeroStat( bj_HEROSTAT_INT, caster, bj_MODIFYMETHOD_SUB, MInt )
endfunction
Name | Type | is_array | initial_value |
BooleanHeroPicked | boolean | Yes | |
BooleanLastSwitchDay | boolean | No | |
BooleanTime | boolean | No | true |
BooleanTMP | boolean | No | |
HeroPicked | unit | No | |
IntCount | integer | No | |
IntCurrentlyProducing | integer | Yes | |
IntCurrentlyProducingElemental | integer | Yes | |
IntDeaths | integer | Yes | |
IntFrags | integer | Yes | |
IntGoreLevel | integer | No | |
IntHeroesLeft | integer | No | |
IntHeroNumber | integer | No | |
IntImprisonmentLevel | integer | No | |
IntJordansMatrixLevel | integer | No | |
IntJustAnArray | integer | Yes | |
IntMarkVictimLevel | integer | No | |
IntMaxUnits | integer | Yes | |
IntMod | integer | No | |
IntRandomHeroNumber | integer | No | |
IntSlumberLevel | integer | No | |
IntStarCurseLevel | integer | No | |
IntStarCurseLoop | integer | No | |
IntStormWarlockSkillLevel | integer | Yes | |
IntTMP | integer | No | |
IntTMP2 | integer | No | |
IntVoidLevel | integer | No | |
IntWineLustLevel | integer | No | |
LocCity | rect | Yes | |
LocElementalGuard | rect | Yes | |
MbdFrags | multiboard | No | |
PGPing | force | No | |
PGPlayers | force | No | |
PlrBuildingLoser | player | No | |
PlrBuildingTaker | player | No | |
PlrLordOfDeath | player | No | |
PlrLordOfFrost | player | No | |
PlrMathematician | player | No | |
PlrNeutral | player | No | |
PlrSorceress | player | No | |
PlrTMP | player | No | |
PlrWildDionyde | player | No | |
PointStarCurse | location | No | |
PointTMP | location | No | |
PointTMP2 | location | No | |
RealAvalancheDMG | real | No | |
RealMortalFateStunDistance | real | No | |
RealTMP | real | No | |
StrCityName | string | Yes | |
StrPlayerName | string | Yes | |
StrShrineDescription | string | Yes | |
TrgMarkVictimDamage | trigger | No | |
TrgVoidInvisibilityE3 | trigger | No | |
TrgVoidInvisibilityE4 | trigger | No | |
TrgVoidInvisibilityM3 | trigger | No | |
TrgVoidInvisibilityM4 | trigger | No | |
UGBlinkToVictim | group | No | |
UGHoliday | group | No | |
UGImprisonment | group | No | |
UGJordansMatrix | group | No | |
UGSlumber | group | No | |
UGTeleport | group | No | |
UGTMP | group | No | |
UGWarriors | group | Yes | |
UGWineLust | group | No | |
UGWineLustSelf | group | No | |
UnitAssassin | unit | No | |
UnitBarracks | unit | Yes | |
UnitBlinkVictim | unit | No | |
UnitCurrentAltar | unit | Yes | |
UnitDivineChannel | unit | No | |
UnitElemental | unit | Yes | |
UnitGrizzlyBear | unit | No | |
UnitLifeSuckTarget | unit | No | |
UnitLordOfDeath | unit | No | |
UnitNaturalDisasterEarthquake | unit | No | |
UnitNaturalDisasterVolcano | unit | No | |
UnitNecromancer | unit | No | |
UnitPhantasm | unit | No | |
UnitRallyAsUnit | unit | Yes | |
UnitRobix | unit | No | |
UnitShrine | unit | Yes | |
UnitSlamshockTaker | unit | No | |
UnitSorceress | unit | No | |
UnitStarCursed | unit | No | |
UnitStormWarlock | unit | No | |
UnitSunLord | unit | No | |
UnitTMP | unit | No | |
UnitTownHall | unit | Yes | |
UnitTraveller | unit | No | |
UnitVictim | unit | No | |
UTElemental | unitcode | Yes | |
UTGoblinSappers | unitcode | Yes | |
UTHero | unitcode | Yes | |
UTProduction | unitcode | Yes | |
UTRandomHero | unitcode | No |