Name | Type | is_array | initial_value |
Angle | real | No | |
BAT_Angle | real | Yes | |
BAT_Caster | unit | No | |
BAT_ClosestAoE | real | No | |
BAT_ClosestDistance | real | No | |
BAT_ClosestGroup | group | No | |
BAT_ClosestGroupUnits | unit | No | |
BAT_Distance | real | Yes | |
BAT_DistanceKeeper | unit | Yes | |
BAT_Duration | real | Yes | |
BAT_EmptyGroupChecker | integer | No | |
BAT_Group | group | No | |
BAT_Height | real | Yes | |
BAT_LocDummy | unit | Yes | |
BAT_MaxIndex | integer | No | |
BAT_PickedUnits | unit | No | |
BAT_Player | player | Yes | |
BAT_RandomUnit | unit | Yes | |
BAT_TempIndex | integer | No | |
BAT_TempPoint | location | No | |
BAT_TempPoint2 | location | No | |
BAT_TempPoint3 | location | No | |
BAT_TempPoint4 | location | No | |
BAT_TotalDistance | real | No | |
Camera_Distance | real | No | |
CenterPoint | location | No | |
DC_Angle | real | No | |
DC_Caster | unit | No | |
DC_Player | player | No | |
DC_TempPoint | location | No | |
DC_TempPoint2 | location | No | |
EL_Angle | real | No | |
EL_Dummy | unit | No | |
EL_Duration | real | Yes | |
EL_Electricity | unit | Yes | |
EL_Fire | unit | Yes | |
EL_Formation | real | No | |
EL_Frost | unit | Yes | |
EL_Group | group | No | |
EL_Magnetism | unit | Yes | |
EL_MaxIndex | integer | No | |
EL_PickedUnits | unit | No | |
EL_Player | player | Yes | |
EL_TempIndex | integer | No | |
EL_TempPoint | location | No | |
EL_TempPoint2 | location | No | |
EL_Triggering | unit | Yes | |
Elements | abilcode | Yes | |
EOB_TriggeringUnit | unit | No | |
ER_Caster | unit | No | |
ER_Dummy | unit | No | |
ER_Group | group | No | |
ER_PickedUnits | unit | No | |
ER_Player | player | No | |
ER_TempPoint | location | No | |
FR_Angle | real | Yes | |
FR_Distance | real | Yes | |
FR_DistanceTravelled | real | Yes | |
FR_FakeRock | unit | Yes | |
FR_NextNode | integer | Yes | |
FR_NodeNumber | integer | No | |
FR_PrevNode | integer | Yes | |
FR_RecyclableNodes | integer | No | |
FR_RecycleNodes | integer | Yes | |
FR_SFX | effect | Yes | |
FR_Timer | timer | No | |
KB_Angle | real | Yes | |
KB_Caster | unit | Yes | |
KB_Duration | real | Yes | |
KB_MaxIndex | integer | No | |
KB_Offset | real | Yes | |
KB_Target | unit | Yes | |
KB_TempIndex | integer | No | |
KB_TempPoint | location | No | |
KB_TempPoint2 | location | No | |
KB_TempPoint3 | location | No | |
KillingDyingPlayer | player | No | |
KillingKillingPlayer | player | No | |
KillingKillingUnit | unit | No | |
KillingTextInteger | integer | No | |
LeaverGroup | group | No | |
Leavers | force | No | |
MAG_Angle | real | No | |
MAG_Group | group | No | |
MAG_PickedUnits | unit | No | |
MAG_TempPoint | location | No | |
MAG_TempPoint2 | location | No | |
Multiboard | multiboard | No | |
NA_Caster | unit | Yes | |
NA_Counter | real | Yes | |
NA_Duration | real | Yes | |
NA_Missile | unit | Yes | |
NA_NextNode | integer | Yes | |
NA_NodeNumber | integer | No | |
NA_PrevNode | integer | Yes | |
NA_RecyclableNodes | integer | No | |
NA_RecycleNodes | integer | Yes | |
NA_SFX | effect | Yes | |
NA_TempRect | rect | No | |
NA_Timer | timer | No | |
NA_TNextNode | integer | Yes | |
NA_TNodeNumber | integer | No | |
NA_TPrevNode | integer | Yes | |
NA_TRecyclableNodes | integer | No | |
NA_TRecycleNodes | integer | Yes | |
NA_TSFX | effect | Yes | |
OD_Duration | real | Yes | |
OD_Essence | item | Yes | |
OD_MaxIndex | integer | No | |
OD_Player | player | Yes | |
OD_TempIndex | integer | No | |
OD_TempPoint | location | No | |
PickedPlayer | player | No | |
PlayerColors | string | Yes | |
PlayerCount | integer | No | |
PlayersOfControl | force | No | |
RE_Caster | unit | No | |
RE_TempPoint | location | No | |
RF_Boolean | boolean | Yes | |
RF_Height | real | Yes | |
RF_MaxIndex | integer | No | |
RF_Rock | unit | Yes | |
RF_SFX | effect | Yes | |
RF_TempIndex | integer | No | |
RF_TempPoint | location | No | |
Score | integer | Yes | |
ScoreAddition | integer | No | |
ScoreKillingUnit | unit | No | |
ScorePlayerADD | player | No | |
ScorePlayerSUB | player | No | |
ScoreSubtraction | integer | No | |
StartingLoc | location | No | |
tempint | integer | No | |
TP_Group | group | No | |
TP_TeleportingUnit | unit | No | |
TP_TempPoint | location | No | |
TP_TempPoint2 | location | No | |
TR_Angle | real | Yes | |
TR_AoE | real | No | |
TR_Caster | unit | Yes | |
TR_DistanceKeeper | unit | Yes | |
TR_DistanceLeft | real | Yes | |
TR_DistanceTravelled | real | Yes | |
TR_Group | group | No | |
TR_KBCaster | unit | No | |
TR_Knockback | unit | No | |
TR_MaxIndex | integer | No | |
TR_PickedUnits | unit | No | |
TR_Player | player | Yes | |
TR_Rock | unit | Yes | |
TR_SFX | effect | Yes | |
TR_TempIndex | integer | No | |
TR_TempPoint | location | No | |
TR_TempPoint2 | location | No | |
TR_TempPoint3 | location | No | |
TR_TotalDistance | real | No | |
TS_Decoy | unit | Yes | |
TS_NextNode | integer | Yes | |
TS_NodeNumber | integer | No | |
TS_PrevNode | integer | Yes | |
TS_RecyclableNodes | integer | No | |
TS_RecycleNodes | integer | Yes | |
TS_Target | unit | No | |
TS_TempGroup | group | No | |
TS_Timer | timer | No |
//TESH.scrollpos=11
//TESH.alwaysfold=0
function FR_Loop takes nothing returns nothing
local integer Node = 0
local real x
local real y
loop
set Node = udg_FR_NextNode[Node]
exitwhen Node == 0
if udg_FR_DistanceTravelled[Node] < udg_FR_Distance[Node] then
set x = GetUnitX(udg_FR_FakeRock[Node])
set y = GetUnitY(udg_FR_FakeRock[Node])
call SetUnitX(udg_FR_FakeRock[Node], x + 6.00 * Cos(udg_FR_Angle[Node]))
call SetUnitY(udg_FR_FakeRock[Node], y + 6.00 * Sin(udg_FR_Angle[Node]))
set udg_FR_DistanceTravelled[Node] = udg_FR_DistanceTravelled[Node] + 6.00
call SetUnitFlyHeight(udg_FR_FakeRock[Node], 4 * 550.00 * udg_FR_DistanceTravelled[Node] * (udg_FR_Distance[Node] - udg_FR_DistanceTravelled[Node]) / (udg_FR_Distance[Node] * udg_FR_Distance[Node] + 1.00), 0.00)
else
call DestroyEffect(udg_FR_SFX[Node])
call UnitApplyTimedLife(udg_FR_FakeRock[Node], 'BTLF', 0.01)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl", udg_FR_FakeRock[Node], "origin"))
set udg_FR_RecycleNodes[udg_FR_RecyclableNodes] = Node
set udg_FR_RecyclableNodes = udg_FR_RecyclableNodes + 1
set udg_FR_NextNode[udg_FR_PrevNode[Node]] = udg_FR_NextNode[Node]
set udg_FR_PrevNode[udg_FR_NextNode[Node]] = udg_FR_PrevNode[Node]
if (udg_FR_NextNode[0] == 0) then
call PauseTimer(udg_FR_Timer)
endif
endif
endloop
endfunction
function FR_OnCast takes nothing returns boolean
local real x
local real y
local real x2
local real y2
local real dx
local real dy
local integer Node
local player p
local unit u
if (GetSpellAbilityId() == 'A00R') then
if (udg_FR_RecyclableNodes == 0) then
set udg_FR_NodeNumber = udg_FR_NodeNumber + 1
set Node = udg_FR_NodeNumber
else
set udg_FR_RecyclableNodes = udg_FR_RecyclableNodes - 1
set Node = udg_FR_RecycleNodes[udg_FR_RecyclableNodes]
endif
set udg_FR_NextNode[Node] = 0
set udg_FR_NextNode[udg_FR_PrevNode[0]] = Node
set udg_FR_PrevNode[Node] = udg_FR_PrevNode[0]
set udg_FR_PrevNode[0] = Node
set u = GetTriggerUnit()
set p = GetTriggerPlayer()
set x = GetUnitX(u)
set y = GetUnitY(u)
set x2 = GetSpellTargetX()
set y2 = GetSpellTargetY()
set udg_FR_Angle[Node] = Atan2(y2 - y, x2 - x)
set dx = x2 - x
set dy = y2 - y
set udg_FR_Distance[Node] = SquareRoot(dx*dx + dy*dy)
set udg_FR_FakeRock[Node] = CreateUnit(p, 'h002', x, y, 0.00)
set udg_FR_SFX[Node] = AddSpecialEffectTarget("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl", udg_FR_FakeRock[Node], "origin")
set udg_FR_DistanceTravelled[Node] = 0.00
if (udg_FR_PrevNode[Node] == 0) then
call TimerStart(udg_FR_Timer, 0.03125000, true, function FR_Loop)
endif
set u = null
endif
return false
endfunction
function InitTrig_Fake_Rock takes nothing returns nothing
local trigger FR = CreateTrigger()
call TriggerAddCondition(FR, Condition(function FR_OnCast))
call TriggerRegisterAnyUnitEventBJ(FR, EVENT_PLAYER_UNIT_SPELL_EFFECT)
endfunction
//TESH.scrollpos=28
//TESH.alwaysfold=0
function BL_OnCast takes nothing returns boolean
local real x
local real y
local real x2
local real y2
local real dx
local real dy
local real d
local unit u
local unit fake
local real angle
local real speed
if (GetSpellAbilityId() == 'A00U') then
set u = GetTriggerUnit()
set speed = GetUnitMoveSpeed(u)
set x = GetUnitX(u)
set y = GetUnitY(u)
set x2 = GetSpellTargetX()
set y2 = GetSpellTargetY()
set dx = x2 - x
set dy = y2 - y
set d = SquareRoot(dx*dx + dy*dy)
set angle = Atan2(y2 - y, x2 - x)
if (GetUnitAbilityLevel(u, 'B006') > 0) then
set fake = CreateUnit(GetTriggerPlayer(), 'n002', x, y, angle)
call SetUnitMoveSpeed(u, speed)
if d > 600.00 then
call SetUnitX(fake, x + 600.00 * Cos(angle))
call SetUnitY(fake, y + 600.00 * Sin(angle))
else
call SetUnitX(fake, x + d * Cos(angle))
call SetUnitY(fake, y + d * Sin(angle))
endif
set x2 = GetUnitX(fake)
set y2 = GetUnitY(fake)
else
if d > 600.00 then
call SetUnitX(u, x + 600.00 * Cos(angle))
call SetUnitY(u, y + 600.00 * Sin(angle))
else
call SetUnitX(u, x + d * Cos(angle))
call SetUnitY(u, y + d * Sin(angle))
endif
set x2 = GetUnitX(u)
set y2 = GetUnitY(u)
endif
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl", x, y))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl", x2, y2))
if (GetUnitAbilityLevel(u, 'B006') > 0) then
set x2 = x2 + 1000.00 * Cos(angle)
set y2 = y2 + 1000.00 * Sin(angle)
call IssuePointOrder(fake, "move", x2, y2)
call UnitApplyTimedLife(fake, 'BTLF', 3.50)
set fake = null
call UnitRemoveAbility(u, 'B006')
endif
set u = null
endif
return false
endfunction
function InitTrig_Blink takes nothing returns nothing
local trigger BL = CreateTrigger()
call TriggerAddCondition(BL, Condition(function BL_OnCast))
call TriggerRegisterAnyUnitEventBJ(BL, EVENT_PLAYER_UNIT_SPELL_EFFECT)
endfunction
//TESH.scrollpos=11
//TESH.alwaysfold=0
function NA_Trees takes nothing returns nothing
local destructable tree
local real x
local real y
local unit u
local integer TempNode
set tree = GetEnumDestructable()
if GetDestructableLife(tree) > 0 then
set x = GetDestructableX(tree)
set y = GetDestructableY(tree)
if (udg_NA_TRecyclableNodes == 0) then
set udg_NA_TNodeNumber = udg_NA_TNodeNumber + 1
set TempNode = udg_NA_TNodeNumber
else
set udg_NA_TRecyclableNodes = udg_NA_TRecyclableNodes - 1
set TempNode = udg_NA_TRecycleNodes[udg_NA_TRecyclableNodes]
endif
set udg_NA_TNextNode[TempNode] = 0
set udg_NA_TNextNode[udg_NA_TPrevNode[0]] = TempNode
set udg_NA_TPrevNode[TempNode] = udg_NA_TPrevNode[0]
set udg_NA_TPrevNode[0] = TempNode
set udg_NA_Missile[TempNode] = CreateUnit(Player(14), 'h002', x, y, 0.00)
call SetUnitFlyHeight(udg_NA_Missile[TempNode], 50.00, 0.00)
set udg_NA_TSFX[TempNode] = AddSpecialEffectTarget("Abilities\\Weapons\\SkeletalMageMissile\\SkeletalMageMissile.mdl", udg_NA_Missile[TempNode], "origin")
call SetDestructableAnimation(tree, "stand hit")
endif
endfunction
function NA_Loop takes nothing returns nothing
local integer Node = 0
local integer TempNode = 0
local real x
local real y
local real x2
local real y2
local real dx
local real dy
local real d
local real angle
loop
set Node = udg_NA_NextNode[Node]
exitwhen Node == 0
set udg_NA_Duration[Node] = udg_NA_Duration[Node] - 0.031250
if udg_NA_Duration[Node] > 0.00 and not(IsUnitType(udg_NA_Caster[Node], UNIT_TYPE_DEAD)) and GetUnitTypeId(udg_NA_Caster[Node]) != 0 then
set x = GetUnitX(udg_NA_Caster[Node])
set y = GetUnitY(udg_NA_Caster[Node])
set udg_NA_Counter[Node] = udg_NA_Counter[Node] - 0.031250
if udg_NA_Counter[Node] < 0.00 then
set udg_NA_TempRect = Rect(0.00, 0.00, 0.00, 0.00)
call SetRect(udg_NA_TempRect, x - 375.00, y - 375.00, x + 375.00, y + 375.00)
call EnumDestructablesInRect(udg_NA_TempRect, null, function NA_Trees)
set udg_NA_Counter[Node] = 0.50
endif
loop
set TempNode = udg_NA_TNextNode[TempNode]
exitwhen TempNode == 0
set x2 = GetUnitX(udg_NA_Missile[TempNode])
set y2 = GetUnitY(udg_NA_Missile[TempNode])
set dx = x2 - x
set dy = y2 - y
set d = SquareRoot(dx*dx + dy*dy)
set angle = Atan2(y - y2, x - x2)
if d > 25.00 then
call SetUnitX(udg_NA_Missile[TempNode], x2 + 15.00 * Cos(angle))
call SetUnitY(udg_NA_Missile[TempNode], y2 + 15.00 * Sin(angle))
else
call DestroyEffect(udg_NA_TSFX[TempNode])
call UnitApplyTimedLife(udg_NA_Missile[TempNode], 'BTLF', 0.01)
call SetWidgetLife(udg_NA_Caster[Node], GetUnitState(udg_NA_Caster[Node], UNIT_STATE_LIFE) + 5.00)
set udg_NA_TRecycleNodes[udg_NA_TRecyclableNodes] = TempNode
set udg_NA_TRecyclableNodes = udg_NA_TRecyclableNodes + 1
set udg_NA_TNextNode[udg_NA_TPrevNode[TempNode]] = udg_NA_TNextNode[TempNode]
set udg_NA_TPrevNode[udg_NA_TNextNode[TempNode]] = udg_NA_TPrevNode[TempNode]
endif
endloop
else
loop
set TempNode = udg_NA_TNextNode[TempNode]
exitwhen TempNode == 0
call DestroyEffect(udg_NA_TSFX[TempNode])
call UnitApplyTimedLife(udg_NA_Missile[TempNode], 'BTLF', 0.01)
set udg_NA_TRecycleNodes[udg_NA_TRecyclableNodes] = TempNode
set udg_NA_TRecyclableNodes = udg_NA_TRecyclableNodes + 1
set udg_NA_TNextNode[udg_NA_TPrevNode[TempNode]] = udg_NA_TNextNode[TempNode]
set udg_NA_TPrevNode[udg_NA_TNextNode[TempNode]] = udg_NA_TPrevNode[TempNode]
endloop
call DestroyEffect(udg_NA_SFX[Node])
set udg_NA_RecycleNodes[udg_NA_RecyclableNodes] = Node
set udg_NA_RecyclableNodes = udg_NA_RecyclableNodes + 1
set udg_NA_NextNode[udg_NA_PrevNode[Node]] = udg_NA_NextNode[Node]
set udg_NA_PrevNode[udg_NA_NextNode[Node]] = udg_NA_PrevNode[Node]
if (udg_NA_NextNode[0] == 0) then
call PauseTimer(udg_NA_Timer)
endif
endif
endloop
endfunction
function NA_OnCast takes nothing returns boolean
local integer Node
if (GetSpellAbilityId() == 'A00Q') then
if (udg_NA_RecyclableNodes == 0) then
set udg_NA_NodeNumber = udg_NA_NodeNumber + 1
set Node = udg_NA_NodeNumber
else
set udg_NA_RecyclableNodes = udg_NA_RecyclableNodes - 1
set Node = udg_NA_RecycleNodes[udg_NA_RecyclableNodes]
endif
set udg_NA_NextNode[Node] = 0
set udg_NA_NextNode[udg_NA_PrevNode[0]] = Node
set udg_NA_PrevNode[Node] = udg_NA_PrevNode[0]
set udg_NA_PrevNode[0] = Node
set udg_NA_Caster[Node] = GetTriggerUnit()
set udg_NA_SFX[Node] = AddSpecialEffectTarget("Abilities\\Weapons\\WitchDoctorMissile\\WitchDoctorMissile.mdl", udg_NA_Caster[Node], "overhead")
set udg_NA_Duration[Node] = 5.00
set udg_NA_Counter[Node] = 0.50
if udg_NA_PrevNode[Node] == 0 then
call TimerStart(udg_NA_Timer, 0.0312500, true, function NA_Loop)
endif
endif
return false
endfunction
//===========================================================================
function InitTrig_Natures_Attraction takes nothing returns nothing
local trigger NA = CreateTrigger()
call TriggerAddCondition(NA, Condition(function NA_OnCast))
call TriggerRegisterAnyUnitEventBJ(NA, EVENT_PLAYER_UNIT_SPELL_EFFECT)
endfunction
//TESH.scrollpos=60
//TESH.alwaysfold=0
function TS_Loop takes nothing returns nothing
local integer Node = 0
local unit u
local real x
local real x2
local real y
local real y2
local real dx
local real dy
local real d
local real aoe = 600.00
loop
set Node = udg_TS_NextNode[Node]
exitwhen Node == 0
if not(IsUnitType(udg_TS_Decoy[Node], UNIT_TYPE_DEAD)) and GetUnitTypeId(udg_TS_Decoy[Node]) != 0 then
set x = GetUnitX(udg_TS_Decoy[Node])
set y = GetUnitY(udg_TS_Decoy[Node])
call GroupEnumUnitsInRange(udg_TS_TempGroup, x, y, 600.00, null)
loop
set u = FirstOfGroup(udg_TS_TempGroup)
exitwhen u == null
set x2 = GetUnitX(u)
set y2 = GetUnitY(u)
set dx = x2 - x
set dy = y2 - y
set d = SquareRoot(dx*dx + dy*dy)
if d < aoe and (GetUnitTypeId(u) == 'h000') and not(IsUnitType(u, UNIT_TYPE_DEAD)) then
set udg_TS_Target = FirstOfGroup(udg_TS_TempGroup)
set aoe = d
endif
call GroupRemoveUnit(udg_TS_TempGroup, u)
endloop
if udg_TS_Target != null and not(IsUnitType(u, UNIT_TYPE_DEAD)) then
call IssuePointOrder(udg_TS_Decoy[Node], "move", x2, y2)
set udg_TS_Target = null
endif
else
set udg_TS_RecycleNodes[udg_TS_RecyclableNodes] = Node
set udg_TS_RecyclableNodes = udg_TS_RecyclableNodes + 1
set udg_TS_NextNode[udg_TS_PrevNode[Node]] = udg_TS_NextNode[Node]
set udg_TS_PrevNode[udg_TS_NextNode[Node]] = udg_TS_PrevNode[Node]
if (udg_TS_NextNode[0] == 0) then
call PauseTimer(udg_TS_Timer)
endif
endif
endloop
endfunction
function TS_OnCast takes nothing returns boolean
local real x
local real y
local real x2
local real y2
local integer Node
local player p
local unit u
local real angle
if (GetSpellAbilityId() == 'A005') and (GetUnitAbilityLevel(GetTriggerUnit(), 'B007') > 0) then
if (udg_TS_RecyclableNodes == 0) then
set udg_TS_NodeNumber = udg_TS_NodeNumber + 1
set Node = udg_TS_NodeNumber
else
set udg_TS_RecyclableNodes = udg_TS_RecyclableNodes - 1
set Node = udg_TS_RecycleNodes[udg_TS_RecyclableNodes]
endif
set u = GetTriggerUnit()
set udg_TS_NextNode[Node] = 0
set udg_TS_NextNode[udg_TS_PrevNode[0]] = Node
set udg_TS_PrevNode[Node] = udg_TS_PrevNode[0]
set udg_TS_PrevNode[0] = Node
set p = GetTriggerPlayer()
set x = GetSpellTargetX()
set y = GetSpellTargetY()
set x2 = GetUnitX(u)
set y2 = GetUnitY(u)
set angle = Atan2(x - x2, y - y2)
set udg_TS_Decoy[Node] = CreateUnit(p, 'h003', x, y, angle)
call SetUnitMoveSpeed(udg_TS_Decoy[Node], 522.00)
call UnitApplyTimedLife(udg_TS_Decoy[Node], 'BTLF', 10.00)
if (udg_TS_PrevNode[Node] == 0) then
call TimerStart(udg_TS_Timer, 0.031250, true, function TS_Loop)
endif
call UnitRemoveAbility(u, 'B007')
set u = null
endif
return false
endfunction
function InitTrig_Tree_Shoes takes nothing returns nothing
local trigger TS = CreateTrigger()
call TriggerAddCondition(TS, Condition(function TS_OnCast))
call TriggerRegisterAnyUnitEventBJ(TS, EVENT_PLAYER_UNIT_SPELL_EFFECT)
endfunction