Auto-translated
There is a problem:
```
function IsDjezebetDead()
SetObjectiveState("obj1",OBJECTIVE_COMPLETED)
SetObjectiveState("alive",OBJECTIVE_COMPLETED)
sleep(10)
SetObjectRotation(Edward,55)
SetObjectPosition(Edward,19,76,0,0)
SetObjectPosition(C1,21,77,0,0)
SetObjectPosition(C2,22,74,0,0)
SetObjectPosition("mage",20,74)
StartAdvMapDialog(0)
startThread(End)
end
function End()
StartDialogScene(path.."S3/DialogScene.xdb#xpointer(/DialogScene)")
sleep(5)
Win()
end
```
After defeating the hero, a dialog should start, followed by a cutscene, but instead, the victory is immediately registered (i.e., neither the dialog nor the cutscene plays). What is the problem?