Auto-translated
I have a hero in the dungeon, and I need to set a condition under which he can be released. That is, so that when someone approaches the dungeon, the prisoner does not immediately come out, but only if certain requirements are met, for example, if 2 artifacts are brought. It should look something like this:
artId=23 # my art's id
art2Id=24 #
If (HasArtifact(getCurrentHero(),artId) and HasArtifact(getCurrentHero(),art2Id) ) then
RemoveArtefact(getCurrentHero(), artId);
RemoveArtefact(getCurrentHero(), art2Id);
FreeHero(prisonedHerO) else
showmessage("an artifact is needed");
end;
However, I can't find how to get the name of the hero who visits the dungeon (there is no such function as getCurrentHero()) and how to make it so that when visiting the dungeon, the hero is released only if my IF condition is met. (FreeHero(prisonedHerO) - ??)