Timers:CreateTimer(10,function()
function Pos(keys)
local caster = keys.caster
if keys.caster:GetHealth ()< 100 then
keys.ability:Po(keys)
else
return nil
end
end
return nil
end)
Timers:CreateTimer(30, -- Start this timer 30 game-time seconds later
function()
DebugPrint("This function is called 30 seconds after the game begins, and every 30 seconds thereafter")
return 30.0 -- Rerun this timer every 30 game-time seconds
end)
end
function Spawn( entityKeyValues )
ability = thisEntity:FindAbilityByName("dragon_knight_elder_dragon_form")
thisEntity:SetContextThink( "dkthink", dkthink , 1)
end
function dkthink()
local health = thisEntity:GetHealth() / thisEntity:GetMaxHealth()
if health <= 0.50 then
if ability:IsFullyCastable() then
thisEntity:CastAbilityNoTarget(ability, -1)
end
end
return 1
end
"ability_run"
{
// General
//-------------------------------------------------------------------------------------------------------------
"BaseClass" "ability_datadriven"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_TOGGLE"
"AbilityTextureName" "bounty_hunter_wind_walk"
// Casting
//-------------------------------------------------------------------------------------------------------------
"AbilityCastPoint" "0.01"
// Time
//-------------------------------------------------------------------------------------------------------------
"AbilityCooldown" "0.0"
// Cost
//-------------------------------------------------------------------------------------------------------------
"AbilityManaCost" "0"
"OnToggleOn"
{
"ApplyModifier"
{
"ModifierName" "running"
"Target" "CASTER"
}
}
"OnToggleOff"
{
"RemoveModifier"
{
"ModifierName" "running"
"Target" "CASTER"
}
}
"Modifiers"
{
"running"
{
"Properties"
{
"MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE" "%mod_run"
"MODIFIER_PROPERTY_MANA_REGEN_CONSTANT" "%energy_regen"
}
"OnCreated"
{
"AttachEffect"
{
"Target" "CASTER"
"EffectName" ""
"EffectAttachType" "follow_origin"
}
}
}
}
"AbilitySpecial"
{
"01"
{
"var_type" "FIELD_INTEGER"
"mod_run" "60"
}
"02"
{
"var_type" "FIELD_INTEGER"
"energy_regen" "-3.5"
}
}
}
function Spawn( entityKeyValues )
ability = thisEntity:FindAbilityByName("ability_run")
thisEntity:SetContextThink( "dkthink", dkthink , 1)
end
function dkthink()
local health = thisEntity:GetHealth() / thisEntity:GetMaxHealth()
if health <= 100 then
if ability:IsFullyCastable() then
thisEntity:CastAbilityToggle(ability, -1)
end
end
return 1
end
"vscripts" "твое_название.lua"
function Spawn( entityKeyValues )
ability = thisEntity:FindAbilityByName("ability_run")
thisEntity:SetContextThink( "dkthink", dkthink , 1)
end
function dkthink()
local mana = thisEntity:GetMana() / thisEntity:GetMaxMana()
if mana <= 90 then
if ability:IsFullyCastable() then
thisEntity:CastAbilityToggle(ability, -1)
end
end
return 1
end