- 1 Дек 2022
- 7
- 0
- Проект
- Кастомка(названия пока-что нет)
"item_wolf_tooth"
{
"BaseClass" "item_datadriven"
"ID" "4003"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_PASSIVE"
"Model" "models/props_gameplay/red_box.vmdl"
"AbilityUnitTargetType" "DOTA_UNIT_TARGET_HERO"
"Effect" "particles/generic_gameplay/dropped_item.vpcf"
"AbilityTextureName" "item_wolftooth"
"ItemCost" "45"
"itemShopTags" "lifesteal"
"ItemQuality" "common"
"ItemAliases" "wolf tooth,wt"
"ItemDeclarations" "DECLARE_PURCHASES_TO_SPECTATORS"
"AbilitySpecial"
{
"01"
{
"var_type" "FIELD_INTEGER"
"hp_restore" "20"
}
}
"RunScript"
{
"ScriptFile" "items/wolftooth.lua"
"Function" "wolftooth_lifesteal"
}
}
{
"BaseClass" "item_datadriven"
"ID" "4003"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_PASSIVE"
"Model" "models/props_gameplay/red_box.vmdl"
"AbilityUnitTargetType" "DOTA_UNIT_TARGET_HERO"
"Effect" "particles/generic_gameplay/dropped_item.vpcf"
"AbilityTextureName" "item_wolftooth"
"ItemCost" "45"
"itemShopTags" "lifesteal"
"ItemQuality" "common"
"ItemAliases" "wolf tooth,wt"
"ItemDeclarations" "DECLARE_PURCHASES_TO_SPECTATORS"
"AbilitySpecial"
{
"01"
{
"var_type" "FIELD_INTEGER"
"hp_restore" "20"
}
}
"RunScript"
{
"ScriptFile" "items/wolftooth.lua"
"Function" "wolftooth_lifesteal"
}
}
wolftooth=class{{}}
function wolftooth_lifesteal(keys)
local hp = GetValuefor("hp_restore")
local attacker = keys.caster
local killed = keys.entity_killed
if attacker and killed:IsCreep()
attacker:SetHealth(attacker:GetHealth()+hp)
SendOverheadEventMessage(nil,OVERHEAD_ALERT_HEAL,attacker,hp,nil)
end
end
function wolftooth_lifesteal(keys)
local hp = GetValuefor("hp_restore")
local attacker = keys.caster
local killed = keys.entity_killed
if attacker and killed:IsCreep()
attacker:SetHealth(attacker:GetHealth()+hp)
SendOverheadEventMessage(nil,OVERHEAD_ALERT_HEAL,attacker,hp,nil)
end
end
Я - новичок и пытаюсь разобраться что да как, поэтому подскажите что не так.