спсholdout_example , это оттуда.
function CHoldoutGameMode:OnEntityKilled( event )
local killedUnit = EntIndexToHScript( event.entindex_killed )
if killedUnit and killedUnit:IsRealHero() then
local newItem = CreateItem( "item_tombstone", killedUnit, killedUnit )
newItem:SetPurchaseTime( 0 )
newItem:SetPurchaser( killedUnit )
local tombstone = SpawnEntityFromTableSynchronous( "dota_item_tombstone_drop", {} )
tombstone:SetContainedItem( newItem )
tombstone:SetAngles( 0, RandomFloat( 0, 360 ), 0 )
FindClearSpaceForUnit( tombstone, killedUnit:GetAbsOrigin(), true )
end
end
"DOTAAbilities"
{
"item_tombstone"
{
// General
//-------------------------------------------------------------------------------------------------------------
"AbilityName" "item_tombstone"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_BEHAVIOR_CHANNELLED | DOTA_ABILITY_BEHAVIOR_DONT_RESUME_ATTACK"
"Model" "models/props_gameplay/tombstoneb01.vmdl"
"PingOverrideText" "DOTA_Chat_Tombstone_Pinged"
"precache"
{
"particle_folder" "particles/units/heroes/hero_morphling"
}
// Stats
//-------------------------------------------------------------------------------------------------------------
"AbilityCastRange" "100"
"AbilityCastPoint" "0.0"
"AbilityChannelTime" "8.0"
// Item Info
//-------------------------------------------------------------------------------------------------------------
"ItemCost" "99999"
"ItemPurchasable" "0"
"ItemShopTags" "consumable"
"ItemQuality" "consumable"
"ItemStackable" "1"
"ItemShareability" "ITEM_FULLY_SHAREABLE"
"ItemPermanent" "0"
"ItemInitialCharges" "1"
"ItemCastOnPickup" "1"
"ItemKillable" "0"
}
}
Ещё один вопрос.Мне нужно что бы умершие воскресали после конца раунда,как это реализовать?Мне нужен типо их индефикатор ,там же что то записывается в функцию ,когда они умирают?
function CHoldoutGameMode:OnEntityKilled( event )
local killedUnit = EntIndexToHScript( event.entindex_killed )
if killedUnit and killedUnit:IsRealHero() then
table.insert(hero)
if x=1 then
hero:SetAbsOrigin( point )
FindClearSpaceForUnit(hero, 0,0,0, false)
--нули координаты спавна героев
hero:Stop()
end
local newItem = CreateItem( "item_tombstone", killedUnit, killedUnit )
newItem:SetPurchaseTime( 0 )
newItem:SetPurchaser( killedUnit )
local tombstone = SpawnEntityFromTableSynchronous( "dota_item_tombstone_drop", {} )
tombstone:SetContainedItem( newItem )
tombstone:SetAngles( 0, RandomFloat( 0, 360 ), 0 )
FindClearSpaceForUnit( tombstone, killedUnit:GetAbsOrigin(), true )
end
end
table.insert(hero)
if x=1 then
hero:SetAbsOrigin( point )
FindClearSpaceForUnit(hero, 0,0,0, false)
--нули координаты спавна героев
hero:Stop()
end
Вот ,а как эту проверку делать? там в переменную killed unit записываются все убитые или только последний?Если только последний нужно делать таблицу...Реализуешь функцию, которую запускаешь по окончанию раунда и в теле функции проверяешь, кто жив, а кто мертв. Соответственно, мертвых респавнишь.