Name | Type | is_array | initial_value |
Aloc | abilcode | No | |
AquL_Ability_Level | integer | Yes | |
AquL_Caster | unit | Yes | |
AquL_Distance | real | Yes | |
AquL_Duration | real | Yes | |
AquL_Group | group | Yes | |
AquL_Lightning | lightning | Yes | |
AquL_Point | location | Yes | |
AquL_Target | unit | Yes | |
AquL_Text | texttag | Yes | |
BerE_Ability_Level | integer | Yes | |
BerE_Boolean | boolean | Yes | |
BerE_Caster | unit | Yes | |
BerE_Caster_2 | unit | Yes | |
BerE_Duration | real | Yes | |
BerE_Mana_Comburst | real | Yes | |
BerE_Temp_Group | group | Yes | |
Caster | unit | Yes | |
DarC_Caster | unit | Yes | |
DarC_Duration | real | Yes | |
DarC_Temp_Group | group | No | |
DMDT_SYSTEM | group | No | |
Duration | integer | Yes | |
Enra_Ability_Level | integer | Yes | |
Enra_Duration | real | Yes | |
Enra_Target | unit | Yes | |
EssS_Attribute_Bonus | integer | Yes | |
EssS_Caster | unit | Yes | |
EssS_Duration | real | Yes | |
FirS_Ability_Level | integer | Yes | |
FirS_Caster | unit | Yes | |
FirS_Duration | real | Yes | |
FirS_HP_Lost | real | Yes | |
FirS_Inteval | real | Yes | |
FirS_Last_HP_Value | real | Yes | |
FirS_SFX | effect | Yes | |
FirS_Target | unit | Yes | |
FocF_Ability_Level | integer | Yes | |
FocF_Arrows_Left | integer | Yes | |
FocF_Caster | unit | Yes | |
FocF_Hurter | unit | Yes | |
FocF_Inteval | real | Yes | |
FocF_Missile | unit | Yes | |
FocF_Missile_Angle | real | Yes | |
FocF_Missile_Duration | real | Yes | |
FocF_Missile_Speed | real | Yes | |
FocF_Target_Point | location | Yes | |
FreC_Ability_Level | integer | Yes | |
FreC_Ability_Level_2 | integer | Yes | |
FreC_Caster | unit | Yes | |
FreC_Caster_2 | unit | Yes | |
FreC_Comet_Left | integer | Yes | |
FreC_Fall_Speed | real | Yes | |
FreC_Height | real | Yes | |
FreC_Inteval | real | Yes | |
FreC_Missile | unit | Yes | |
FreC_Target | unit | Yes | |
FreC_Target_2 | unit | Yes | |
General_Integer | integer | Yes | |
integer | integer | Yes | |
KB_SFX | string | Yes | |
Point | location | Yes | |
PowS_Ability_Level | integer | Yes | |
PowS_Angle | real | Yes | |
PowS_Caster | unit | Yes | |
PowS_Missile | unit | Yes | |
PowS_Speed | real | Yes | |
PowS_Temp_Distance | real | Yes | |
PowS_Temp_Group | group | Yes | |
PowS_Timed_Life | real | Yes | |
SpiS_Angle | real | Yes | |
SpiS_Distance | real | Yes | |
SpiS_Duration | real | Yes | |
SpiS_Lightning | lightning | Yes | |
SpiS_Missile | unit | Yes | |
SpiS_Target | unit | Yes | |
SpiS_Target_2 | unit | Yes | |
SpiS_Target_3 | unit | Yes | |
SYSTEM_CASTERVARS | unit | No | |
SYSTEM_HEROES | unitcode | Yes | |
SYSTEM_PLAYER_HERO | unit | Yes | |
Target | unit | Yes | |
Temp_Group | group | Yes | |
Temp_Integer | integer | Yes | |
Temp_Owner | player | Yes | |
Temp_Point | location | Yes | |
Temp_Real | real | Yes | |
Temp_Unit | unit | Yes | |
Temp_Unit_Visual | unit | No | |
TMOL_SFX_I | string | Yes | |
TMOL_SFX_II | string | Yes | |
TMOL_SFX_III | string | Yes | |
TMOL_SFX_IV | string | Yes | |
TMOL_SFX_V | string | Yes | |
TMOL_Timed | real | Yes | |
TMOL_UNIT | unit | Yes |
//TESH.scrollpos=0
//TESH.alwaysfold=0
function CS_MoveUnit takes unit u, real x, real y returns boolean
local rect r=bj_mapInitialPlayableArea
local real t=GetRectMinX(r)
local boolean b=true
if (x<t) then
set x=t
set b=false
else
set t=GetRectMaxX(r)
if (x>t) then
set b=false
set x=t
endif
endif
set t=GetRectMinY(r)
if (y<t) then
set y=t
set b=false
else
set t=GetRectMaxY(r)
if (y>t) then
set y=t
set b=false
endif
endif
if (b) then
call SetUnitX(u, x)
call SetUnitY(u, y)
endif
set r=null
return b
endfunction
//===========================================================================
function InitTrig_CS_Move takes nothing returns nothing
set gg_trg_CS_Move = CreateTrigger( )
endfunction
//TESH.scrollpos=1
//TESH.alwaysfold=0
function AddCasterFacing takes real fac returns unit
local unit m = CreateUnit( Player(15), 'n000', 0 ,0 ,fac)
call UnitAddAbility(m, 'Aloc')
call UnitAddAbility(m, 'Arav')
call UnitRemoveAbility(m, 'Arav')
set udg_SYSTEM_CASTERVARS=m
set m=null
return udg_SYSTEM_CASTERVARS
endfunction
//===========================================================================
function InitTrig_Add_Caster_Facing takes nothing returns nothing
set gg_trg_Add_Caster_Facing = CreateTrigger( )
endfunction
//TESH.scrollpos=2
//TESH.alwaysfold=0
function UnitMoveToAsProjectileGen takes unit m, real arc, real x2, real y2, unit target, real z2 returns nothing
//
// The internal projectile system used by all the projectile functions
//
local real x1 = GetUnitX(m)
local real y1 = GetUnitY(m)
local real acel = arc*1600
local real speed = GetUnitMoveSpeed(m)
local real z1 = GetUnitFlyHeight(m)
local real d
local real d1
local real d2
local real t
local real vel
local real dif = 0
local location p
local boolean tounit = (target!=null)
local boolean b = false
local boolean mode = false
if tounit then
set x2=GetUnitX(target)
set y2=GetUnitY(target)
set z2=GetUnitFlyHeight(target)+z2
endif
set mode=(z2>z1)
set d=SquareRoot(Pow(x2-x1,2)+Pow(y2-y1,2))
set d1=1000000
set d2=0
set t=d/speed
if t==0 then
set t=0.001
endif
set vel=(z2-z1+0.5*acel*t*t)/t
call SetUnitFacing( m, Atan2BJ(y2 - y1, x2 - x2) )
call IssuePointOrder( m, "move", x2,y2)
set t=0
loop
set d2=d1
if tounit then
if IsUnitDeadBJ(target) then
set tounit=false
else
set x2=GetUnitX(target)
set y2=GetUnitY(target)
endif
endif
set d1=SquareRoot(Pow(x2-GetUnitX(m),2)+Pow(y2-GetUnitY(m),2))
exitwhen b or d1==0
set b=(d1<=speed*(t-dif))
exitwhen (mode and b) or (GetUnitCurrentOrder(m) != OrderId("move"))
if tounit then
call IssuePointOrder( m, "move", x2,y2)
endif
set dif=t
if dif==0.001 then
set t=0.1
else
set t= (d-d1)/speed
endif
set t= 2*t-dif
call SetUnitFlyHeight( m, z1+(vel*t-0.5*acel*t*t), RAbsBJ( vel-acel*(t+dif)/2) )
set t=(t+dif)/2
call TriggerSleepAction(0)
endloop
if tounit then
set x2=GetUnitX(target)
set y2=GetUnitY(target)
endif
call SetUnitFlyHeight( m,z2,0)
call SetUnitX (m,x2)
call SetUnitY (m,y2)
endfunction
//===========================================================================
function InitTrig_Projectile_System takes nothing returns nothing
set gg_trg_Projectile_System = CreateTrigger( )
endfunction