Auto-translated
Here is the code:
And this is not just in this battle. And yes, nothing happens as intended. Apparently, I need to somehow get the hero's name...
function DefenderCreatureDeath(unit)
if(GetCreatureType(unit) == 21) then
removeUnit("CREATURE_DEVIL")
SummonCreature(DEFENDER,137,10,-1,-1)
end
if(GetCreatureType(unit) == 27) then
removeUnit("CREATURE_SUCCUBUS")
SummonCreature(DEFENDER,134,10,-1,-1)
end
end
local units = GetCreatures(DEFENDER);
for i, unit in units do
local unit_id = GetCreatureType(unit);
if(unit_id == 27) then
removeUnit(unit)
end
end
local units = GetCreatures(DEFENDER);
for i, unit in units do
local unit_id = GetCreatureType(unit);
if(unit_id == 21) then
removeUnit(unit)
end
end
Here is the error:
And this is not just in this battle. And yes, nothing happens as intended. Apparently, I need to somehow get the hero's name...