Я не уверен, но в npc_units_custom.txt юниту добавь строчкуСобственно, нужно сбить реген тарраски у героя, которого атакует определённый крип, то бишь заставить предмет перезаряжаться, как это происходит с героями.
Как это можно сделать?
Вот юнит из Together we Stand, там они сбивают тараскуПроверял, не работает. Это тоже не работает.
"CombatClassAttack" "DOTA_COMBAT_CLASS_ATTACK_HERO"
"CombatClassDefend" "DOTA_COMBAT_CLASS_DEFEND_HERO"
"UnitRelationShipClass" "DOTA_NPC_UNIT_RELATIONSHIP_TYPE_HERO"
"npc_dota_warlock_boss_1"
{
// General
//----------------------------------------------------------------
"Model" "models/heroes/warlock/warlock.vmdl"
"BaseClass" "npc_dota_creature"
"ModelScale" "1.2"
"Level" "1"
"ConsideredHero" "1"
"MinimapIcon" "minimap_roshancamp"
"MinimapIconSize" "260"
"SoundSet" "Hero_Warlock" // Name of sound set.
"GameSoundsFile" "soundevents/game_sounds_heroes/game_sounds_warlock.vsndevts"
// Inventory
//----------------------------------------------------------------
"HasInventory" "1"
// Abilities
//----------------------------------------------------------------
"AbilityLayout" "4"
"Ability1" "fire_to_point" // Ability 1.
"Ability2" "shackle_element" // Ability 2.
"Ability3" "drag_away" // Ability 3.
"Ability4" "warlock_disappear" // Ability 4.
"Ability5" "" // Ability 5.
"Ability6" "" // Ability 6 - Extra.
"Ability7" "" // Ability 7 - Extra.
"Ability8" "" // Ability 8 - Extra.
// Armor
//----------------------------------------------------------------
"ArmorPhysical" "30" // Physical protection.
"MagicalResistance" "25" // Magical protection.
// Attack
//----------------------------------------------------------------
"AttackCapabilities" "DOTA_UNIT_CAP_RANGED_ATTACK"
"AttackDamageMin" "140" // Damage range min.
"AttackDamageMax" "280" // Damage range max.
"AttackRate" "1.5" // Speed of attack.
"AttackAnimationPoint" "0.3" // Normalized time in animation cycle to attack.
"AttackAcquisitionRange" "600" // Range within a target can be acquired.
"AttackRange" "650" // Range within a target can be attacked.
"ProjectileModel" "particles/units/heroes/hero_warlock/warlock_base_attack.vpcf" // Particle system model for projectile.
"ProjectileSpeed" "1200" // Speed of projectile.
// Bounty
//----------------------------------------------------------------
"BountyXP" "100" // Experience earn.
"BountyGoldMin" "200" // Gold earned min.
"BountyGoldMax" "200" // Gold earned max.
// Bounds
//----------------------------------------------------------------
"RingRadius" "70"
"HealthBarOffset" "300"
"BoundsHullName" "DOTA_HULL_SIZE_HERO"
// Movement
//----------------------------------------------------------------
"MovementCapabilities" "DOTA_UNIT_CAP_MOVE_GROUND" // Type of locomotion - ground, air
"MovementSpeed" "522" // Speed
"MovementTurnRate" "0.3" // Turning rate.
"GameSoundsFile" "soundevents/game_sounds_heroes/game_sounds_warlock.vsndevts"
"VoiceFile" "soundevents/voscripts/game_sounds_vo_warlock.vsndevts"
// Status
//----------------------------------------------------------------
"StatusHealth" "20000" // Base health.
"StatusHealthRegen" "50.0" // Health regeneration rate.
"StatusMana" "1000" // Base mana.
"StatusManaRegen" "50.0" // Mana regeneration rate.
// Team
//----------------------------------------------------------------
"TeamName" "DOTA_TEAM_BADGUYS" // Team name.
"CombatClassAttack" "DOTA_COMBAT_CLASS_ATTACK_HERO"
"CombatClassDefend" "DOTA_COMBAT_CLASS_DEFEND_HERO"
"UnitRelationshipClass" "DOTA_NPC_UNIT_RELATIONSHIP_TYPE_DEFAULT"
// Vision
//----------------------------------------------------------------
"VisionDaytimeRange" "1400" // Range of vision during day light.
"VisionNighttimeRange" "1400" // Range of vision at night time.
"vscripts" "creature_ai/warlock_1_ai.lua"
// Creature Data
//----------------------------------------------------------------------------------------------------------------------
"Creature"
{
"CanRespawn" "0"
"DisableResistance" "100"
//Level Up Parameters
//-----------------------------------------------------------------
"HPGain" "1"
"DamageGain" "1"
"ArmorGain" "1"
"MagicResistGain" "1"
"MoveSpeedGain" "1"
"BountyGain" "3"
"XPGain" "100"
"DefaultState" "Invade"
"AttachWearables"
{
"Wearable1"
{
"ItemDef" "5725"
}
"Wearable2"
{
"ItemDef" "5726"
}
"Wearable3"
{
"ItemDef" "5727"
}
"Wearable4"
{
"ItemDef" "5728"
}
"Wearable5"
{
"ItemDef" "5729"
}
"Wearable6"
{
"ItemDef" "5730"
}
"Wearable7"
{
"ItemDef" "5594"
}
}
}
}
А у крипов в доте бегающим по линиями нейтральная команда, ага.Скажу по секрету: дело в том, что крипы из команды "плохих парней", а герои из "хороших". В связи с этим любая атака крипов сбивает тараску.
Ну а насчет вопроса - надо копаться, но пока можешь попросту сделать крипов DOTA_TEAM_BADGUYS.
function modifier_infest_hide:OnIntervalThink()
if IsServer() then
if self.target:IsAlive() == false then
self:Destroy()
end
for i = 0, 5, 1 do
local current_item = self:GetCaster():GetItemInSlot(i)
if current_item ~= nil then
if current_item:GetName() == "item_heart" or current_item:GetName() == "item_heart_2" or current_item:GetName() == "item_boots_of_protection" then
current_item:StartCooldown(5)
end
end
end
self:GetParent():SetAbsOrigin(self.target:GetAbsOrigin())
end
end
А у крипов в доте бегающим по линиями нейтральная команда, ага.
Не помогло.Ну а насчет вопроса - надо копаться, но пока можешь попросту сделать крипов DOTA_TEAM_BADGUYS.
"npc_dota_ve_keeper"
{
// General
//----------------------------------------------------------------
"BaseClass" "npc_dota_creature"
"Model" "models/heroes/omniknight/omniknight.vmdl"
"ModelScale" "2.2"
"SoundSet" "Hero_Omniknight"
"GameSoundsFile" "soundevents/game_sounds_heroes/game_sounds_omniknight.vsndevts"
"Level" "1"
"HealthBarOffset" "450"
"Ability1" "medusa_split_shot"
// Armor
//----------------------------------------------------------------
"MagicalResistance" "25"
"ArmorPhysical" "15"
// Attack
//----------------------------------------------------------------
"AttackCapabilities" "DOTA_UNIT_CAP_MELEE_ATTACK"
"AttackDamageType" "DAMAGE_TYPE_ArmorPhysical"
"AttackDamageMin" "50"
"AttackDamageMax" "115"
"AttackRate" "0.8"
"AttackAnimationPoint" "0.5"
"AttackAcquisitionRange" "850"
"AttackRange" "850"
"ProjectileModel" "particles/base_attacks/ranged_tower_good.vpcf"
"ProjectileSpeed" "900"
"IsAncient" "1"
"IsNeutralUnitType" "0"
// Bounty
//----------------------------------------------------------------
"BountyGoldMin" "1000"
"BountyGoldMax" "1000"
"CanBeDominated" "0"
"ConsideredHero" "1"
// Bounds
//----------------------------------------------------------------
"BoundsHullName" "DOTA_HULL_SIZE_HERO"
"CollisionSize" "200"
"RingRadius" "200"
// Movement
//----------------------------------------------------------------
"MovementCapabilities" "DOTA_UNIT_CAP_MOVE_NONE"
"MovementSpeed" "0"
"MovementTurnRate" "1"
// Status
//----------------------------------------------------------------
"StatusHealth" "5000"
"StatusHealthRegen" "0.1"
"StatusMana" "0"
"StatusManaRegen" "0"
// Vision
//----------------------------------------------------------------
"VisionDaytimeRange" "1400"
"VisionNighttimeRange" "800"
// Team
//----------------------------------------------------------------
"TeamName" "DOTA_TEAM_CUSTOM_8"
"CombatClassAttack" "DOTA_COMBAT_CLASS_ATTACK_HERO"
"CombatClassDefend" "DOTA_COMBAT_CLASS_DEFEND_HERO"
"UnitRelationShipClass" "DOTA_NPC_UNIT_RELATIONSHIP_TYPE_HERO"
// Creature Data
//----------------------------------------------------------------
"Creature"
{
"DisableClumpingBehavior" "1"
"DefaultState" "Invade"
"States"
{
"Invade"
{
"Name" "Invade"
"Aggression" "100.0"
"Avoidance" "0.0"
"Support" "0.0"
}
}
"AttachWearables"
{
"Wearable1" {"ItemDef" "45" }
"Wearable2" {"ItemDef" "8170" }
"Wearable3" {"ItemDef" "8171" }
"Wearable4" {"ItemDef" "8172" }
"Wearable5" {"ItemDef" "8173" }
"Wearable6" {"ItemDef" "8174" }
}
}
}
function GameMode:OnEntityHurt(keys)
--DebugPrint("[BAREBONES] Entity Hurt")
--DebugPrintTable(keys)
local damagebits = keys.damagebits -- This might always be 0 and therefore useless
if keys.entindex_attacker ~= nil and keys.entindex_killed ~= nil then
local entCause = EntIndexToHScript(keys.entindex_attacker)
local entVictim = EntIndexToHScript(keys.entindex_killed)
-- The ability/item used to damage, or nil if not damaged by an item/ability
local damagingAbility = nil
if keys.entindex_inflictor ~= nil then
damagingAbility = EntIndexToHScript( keys.entindex_inflictor )
end
if entVictim:IsAlive() then
if entVictim:IsHero() then
for i = 0, 5, 1 do
local current_item = entVictim:GetItemInSlot(i)
if current_item ~= nil then
if current_item:GetName() == "item_heart" then
current_item:StartCooldown(current_item:GetCooldown(1))
end
end
end
end
end
end
end