initial commit

This commit is contained in:
2021-10-24 15:36:18 -04:00
commit b9a5a8fe23
11982 changed files with 220468 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
require("ai/shared")
--------------------------------------------------------------------------------
function Spawn( entityKeyValues )
if IsServer() == false then
return
end
--printf( "thisEntity:GetUnitName() == %s", thisEntity:GetUnitName() )
thisEntity.hSwingAbility = thisEntity:FindAbilityByName( "pendulum_swing" )
thisEntity:SetContextThink( "PendulumTrapThink", PendulumTrapThink, RandomFloat( 0.1, 1.0 ) )
end
--------------------------------------------------------------------------------
function PendulumTrapThink()
if IsServer() then
local enemies = GetEnemyHeroesInRange( thisEntity, 2048 ) -- will need to search just in room
if not enemies or #enemies == 0 then
--print( "no enemies" )
thisEntity:InterruptChannel()
return RandomFloat( 0.1, 1.0 )
end
if not thisEntity:IsChanneling() then
ExecuteOrderFromTable({
UnitIndex = thisEntity:entindex(),
OrderType = DOTA_UNIT_ORDER_CAST_NO_TARGET,
AbilityIndex = thisEntity.hSwingAbility:entindex(),
Queue = false,
})
end
end
return 1
end
--------------------------------------------------------------------------------