function SpawnUnit takes integer unitType, player forPlayer, location tLoc, location eLoc returns nothing
local integer unitPNum = GetConvertedPlayerId(forPlayer)
local integer playerPNum = GetConvertedPlayerId(udg_CPUToPlayer[unitPNum])
local integer tInd = udg_SQueIndex[playerPNum]
local integer i =1
set udg_SQueType[tInd] = unitType
set udg_SQueUnitPNum[tInd] = unitPNum
set udg_SQueLocX[tInd] = GetLocationX(tLoc)
set udg_SQueLocY[tInd] = GetLocationY(tLoc)
set udg_SQueEndLoc[tInd] = eLoc
set udg_SQueCheesePow[tInd] = 1
set udg_SQueMoveSpeed[tInd] = 1
set udg_SQueIsKage[tInd] = false
loop
exitwhen i>4
if (udg_HPCheeseBoost[i]>1 and i!=playerPNum) then
set udg_SQueCheesePow[tInd] = udg_CheesePower[i]
endif
if (udg_GatoradeBoost[i]>1 and i!=playerPNum) then
set udg_SQueMoveSpeed[tInd] = 1.20
endif
if (udg_KageBoost[i]>1 and i!=playerPNum) then
set udg_SQueType[tInd+1] = udg_SQueType[tInd]
set udg_SQueUnitPNum[tInd+1] = udg_SQueUnitPNum[tInd]
set udg_SQueLocX[tInd+1] = udg_SQueLocX[tInd]
set udg_SQueLocY[tInd+1] = udg_SQueLocY[tInd]
set udg_SQueEndLoc[tInd+1] = udg_SQueEndLoc[tInd]
set udg_SQueCheesePow[tInd+1] = udg_SQueCheesePow[tInd]
set udg_SQueMoveSpeed[tInd+1] = udg_SQueMoveSpeed[tInd]
set udg_SQueIsKage[tInd+1] = true
set udg_SQueIndex[playerPNum] = udg_SQueIndex[playerPNum] + 1
endif
set i=i+1
endloop
set udg_SQueIndex[playerPNum] = udg_SQueIndex[playerPNum] + 1
endfunction
function IsStructure takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == true )
endfunction
function SimBuy takes integer unitType returns nothing
local integer pNum = 4
local integer sendUnitLoop = 1
local integer soldUnitType = unitType
loop
exitwhen sendUnitLoop > 4
if ( pNum== sendUnitLoop) then
call LeaderboardSetPlayerItemValueBJ( ConvertedPlayer(sendUnitLoop), udg_StatsBoard, udg_PlayerIncome[sendUnitLoop] )
else
if ( soldUnitType == 'h01S' ) then
call SpawnUnit('h01Q',udg_PlayerToCPU[sendUnitLoop],udg_WaterStartLoc[sendUnitLoop],udg_WaterEndLoc2[sendUnitLoop])
call SpawnUnit('h01Q',udg_PlayerToCPU[sendUnitLoop],udg_WaterStartLoc[sendUnitLoop],udg_WaterEndLoc[sendUnitLoop])
call SpawnUnit('h01R',udg_PlayerToCPU[sendUnitLoop],PolarProjectionBJ(udg_StartLoc[sendUnitLoop], 75.00, AngleBetweenPoints(udg_StartLoc[sendUnitLoop], udg_EndLoc[sendUnitLoop])),udg_EndLoc[sendUnitLoop])
call SpawnUnit('h01R',udg_PlayerToCPU[sendUnitLoop],udg_StartLoc[sendUnitLoop],udg_EndLoc[sendUnitLoop])
call SpawnUnit(soldUnitType,udg_PlayerToCPU[sendUnitLoop],udg_StartLoc[sendUnitLoop],udg_EndLoc[sendUnitLoop])
endif
if (soldUnitType == 'h030') then
call SpawnUnit('h030',udg_PlayerToCPU[sendUnitLoop],udg_WaterStartLoc[sendUnitLoop],udg_WaterForwarder[sendUnitLoop])
endif
if (soldUnitType == 'h01C' or soldUnitType == 'h00Z' or soldUnitType == 'h02Z') then
call SpawnUnit(soldUnitType,udg_PlayerToCPU[sendUnitLoop],udg_WaterStartLoc[sendUnitLoop],udg_WaterEndLoc[sendUnitLoop])
endif
if (soldUnitType == 'h00Z') then
call SpawnUnit(soldUnitType,udg_PlayerToCPU[sendUnitLoop],udg_WaterStartLoc[sendUnitLoop],udg_WaterEndLoc2[sendUnitLoop])
endif
if (soldUnitType != 'h00Z' and soldUnitType != 'h01C' and soldUnitType != 'h030' and soldUnitType != 'h02Z') then
call SpawnUnit(soldUnitType,udg_PlayerToCPU[sendUnitLoop],udg_StartLoc[sendUnitLoop],udg_EndLoc[sendUnitLoop])
endif
endif
set sendUnitLoop = sendUnitLoop + 1
endloop
endfunction
Name | Type | is_array | initial_value |
ArborCount | integer | Yes | |
BankCount | integer | Yes | |
CheesePower | real | Yes | 1.25 |
CPUToPlayer | player | Yes | |
CurrentWave | integer | No | 0 |
DelayTime | real | No | 0.80 |
DWS_Stacks | integer | Yes | |
EndGameScale | real | No | 1.00 |
EndLoc | location | Yes | |
GatoradeBoost | integer | Yes | |
HPCheeseBoost | integer | Yes | |
HYB | integer | Yes | |
IsDeafeated | boolean | Yes | |
KageBoost | integer | Yes | |
Lives | integer | Yes | 40 |
LivesPower | integer | Yes | 12 |
lumberjackIncLoop | integer | No | |
LumberShards | integer | Yes | |
pepOn | boolean | No | |
PlayerIncome | integer | Yes | 100 |
PlayerToCPU | player | Yes | |
PoisonDamageSource | unit | Yes | |
PoisonDuration | integer | No | 7 |
PoisonStacks | hashtable | No | |
PoisonUG | group | No | |
sellGroup | group | Yes | |
SendUnitLoop | integer | No | |
SpawnAmount | integer | No | 16 |
SpawnAmountLoop | integer | No | |
SpawnSpacing | real | No | 0.24 |
SpawnWavesLoop | integer | No | |
SQueCheesePow | real | Yes | |
SQueEndLoc | location | Yes | |
SQueIndex | integer | Yes | |
SQueIsKage | boolean | Yes | |
SQueLocX | real | Yes | |
SQueLocY | real | Yes | |
SQueMoveSpeed | real | Yes | |
SQueType | integer | Yes | |
SQueUnitPNum | integer | Yes | |
StartLoc | location | Yes | |
StatsBoard | leaderboard | No | |
StormXLoc | hashtable | No | |
StormYLoc | hashtable | No | |
SweepLoop | integer | No | |
SweepPos | hashtable | No | |
t_IsSelected | boolean | No | |
tCost | integer | No | |
TempPlayerIndex | integer | No | |
TempSpawnAmount | integer | No | |
TempSweepX | real | No | |
TempSweepY | real | No | |
tIncome | integer | No | |
tStacks | integer | No | |
tTicksLeft | integer | No | |
WaterEndLoc | location | Yes | |
WaterEndLoc2 | location | Yes | |
WaterForwarder | location | Yes | |
WaterStartLoc | location | Yes | |
WaveDescription | string | Yes | |
WaveTimer | timer | No | |
WaveTimerWindow | timerdialog | No | |
WaveUnits | unitcode | Yes | |
WinCount | integer | No | |
WinLoop | integer | No |
function Trig_Clean_Corpse_Actions takes nothing returns nothing
local unit tUnit = GetTriggerUnit()
call TriggerSleepAction( 1.00 )
call RemoveUnit( tUnit )
endfunction
//===========================================================================
function InitTrig_Clean_Corpse takes nothing returns nothing
set gg_trg_Clean_Corpse = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Clean_Corpse, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Clean_Corpse, function Trig_Clean_Corpse_Actions )
endfunction
function SameOwnerAsTarget takes nothing returns boolean
return ( GetOwningPlayer(GetTriggerUnit()) == GetOwningPlayer(GetFilterUnit()) )
endfunction
function Trig_Global_Damage_Tracker_Actions takes nothing returns nothing
local unit tUnit = GetTriggerUnit()
local unit dsUnit = GetEventDamageSource()
local location tLoc = GetUnitLoc(tUnit)
local location dsLoc = GetUnitLoc(dsUnit)
local integer tType = GetUnitTypeId(tUnit)
local integer dsType = GetUnitTypeId(dsUnit)
local integer dsPnum = GetConvertedPlayerId(GetOwningPlayer(dsUnit))
local integer i = 0
if (dsType=='h03B' or dsType=='h03O') then
call BlzSetEventDamage(GetEventDamage() + (.025*Pow(GetPlayerState(GetOwningPlayer(dsUnit), PLAYER_STATE_RESOURCE_GOLD),.6)))
endif
if (dsType=='h03G') then
if ( UnitHasBuffBJ(tUnit, 'Bfrz') or UnitHasBuffBJ(tUnit, 'BEsh' )) then
if ( ( GetRandomInt(1, 10) == 2 ) ) then
call BlzSetEventDamage(GetEventDamage()*2)
call CreateNUnitsAtLoc( 1, 'h03H', Player(PLAYER_NEUTRAL_PASSIVE), GetUnitLoc(tUnit), bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
endif
endif
endif
if (dsType=='h03I') then
if ( UnitHasBuffBJ(tUnit, 'Bfrz') or UnitHasBuffBJ(tUnit, 'BEsh' )) then
if ( ( GetRandomInt(1, 100) <= 15 ) ) then
call BlzSetEventDamage(GetEventDamage()*2.75)
call CreateNUnitsAtLoc( 1, 'h03H', Player(PLAYER_NEUTRAL_PASSIVE), GetUnitLoc(tUnit), bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
endif
endif
endif
if (dsType=='h03J') then
if ( UnitHasBuffBJ(tUnit, 'Bfrz') or UnitHasBuffBJ(tUnit, 'BEsh' )) then
if ( ( GetRandomInt(1, 100) <= 25 ) ) then
call BlzSetEventDamage(GetEventDamage()*3.75)
call CreateNUnitsAtLoc( 1, 'h03H', Player(PLAYER_NEUTRAL_PASSIVE), GetUnitLoc(tUnit), bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
endif
endif
endif
if (dsType=='h03R') then
if ( UnitHasBuffBJ(tUnit, 'Bfrz') or UnitHasBuffBJ(tUnit, 'BEsh' )) then
if ( ( GetRandomInt(1, 100) <= 25 ) ) then
call BlzSetEventDamage(GetEventDamage()*5)
call CreateNUnitsAtLoc( 1, 'h03H', Player(PLAYER_NEUTRAL_PASSIVE), GetUnitLoc(tUnit), bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
endif
endif
endif
if (dsType=='h03K') then
if ( ( GetRandomInt(1, 100) <= 3 ) ) then
call CreateNUnitsAtLoc( 1, 'h02G', GetOwningPlayer(dsUnit), GetUnitLoc(tUnit), bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A00L', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "shadowstrike", tUnit )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
endif
endif
if (dsType=='h03L') then
if ( ( GetRandomInt(1, 100) <= 5 ) ) then
call CreateNUnitsAtLoc( 1, 'h02G', GetOwningPlayer(dsUnit), GetUnitLoc(tUnit), bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A00N', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "shadowstrike", tUnit )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
endif
endif
if (dsType=='h03X' or dsType=='h03Y' or dsType=='h03T' or dsType=='h03U' or dsType=='h03V' or dsType=='h03W' or dsType=='h000') then
call SaveIntegerBJ( ( LoadIntegerBJ(0, GetHandleIdBJ(tUnit), udg_PoisonStacks) + 1 ), 0, GetHandleIdBJ(tUnit), udg_PoisonStacks )
call SaveIntegerBJ( udg_PoisonDuration, 1, GetHandleIdBJ(tUnit), udg_PoisonStacks )
if (IsUnitInGroup(tUnit,udg_PoisonUG)==false) then
call GroupAddUnitSimple( tUnit, udg_PoisonUG )
endif
endif
if (dsType=='h041' or dsType=='h040') then
call SaveIntegerBJ( ( LoadIntegerBJ(0, GetHandleIdBJ(tUnit), udg_PoisonStacks) + 4 ), 0, GetHandleIdBJ(tUnit), udg_PoisonStacks )
call SaveIntegerBJ( udg_PoisonDuration, 1, GetHandleIdBJ(tUnit), udg_PoisonStacks )
if (IsUnitInGroup(tUnit,udg_PoisonUG)==false) then
call GroupAddUnitSimple( tUnit, udg_PoisonUG )
endif
endif
endfunction
//===========================================================================
function InitTrig_Global_Damage_Tracker takes nothing returns nothing
set gg_trg_Global_Damage_Tracker = CreateTrigger( )
call TriggerAddAction( gg_trg_Global_Damage_Tracker, function Trig_Global_Damage_Tracker_Actions )
endfunction
function CheckPosSweep takes nothing returns nothing
local real hashX = LoadRealBJ(0, GetHandleIdBJ(GetEnumUnit()), udg_SweepPos)
local real hashY = LoadRealBJ(1, GetHandleIdBJ(GetEnumUnit()), udg_SweepPos)
local integer flagCount = LoadIntegerBJ(2, GetHandleIdBJ(GetEnumUnit()), udg_SweepPos)
local real curX = GetUnitX(GetEnumUnit())
local real curY = GetUnitY(GetEnumUnit())
call SaveRealBJ( curX, 0, GetHandleIdBJ(GetEnumUnit()), udg_SweepPos )
call SaveRealBJ( curY, 1, GetHandleIdBJ(GetEnumUnit()), udg_SweepPos )
if ( hashX==curX and hashY==curY and flagCount<=0) then
call IssuePointOrderLocBJ( GetEnumUnit(), "move", udg_EndLoc[GetConvertedPlayerId(udg_CPUToPlayer[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])] )
call SaveIntegerBJ( 1, 2, GetHandleIdBJ(GetEnumUnit()), udg_SweepPos )
endif
if ( hashX==curX and hashY==curY and flagCount==1) then
call DisplayTimedTextToForce( GetPlayersAll(), 30, "Anti-Block Triggered (" + GetPlayerName(udg_CPUToPlayer[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))]) + ") - Sweeper")
call RemoveUnit( GroupPickRandomUnit(GetUnitsInRangeOfLocMatching(100.00, GetUnitLoc(GetEnumUnit()), Condition(function IsStructure))))
call RemoveUnit( GroupPickRandomUnit(GetUnitsInRangeOfLocMatching(200.00, GetUnitLoc(GetEnumUnit()), Condition(function IsStructure))))
call RemoveUnit (GetEnumUnit())
endif
endfunction
function Trig_SweepCheck_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsOfTypeIdAll('h01V'), function CheckPosSweep)
endfunction
//===========================================================================
function InitTrig_SweepCheck takes nothing returns nothing
set gg_trg_SweepCheck = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_SweepCheck , 3.1 )
call TriggerAddAction( gg_trg_SweepCheck, function Trig_SweepCheck_Actions)
endfunction
function IsMazeUnit takes nothing returns boolean
return ( GetOwningPlayer(GetFilterUnit()) == Player(20) or GetOwningPlayer(GetFilterUnit()) == Player(21) or GetOwningPlayer(GetFilterUnit()) == Player(22) or GetOwningPlayer(GetFilterUnit()) == Player(23) ) and (GetUnitRace(GetFilterUnit()) == RACE_HUMAN or GetUnitRace(GetFilterUnit()) == RACE_NIGHTELF) and (GetUnitTypeId(GetFilterUnit())!='h01V') and (IsUnitAliveBJ(GetFilterUnit()))
endfunction
function CheckPosUnit takes nothing returns nothing
local real hashX = LoadRealBJ(0, GetHandleIdBJ(GetEnumUnit()), udg_SweepPos)
local real hashY = LoadRealBJ(1, GetHandleIdBJ(GetEnumUnit()), udg_SweepPos)
local integer flagCount = LoadIntegerBJ(2, GetHandleIdBJ(GetEnumUnit()), udg_SweepPos)
local real curX = GetUnitX(GetEnumUnit())
local real curY = GetUnitY(GetEnumUnit())
call SaveRealBJ( curX, 0, GetHandleIdBJ(GetEnumUnit()), udg_SweepPos )
call SaveRealBJ( curY, 1, GetHandleIdBJ(GetEnumUnit()), udg_SweepPos )
if ( hashX==curX and hashY==curY and flagCount<=0) then
call IssuePointOrderLocBJ( GetEnumUnit(), "move", udg_EndLoc[GetConvertedPlayerId(udg_CPUToPlayer[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])] )
call SaveIntegerBJ( 1, 2, GetHandleIdBJ(GetEnumUnit()), udg_SweepPos )
endif
if ( hashX==curX and hashY==curY and flagCount==1) then
call DisplayTimedTextToForce( GetPlayersAll(), 30, "Anti-Block Triggered (" + GetPlayerName(udg_CPUToPlayer[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))]) + " - " + GetUnitName(GetEnumUnit()))
call RemoveUnit( GroupPickRandomUnit(GetUnitsInRangeOfLocMatching(200.00, GetUnitLoc(GetEnumUnit()), Condition(function IsStructure))))
endif
if (hashX!=curX or hashY!=curY) then
call SaveIntegerBJ( 0, 2, GetHandleIdBJ(GetEnumUnit()), udg_SweepPos )
endif
endfunction
function BlockCheckActions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function IsMazeUnit)),function CheckPosUnit)
endfunction
//===========================================================================
function InitTrig_BlockCheck takes nothing returns nothing
set gg_trg_BlockCheck = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_BlockCheck ,3 )
call TriggerAddAction( gg_trg_BlockCheck, function BlockCheckActions)
endfunction
function Trig_Send_unit_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetTriggerUnit()) == 'h007' or GetUnitTypeId(GetTriggerUnit()) == 'h01M' ) then
return true
endif
return false
endfunction
function Trig_Send_unit_Actions takes nothing returns nothing
local integer pNum = GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))
local integer sendUnitLoop = 1
local integer soldUnitType = GetUnitTypeId(GetSoldUnit())
set udg_PlayerIncome[pNum] = ( udg_PlayerIncome[pNum] + GetUnitLevel(GetSoldUnit()) )
loop
exitwhen sendUnitLoop > 4
if ( pNum== sendUnitLoop) then
call LeaderboardSetPlayerItemValueBJ( ConvertedPlayer(sendUnitLoop), udg_StatsBoard, udg_PlayerIncome[sendUnitLoop] )
else
if ( soldUnitType == 'h01S' ) then
call SpawnUnit('h01Q',udg_PlayerToCPU[sendUnitLoop],udg_WaterStartLoc[sendUnitLoop],udg_WaterEndLoc2[sendUnitLoop])
call SpawnUnit('h01Q',udg_PlayerToCPU[sendUnitLoop],udg_WaterStartLoc[sendUnitLoop],udg_WaterEndLoc[sendUnitLoop])
call SpawnUnit('h01R',udg_PlayerToCPU[sendUnitLoop],PolarProjectionBJ(udg_StartLoc[sendUnitLoop], 75.00, AngleBetweenPoints(udg_StartLoc[sendUnitLoop], udg_EndLoc[sendUnitLoop])),udg_EndLoc[sendUnitLoop])
call SpawnUnit('h01R',udg_PlayerToCPU[sendUnitLoop],udg_StartLoc[sendUnitLoop],udg_EndLoc[sendUnitLoop])
call SpawnUnit(soldUnitType,udg_PlayerToCPU[sendUnitLoop],udg_StartLoc[sendUnitLoop],udg_EndLoc[sendUnitLoop])
endif
if (soldUnitType == 'h030') then
call SpawnUnit('h030',udg_PlayerToCPU[sendUnitLoop],udg_WaterStartLoc[sendUnitLoop],udg_WaterForwarder[sendUnitLoop])
endif
if (soldUnitType == 'h01C' or soldUnitType == 'h00Z' or soldUnitType == 'h02Z') then
call SpawnUnit(soldUnitType,udg_PlayerToCPU[sendUnitLoop],udg_WaterStartLoc[sendUnitLoop],udg_WaterEndLoc[sendUnitLoop])
endif
if (soldUnitType == 'h00Z') then
call SpawnUnit(soldUnitType,udg_PlayerToCPU[sendUnitLoop],udg_WaterStartLoc[sendUnitLoop],udg_WaterEndLoc2[sendUnitLoop])
endif
if (soldUnitType != 'h00Z' and soldUnitType != 'h01C' and soldUnitType != 'h030' and soldUnitType != 'h02Z') then
call SpawnUnit(soldUnitType,udg_PlayerToCPU[sendUnitLoop],udg_StartLoc[sendUnitLoop],udg_EndLoc[sendUnitLoop])
endif
endif
set sendUnitLoop = sendUnitLoop + 1
endloop
call RemoveUnit( GetSoldUnit() )
endfunction
//===========================================================================
function InitTrig_Send_unit takes nothing returns nothing
set gg_trg_Send_unit = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Send_unit, EVENT_PLAYER_UNIT_SELL )
call TriggerAddCondition( gg_trg_Send_unit, Condition( function Trig_Send_unit_Conditions ) )
call TriggerAddAction( gg_trg_Send_unit, function Trig_Send_unit_Actions )
endfunction
function Trig_Unit_Spawn_Delay_Actions takes nothing returns nothing
local integer i = 1
local integer tInd = 0
local unit tUnit = null
loop
exitwhen i> 4
set tInd = udg_SQueIndex[i] - 1
if (udg_SQueUnitPNum[tInd]!=0) then
set tUnit = CreateUnit(ConvertedPlayer(udg_SQueUnitPNum[tInd]),udg_SQueType[tInd], udg_SQueLocX[tInd] , udg_SQueLocY[tInd] ,bj_UNIT_FACING)
set udg_SQueUnitPNum[tInd] = 0
call IssuePointOrderLocBJ( tUnit, "move", udg_SQueEndLoc[tInd] )
call BlzSetUnitBaseDamage( tUnit, 9999, 1 )
call BlzSetUnitMaxHP( tUnit , R2I(( GetUnitStateSwap(UNIT_STATE_MAX_LIFE, tUnit ) * udg_SQueCheesePow[tInd] )) )
call SetUnitMoveSpeed( tUnit, ( GetUnitMoveSpeed(tUnit) * udg_SQueMoveSpeed[tInd] ) )
if (udg_SQueIsKage[tInd]) then
call BlzSetUnitDiceSides( tUnit, BlzGetUnitDiceSides(tUnit,1)*2, 1 )
endif
set udg_SQueIndex[i] = udg_SQueIndex[i] - 1
call BlzSetUnitMaxHP( tUnit , R2I(( GetUnitStateSwap(UNIT_STATE_MAX_LIFE, tUnit ) * udg_EndGameScale )) )
call SetUnitLifePercentBJ( tUnit , 100 )
call SaveIntegerBJ( 0, 0, GetHandleIdBJ(tUnit), udg_PoisonStacks )
call TriggerRegisterUnitEvent( gg_trg_Global_Damage_Tracker, tUnit, EVENT_UNIT_DAMAGED )
endif
set i= i+ 1
endloop
endfunction
//===========================================================================
function InitTrig_Unit_Spawn_Delay takes nothing returns nothing
set gg_trg_Unit_Spawn_Delay = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Unit_Spawn_Delay, udg_SpawnSpacing )
call TriggerAddAction( gg_trg_Unit_Spawn_Delay, function Trig_Unit_Spawn_Delay_Actions )
endfunction
function Trig_Grim_Reducation_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetSoldUnit()) == 'u003' or GetUnitTypeId(GetSoldUnit()) == 'u00D' ) then
return true
endif
return false
endfunction
function Trig_Grim_Reducation_Actions takes nothing returns nothing
local integer PNum = GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))
local integer i =1
loop
exitwhen i>4
if (i!=PNum) then
set udg_LivesPower[i] = ( udg_LivesPower[i] - 4 )
endif
set i=i+1
endloop
call RemoveUnit( GetSoldUnit() )
endfunction
//===========================================================================
function InitTrig_Grim_Reducation takes nothing returns nothing
set gg_trg_Grim_Reducation = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Grim_Reducation, Player(0), EVENT_PLAYER_UNIT_SELL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Grim_Reducation, Player(1), EVENT_PLAYER_UNIT_SELL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Grim_Reducation, Player(2), EVENT_PLAYER_UNIT_SELL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Grim_Reducation, Player(3), EVENT_PLAYER_UNIT_SELL )
call TriggerAddCondition( gg_trg_Grim_Reducation, Condition( function Trig_Grim_Reducation_Conditions ) )
call TriggerAddAction( gg_trg_Grim_Reducation, function Trig_Grim_Reducation_Actions )
endfunction
function WolfCond takes nothing returns boolean
if (GetUnitTypeId(GetSoldUnit()) == 'u002' or GetUnitTypeId(GetSoldUnit()) == 'u00D' ) then
return true
endif
return false
endfunction
function WolfActions takes nothing returns nothing
local integer PNum = GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))
local integer i =1
loop
exitwhen i>4
if (i!=PNum) then
set udg_PlayerIncome[i] = R2I(I2R(udg_PlayerIncome[i]) * .85)
call LeaderboardSetPlayerItemValueBJ( ConvertedPlayer(i), udg_StatsBoard, udg_PlayerIncome[i] )
endif
set i=i+1
endloop
call RemoveUnit( GetSoldUnit() )
endfunction
//===========================================================================
function InitTrig_Wolf takes nothing returns nothing
set gg_trg_Wolf = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Wolf, Player(0), EVENT_PLAYER_UNIT_SELL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Wolf, Player(1), EVENT_PLAYER_UNIT_SELL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Wolf, Player(2), EVENT_PLAYER_UNIT_SELL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Wolf, Player(3), EVENT_PLAYER_UNIT_SELL )
call TriggerAddCondition( gg_trg_Wolf, Condition( function WolfCond) )
call TriggerAddAction( gg_trg_Wolf, function WolfActions)
endfunction