//TESH.scrollpos=35
//TESH.alwaysfold=0
function SpawnItems takes location loc, integer odds returns nothing
local integer dice
local integer n = 0
local boolean stop = false
local integer itemid
local integer rand
loop
exitwhen n>=odds or stop==true
set dice = GetRandomInt(1, 100)
if dice<4 then
set rand = GetRandomInt(1, 3)
if rand==1 then
set itemid = 'I00N'
elseif rand==2 then
set itemid = 'I00M'
elseif rand==3 then
set itemid = 'I00U'
endif
set stop = true
endif
if dice>=4 and dice<6 then
set rand = GetRandomInt(1, 3)
if rand==1 then
set itemid = 'I00P'
elseif rand==2 then
set itemid = 'I00Q'
elseif rand==3 then
set itemid = 'I00L'
endif
set stop = true
endif
if dice==6 then
set rand = GetRandomInt(1, 3)
if rand==1 then
set itemid = 'I00O'
elseif rand==2 then
set itemid = 'I00K'
elseif rand==3 then
set itemid = 'I00S'
endif
set stop = true
endif
if stop==true then
call CreateItemLoc(itemid, loc)
endif
set n = n+1
endloop
call RemoveLocation(loc)
endfunction
function KickBounceDamage takes unit u, unit c, integer speed returns nothing
local location ul = GetUnitLoc(u)
call UnitDamageTargetBJ(c, udg_Kicker[GetPlayerId(GetOwningPlayer(u))], 3*speed*(1+GetUnitAbilityLevel(c, 'A00L')/10), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL)
call DestroyEffect(AddSpecialEffectLoc("Objects\\Spawnmodels\\Human\\HumanLargeDeathExplode\\HumanLargeDeathExplode.mdl", ul))
call RemoveLocation(ul)
set ul = null
call SetUnitLifePercentBJ(u, GetUnitStatePercent(udg_Kicker[GetPlayerId(GetOwningPlayer(u))], UNIT_STATE_LIFE, UNIT_STATE_MAX_LIFE))
endfunction
Name | Type | is_array | initial_value |
BlockGroup | group | No | |
BoomerangTarget | location | Yes | |
BoomG | group | Yes | |
BoomReturn | boolean | Yes | |
BoomSpecial | effect | Yes | |
BossFight | boolean | No | false |
BowlGroup | group | No | |
BowlGroup2 | group | No | |
Btn10 | button | No | |
Btn15 | button | No | |
Btn20 | button | No | |
Btn25 | button | No | |
Btn30 | button | No | |
Btn5 | button | No | |
CamAoA | real | Yes | 300.00 |
CamDist | real | Yes | 2100.00 |
CamRotation | real | Yes | 90.00 |
CamShopPt | location | No | |
Caveman | unit | Yes | |
CentBounce | boolean | No | |
Cinematic | boolean | No | false |
CmdShopPt | location | No | |
Corner | location | No | |
Crit | integer | Yes | |
DialogObj | dialog | No | |
Firepower | integer | Yes | |
FlingingBottom | group | No | |
FlingingLeft | group | No | |
FlingingRight | group | No | |
FlingingTop | group | No | |
FrenzyGroup | group | No | |
GamePaused | boolean | No | false |
Glower | unit | Yes | |
ItemCorner1 | location | No | |
ItemCorner2 | location | No | |
JanitorBusy | boolean | No | false |
JanitorFirst | boolean | No | false |
Kicked | group | No | |
Kicked2 | group | No | |
Kicker | unit | Yes | |
Kill_Quota | integer | No | 15 |
Kills | integer | Yes | 0 |
LeechRelease | boolean | No | |
MapCenter | location | No | |
MopLightning | lightning | Yes | |
Multikill_Count | integer | Yes | 0 |
Multikill_Timer | timer | Yes | |
OnePoint | boolean | No | |
RandomInt | integer | No | |
RoundNumber | integer | No | 1 |
Sharpness | integer | Yes | 0 |
SlingLightning | lightning | Yes | |
SpreeCount | integer | Yes | 0 |
Stamina | integer | Yes | |
StartGate | integer | Yes | |
StartGateRegion | rect | Yes | |
StartGateTeamRegion | rect | Yes | |
Switchoff | boolean | No | false |
TeamKills | integer | Yes | |
TeamPoints | integer | Yes | 0 |
TeamVictory | integer | No | |
tempAng | real | No | |
tempGroup | group | No | |
tempGroup2 | group | No | |
tempInt | integer | No | |
tempPlayer | integer | No | |
tempPoint | location | No | |
tempPoint2 | location | No | |
tempPoint3 | location | No | |
tempPoint4 | location | No | |
tempPoint5 | location | No | |
tempPoint6 | location | No | |
tempUnit | unit | No | |
Trap | unit | Yes | |
VictoryType | unitcode | No | |
WinningColor | string | No |
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_CreateCavemen_Actions takes nothing returns nothing
local integer red
local integer blue
local integer green
local integer yellow
set red = GetRandomInt(1, 4)
set udg_StartGate[1] = red
set blue = GetRandomInt(1, 4)
loop
exitwhen blue!=red
set blue = GetRandomInt(1, 4)
endloop
set udg_StartGate[2] = blue
set green = GetRandomInt(1, 4)
loop
exitwhen green!=red and green!=blue
set green = GetRandomInt(1, 4)
endloop
set udg_StartGate[3] = green
set yellow = GetRandomInt(1, 4)
loop
exitwhen yellow!=red and yellow!=green and yellow!=blue
set yellow = GetRandomInt(1, 4)
endloop
set udg_StartGate[4] = yellow
endfunction
function InitTrig_CreateCavemen takes nothing returns nothing
set gg_trg_CreateCavemen = CreateTrigger( )
call TriggerAddAction( gg_trg_CreateCavemen, function Trig_CreateCavemen_Actions )
endfunction
//TESH.scrollpos=23
//TESH.alwaysfold=0
function DropCond takes nothing returns boolean
return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO)
endfunction
function Trig_DropItems_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local location ul = GetUnitLoc(u)
local integer n = 1
local item i = GetItemOfTypeFromUnitBJ(u, 'I004')
local item i2 = GetItemOfTypeFromUnitBJ(u, 'I006')
loop
exitwhen UnitHasItemOfTypeBJ(u, 'I004')==false
call CreateItemLoc('I000', ul)
call SetItemCharges(i, GetItemCharges(i)-1)
if GetItemCharges(i)<=0 then
call RemoveItem(i)
call UnitRemoveAbility(u, 'A00A')
endif
endloop
loop
exitwhen UnitHasItemOfTypeBJ(u, 'I006')==false
call CreateItemLoc('I00T', ul)
call SetItemCharges(i2, GetItemCharges(i2)-1)
if GetItemCharges(i2)<=0 then
call RemoveItem(i2)
call UnitRemoveAbility(u, 'A00D')
endif
endloop
loop
exitwhen GetPlayerState(GetOwningPlayer(u), PLAYER_STATE_RESOURCE_GOLD)<=0
call CreateItemLoc('I001', ul)
call AdjustPlayerStateBJ(-1, GetOwningPlayer(u), PLAYER_STATE_RESOURCE_GOLD)
endloop
set u = null
loop
exitwhen n>6
call UnitRemoveItemFromSlotSwapped(n, u)
set n = n+1
endloop
endfunction
function InitTrig_DropItems takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(t, Condition(function DropCond))
call TriggerAddAction(t, function Trig_DropItems_Actions )
set t = null
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function MinibotsCond takes nothing returns boolean
return udg_GamePaused==false and udg_BossFight==false
endfunction
function Trig_Spawn_Minibots_Actions takes nothing returns nothing
local location l = PolarProjectionBJ(udg_MapCenter, 350, GetRandomDirectionDeg())
local unit shooter = CreateUnitAtLoc(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'h00C', udg_MapCenter, 0)
local unit target = CreateUnitAtLoc(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'h00D', l, 0)
call UnitApplyTimedLife(shooter, 'BTLF', 1.45)
call IssueTargetOrderBJ(shooter, "attack", target)
call RemoveLocation(l)
set l = null
set shooter = null
set target = null
endfunction
function InitTrig_Spawn_Minibots takes nothing returns nothing
set gg_trg_Spawn_Minibots = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Spawn_Minibots, 2.5 )
call TriggerAddCondition(gg_trg_Spawn_Minibots, Condition(function MinibotsCond))
call TriggerAddAction( gg_trg_Spawn_Minibots, function Trig_Spawn_Minibots_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function InfernalCond takes nothing returns boolean
return udg_GamePaused==false and udg_BossFight==false
endfunction
function InfernalAct takes nothing returns nothing
local location l = PolarProjectionBJ(udg_MapCenter, 550, GetRandomDirectionDeg())
local unit shooter = CreateUnitAtLoc(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'h00C', udg_MapCenter, 0)
call UnitApplyTimedLife(shooter, 'BTLF', 3)
call IssuePointOrderLocBJ(shooter, "dreadlordinferno", l)
call RemoveLocation(l)
set l = null
set shooter = null
endfunction
function InitTrig_Spawn_Infernals takes nothing returns nothing
set gg_trg_Spawn_Infernals = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Spawn_Infernals, 60 )
call TriggerAddCondition(gg_trg_Spawn_Infernals, Condition(function InfernalCond))
call TriggerAddAction( gg_trg_Spawn_Infernals, function InfernalAct)
endfunction
//TESH.scrollpos=19
//TESH.alwaysfold=0
function LeechSpawnCond takes nothing returns boolean
return udg_GamePaused==false and udg_BossFight==false and udg_LeechRelease==true
endfunction
function LeechSpawnAct takes nothing returns nothing
local location l
local integer n
local integer typ
set n = GetRandomInt(1, 4)
if n==1 then
set l = GetRectCenter(gg_rct_Leech1)
endif
if n==2 then
set l = GetRectCenter(gg_rct_Leech2)
endif
if n==3 then
set l = GetRectCenter(gg_rct_Leech3)
endif
if n==4 then
set l = GetRectCenter(gg_rct_Leech4)
endif
call TriggerSleepAction(0.01)
set n = GetRandomInt(1, 3)
if n==1 then
set typ = 'h00P'
endif
if n==2 then
set typ = 'n003'
endif
if n==3 then
set typ = 'n004'
endif
call CreateUnitAtLoc(Player(PLAYER_NEUTRAL_AGGRESSIVE), typ, l, GetRandomReal(0,360))
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl", l))
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_Spawn_Random takes nothing returns nothing
set gg_trg_Spawn_Random = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Spawn_Random, 25 )
call TriggerAddCondition(gg_trg_Spawn_Random, Condition(function LeechSpawnCond))
call TriggerAddAction( gg_trg_Spawn_Random, function LeechSpawnAct)
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Minibot_Death_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'h00A' ) ) then
return false
endif
return true
endfunction
function Trig_Minibot_Death_Actions takes nothing returns nothing
local location l
call TriggerSleepAction(0.3)
set l = GetUnitLoc(GetTriggerUnit())
call RemoveUnit(GetTriggerUnit())
call CreateItemLoc('I000', l)
call SpawnItems(l, 1)
call AdjustPlayerStateBJ( 1, GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_LUMBER )
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_Minibot_Death takes nothing returns nothing
set gg_trg_Minibot_Death = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Minibot_Death, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Minibot_Death, Condition( function Trig_Minibot_Death_Conditions ) )
call TriggerAddAction( gg_trg_Minibot_Death, function Trig_Minibot_Death_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function InfDeathCond takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'n000' ) ) then
return false
endif
return true
endfunction
function InfDeathAct takes nothing returns nothing
local location l
call TriggerSleepAction(2.4)
set l = GetUnitLoc(GetTriggerUnit())
call RemoveUnit(GetTriggerUnit())
call CreateItemLoc('I00T', l)
call CreateItemLoc('I00T', l)
call CreateItemLoc('I00T', l)
call SpawnItems(l, 5)
call AdjustPlayerStateBJ( 16, GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_LUMBER )
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_Infernal_Death takes nothing returns nothing
set gg_trg_Infernal_Death = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Infernal_Death, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Infernal_Death, Condition( function InfDeathCond ) )
call TriggerAddAction( gg_trg_Infernal_Death, function InfDeathAct )
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
function Leech_Death_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'h00P' ) ) then
return false
endif
return true
endfunction
function Leech_Death_Actions takes nothing returns nothing
local location l
local integer n = 0
local unit gas
call TriggerSleepAction(0.6)
set l = GetUnitLoc(GetTriggerUnit())
call CreateItemLoc('I00R', l)
call CreateItemLoc('I00R', l)
call CreateItemLoc('I00R', l)
call SpawnItems(l, 2)
call AdjustPlayerStateBJ( 6, GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_LUMBER )
set gas = CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()), 'h00Q', l, 270)
loop
exitwhen n>=50
call TriggerSleepAction(0.01)
call UnitDamagePointLoc(GetTriggerUnit(), 0, 128, l, 80, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL)
set n = n+1
endloop
call RemoveUnit(gas)
call RemoveUnit(GetTriggerUnit())
call RemoveLocation(l)
set gas = null
set l = null
endfunction
function InitTrig_Leech_Death takes nothing returns nothing
set gg_trg_Leech_Death = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Leech_Death, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Leech_Death, Condition( function Leech_Death_Conditions ) )
call TriggerAddAction( gg_trg_Leech_Death, function Leech_Death_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function StoneG_Death_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'n003' ) ) then
return false
endif
return true
endfunction
function StoneG_Death_Actions takes nothing returns nothing
local location l
call TriggerSleepAction(1.8)
set l = GetUnitLoc(GetTriggerUnit())
call CreateItemLoc('I001', l)
call CreateItemLoc('I001', l)
call CreateItemLoc('I001', l)
call CreateItemLoc('I001', l)
call CreateItemLoc('I001', l)
call CreateItemLoc('I001', l)
call SpawnItems(l, 2)
call AdjustPlayerStateBJ( 6, GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_LUMBER )
call RemoveUnit(GetTriggerUnit())
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_StoneGolem_Death takes nothing returns nothing
set gg_trg_StoneGolem_Death = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_StoneGolem_Death, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_StoneGolem_Death, Condition( function StoneG_Death_Conditions ) )
call TriggerAddAction( gg_trg_StoneGolem_Death, function StoneG_Death_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function SteelG_Death_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'n004' ) ) then
return false
endif
return true
endfunction
function SteelG_Death_Actions takes nothing returns nothing
local location l
call TriggerSleepAction(1.8)
set l = GetUnitLoc(GetTriggerUnit())
call CreateItemLoc('I000', l)
call CreateItemLoc('I000', l)
call CreateItemLoc('I000', l)
call CreateItemLoc('I000', l)
call CreateItemLoc('I000', l)
call CreateItemLoc('I000', l)
call SpawnItems(l, 3)
call AdjustPlayerStateBJ( 9, GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_LUMBER )
call RemoveUnit(GetTriggerUnit())
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_SteelGolem_Death takes nothing returns nothing
set gg_trg_SteelGolem_Death = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_SteelGolem_Death, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_SteelGolem_Death, Condition( function SteelG_Death_Conditions ) )
call TriggerAddAction( gg_trg_SteelGolem_Death, function SteelG_Death_Actions )
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
function Trig_Provoke_Janitor_Conditions takes nothing returns boolean
return GetUnitTypeId(GetSpellTargetUnit()) == 'h008' and GetSpellAbilityId() == 'A00B'
endfunction
function Trig_Provoke_Janitor_Actions takes nothing returns nothing
local unit j = GetSpellTargetUnit()
local unit a = GetTriggerUnit()
local integer n = 1
local location jloc = GetUnitLoc(j)
local location provloc = GetUnitLoc(udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(a))])
local real ang = AngleBetweenPoints(jloc, provloc)
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(a)), 8, ("|cffe01010Warning: your attacks have provoked the Janitor!|r" ) )
call TriggerSleepAction(1)
call IssuePointOrderLocBJ(j, "carrionswarm", provloc)
call RemoveLocation(jloc)
call RemoveLocation(provloc)
call TriggerSleepAction(0.5)
loop
exitwhen n>3
set ang = ang+GetRandomReal(-10,10)
set jloc = GetUnitLoc(j)
set provloc = PolarProjectionBJ(jloc, 500, ang)
call IssuePointOrderLocBJ(j, "carrionswarm", provloc)
call RemoveLocation(jloc)
call RemoveLocation(provloc)
call TriggerSleepAction(0.5)
set n = n+1
endloop
set jloc = GetUnitLoc(j)
call SpawnItems(jloc, 1)
call UnitRemoveBuffBJ('Bcrs', j)
set jloc = GetRandomLocInRect(gg_rct_MapMedium)
call IssuePointOrderLocBJ(gg_unit_h008_0012, "move", jloc)
call RemoveLocation(jloc)
set jloc = null
set provloc = null
set j = null
set a = null
set provloc = null
if udg_JanitorFirst==false then
call DisplayTimedTextToForce(GetPlayersAll(), 15.00, "|cffa0a0ffAnnouncer: Ok, maybe I lied about the Janitor. But he's really a good guy once you get to know him.|r" )
set udg_JanitorFirst = true
endif
endfunction
//===========================================================================
function InitTrig_Provoke_Janitor takes nothing returns nothing
set gg_trg_Provoke_Janitor = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Provoke_Janitor, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Provoke_Janitor, Condition( function Trig_Provoke_Janitor_Conditions ) )
call TriggerAddAction( gg_trg_Provoke_Janitor, function Trig_Provoke_Janitor_Actions )
endfunction
//TESH.scrollpos=245
//TESH.alwaysfold=0
function KillTrees takes nothing returns nothing
call KillDestructable(GetEnumDestructable())
endfunction
function Deflect takes unit collu, unit u , real ang returns nothing
local location ul = GetUnitLoc(u)
local location collul = GetUnitLoc(collu)
local real dir = AngleBetweenPoints(collul, ul)
local integer dist = GetUnitUserData(u)/1000
local location v
local real ang2 = (2*dir)-(180+ang)
local unit d
call GroupAddUnit(udg_BlockGroup, collu)
set v = PolarProjectionBJ(ul, 50, ang2)
call SetUnitUserData(u, dist*1000+R2I(ang2))
call SetUnitPositionLoc(u, v)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\Defend\\DefendCaster.mdl", collu, "origin"))
set d = CreateUnitAtLoc(GetOwningPlayer(collu), 'h000', udg_MapCenter, 270)
call IssueImmediateOrder(d, "roar")
call UnitApplyTimedLife(d, 'BTLF', 2)
call CreateTextTagLocBJ( "Block!", collul, 0, 16.00, 6, 80, 80, 0 )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 100.00, 90 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 3.00 )
call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 1.50 )
call RemoveLocation(ul)
call RemoveLocation(collul)
call RemoveLocation(v)
set v = null
set ul = null
set collul = null
set d = null
endfunction
function SlideCond takes nothing returns boolean
return CountUnitsInGroup(udg_BowlGroup)>=1
endfunction
function Trig_Slide_Actions takes nothing returns nothing
local unit u
local unit cave
local location ul
local location v
local real ang
local integer dist
local group g = CreateGroup()
local group coll
local unit collu
local location collul
local real collang
local real dam
local unit curser
local real radius
local integer modint = 0
local real dir = 0
local integer z = 1
local boolean crt = false
local unit zu
call GroupAddGroup(udg_BowlGroup, g)
loop
set u = FirstOfGroup(g)
exitwhen u==null
set dist = GetUnitUserData(u)/1000
set ul = GetUnitLoc(u)
set ang = ModuloInteger(GetUnitUserData(u), 1000)
set ang = ModuloInteger(R2I(ang), 360)
//------------------------------------Boomerang-----------------------------------------
if GetUnitTypeId(u)=='h00O' then
set dir = AngleBetweenPoints(udg_BoomerangTarget[GetPlayerId(GetOwningPlayer(u))], ul)
if DistanceBetweenPoints(ul, udg_BoomerangTarget[GetPlayerId(GetOwningPlayer(u))])<=60 then
if udg_BoomReturn[GetPlayerId(GetOwningPlayer(u))]==false then
set udg_BoomReturn[GetPlayerId(GetOwningPlayer(u))] = true
set dist = dist+15
else
set udg_BoomReturn[GetPlayerId(GetOwningPlayer(u))] = false
call RemoveLocation(udg_BoomerangTarget[GetPlayerId(GetOwningPlayer(u))])
set dist = 0
endif
endif
if udg_BoomReturn[GetPlayerId(GetOwningPlayer(u))]==true then
call RemoveLocation(udg_BoomerangTarget[GetPlayerId(GetOwningPlayer(u))])
set udg_BoomerangTarget[GetPlayerId(GetOwningPlayer(u))] = GetUnitLoc(udg_Caveman[GetPlayerId(GetOwningPlayer(u))+1])
endif
if ang>dir and ang-180<dir then
set modint = 4
endif
if ang+180>dir and ang<dir then
set modint = -4
endif
if ang-360>dir and ang-540<dir then
set modint = 4
endif
if ang-180>dir and ang-360<dir then
set modint = -4
endif
set ang = ang+modint
if ang<0 then
set ang = ang+360
endif
if ang>360 then
set ang = ang-360
endif
set z = 10
call SetUnitFlyHeight(u, 30, 0)
set v = PolarProjectionBJ(ul, 0.5*dist/z, dir+180)
call SetUnitPositionLoc(u, v)
call RemoveLocation(v)
call RemoveLocation(ul)
set ul = GetUnitLoc(u)
endif
//-----------------------------------EndBoomerang---------------------------------------
if DistanceBetweenPoints(udg_MapCenter, ul)<=300 then
set ang = (2*AngleBetweenPoints(udg_MapCenter, ul))-(180+ang)
loop
exitwhen ang>0
set ang = ang+360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set v = PolarProjectionBJ(ul, dist, ang)
call SetUnitPositionLoc(u, v)
call RemoveLocation(ul)
set ul = GetUnitLoc(u)
endif
set v = PolarProjectionBJ(ul, 1.5*dist/z, ang)
set z = 1
call SetUnitPositionLoc(u, v)
if IsUnitInGroup(u, udg_Kicked) then
call SetUnitPositionLoc(udg_Kicker[GetPlayerId(GetOwningPlayer(u))], v)
endif
call SetUnitUserData(u, ((dist-1)*1000)+R2I(ang))
if IsUnitType(u, UNIT_TYPE_HERO)==false and u!=gg_unit_h008_0012 then
call SetUnitFacing(u, ang)
endif
if dist<=0 then
call GroupRemoveUnit(udg_BowlGroup, u)
if GetUnitTypeId(u)=='h001' then
call RemoveUnit(u)
call CreateItemLoc('I001', ul)
endif
if GetUnitTypeId(u)=='h00B' then
call RemoveUnit(u)
call CreateItemLoc('I000', ul)
endif
if GetUnitTypeId(u)=='h00G' then
call RemoveUnit(u)
endif
if GetUnitTypeId(u)=='h00H' then
call RemoveUnit(u)
call CreateItemLoc('I00T', ul)
endif
if GetUnitTypeId(u)=='h00O' then
set udg_BoomReturn[GetPlayerId(GetOwningPlayer(u))] = false
call GroupRemoveUnit(udg_BoomG[GetPlayerId(GetOwningPlayer(u))], u)
call RemoveUnit(u)
call CreateItemLoc('I001', ul)
call CreateItemLoc('I000', ul)
call CreateItemLoc('I000', ul)
endif
if IsUnitInGroup(u, udg_Kicked) then
call ShowUnit(udg_Kicker[GetPlayerId(GetOwningPlayer(u))], true)
call GroupRemoveUnit(udg_Kicked2, udg_Kicker[GetPlayerId(GetOwningPlayer(u))])
call RemoveUnit(u)
endif
endif
//-----------------------------------Collision------------------------------------------
if dist>=8 and (GetUnitTypeId(u)=='h001' or GetUnitTypeId(u)=='h00B' or GetUnitTypeId(u)=='h00G' or GetUnitTypeId(u)=='h00H') or IsUnitInGroup(u, udg_Kicked) or GetUnitTypeId(u)=='h00O' then
set coll = CreateGroup()
if GetUnitTypeId(u)=='h00H' or GetUnitTypeId(u)=='h00O' then
set radius = 110
else
set radius = 70
endif
call EnumDestructablesInCircleBJ(radius, v, function KillTrees)
call GroupEnumUnitsInRangeOfLoc(coll, v, radius, null)
call GroupRemoveUnit(coll, u)
call GroupRemoveGroup(coll, udg_BowlGroup)
call GroupRemoveUnit(coll, gg_unit_h00E_0013)
call GroupRemoveUnit(coll, gg_unit_h00E_0014)
call GroupRemoveUnit(coll, gg_unit_h00E_0015)
if GetUnitTypeId(u)=='h00O' then
call GroupRemoveUnit(coll, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))])
endif
loop
set collu = FirstOfGroup(coll)
loop
exitwhen IsUnitInGroup(collu, udg_FlingingLeft)==false and IsUnitInGroup(collu, udg_FlingingRight)==false and IsUnitInGroup(collu, udg_FlingingTop)==false and IsUnitInGroup(collu, udg_FlingingBottom)==false and GetUnitTypeId(collu)!='h00V' and GetUnitTypeId(collu)!='h00W' and GetUnitTypeId(collu)!='h00X' and GetUnitTypeId(collu)!='h00U'
call GroupRemoveUnit(coll, collu)
set collu = FirstOfGroup(coll)
endloop
exitwhen CountUnitsInGroup(coll)==0
set collul = GetUnitLoc(collu)
set collang = AngleBetweenPoints(v, collul)
set collang = 360+collang
if not(IsUnitInGroup(collu, udg_BowlGroup2)) then
set collang = (2*ang+collang)/3
endif
call SetUnitUserData(collu, 15000+R2I(collang))
call GroupAddUnit(udg_BowlGroup, collu)
call GroupRemoveUnit(coll, collu)
if UnitHasItemOfTypeBJ(collu, 'I00M') and GetRandomInt(1, 100)<=12 then
call Deflect(collu, u, ang)
endif
if UnitHasItemOfTypeBJ(collu, 'I00Q') and GetRandomInt(1, 100)<=15 then
call Deflect(collu, u, ang)
endif
if UnitHasItemOfTypeBJ(collu, 'I00K') and GetRandomInt(1, 100)<=18 then
call Deflect(collu, u, ang)
endif
if UnitHasItemOfTypeBJ(collu, 'I01B') and GetRandomInt(1, 100)<=20 then
call Deflect(collu, u, ang)
endif
if UnitHasItemOfTypeBJ(collu, 'I00F') and GetRandomInt(1, 100)<=25 then
call Deflect(collu, u, ang)
endif
if GetUnitTypeId(collu)!='h001' and GetUnitTypeId(collu)!='h00A' and GetUnitTypeId(collu)!='h00B' and GetUnitTypeId(collu)!='h008' and GetUnitTypeId(collu)!='h00E' and GetUnitTypeId(collu)!='n000' and GetUnitTypeId(u)!='h00G' and IsUnitInGroup(collu, udg_BlockGroup)==false and GetUnitTypeId(collu)!='n003' and GetUnitTypeId(collu)!='n004' then
call DestroyEffect(AddSpecialEffectLoc("Objects\\Spawnmodels\\Human\\HumanLargeDeathExplode\\HumanLargeDeathExplode.mdl", collul))
else
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
endif
if GetUnitTypeId(u)=='h00G' then
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl", collul))
endif
if GetUnitTypeId(collu)=='h008' then
set curser = CreateUnitAtLoc(GetOwningPlayer(u), 'h00F', collul, AngleBetweenPoints(udg_MapCenter, collul))
call UnitApplyTimedLife(curser, 'BTLF', 1)
call IssueTargetOrderBJ(curser, "curse", collu)
endif
set dam = dist
if GetUnitTypeId(u)=='h00B' then
set dam = dam*1.5
endif
if GetUnitTypeId(u)=='h00H' then
set dam = dam*1.1
endif
set cave = udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))]
if UnitHasItemOfTypeBJ(cave, 'I00N') then
set dam = dam*1.1
endif
if UnitHasItemOfTypeBJ(cave, 'I00P') then
set dam = dam*1.2
endif
if UnitHasItemOfTypeBJ(cave, 'I00O') then
set dam = dam*1.3
endif
if UnitHasItemOfTypeBJ(cave, 'I013') then
set dam = dam*1.1
endif
if UnitHasItemOfTypeBJ(cave, 'I014') then
set dam = dam*1.2
endif
if UnitHasItemOfTypeBJ(cave, 'I015') then
set dam = dam*1.3
endif
if UnitHasItemOfTypeBJ(cave, 'I019') then
set dam = dam*1.1
endif
if UnitHasItemOfTypeBJ(cave, 'I00B') then
set dam = dam*1.5
endif
if GetUnitState(u, UNIT_STATE_MANA)>0 then
set dam = dam*(1+(.04*GetUnitState(u, UNIT_STATE_MANA)))
endif
if GetUnitTypeId(u)=='h00O' then
set dam = dam*(.1+GetUnitAbilityLevel(udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], 'A00M')/20)
endif
if GetRandomReal(1,100)<=3+(0.4*udg_Crit[GetConvertedPlayerId(GetOwningPlayer(u))]) then
set dam = dam*10
set udg_tempPoint = GetUnitLoc(collu)
call TriggerExecute(gg_trg_Crit)
if GetLocalPlayer()==GetOwningPlayer(collu) or GetLocalPlayer()==GetOwningPlayer(u) then
call StartSound(gg_snd_crit_received3)
endif
set crt = true
endif
if IsUnitInGroup(collu, udg_BlockGroup)==false then
if GetUnitTypeId(u)=='h00G' and GetUnitTypeId(collu)!='h008' then
call UnitDamageTargetBJ(u, collu, 0.75*GetUnitState(collu, UNIT_STATE_MAX_LIFE), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL)
if crt==true then
call UnitDamageTargetBJ(u, collu, 100*GetUnitState(collu, UNIT_STATE_MAX_LIFE), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL)
endif
endif
set crt = false
if IsUnitEnemy(collu, GetOwningPlayer(u)) then
call UnitDamageTargetBJ(u, collu, dam, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL)
if IsUnitInGroup(u, udg_Kicked) then
call UnitDamageTargetBJ(u, udg_Kicker[GetPlayerId(GetOwningPlayer(u))], 3*dam, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL)
endif
endif
if udg_BossFight==true and GetUnitTypeId(collu)=='h008' then
call UnitDamageTargetBJ(u, collu, dam, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL)
endif
endif
if UnitHasItemOfTypeBJ(cave, 'I00B') and GetRandomInt(1,25)==15 and IsUnitAliveBJ(collu) then
set zu = CreateUnitAtLoc(GetOwningPlayer(cave), 'h000', v, GetRandomReal(0,360))
call IssueImmediateOrder(zu, "thunderclap")
call UnitApplyTimedLife(zu, 'BTLF', 1)
set zu = null
endif
set cave = null
set collu = null
call RemoveLocation(collul)
set collul = null
endloop
call DestroyGroup(coll)
set coll = null
endif
call RemoveLocation(v)
set v = null
call RemoveLocation(ul)
set ul = null
call GroupRemoveUnit(g, u)
set u = null
endloop
call DestroyGroup(g)
set g = null
set curser = null
set zu = null
if CountUnitsInGroup(udg_BowlGroup)==0 then
call DisableTrigger(GetTriggeringTrigger())
endif
endfunction
function InitTrig_Slide takes nothing returns nothing
set gg_trg_Slide = CreateTrigger( )
call DisableTrigger( gg_trg_Slide )
call TriggerRegisterTimerEventPeriodic( gg_trg_Slide, 0.03 )
call TriggerAddCondition( gg_trg_Slide, Condition(function SlideCond) )
call TriggerAddAction( gg_trg_Slide, function Trig_Slide_Actions )
endfunction
//TESH.scrollpos=27
//TESH.alwaysfold=0
function LightPentCond takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
endfunction
function LightPentAct takes nothing returns nothing
local unit c = GetSpellAbilityUnit()
local location cLoc = GetUnitLoc(GetSpellAbilityUnit())
local location t = GetSpellTargetLoc()
local location array v
local real angle = AngleBetweenPoints(cLoc, t)
local integer count = 0
local lightning array light
local unit d
call TriggerSleepAction(0.10)
loop
exitwhen count>=5
set v[count] = PolarProjectionBJ(t, 250, angle)
set angle = angle-72
set count = count+1
endloop
set count = 2
set v[5] = v[0]
set v[6] = v[1]
set v[7] = v[2]
set light[0] = AddLightningLoc("AFOD", cLoc, v[0])
set d = CreateUnit(GetOwningPlayer(c), 'h000', GetLocationX(cLoc), GetLocationY(cLoc), 0.)
call IssuePointOrderLocBJ(d, "impale", v[0])
call UnitApplyTimedLifeBJ(1.00, 'BTLF', d)
set d = null
call TriggerSleepAction(0.12)
set light[1] = AddLightningLoc("AFOD", v[0], v[1])
set d = CreateUnit(GetOwningPlayer(c), 'h000', GetLocationX(v[0]), GetLocationY(v[0]), 0.)
call IssuePointOrderLocBJ(d, "impale", v[1])
call UnitApplyTimedLifeBJ(1.00, 'BTLF', d)
set d = null
call TriggerSleepAction(0.12)
set light[6] = AddLightningLoc("AFOD", v[1], v[3])
set d = CreateUnit(GetOwningPlayer(c), 'h000', GetLocationX(v[1]), GetLocationY(v[1]), 0.)
call IssuePointOrderLocBJ(d, "impale", v[3])
call UnitApplyTimedLifeBJ(1.00, 'BTLF', d)
set d = null
call DestroyLightning(light[0])
call TriggerSleepAction(0.12)
loop
exitwhen count>=6
set light[count] = AddLightningLoc("AFOD", v[count-1], v[count])
set d = CreateUnit(GetOwningPlayer(c), 'h000', GetLocationX(v[count-1]), GetLocationY(v[count-1]), 0.)
call IssuePointOrderLocBJ(d, "impale", v[count])
call UnitApplyTimedLifeBJ(0.40, 'BTLF', d)
set d = null
call TriggerSleepAction(0.12)
set light[count+5] = AddLightningLoc("AFOD", v[count], v[count+2])
set d = CreateUnit(GetOwningPlayer(c), 'h000', GetLocationX(v[count]), GetLocationY(v[count]), 0.)
call IssuePointOrderLocBJ(d, "impale", v[count+2])
call UnitApplyTimedLifeBJ(0.40, 'BTLF', d)
set d = null
call TriggerSleepAction(0.12)
set count = count+1
endloop
call TriggerSleepAction(4.)
set count = 1
loop
exitwhen count>=12
call DestroyLightning(light[count])
call RemoveLocation(v[count])
set v[count]=null
set light[count] = null
set count = count+1
endloop
call RemoveLocation(t)
call RemoveLocation(cLoc)
set cLoc = null
set c = null
set t = null
endfunction
function InitTrig_LightningPentagram takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function LightPentCond))
call TriggerAddAction(t, function LightPentAct)
set t = null
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function LaserCond takes nothing returns boolean
return GetSpellAbilityId() == 'A009' or GetSpellAbilityId() == 'A010'
endfunction
function LaserAct takes nothing returns nothing
local unit c = GetTriggerUnit()
local location t = GetSpellTargetLoc()
local location cl = GetUnitLoc(c)
local real ang = AngleBetweenPoints(cl, t)
local location v = PolarProjectionBJ(cl, 40, ang)
local unit d = CreateUnitAtLoc(GetOwningPlayer(c), 'h00G', cl, ang)
set ang = 360+ang
if IsUnitType(c, UNIT_TYPE_HERO) == true then
set ang = ang+GetRandomReal(-20,20)
endif
call GroupAddUnit(udg_BowlGroup, d)
call SetUnitUserData(d, 75000+R2I(ang))
call EnableTrigger(gg_trg_Slide)
call GroupAddUnit(udg_BowlGroup, c)
call SetUnitUserData(c, 12000+R2I(ang+180))
call GroupAddUnit(udg_BowlGroup2, c)
call TriggerSleepAction(0)
call GroupRemoveUnit(udg_BowlGroup2, c)
endfunction
function InitTrig_Laser takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function LaserCond))
call TriggerAddAction(t, function LaserAct)
set t = null
endfunction
//TESH.scrollpos=22
//TESH.alwaysfold=0
function BowlCond takes nothing returns boolean
return GetSpellAbilityId() == 'A008' and GetPlayerState(GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_RESOURCE_GOLD)>=1
endfunction
function BowlAct takes nothing returns nothing
local unit c = GetTriggerUnit()
local location t = GetSpellTargetLoc()
local location cl = GetUnitLoc(c)
local real ang = AngleBetweenPoints(cl, t)
local unit d = CreateUnitAtLoc(GetOwningPlayer(c), 'h001', cl, ang)
local integer dist = 60000+(1000*udg_Firepower[GetConvertedPlayerId(GetOwningPlayer(c))])
local integer knock = 12000-1000*udg_Stamina[GetConvertedPlayerId(GetOwningPlayer(c))]
if knock<3000 or UnitHasItemOfTypeBJ(c, 'I01D') then
set knock = 3000
endif
if IsUnitInGroup(c, udg_FrenzyGroup) then
set knock = 1000
else
call GroupAddUnit(udg_BowlGroup, c)
call SetUnitUserData(c, knock+R2I(ang+180))
call GroupAddUnit(udg_BowlGroup2, c)
endif
set ang = 360+ang
call GroupAddUnit(udg_BowlGroup, d)
call SetUnitUserData(d, dist+R2I(ang))
call EnableTrigger(gg_trg_Slide)
call TriggerSleepAction(0)
call GroupRemoveUnit(udg_BowlGroup2, c)
call SetPlayerState(GetOwningPlayer(c), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(GetOwningPlayer(c), PLAYER_STATE_RESOURCE_GOLD)-1)
if udg_Sharpness[GetConvertedPlayerId(GetOwningPlayer(c))]>0 then
call SetUnitManaBJ(d, udg_Sharpness[GetConvertedPlayerId(GetOwningPlayer(c))])
endif
set udg_Sharpness[GetConvertedPlayerId(GetOwningPlayer(c))] = 0
call RemoveLocation(cl)
call RemoveLocation(t)
set c = null
set d = null
set cl = null
set t = null
endfunction
function InitTrig_Bowl takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function BowlCond))
call TriggerAddAction(t, function BowlAct)
set t = null
endfunction
//TESH.scrollpos=25
//TESH.alwaysfold=0
function SteelCond takes nothing returns boolean
return GetSpellAbilityId() == 'A00A' and (UnitHasItemOfTypeBJ(GetTriggerUnit(), 'I004') or GetUnitTypeId(GetTriggerUnit())=='h00J')
endfunction
function SteelAct takes nothing returns nothing
local unit c = GetTriggerUnit()
local location t = GetSpellTargetLoc()
local location cl = GetUnitLoc(c)
local real ang = AngleBetweenPoints(cl, t)
local unit d = CreateUnitAtLoc(GetOwningPlayer(c), 'h00B', cl, ang)
local integer dist = 60000+(1000*udg_Firepower[GetConvertedPlayerId(GetOwningPlayer(c))])
local integer knock = 12000-1000*udg_Stamina[GetConvertedPlayerId(GetOwningPlayer(c))]
if knock<3000 or UnitHasItemOfTypeBJ(c, 'I01D') then
set knock = 3000
endif
if IsUnitInGroup(c, udg_FrenzyGroup) then
set knock = 1000
else
call GroupAddUnit(udg_BowlGroup, c)
call SetUnitUserData(c, knock+R2I(ang+180))
call GroupAddUnit(udg_BowlGroup2, c)
endif
set ang = 360+ang
call GroupAddUnit(udg_BowlGroup, d)
call SetUnitUserData(d, dist+R2I(ang))
call EnableTrigger(gg_trg_Slide)
call TriggerSleepAction(0)
call GroupRemoveUnit(udg_BowlGroup2, c)
call SetItemCharges( GetItemOfTypeFromUnitBJ(c, 'I004'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(c, 'I004')) - 1 ) )
if GetItemCharges(GetItemOfTypeFromUnitBJ(c, 'I004'))<=0 then
call RemoveItem(GetItemOfTypeFromUnitBJ(c, 'I004'))
call UnitRemoveAbility(c, 'A00A')
endif
if udg_Sharpness[GetConvertedPlayerId(GetOwningPlayer(c))]>0 then
call SetUnitManaBJ(d, udg_Sharpness[GetConvertedPlayerId(GetOwningPlayer(c))])
endif
set udg_Sharpness[GetConvertedPlayerId(GetOwningPlayer(c))] = 0
call RemoveLocation(cl)
call RemoveLocation(t)
set c = null
set d = null
set cl = null
set t = null
endfunction
function InitTrig_Steel takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function SteelCond))
call TriggerAddAction(t, function SteelAct)
set t = null
endfunction
//TESH.scrollpos=19
//TESH.alwaysfold=0
function SmolderCond takes nothing returns boolean
return GetSpellAbilityId() == 'A00D' and (UnitHasItemOfTypeBJ(GetTriggerUnit(), 'I006') or GetUnitTypeId(GetTriggerUnit())=='h00J')
endfunction
function SmolderAct takes nothing returns nothing
local unit c = GetTriggerUnit()
local location t = GetSpellTargetLoc()
local location cl = GetUnitLoc(c)
local real ang = AngleBetweenPoints(cl, t)
local location v = PolarProjectionBJ(cl, 50, ang)
local unit d = CreateUnitAtLoc(GetOwningPlayer(c), 'h00H', v, ang)
local integer dist = 50000+(1000*udg_Firepower[GetConvertedPlayerId(GetOwningPlayer(c))])
local integer knock = 16000-1000*udg_Stamina[GetConvertedPlayerId(GetOwningPlayer(c))]
if knock<3000 or UnitHasItemOfTypeBJ(c, 'I01D') then
set knock = 3000
endif
if IsUnitInGroup(c, udg_FrenzyGroup) then
set knock = 1000
else
call GroupAddUnit(udg_BowlGroup, c)
call SetUnitUserData(c, knock+R2I(ang+180))
call GroupAddUnit(udg_BowlGroup2, c)
endif
set ang = 360+ang
call GroupAddUnit(udg_BowlGroup, d)
call SetUnitUserData(d, dist+R2I(ang))
call EnableTrigger(gg_trg_Slide)
call TriggerSleepAction(0)
call GroupRemoveUnit(udg_BowlGroup2, c)
call SetItemCharges( GetItemOfTypeFromUnitBJ(c, 'I006'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(c, 'I006')) - 1 ) )
if GetItemCharges(GetItemOfTypeFromUnitBJ(c, 'I006'))<=0 then
call RemoveItem(GetItemOfTypeFromUnitBJ(c, 'I006'))
call UnitRemoveAbility(c, 'A00D')
endif
if udg_Sharpness[GetConvertedPlayerId(GetOwningPlayer(c))]>0 then
call SetUnitManaBJ(d, udg_Sharpness[GetConvertedPlayerId(GetOwningPlayer(c))])
endif
set udg_Sharpness[GetConvertedPlayerId(GetOwningPlayer(c))] = 0
call RemoveLocation(cl)
call RemoveLocation(v)
call RemoveLocation(t)
set c = null
set d = null
set cl = null
set v = null
set t = null
endfunction
function InitTrig_Smolder takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function SmolderCond))
call TriggerAddAction(t, function SmolderAct)
set t = null
endfunction
//TESH.scrollpos=21
//TESH.alwaysfold=0
function BoomerangCond takes nothing returns boolean
return GetSpellAbilityId() == 'A00M' and UnitHasItemOfTypeBJ(GetTriggerUnit(), 'I004') and GetItemCharges(GetItemOfTypeFromUnitBJ(GetTriggerUnit(), 'I004')) >= 2 and GetPlayerState(GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_RESOURCE_GOLD)>=1 and CountUnitsInGroup(udg_BoomG[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))])==0
endfunction
function BoomerangAct takes nothing returns nothing
local unit c = GetTriggerUnit()
local location t = GetSpellTargetLoc()
local location cl = GetUnitLoc(c)
local real ang = AngleBetweenPoints(cl, t)-(52*(DistanceBetweenPoints(cl, t)/1200))
local location cl2 = PolarProjectionBJ(cl, 40, ang)
local unit d = CreateUnitAtLoc(GetOwningPlayer(c), 'h00O', cl2, ang)
local integer dist = 300000+(1000*udg_Firepower[GetConvertedPlayerId(GetOwningPlayer(c))])
local integer knock = 12000-1000*udg_Stamina[GetConvertedPlayerId(GetOwningPlayer(c))]
if knock<3000 or UnitHasItemOfTypeBJ(c, 'I01D') then
set knock = 3000
endif
set udg_BoomerangTarget[GetPlayerId(GetOwningPlayer(c))] = GetSpellTargetLoc()
call GroupAddUnit(udg_BoomG[GetPlayerId(GetOwningPlayer(c))], d)
call GroupAddUnit(udg_BowlGroup, c)
call SetUnitUserData(c, knock+R2I(ang+180))
call GroupAddUnit(udg_BowlGroup2, c)
set ang = 360+ang
call GroupAddUnit(udg_BowlGroup, d)
call SetUnitUserData(d, dist+R2I(ang))
call EnableTrigger(gg_trg_Slide)
call TriggerSleepAction(0)
call GroupRemoveUnit(udg_BowlGroup2, c)
call SetPlayerState(GetOwningPlayer(c), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(GetOwningPlayer(c), PLAYER_STATE_RESOURCE_GOLD)-1)
call SetItemCharges( GetItemOfTypeFromUnitBJ(c, 'I004'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(c, 'I004')) - 2 ) )
if GetItemCharges(GetItemOfTypeFromUnitBJ(c, 'I004'))<=0 then
call RemoveItem(GetItemOfTypeFromUnitBJ(c, 'I004'))
endif
if udg_Sharpness[GetConvertedPlayerId(GetOwningPlayer(c))]>0 then
call SetUnitManaBJ(d, udg_Sharpness[GetConvertedPlayerId(GetOwningPlayer(c))])
endif
set udg_Sharpness[GetConvertedPlayerId(GetOwningPlayer(c))] = 0
call RemoveLocation(cl)
call RemoveLocation(cl2)
call RemoveLocation(t)
set c = null
set d = null
set cl = null
set cl2 = null
set t = null
endfunction
function InitTrig_Boomerang takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function BoomerangCond))
call TriggerAddAction(t, function BoomerangAct)
set t = null
endfunction
//TESH.scrollpos=18
//TESH.alwaysfold=0
function Trig_ThrowFrenzy_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A00G'
endfunction
function Trig_ThrowFrenzy_Actions takes nothing returns nothing
local unit c = GetTriggerUnit()
local location cl = GetUnitLoc(c)
local location t = GetSpellTargetLoc()
local location t2
local location t3 = PolarProjectionBJ(cl, 64, AngleBetweenPoints(cl, t))
local location t4
local integer n = 1
local integer hits = (2+GetUnitAbilityLevel(c, 'A00G'))
local unit d
call GroupAddUnit(udg_FrenzyGroup, c)
loop
exitwhen n>hits
call TriggerSleepAction(0.01)
set t4 = PolarProjectionBJ(t, 128, GetRandomReal(0, 360))
set t2 = PolarProjectionBJ(t3, 64, AngleBetweenPoints(cl, t4))
set d = CreateUnitAtLoc(GetOwningPlayer(c), 'h00J', t3, AngleBetweenPoints(cl, t))
if UnitHasItemOfTypeBJ(c, 'I006') then
call IssuePointOrderLocBJ(d, "breathoffire", t2)
call SetItemCharges(GetItemOfTypeFromUnitBJ(c, 'I006'), (GetItemCharges(GetItemOfTypeFromUnitBJ(c, 'I006'))-1))
if GetItemCharges(GetItemOfTypeFromUnitBJ(c, 'I006'))==0 then
call RemoveItem(GetItemOfTypeFromUnitBJ(c, 'I006'))
call UnitRemoveAbility(c, 'A00D')
endif
else
if UnitHasItemOfTypeBJ(c, 'I004') then
call IssuePointOrderLocBJ(d, "shockwave", t2)
call SetItemCharges(GetItemOfTypeFromUnitBJ(c, 'I004'), (GetItemCharges(GetItemOfTypeFromUnitBJ(c, 'I004'))-1))
if GetItemCharges(GetItemOfTypeFromUnitBJ(c, 'I004'))==0 then
call RemoveItem(GetItemOfTypeFromUnitBJ(c, 'I004'))
call UnitRemoveAbility(c, 'A00A')
endif
else
call IssuePointOrderLocBJ(d, "carrionswarm", t2)
call SetPlayerState(GetOwningPlayer(c), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(GetOwningPlayer(c), PLAYER_STATE_RESOURCE_GOLD)-1)
endif
endif
call RemoveUnit(d)
set d = null
call RemoveLocation(t2)
call RemoveLocation(t4)
set t2 = null
set t4 = null
set n = n+1
endloop
call GroupRemoveUnit(udg_FrenzyGroup, c)
call RemoveLocation(t)
set t = null
set c = null
call RemoveLocation(cl)
set cl = null
call RemoveLocation(t3)
set t3 = null
endfunction
//===========================================================================
function InitTrig_ThrowFrenzy takes nothing returns nothing
set gg_trg_ThrowFrenzy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_ThrowFrenzy, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_ThrowFrenzy, Condition( function Trig_ThrowFrenzy_Conditions ) )
call TriggerAddAction( gg_trg_ThrowFrenzy, function Trig_ThrowFrenzy_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function KickCond takes nothing returns boolean
return GetSpellAbilityId() == 'A00L' and IsUnitType(GetSpellTargetUnit(), UNIT_TYPE_HERO) == true
endfunction
function KickAct takes nothing returns nothing
local unit c = GetTriggerUnit()
local unit t = GetSpellTargetUnit()
local location cl = GetUnitLoc(c)
local location tl = GetUnitLoc(t)
local real ang = AngleBetweenPoints(cl, tl)
local unit d = CreateUnitAtLoc(GetOwningPlayer(c), 'h00N', cl, GetUnitFacing(t))
local integer dist = 44000+(4000*GetUnitAbilityLevel(c, 'A00L'))
local integer knock = 12000-1000*udg_Stamina[GetConvertedPlayerId(GetOwningPlayer(c))]
if UnitHasItemOfTypeBJ(c, 'I01D') then
set dist = dist+16000
endif
call SetUnitLifePercentBJ(d, GetUnitStatePercent(t, UNIT_STATE_LIFE, UNIT_STATE_MAX_LIFE))
call GroupAddUnit(udg_BowlGroup, c)
call GroupAddUnit(udg_Kicked, d)
call GroupAddUnit(udg_Kicked2, c)
call SetUnitUserData(c, knock+R2I(ang+180))
call GroupAddUnit(udg_BowlGroup2, c)
set ang = 360+ang
call GroupAddUnit(udg_BowlGroup, d)
call SetUnitUserData(d, dist+R2I(ang))
call EnableTrigger(gg_trg_Slide)
set udg_Kicker[GetPlayerId(GetOwningPlayer(c))] = t
call ShowUnit(t, false)
call TriggerSleepAction(0)
call GroupRemoveUnit(udg_BowlGroup2, c)
call RemoveLocation(cl)
call RemoveLocation(tl)
set c = null
set cl = null
set tl = null
set t = null
set d = null
endfunction
function InitTrig_Kick takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function KickCond))
call TriggerAddAction(t, function KickAct)
set t = null
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function OoB1_Actions takes nothing returns nothing
local location l = GetRectCenter(gg_rct_oobt1)
call SetUnitPositionLoc(GetTriggerUnit(), l)
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_OoB1 takes nothing returns nothing
set gg_trg_OoB1 = CreateTrigger()
call TriggerRegisterEnterRectSimple( gg_trg_OoB1, gg_rct_oob1 )
call TriggerAddAction( gg_trg_OoB1, function OoB1_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function OoB2_Actions takes nothing returns nothing
local location l = GetRectCenter(gg_rct_oobt2)
call SetUnitPositionLoc(GetTriggerUnit(), l)
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_OoB2 takes nothing returns nothing
set gg_trg_OoB2 = CreateTrigger()
call TriggerRegisterEnterRectSimple( gg_trg_OoB2, gg_rct_oob2 )
call TriggerAddAction( gg_trg_OoB2, function OoB2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function OoB3_Actions takes nothing returns nothing
local location l = GetRectCenter(gg_rct_oobt3)
call SetUnitPositionLoc(GetTriggerUnit(), l)
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_OoB3 takes nothing returns nothing
set gg_trg_OoB3 = CreateTrigger()
call TriggerRegisterEnterRectSimple( gg_trg_OoB3, gg_rct_oob3 )
call TriggerAddAction( gg_trg_OoB3, function OoB3_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function OoB4_Actions takes nothing returns nothing
local location l = GetRectCenter(gg_rct_oobt4)
call SetUnitPositionLoc(GetTriggerUnit(), l)
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_OoB4 takes nothing returns nothing
set gg_trg_OoB4 = CreateTrigger()
call TriggerRegisterEnterRectSimple( gg_trg_OoB4, gg_rct_oob4 )
call TriggerAddAction( gg_trg_OoB4, function OoB4_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function OoB5_Actions takes nothing returns nothing
local location l = GetRectCenter(gg_rct_oobt5)
call SetUnitPositionLoc(GetTriggerUnit(), l)
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_OoB5 takes nothing returns nothing
set gg_trg_OoB5 = CreateTrigger()
call TriggerRegisterEnterRectSimple( gg_trg_OoB5, gg_rct_oob5 )
call TriggerAddAction( gg_trg_OoB5, function OoB5_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function OoB6_Actions takes nothing returns nothing
local location l = GetRectCenter(gg_rct_oobt6)
call SetUnitPositionLoc(GetTriggerUnit(), l)
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_OoB6 takes nothing returns nothing
set gg_trg_OoB6 = CreateTrigger()
call TriggerRegisterEnterRectSimple( gg_trg_OoB6, gg_rct_oob6 )
call TriggerAddAction( gg_trg_OoB6, function OoB6_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function OoB7_Actions takes nothing returns nothing
local location l = GetRectCenter(gg_rct_oobt7)
call SetUnitPositionLoc(GetTriggerUnit(), l)
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_OoB7 takes nothing returns nothing
set gg_trg_OoB7 = CreateTrigger()
call TriggerRegisterEnterRectSimple( gg_trg_OoB7, gg_rct_oob7 )
call TriggerAddAction( gg_trg_OoB7, function OoB7_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function OoB8_Actions takes nothing returns nothing
local location l = GetRectCenter(gg_rct_oobt8)
call SetUnitPositionLoc(GetTriggerUnit(), l)
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_OoB8 takes nothing returns nothing
set gg_trg_OoB8 = CreateTrigger()
call TriggerRegisterEnterRectSimple( gg_trg_OoB8, gg_rct_oob8 )
call TriggerAddAction( gg_trg_OoB8, function OoB8_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function OoB9_Actions takes nothing returns nothing
local location l = GetRectCenter(gg_rct_oobt9)
call SetUnitPositionLoc(GetTriggerUnit(), l)
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_OoB9 takes nothing returns nothing
set gg_trg_OoB9 = CreateTrigger()
call DisableTrigger( gg_trg_OoB9 )
call TriggerRegisterEnterRectSimple( gg_trg_OoB9, gg_rct_oob9 )
call TriggerAddAction( gg_trg_OoB9, function OoB9_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function OoB10_Actions takes nothing returns nothing
local location l = GetRectCenter(gg_rct_oobt10)
call SetUnitPositionLoc(GetTriggerUnit(), l)
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_OoB10 takes nothing returns nothing
set gg_trg_OoB10 = CreateTrigger()
call TriggerRegisterEnterRectSimple( gg_trg_OoB10, gg_rct_oob10 )
call TriggerAddAction( gg_trg_OoB10, function OoB10_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function OoB11_Actions takes nothing returns nothing
local location l = GetRectCenter(gg_rct_oobt11)
call SetUnitPositionLoc(GetTriggerUnit(), l)
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_OoB11 takes nothing returns nothing
set gg_trg_OoB11 = CreateTrigger()
call TriggerRegisterEnterRectSimple( gg_trg_OoB11, gg_rct_oob11 )
call TriggerAddAction( gg_trg_OoB11, function OoB11_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function OoB12_Actions takes nothing returns nothing
local location l = GetRectCenter(gg_rct_oobt12)
call SetUnitPositionLoc(GetTriggerUnit(), l)
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_OoB12 takes nothing returns nothing
set gg_trg_OoB12 = CreateTrigger()
call TriggerRegisterEnterRectSimple( gg_trg_OoB12, gg_rct_oob12 )
call TriggerAddAction( gg_trg_OoB12, function OoB12_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function OoB13_Actions takes nothing returns nothing
local location l = GetRectCenter(gg_rct_oobt13)
call SetUnitPositionLoc(GetTriggerUnit(), l)
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_OoB13 takes nothing returns nothing
set gg_trg_OoB13 = CreateTrigger()
call TriggerRegisterEnterRectSimple( gg_trg_OoB13, gg_rct_oob13 )
call TriggerAddAction( gg_trg_OoB13, function OoB13_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function OoB14_Actions takes nothing returns nothing
local location l = GetRectCenter(gg_rct_oobt14)
call SetUnitPositionLoc(GetTriggerUnit(), l)
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_OoB14 takes nothing returns nothing
set gg_trg_OoB14 = CreateTrigger()
call TriggerRegisterEnterRectSimple( gg_trg_OoB14, gg_rct_oob14 )
call TriggerAddAction( gg_trg_OoB14, function OoB14_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function OoB15_Actions takes nothing returns nothing
local location l = GetRectCenter(gg_rct_oobt15)
call SetUnitPositionLoc(GetTriggerUnit(), l)
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_OoB15 takes nothing returns nothing
set gg_trg_OoB15 = CreateTrigger()
call TriggerRegisterEnterRectSimple( gg_trg_OoB15, gg_rct_oob15 )
call TriggerAddAction( gg_trg_OoB15, function OoB15_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function OoB16_Actions takes nothing returns nothing
local location l = GetRectCenter(gg_rct_oobt16)
call SetUnitPositionLoc(GetTriggerUnit(), l)
call RemoveLocation(l)
set l = null
endfunction
function InitTrig_OoB16 takes nothing returns nothing
set gg_trg_OoB16 = CreateTrigger()
call TriggerRegisterEnterRectSimple( gg_trg_OoB16, gg_rct_oob16 )
call TriggerAddAction( gg_trg_OoB16, function OoB16_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Horizontal_Bounce_Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function Trig_Horizontal_Bounce_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
if RectContainsLoc(gg_rct_TopGate, ul)==false and RectContainsLoc(gg_rct_BottomGate, ul)==false then
set ang = 360-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endif
endfunction
//===========================================================================
function InitTrig_Horizontal_Bounce takes nothing returns nothing
set gg_trg_Horizontal_Bounce = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall1 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall3 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall5 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall7 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall9 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall11 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall13 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall15 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall17 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall19 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall21 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall23 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall25 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall27 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall45 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall47 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall49 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall51 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall55 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall57 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall61 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall63 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall65 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce, gg_rct_Wall67 )
call TriggerAddCondition( gg_trg_Horizontal_Bounce, Condition( function Trig_Horizontal_Bounce_Conditions ) )
call TriggerAddAction( gg_trg_Horizontal_Bounce, function Trig_Horizontal_Bounce_Actions )
endfunction
//TESH.scrollpos=23
//TESH.alwaysfold=0
function Trig_Horizontal_BounceSConditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function Trig_Horizontal_BounceSActions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
loop
exitwhen ang<360
set ang = ang-360
endloop
loop
exitwhen ang>0
set ang = ang+360
endloop
if ang<180 then
set ang = 360-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
endif
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
set u = null
endfunction
//===========================================================================
function InitTrig_Horizontal_Bounce_South takes nothing returns nothing
set gg_trg_Horizontal_Bounce_South = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce_South, gg_rct_Wall59S )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce_South, gg_rct_Wall43 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce_South, gg_rct_Wall39 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce_South, gg_rct_Wall35 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce_South, gg_rct_Wall29 )
call TriggerAddCondition( gg_trg_Horizontal_Bounce_South, Condition( function Trig_Horizontal_BounceSConditions ) )
call TriggerAddAction( gg_trg_Horizontal_Bounce_South, function Trig_Horizontal_BounceSActions )
endfunction
//TESH.scrollpos=31
//TESH.alwaysfold=0
function Trig_Horizontal_BounceNConditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function Trig_Horizontal_BounceNActions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
loop
exitwhen ang<360
set ang = ang-360
endloop
loop
exitwhen ang>0
set ang = ang+360
endloop
if ang>180 then
set ang = 360-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
loop
exitwhen ang>0
set ang = ang+360
endloop
endif
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
set u = null
endfunction
//===========================================================================
function InitTrig_Horizontal_Bounce_North takes nothing returns nothing
set gg_trg_Horizontal_Bounce_North = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce_North, gg_rct_Wall53N )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce_North, gg_rct_Wall41 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce_North, gg_rct_Wall37 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce_North, gg_rct_Wall33 )
call TriggerRegisterEnterRectSimple( gg_trg_Horizontal_Bounce_North, gg_rct_Wall31 )
call TriggerAddCondition( gg_trg_Horizontal_Bounce_North, Condition( function Trig_Horizontal_BounceNConditions ) )
call TriggerAddAction( gg_trg_Horizontal_Bounce_North, function Trig_Horizontal_BounceNActions )
endfunction
//TESH.scrollpos=40
//TESH.alwaysfold=0
function VBounce_Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function VBounce_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
if RectContainsLoc(gg_rct_LeftGate, ul)==false and RectContainsLoc(gg_rct_RightGate, ul)==false then
set ang = 180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endif
endfunction
//===========================================================================
function InitTrig_Vertical_Bounce takes nothing returns nothing
set gg_trg_Vertical_Bounce = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall2 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall4 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall6 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall8 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall10 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall12 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall14 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall16 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall18 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall20 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall22 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall24 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall26 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall28 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall46 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall48 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall52 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall54 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall58 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall60 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall62 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall64 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall66 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce, gg_rct_Wall68 )
call TriggerAddCondition( gg_trg_Vertical_Bounce, Condition( function VBounce_Conditions ) )
call TriggerAddAction( gg_trg_Vertical_Bounce, function VBounce_Actions )
endfunction
//TESH.scrollpos=27
//TESH.alwaysfold=0
function VBounceEConditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function VBounceEActions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
loop
exitwhen ang<360
set ang = ang-360
endloop
loop
exitwhen ang>0
set ang = ang+360
endloop
if ang>90 and ang<270 then
set ang = 180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
endif
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
set u = null
endfunction
//===========================================================================
function InitTrig_Vertical_Bounce_East takes nothing returns nothing
set gg_trg_Vertical_Bounce_East = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce_East, gg_rct_Wall50E )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce_East, gg_rct_Wall32 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce_East, gg_rct_Wall44 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce_East, gg_rct_Wall40 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce_East, gg_rct_Wall36 )
call TriggerAddCondition( gg_trg_Vertical_Bounce_East, Condition( function VBounceEConditions ) )
call TriggerAddAction( gg_trg_Vertical_Bounce_East, function VBounceEActions )
endfunction
//TESH.scrollpos=23
//TESH.alwaysfold=0
function VBounceWConditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function VBounceWActions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
loop
exitwhen ang<360
set ang = ang-360
endloop
loop
exitwhen ang>0
set ang = ang+360
endloop
if (ang>=0 and ang<90) or (ang>270 and ang<360) then
set ang = 180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
endif
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
set u = null
endfunction
//===========================================================================
function InitTrig_Vertical_Bounce_West takes nothing returns nothing
set gg_trg_Vertical_Bounce_West = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce_West, gg_rct_Wall56W )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce_West, gg_rct_Wall38 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce_West, gg_rct_Wall42 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce_West, gg_rct_Wall30 )
call TriggerRegisterEnterRectSimple( gg_trg_Vertical_Bounce_West, gg_rct_Wall34 )
call TriggerAddCondition( gg_trg_Vertical_Bounce_West, Condition( function VBounceWConditions ) )
call TriggerAddAction( gg_trg_Vertical_Bounce_West, function VBounceWActions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function TLB1Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TLB1Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_TLCorner1), GetRectMinY(gg_rct_TLCorner1))
local real dir = AngleBetweenPoints(corner, ul)
local boolean b
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TLBounce1 takes nothing returns nothing
set gg_trg_TLBounce1 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TLBounce1, gg_rct_TLCorner1)
call TriggerAddCondition( gg_trg_TLBounce1, Condition( function TLB1Conditions ) )
call TriggerAddAction( gg_trg_TLBounce1, function TLB1Actions )
endfunction
//TESH.scrollpos=5
//TESH.alwaysfold=0
function TLB2Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TLB2Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_TLCorner2), GetRectMinY(gg_rct_TLCorner2))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TLBounce2 takes nothing returns nothing
set gg_trg_TLBounce2 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TLBounce2, gg_rct_TLCorner2)
call TriggerAddCondition( gg_trg_TLBounce2, Condition( function TLB2Conditions ) )
call TriggerAddAction( gg_trg_TLBounce2, function TLB2Actions )
endfunction
//TESH.scrollpos=5
//TESH.alwaysfold=0
function TLB3Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TLB3Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_TLCorner3), GetRectMinY(gg_rct_TLCorner3))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TLBounce3 takes nothing returns nothing
set gg_trg_TLBounce3 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TLBounce3, gg_rct_TLCorner3)
call TriggerAddCondition( gg_trg_TLBounce3, Condition( function TLB3Conditions ) )
call TriggerAddAction( gg_trg_TLBounce3, function TLB3Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function TLB4Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TLB4Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_TLCorner4), GetRectMinY(gg_rct_TLCorner4))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TLBounce4 takes nothing returns nothing
set gg_trg_TLBounce4 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TLBounce4, gg_rct_TLCorner4)
call TriggerAddCondition( gg_trg_TLBounce4, Condition( function TLB4Conditions ) )
call TriggerAddAction( gg_trg_TLBounce4, function TLB4Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function TLB5Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TLB5Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_TLCorner5), GetRectMinY(gg_rct_TLCorner5))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TLBounce5 takes nothing returns nothing
set gg_trg_TLBounce5 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TLBounce5, gg_rct_TLCorner5)
call TriggerAddCondition( gg_trg_TLBounce5, Condition( function TLB5Conditions ) )
call TriggerAddAction( gg_trg_TLBounce5, function TLB5Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function TLB6Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TLB6Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_TLCorner6), GetRectMinY(gg_rct_TLCorner6))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TLBounce6 takes nothing returns nothing
set gg_trg_TLBounce6 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TLBounce6, gg_rct_TLCorner6)
call TriggerAddCondition( gg_trg_TLBounce6, Condition( function TLB6Conditions ) )
call TriggerAddAction( gg_trg_TLBounce6, function TLB6Actions )
endfunction
//TESH.scrollpos=5
//TESH.alwaysfold=0
function TLB7Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TLB7Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_TLCorner7), GetRectMinY(gg_rct_TLCorner7))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TLBounce7 takes nothing returns nothing
set gg_trg_TLBounce7 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TLBounce7, gg_rct_TLCorner7)
call TriggerAddCondition( gg_trg_TLBounce7, Condition( function TLB7Conditions ) )
call TriggerAddAction( gg_trg_TLBounce7, function TLB7Actions )
endfunction
//TESH.scrollpos=8
//TESH.alwaysfold=0
function TLB8Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TLB8Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_TLCorner8), GetRectMinY(gg_rct_TLCorner8))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TLBounce8 takes nothing returns nothing
set gg_trg_TLBounce8 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TLBounce8, gg_rct_TLCorner8)
call TriggerAddCondition( gg_trg_TLBounce8, Condition( function TLB8Conditions ) )
call TriggerAddAction( gg_trg_TLBounce8, function TLB8Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function TLB9Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TLB9Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_TLCorner9), GetRectMinY(gg_rct_TLCorner9))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TLBounce9 takes nothing returns nothing
set gg_trg_TLBounce9 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TLBounce9, gg_rct_TLCorner9)
call TriggerAddCondition( gg_trg_TLBounce9, Condition( function TLB9Conditions ) )
call TriggerAddAction( gg_trg_TLBounce9, function TLB9Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function TLB10Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TLB10Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_TLCorner10), GetRectMinY(gg_rct_TLCorner10))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TLBounce10 takes nothing returns nothing
set gg_trg_TLBounce10 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TLBounce10, gg_rct_TLCorner10)
call TriggerAddCondition( gg_trg_TLBounce10, Condition( function TLB10Conditions ) )
call TriggerAddAction( gg_trg_TLBounce10, function TLB10Actions )
endfunction
//TESH.scrollpos=8
//TESH.alwaysfold=0
function TLB11Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TLB11Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_TLCorner11), GetRectMinY(gg_rct_TLCorner11))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TLBounce11 takes nothing returns nothing
set gg_trg_TLBounce11 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TLBounce11, gg_rct_TLCorner11)
call TriggerAddCondition( gg_trg_TLBounce11, Condition( function TLB11Conditions ) )
call TriggerAddAction( gg_trg_TLBounce11, function TLB11Actions )
endfunction
//TESH.scrollpos=8
//TESH.alwaysfold=0
function TLB12Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TLB12Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_TLCorner12), GetRectMinY(gg_rct_TLCorner12))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TLBounce12 takes nothing returns nothing
set gg_trg_TLBounce12 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TLBounce12, gg_rct_TLCorner12)
call TriggerAddCondition( gg_trg_TLBounce12, Condition( function TLB12Conditions ) )
call TriggerAddAction( gg_trg_TLBounce12, function TLB12Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function TLB13Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TLB13Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_TLCorner13), GetRectMinY(gg_rct_TLCorner13))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TLBounce13 takes nothing returns nothing
set gg_trg_TLBounce13 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TLBounce13, gg_rct_TLCorner13)
call TriggerAddCondition( gg_trg_TLBounce13, Condition( function TLB13Conditions ) )
call TriggerAddAction( gg_trg_TLBounce13, function TLB13Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function TRB1Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TRB1Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_TRCorner1), GetRectMinY(gg_rct_TRCorner1))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TRBounce1 takes nothing returns nothing
set gg_trg_TRBounce1 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TRBounce1, gg_rct_TRCorner1)
call TriggerAddCondition( gg_trg_TRBounce1, Condition( function TRB1Conditions ) )
call TriggerAddAction( gg_trg_TRBounce1, function TRB1Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function TRB2Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TRB2Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_TRCorner2), GetRectMinY(gg_rct_TRCorner2))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TRBounce2 takes nothing returns nothing
set gg_trg_TRBounce2 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TRBounce2, gg_rct_TRCorner2)
call TriggerAddCondition( gg_trg_TRBounce2, Condition( function TRB2Conditions ) )
call TriggerAddAction( gg_trg_TRBounce2, function TRB2Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function TRB3Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TRB3Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_TRCorner3), GetRectMinY(gg_rct_TRCorner3))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TRBounce3 takes nothing returns nothing
set gg_trg_TRBounce3 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TRBounce3, gg_rct_TRCorner3)
call TriggerAddCondition( gg_trg_TRBounce3, Condition( function TRB3Conditions ) )
call TriggerAddAction( gg_trg_TRBounce3, function TRB3Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function TRB4Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TRB4Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_TRCorner4), GetRectMinY(gg_rct_TRCorner4))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TRBounce4 takes nothing returns nothing
set gg_trg_TRBounce4 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TRBounce4, gg_rct_TRCorner4)
call TriggerAddCondition( gg_trg_TRBounce4, Condition( function TRB4Conditions ) )
call TriggerAddAction( gg_trg_TRBounce4, function TRB4Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function TRB5Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TRB5Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_TRCorner5), GetRectMinY(gg_rct_TRCorner5))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TRBounce5 takes nothing returns nothing
set gg_trg_TRBounce5 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TRBounce5, gg_rct_TRCorner5)
call TriggerAddCondition( gg_trg_TRBounce5, Condition( function TRB5Conditions ) )
call TriggerAddAction( gg_trg_TRBounce5, function TRB5Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function TRB6Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TRB6Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_TRCorner6), GetRectMinY(gg_rct_TRCorner6))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TRBounce6 takes nothing returns nothing
set gg_trg_TRBounce6 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TRBounce6, gg_rct_TRCorner6)
call TriggerAddCondition( gg_trg_TRBounce6, Condition( function TRB6Conditions ) )
call TriggerAddAction( gg_trg_TRBounce6, function TRB6Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function TRB7Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TRB7Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_TRCorner7), GetRectMinY(gg_rct_TRCorner7))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TRBounce7 takes nothing returns nothing
set gg_trg_TRBounce7 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TRBounce7, gg_rct_TRCorner7)
call TriggerAddCondition( gg_trg_TRBounce7, Condition( function TRB7Conditions ) )
call TriggerAddAction( gg_trg_TRBounce7, function TRB7Actions )
endfunction
//TESH.scrollpos=8
//TESH.alwaysfold=0
function TRB8Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TRB8Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_TRCorner8), GetRectMinY(gg_rct_TRCorner8))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TRBounce8 takes nothing returns nothing
set gg_trg_TRBounce8 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TRBounce8, gg_rct_TRCorner8)
call TriggerAddCondition( gg_trg_TRBounce8, Condition( function TRB8Conditions ) )
call TriggerAddAction( gg_trg_TRBounce8, function TRB8Actions )
endfunction
//TESH.scrollpos=8
//TESH.alwaysfold=0
function TRB9Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TRB9Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_TRCorner9), GetRectMinY(gg_rct_TRCorner9))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TRBounce9 takes nothing returns nothing
set gg_trg_TRBounce9 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TRBounce9, gg_rct_TRCorner9)
call TriggerAddCondition( gg_trg_TRBounce9, Condition( function TRB9Conditions ) )
call TriggerAddAction( gg_trg_TRBounce9, function TRB9Actions )
endfunction
//TESH.scrollpos=8
//TESH.alwaysfold=0
function TRB10Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TRB10Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_TRCorner10), GetRectMinY(gg_rct_TRCorner10))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TRBounce10 takes nothing returns nothing
set gg_trg_TRBounce10 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TRBounce10, gg_rct_TRCorner10)
call TriggerAddCondition( gg_trg_TRBounce10, Condition( function TRB10Conditions ) )
call TriggerAddAction( gg_trg_TRBounce10, function TRB10Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function TRB11Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TRB11Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_TRCorner11), GetRectMinY(gg_rct_TRCorner11))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TRBounce11 takes nothing returns nothing
set gg_trg_TRBounce11 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TRBounce11, gg_rct_TRCorner11)
call TriggerAddCondition( gg_trg_TRBounce11, Condition( function TRB11Conditions ) )
call TriggerAddAction( gg_trg_TRBounce11, function TRB11Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function TRB12Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TRB12Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_TRCorner12), GetRectMinY(gg_rct_TRCorner12))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TRBounce12 takes nothing returns nothing
set gg_trg_TRBounce12 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TRBounce12, gg_rct_TRCorner12)
call TriggerAddCondition( gg_trg_TRBounce12, Condition( function TRB12Conditions ) )
call TriggerAddAction( gg_trg_TRBounce12, function TRB12Actions )
endfunction
//TESH.scrollpos=11
//TESH.alwaysfold=0
function TRB13Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function TRB13Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_TRCorner13), GetRectMinY(gg_rct_TRCorner13))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_TRBounce13 takes nothing returns nothing
set gg_trg_TRBounce13 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_TRBounce13, gg_rct_TRCorner13)
call TriggerAddCondition( gg_trg_TRBounce13, Condition( function TRB13Conditions ) )
call TriggerAddAction( gg_trg_TRBounce13, function TRB13Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function BLB1Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BLB1Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_BLCorner1), GetRectMaxY(gg_rct_BLCorner1))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BLBounce1 takes nothing returns nothing
set gg_trg_BLBounce1 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BLBounce1, gg_rct_BLCorner1)
call TriggerAddCondition( gg_trg_BLBounce1, Condition( function BLB1Conditions ) )
call TriggerAddAction( gg_trg_BLBounce1, function BLB1Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function BLB2Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BLB2Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_BLCorner2), GetRectMaxY(gg_rct_BLCorner2))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BLBounce2 takes nothing returns nothing
set gg_trg_BLBounce2 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BLBounce2, gg_rct_BLCorner2)
call TriggerAddCondition( gg_trg_BLBounce2, Condition( function BLB2Conditions ) )
call TriggerAddAction( gg_trg_BLBounce2, function BLB2Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function BLB3Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BLB3Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_BLCorner3), GetRectMaxY(gg_rct_BLCorner3))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BLBounce3 takes nothing returns nothing
set gg_trg_BLBounce3 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BLBounce3, gg_rct_BLCorner3)
call TriggerAddCondition( gg_trg_BLBounce3, Condition( function BLB3Conditions ) )
call TriggerAddAction( gg_trg_BLBounce3, function BLB3Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function BLB4Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BLB4Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_BLCorner4), GetRectMaxY(gg_rct_BLCorner4))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BLBounce4 takes nothing returns nothing
set gg_trg_BLBounce4 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BLBounce4, gg_rct_BLCorner4)
call TriggerAddCondition( gg_trg_BLBounce4, Condition( function BLB4Conditions ) )
call TriggerAddAction( gg_trg_BLBounce4, function BLB4Actions )
endfunction
//TESH.scrollpos=5
//TESH.alwaysfold=0
function BLB5Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BLB5Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_BLCorner5), GetRectMaxY(gg_rct_BLCorner5))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BLBounce5 takes nothing returns nothing
set gg_trg_BLBounce5 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BLBounce5, gg_rct_BLCorner5)
call TriggerAddCondition( gg_trg_BLBounce5, Condition( function BLB5Conditions ) )
call TriggerAddAction( gg_trg_BLBounce5, function BLB5Actions )
endfunction
//TESH.scrollpos=8
//TESH.alwaysfold=0
function BLB6Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BLB6Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_BLCorner6), GetRectMaxY(gg_rct_BLCorner6))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BLBounce6 takes nothing returns nothing
set gg_trg_BLBounce6 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BLBounce6, gg_rct_BLCorner6)
call TriggerAddCondition( gg_trg_BLBounce6, Condition( function BLB6Conditions ) )
call TriggerAddAction( gg_trg_BLBounce6, function BLB6Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function BLB7Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BLB7Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_BLCorner7), GetRectMaxY(gg_rct_BLCorner7))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BLBounce7 takes nothing returns nothing
set gg_trg_BLBounce7 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BLBounce7, gg_rct_BLCorner7)
call TriggerAddCondition( gg_trg_BLBounce7, Condition( function BLB7Conditions ) )
call TriggerAddAction( gg_trg_BLBounce7, function BLB7Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function BLB8Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BLB8Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_BLCorner8), GetRectMaxY(gg_rct_BLCorner8))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BLBounce8 takes nothing returns nothing
set gg_trg_BLBounce8 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BLBounce8, gg_rct_BLCorner8)
call TriggerAddCondition( gg_trg_BLBounce8, Condition( function BLB8Conditions ) )
call TriggerAddAction( gg_trg_BLBounce8, function BLB8Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function BLB9Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BLB9Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_BLCorner9), GetRectMaxY(gg_rct_BLCorner9))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BLBounce9 takes nothing returns nothing
set gg_trg_BLBounce9 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BLBounce9, gg_rct_BLCorner9)
call TriggerAddCondition( gg_trg_BLBounce9, Condition( function BLB9Conditions ) )
call TriggerAddAction( gg_trg_BLBounce9, function BLB9Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function BLB10Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BLB10Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_BLCorner10), GetRectMaxY(gg_rct_BLCorner10))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BLBounce10 takes nothing returns nothing
set gg_trg_BLBounce10 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BLBounce10, gg_rct_BLCorner10)
call TriggerAddCondition( gg_trg_BLBounce10, Condition( function BLB10Conditions ) )
call TriggerAddAction( gg_trg_BLBounce10, function BLB10Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function BLB11Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BLB11Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_BLCorner11), GetRectMaxY(gg_rct_BLCorner11))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BLBounce11 takes nothing returns nothing
set gg_trg_BLBounce11 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BLBounce11, gg_rct_BLCorner11)
call TriggerAddCondition( gg_trg_BLBounce11, Condition( function BLB11Conditions ) )
call TriggerAddAction( gg_trg_BLBounce11, function BLB11Actions )
endfunction
//TESH.scrollpos=15
//TESH.alwaysfold=0
function BLB12Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BLB12Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_BLCorner12), GetRectMaxY(gg_rct_BLCorner12))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BLBounce12 takes nothing returns nothing
set gg_trg_BLBounce12 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BLBounce12, gg_rct_BLCorner12)
call TriggerAddCondition( gg_trg_BLBounce12, Condition( function BLB12Conditions ) )
call TriggerAddAction( gg_trg_BLBounce12, function BLB12Actions )
endfunction
//TESH.scrollpos=15
//TESH.alwaysfold=0
function BLB13Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BLB13Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMaxX(gg_rct_BLCorner13), GetRectMaxY(gg_rct_BLCorner13))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BLBounce13 takes nothing returns nothing
set gg_trg_BLBounce13 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BLBounce13, gg_rct_BLCorner13)
call TriggerAddCondition( gg_trg_BLBounce13, Condition( function BLB13Conditions ) )
call TriggerAddAction( gg_trg_BLBounce13, function BLB13Actions )
endfunction
//TESH.scrollpos=15
//TESH.alwaysfold=0
function BRB1Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BRB1Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_BRCorner1), GetRectMaxY(gg_rct_BRCorner1))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BRBounce1 takes nothing returns nothing
set gg_trg_BRBounce1 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BRBounce1, gg_rct_BRCorner1)
call TriggerAddCondition( gg_trg_BRBounce1, Condition( function BRB1Conditions ) )
call TriggerAddAction( gg_trg_BRBounce1, function BRB1Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function BRB2Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BRB2Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_BRCorner2), GetRectMaxY(gg_rct_BRCorner2))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BRBounce2 takes nothing returns nothing
set gg_trg_BRBounce2 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BRBounce2, gg_rct_BRCorner2)
call TriggerAddCondition( gg_trg_BRBounce2, Condition( function BRB2Conditions ) )
call TriggerAddAction( gg_trg_BRBounce2, function BRB2Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function BRB3Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BRB3Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_BRCorner3), GetRectMaxY(gg_rct_BRCorner3))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BRBounce3 takes nothing returns nothing
set gg_trg_BRBounce3 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BRBounce3, gg_rct_BRCorner3)
call TriggerAddCondition( gg_trg_BRBounce3, Condition( function BRB3Conditions ) )
call TriggerAddAction( gg_trg_BRBounce3, function BRB3Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function BRB4Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BRB4Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_BRCorner4), GetRectMaxY(gg_rct_BRCorner4))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BRBounce4 takes nothing returns nothing
set gg_trg_BRBounce4 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BRBounce4, gg_rct_BRCorner4)
call TriggerAddCondition( gg_trg_BRBounce4, Condition( function BRB4Conditions ) )
call TriggerAddAction( gg_trg_BRBounce4, function BRB4Actions )
endfunction
//TESH.scrollpos=15
//TESH.alwaysfold=0
function BRB5Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BRB5Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_BRCorner5), GetRectMaxY(gg_rct_BRCorner5))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BRBounce5 takes nothing returns nothing
set gg_trg_BRBounce5 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BRBounce5, gg_rct_BRCorner5)
call TriggerAddCondition( gg_trg_BRBounce5, Condition( function BRB5Conditions ) )
call TriggerAddAction( gg_trg_BRBounce5, function BRB5Actions )
endfunction
//TESH.scrollpos=15
//TESH.alwaysfold=0
function BRB6Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BRB6Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_BRCorner6), GetRectMaxY(gg_rct_BRCorner6))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BRBounce6 takes nothing returns nothing
set gg_trg_BRBounce6 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BRBounce6, gg_rct_BRCorner6)
call TriggerAddCondition( gg_trg_BRBounce6, Condition( function BRB6Conditions ) )
call TriggerAddAction( gg_trg_BRBounce6, function BRB6Actions )
endfunction
//TESH.scrollpos=15
//TESH.alwaysfold=0
function BRB7Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BRB7Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_BRCorner7), GetRectMaxY(gg_rct_BRCorner7))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BRBounce7 takes nothing returns nothing
set gg_trg_BRBounce7 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BRBounce7, gg_rct_BRCorner7)
call TriggerAddCondition( gg_trg_BRBounce7, Condition( function BRB7Conditions ) )
call TriggerAddAction( gg_trg_BRBounce7, function BRB7Actions )
endfunction
//TESH.scrollpos=15
//TESH.alwaysfold=0
function BRB8Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BRB8Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_BRCorner8), GetRectMaxY(gg_rct_BRCorner8))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BRBounce8 takes nothing returns nothing
set gg_trg_BRBounce8 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BRBounce8, gg_rct_BRCorner8)
call TriggerAddCondition( gg_trg_BRBounce8, Condition( function BRB8Conditions ) )
call TriggerAddAction( gg_trg_BRBounce8, function BRB8Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function BRB9Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BRB9Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_BRCorner9), GetRectMaxY(gg_rct_BRCorner9))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BRBounce9 takes nothing returns nothing
set gg_trg_BRBounce9 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BRBounce9, gg_rct_BRCorner9)
call TriggerAddCondition( gg_trg_BRBounce9, Condition( function BRB9Conditions ) )
call TriggerAddAction( gg_trg_BRBounce9, function BRB9Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function BRB10Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BRB10Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_BRCorner10), GetRectMaxY(gg_rct_BRCorner10))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BRBounce10 takes nothing returns nothing
set gg_trg_BRBounce10 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BRBounce10, gg_rct_BRCorner10)
call TriggerAddCondition( gg_trg_BRBounce10, Condition( function BRB10Conditions ) )
call TriggerAddAction( gg_trg_BRBounce10, function BRB10Actions )
endfunction
//TESH.scrollpos=15
//TESH.alwaysfold=0
function BRB11Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BRB11Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_BRCorner11), GetRectMaxY(gg_rct_BRCorner11))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BRBounce11 takes nothing returns nothing
set gg_trg_BRBounce11 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BRBounce11, gg_rct_BRCorner11)
call TriggerAddCondition( gg_trg_BRBounce11, Condition( function BRB11Conditions ) )
call TriggerAddAction( gg_trg_BRBounce11, function BRB11Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function BRB12Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BRB12Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_BRCorner12), GetRectMaxY(gg_rct_BRCorner12))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BRBounce12 takes nothing returns nothing
set gg_trg_BRBounce12 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BRBounce12, gg_rct_BRCorner12)
call TriggerAddCondition( gg_trg_BRBounce12, Condition( function BRB12Conditions ) )
call TriggerAddAction( gg_trg_BRBounce12, function BRB12Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function BRB13Conditions takes nothing returns boolean
return IsUnitInGroup(GetTriggerUnit(), udg_BowlGroup)
endfunction
function BRB13Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer cv = GetUnitUserData(u)
local integer ang = ModuloInteger(cv, 1000)
local integer dist = (cv/1000)
local location ul = GetUnitLoc(u)
local location v
local location corner = Location(GetRectMinX(gg_rct_BRCorner13), GetRectMaxY(gg_rct_BRCorner13))
local real dir = AngleBetweenPoints(corner, ul)
set ang = (2*R2I(dir))-180-ang
loop
exitwhen ang>0
set ang = ang+360
endloop
loop
exitwhen ang<360
set ang = ang-360
endloop
if IsUnitInGroup(u, udg_Kicked) then
call KickBounceDamage(u, udg_Caveman[GetConvertedPlayerId(GetOwningPlayer(u))], dist)
endif
call SetUnitUserData(u, dist*1000+ang)
call RemoveLocation(ul)
set ul = null
call RemoveLocation(v)
set v = null
call RemoveLocation(corner)
set corner = null
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl", ul))
set u = null
endfunction
function InitTrig_BRBounce13 takes nothing returns nothing
set gg_trg_BRBounce13 = CreateTrigger( )
call TriggerRegisterEnterRectSimple(gg_trg_BRBounce13, gg_rct_BRCorner13)
call TriggerAddCondition( gg_trg_BRBounce13, Condition( function BRB13Conditions ) )
call TriggerAddAction( gg_trg_BRBounce13, function BRB13Actions )
endfunction