Auto-translated
Could you explain how the function that triggers a battle works? Why does an error occur when attempting to start a battle with the hero "Nemor," who is a reserve hero placed on the map by a script (a neutral hero, initially yellow), stating that this hero is not a reserve hero...?
Added 5 minutes later
Here is all the script code related to this hero:
DeployReserveHero("Nemor", 111, 121, 1)
sleep(2)
SetObjectOwner("Nemor", 8)
AddHeroCreatures("Nemor", CREATURE_SHADOW_DRAGON, 5 * diff)
AddHeroCreatures("Nemor", CREATURE_BANSHEE, 10 * diff)
AddHeroCreatures("Nemor", CREATURE_LICH_MASTER, 15 * diff)
AddHeroCreatures("Nemor", CREATURE_NOSFERATU, 25 * diff)
AddHeroCreatures("Nemor", CREATURE_GHOST, 30 * diff)
AddHeroCreatures("Nemor", CREATURE_DISEASE_ZOMBIE, 70 * diff)
AddHeroCreatures("Nemor", CREATURE_SKELETON_WARRIOR, 100 * diff)
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "SkullBatttle", "SkullBatttleScript")
function SkullBatttleScript(hero)
StartCombat(hero, "Nemor", 7,
CREATURE_SKELETON_WARRIOR, GetHeroCreatures("Nemor", CREATURE_SKELETON_WARRIOR),
CREATURE_DISEASE_ZOMBIE, GetHeroCreatures("Nemor", CREATURE_DISEASE_ZOMBIE),
CREATURE_GHOST, GetHeroCreatures("Nemor", CREATURE_GHOST),
CREATURE_NOSFERATU, GetHeroCreatures("Nemor", CREATURE_NOSFERATU),
CREATURE_LICH_MASTER, GetHeroCreatures("Nemor", CREATURE_LICH_MASTER),
CREATURE_BANSHEE, GetHeroCreatures("Nemor", CREATURE_BANSHEE),
CREATURE_SHADOW_DRAGON, GetHeroCreatures("Nemor", CREATURE_SHADOW_DRAGON),
nil, "SkullCombatEnd", nil, nil)
end
function SkullCombatEnd(hero, result)
if result then
if IsObjectExists("Nemor") == 0 then
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "SkullBatttle", nil)
MessageBox(path.."necroend.txt")
else
AddHeroCreatures("Nemor", CREATURE_SHADOW_DRAGON, 5 * diff)
AddHeroCreatures("Nemor", CREATURE_BANSHEE, 10 * diff)
AddHeroCreatures("Nemor", CREATURE_LICH_MASTER, 15 * diff)
AddHeroCreatures("Nemor", CREATURE_NOSFERATU, 25 * diff)
AddHeroCreatures("Nemor", CREATURE_GHOST, 30 * diff)
AddHeroCreatures("Nemor", CREATURE_DISEASE_ZOMBIE, 70 * diff)
AddHeroCreatures("Nemor", CREATURE_SKELETON_WARRIOR, 100 * diff)
end
end
end
Added 5 minutes later
Here is all the script code related to this hero:
DeployReserveHero("Nemor", 111, 121, 1)
sleep(2)
SetObjectOwner("Nemor", 8)
AddHeroCreatures("Nemor", CREATURE_SHADOW_DRAGON, 5 * diff)
AddHeroCreatures("Nemor", CREATURE_BANSHEE, 10 * diff)
AddHeroCreatures("Nemor", CREATURE_LICH_MASTER, 15 * diff)
AddHeroCreatures("Nemor", CREATURE_NOSFERATU, 25 * diff)
AddHeroCreatures("Nemor", CREATURE_GHOST, 30 * diff)
AddHeroCreatures("Nemor", CREATURE_DISEASE_ZOMBIE, 70 * diff)
AddHeroCreatures("Nemor", CREATURE_SKELETON_WARRIOR, 100 * diff)
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "SkullBatttle", "SkullBatttleScript")
function SkullBatttleScript(hero)
StartCombat(hero, "Nemor", 7,
CREATURE_SKELETON_WARRIOR, GetHeroCreatures("Nemor", CREATURE_SKELETON_WARRIOR),
CREATURE_DISEASE_ZOMBIE, GetHeroCreatures("Nemor", CREATURE_DISEASE_ZOMBIE),
CREATURE_GHOST, GetHeroCreatures("Nemor", CREATURE_GHOST),
CREATURE_NOSFERATU, GetHeroCreatures("Nemor", CREATURE_NOSFERATU),
CREATURE_LICH_MASTER, GetHeroCreatures("Nemor", CREATURE_LICH_MASTER),
CREATURE_BANSHEE, GetHeroCreatures("Nemor", CREATURE_BANSHEE),
CREATURE_SHADOW_DRAGON, GetHeroCreatures("Nemor", CREATURE_SHADOW_DRAGON),
nil, "SkullCombatEnd", nil, nil)
end
function SkullCombatEnd(hero, result)
if result then
if IsObjectExists("Nemor") == 0 then
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "SkullBatttle", nil)
MessageBox(path.."necroend.txt")
else
AddHeroCreatures("Nemor", CREATURE_SHADOW_DRAGON, 5 * diff)
AddHeroCreatures("Nemor", CREATURE_BANSHEE, 10 * diff)
AddHeroCreatures("Nemor", CREATURE_LICH_MASTER, 15 * diff)
AddHeroCreatures("Nemor", CREATURE_NOSFERATU, 25 * diff)
AddHeroCreatures("Nemor", CREATURE_GHOST, 30 * diff)
AddHeroCreatures("Nemor", CREATURE_DISEASE_ZOMBIE, 70 * diff)
AddHeroCreatures("Nemor", CREATURE_SKELETON_WARRIOR, 100 * diff)
end
end
end