The battle ends only when there are no hydras left, neither summoned nor regular ones.
----
Why are you checking for hydra deaths during movement (DefenderCreatureMove) and not during the actual death (DefenderCreatureDeath)? This isn't a complaint, but just a question: why? Is it definitely impossible to do it differently?