I've encountered a problem! In the original Heroes Campaign, in the fifth mission, after Godric frees Isabelle, Agrail attacks the Castle. I decided to implement the same feature in my scenario, but the dialogue scene plays BEFORE Vittorio attacks the Castle!
If you need it to trigger after the town is captured, you need to add a script for town capture with activation of the function through OBJECT_CAPTURE_TRIGGER, where we check who captured it and who the new owner is, and then trigger the video if the town was captured by the player who owns the hero you need. Something like this:
function TownCaptured( oldowner, newowner )
if IsHeroAlive("Hafad") then
if IsHeroAlive("Christian") then
if ( newowner == GetObjectOwner("Christian") ) then
StartDialogScene("/DialogScenes/FallenKnight/S3/DialogScene.xdb#xpointer(/DialogScene)")
sleep(1)
SetObjectiveState("prim5", OBJECTIVE_COMPLETED, 1)
SetObjectiveState("prim6", OBJECTIVE_ACTIVE, 1)
elseif newowner == PLAYER_2 then
SetObjectiveState("prim5", OBJECTIVE_FAILED, 1)
sleep(10)
loose()
end
end
end
end
Trigger( OBJECT_CAPTURE_TRIGGER, "castle", "TownCaptured" );Thus, after MoveHero from the function with the hero respawn, you can remove the conditions and actions.