function GameMode:OnNPCSpawned(keys)
DebugPrint("[BAREBONES] NPC Spawned")
DebugPrintTable(keys)
local npc = EntIndexToHScript(keys.entindex)
if npc:IsRealHero() and firstspawn[npc:GetPlayerOwnerID()] == true then
npc:SetHealth(npc:GetMaxHealth()/2)
Timers:CreateTimer(0.05,
function()
npc:SetMana(0)
return nil
end)
end
if firstspawn[npc:GetPlayerOwnerID()] == nil then
firstspawn[npc:GetPlayerOwnerID()] = true
end
if npc:GetUnitName() == "baby" or npc:GetUnitName() == "woman" then
npc:AddNewModifier(npc,nil,"modifier_villager",{})
elseif npc:GetUnitName() == "zvd_keeper" then
npc:AddNewModifier(npc, nil, "modifier_shopkeeper", {})
npc:AddNewModifier(npc,nil,"modifier_shop",{})
end
end