Auto-translated
function TransformDwelling(hero, hut)
local state = GetObjectiveState('required_quest')
if GetCurrentPlayer() == 1 and (state == OBJECTIVE_ACTIVE or state == OBJECTIVE_FAILED) then
QuestionBox (path.."transformd.txt" , 'transformnok("'..hut..'")' );
end
end
Something like this, if I understood the conditions correctly.
Everything works, thank you.