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,47 @@
---------------------------------------------------------------------------
-- Arrow Trap
---------------------------------------------------------------------------
function OnTrigger( trigger )
if thisEntity.isTrapActivated then
printf( "Trap Skip" )
return
end
EmitGlobalSound( "ui.ui_player_disconnected" )
EmitSoundOn( "AghanimsFortress.TrapActivate", thisEntity )
thisEntity.isTrapActivated = true
thisEntity.hArrowAbility = thisEntity:FindAbilityByName( "arrow" )
if thisEntity.hArrowAbility == nil then
print( "ERROR: thisEntity.hArrowAbility not found" )
return
end
local fDelay = 0.6
thisEntity:SetContextThink( "ArrowTrapActivate", function() return ArrowTrapActivate() end, fDelay )
end
---------------------------------------------------------------------------
function ArrowTrapActivate()
if not IsServer() then
return
end
if GameRules:IsGamePaused() == true then
return 0.5
end
if thisEntity.isTrapActivated == true then
thisEntity:SetAnimation( "bark_attack" );
thisEntity:CastAbilityOnPosition( thisEntity:GetTrapTarget(), thisEntity.hArrowAbility, -1 )
thisEntity.isTrapActivated = false
end
return -1
end
---------------------------------------------------------------------------