BlueHeavenHero, I understand... Then, let's rewrite the function like this:
function TownCaptured( oldowner, newowner )
if ( newowner == PLAYER_1 ) and ( IsHeroAlive("Christian") ~= true ) then
StartDialogScene("/DialogScenes/FallenKnight/S3/DialogScene.xdb#xpointer(/DialogScene)")
sleep(1)
DeployReserveHero("Christian", 98, 108, 0)
SetObjectiveState("prim5", OBJECTIVE_COMPLETED, 1)
SetObjectiveState("prim6", OBJECTIVE_ACTIVE, 1)
sleep(3)
MoveHero("Christian", 126, 139, -1)
end
if newowner == PLAYER_2 then
SetObjectiveState("prim5", OBJECTIVE_FAILED, 1)
sleep(10)
Loose()
end
end
Trigger( OBJECT_CAPTURE_TRIGGER, "castle", "TownCaptured" );Using the same logic, we'll attach a trigger to the loss of heroes for the player who owns your hero. When the hero is lost, a function will be launched that checks if the player lost the correct hero, and then a video will play or something else will happen if needed.
If the battle is launched through StartCombat, there is an argument that allows you to launch a function after the battle is over. Write a function with text that will be launched after the battle and display the text.
Auto-translated