Name | Type | is_array | initial_value |
AV_Angle | real | Yes | |
AV_AtkLoc | location | Yes | |
AV_CastLoc | location | Yes | |
AV_DmgGroup | group | Yes | |
AV_HPRet | real | Yes | |
AV_Index | integer | Yes | |
AV_Owner | unit | Yes | |
AV_Pause | boolean | No | |
AV_Rect | rect | Yes | |
AV_ShotsNum | integer | Yes | |
AV_TarLoc | location | No | |
BT_Angle | real | No | |
BT_Chance | integer | No | |
BT_Damage | real | No | |
BT_DamageGroup | group | No | |
BT_Effect | effect | No | |
BT_Explosion | string | No | |
BT_ExpNum | integer | No | |
BT_HDamage | real | No | |
BT_IKHero | boolean | No | |
BT_Integer | integer | No | |
BT_Point | location | No | |
BT_TempGroup | group | No | |
BT_TempLoc | location | No | |
CF_AoE | real | No | |
CF_Caster | unit | No | |
CF_CastLoc | location | No | |
CF_Effect | string | No | |
CF_Group | group | No | |
CF_Integer | integervar | No | |
CF_SwapLoc | location | Yes | |
CF_SwapUnit | unit | Yes | |
Creep_Point | location | Yes | |
FF_Caster | unit | Yes | |
FF_Counter | real | Yes | |
FF_Effect1 | effect | Yes | |
FF_Effect2 | effect | Yes | |
FF_FB1 | unit | Yes | |
FF_FB2 | unit | Yes | |
FF_FBLoc1 | location | Yes | |
FF_FBLoc2 | location | Yes | |
FF_Index | integer | Yes | |
FF_MoveLoc | location | No | |
FF_Target | unit | Yes | |
FF_TargetLoc | location | Yes | |
FS_Damage | real | Yes | |
FS_Damaged | group | Yes | |
FS_DummyLoc | location | Yes | |
FS_Effect | effect | Yes | |
FS_Effect2 | effect | Yes | |
FS_Integer | integer | Yes | |
FS_TargetLoc | location | Yes | |
FS_TempLoc | location | Yes | |
FS_Unit | unit | Yes | |
Integer_CS | integer | No | |
Item_Bonus | abilcode | No | |
Item_One | itemcode | No | |
Item_Two | itemcode | No | |
KB_Angle | real | Yes | |
KB_Casters | unit | Yes | |
KB_CountBuffs | integer | No | |
KB_DestroyTrees | boolean | Yes | |
KB_EffectCounter | integer | Yes | |
KB_EffectCounter2 | integer | Yes | |
KB_Effects_1 | string | Yes | |
KB_Effects_2 | string | Yes | |
KB_GeneralIntegers | integervar | Yes | |
KB_KnockbackedUnits | group | No | |
KB_Levels | integer | Yes | |
KB_MaxDistance | real | Yes | |
KB_ReachedDistance | real | Yes | |
KB_ReducedReal | real | No | |
KB_ReduceSpeedReal | real | Yes | |
KB_SpecificSpeed | real | Yes | |
KB_StartPositions | location | Yes | |
KB_TempPoint | location | Yes | |
KB_TempReal | real | No | |
KB_TotalKnockUnits | integer | No | |
KB_Units | unit | Yes | |
KBA_Caster | unit | No | |
KBA_DestroyTrees | boolean | No | |
KBA_DistancePerLevel | real | No | |
KBA_Level | integer | No | |
KBA_SpecialEffects | string | Yes | |
KBA_Speed | real | No | |
KBA_StartingPosition | location | No | |
KBA_TargetUnit | unit | No | |
MS_Caster | unit | No | |
MS_Group | group | No | |
MS_Loc | location | Yes | |
MS_Rect | rect | No | |
PH_Angle | real | Yes | |
PH_CastLoc | location | Yes | |
PH_Damage | real | Yes | |
PH_Distance | real | Yes | |
PH_DistancePerSec | real | No | |
PH_DistDam | real | No | |
PH_Dummy | unit | Yes | |
PH_DummyLoc | location | Yes | |
PH_Hero | unit | Yes | |
PH_Index | integer | Yes | |
PH_MoveLoc | location | Yes | |
PH_SFX | string | Yes | |
PH_Special | effect | Yes | |
PH_Target | unit | Yes | |
PH_TargUnitLoc | location | Yes | |
Ret_Damage | real | No | |
Ret_Group | group | No | |
Ret_Items | item | Yes | |
Ret_Loc | location | No | |
Ret_SpEf | string | No | |
Ret_Stats | integer | Yes | |
Rex_Quest | effect | No | |
SB_Duration | real | No | |
SB_Left | integervar | No | |
SB_Point | location | No | |
SB_Right | integervar | No | |
SR_Dummy | unit | Yes | |
SR_DummyLoc | location | Yes | |
SR_Hero | unit | Yes | |
SR_Integer | integer | Yes | |
SR_STL | location | No | |
SR_TargetLoc | location | Yes | |
SR_TempLoc | location | Yes | |
SR_X | real | No | |
SR_Y | real | No | |
Temp_Integer | integer | No | |
TempLoc | location | No | |
TempSFX | effect | No | |
Tester | unit | No | |
WP_AoE | real | No | |
WP_Damage | real | No | |
WP_DamageGroup | group | No | |
WP_Point | location | No | |
WP_Rect | rect | No | |
X | real | No | |
Y | real | No |
//TESH.scrollpos=0
//TESH.alwaysfold=0
// This library has been slightly edited by Deuterium
// for the sake of making it function with GUI flawlessly.
library IsTerrainWalkable initializer Init
//*****************************************************************
//* IsTerrainWalkable
//*
//* rewritten in vJass by: Anitarf
//* original implementation: Vexorian
//*
//* A function for checking if a point is pathable for ground
//* units (it does so by attempting to move an item there and
//* checking where it ended up), typically used to stop sliding
//* units before they end up stuck in trees. If the point is not
//* pathable, the function will also determine the nearest point
//* that is (the point where the item ends up).
//*****************************************************************
globals
// this value is how far from a point the item may end up for the point to be considered pathable
private constant real MAX_RANGE = 10.0
// the following two variables are set to the position of the item after each pathing check
// that way, if a point isn't pathable, these will be the coordinates of the nearest point that is
// public real X = 0.0
// public real Y = 0.0
// END OF CALIBRATION SECTION
// ================================================================
private rect r
private item check
private item array hidden
private integer hiddenMax = 0
endglobals
private function Init takes nothing returns nothing
set check = CreateItem('ciri',0,0)
call SetItemVisible(check,false)
set r = Rect(0.0,0.0,128.0,128.0)
endfunction
private function HideBothersomeItem takes nothing returns nothing
if IsItemVisible(GetEnumItem()) then
set hidden[hiddenMax]=GetEnumItem()
call SetItemVisible(hidden[hiddenMax],false)
set hiddenMax=hiddenMax+1
endif
endfunction
// ================================================================
function IsTerrainWalkable takes real x, real y returns boolean
// first, hide any items in the area so they don't get in the way of our item
call MoveRectTo(r, x,y)
call EnumItemsInRect(r,null,function HideBothersomeItem)
// try to move the check item and get it's coordinates
call SetItemPosition(check,x,y)//this unhides the item...
set udg_X = GetItemX(check)
set udg_Y = GetItemY(check)
call SetItemVisible(check,false)//...so we must hide it again
// before returning, unhide any items that got hidden at the start
loop
exitwhen hiddenMax<=0
set hiddenMax=hiddenMax-1
call SetItemVisible(hidden[hiddenMax],true)
set hidden[hiddenMax]=null
endloop
// return pathability status
return (x-udg_X)*(x-udg_X)+(y-udg_Y)*(y-udg_Y) < MAX_RANGE*MAX_RANGE
endfunction
endlibrary