I think you just need to wait for the battle to end, and then run the function again based on the result.
And yes, RedHeaven is right, you need to carefully check the contents. Otherwise, one trigger will overwrite another, at the very least.
Sorry, I made a mistake. I forgot to mention that the call date also changed, in addition to the function name and hero name. Basically, demons would emerge from the gates of hell and all run to one point, so the RedHeavenHero option is perfect... And can I ask another question? Could you tell me how to set time limits for multiple tasks? I had no problems with one, I wrote a trigger so that upon reaching a certain date, a defeat would be issued, and upon fulfilling the condition, the trigger would be reset, but when I needed another time limit for the next task, I tried to duplicate the function as in the first case, substituting new values, but both functions stopped working. I also tried to combine two functions into one using elseif, thanks to the hints, but I couldn't get anything working... In general, please tell me how I can implement 2 time limits (or intervals) for completing tasks... For example, "capture garrison 1 within one week" and "capture garrison 2 within 3 weeks". Sorry for the long text, I hope I didn't confuse you. As always, thank you in advance...
Added 18 hours 22 minutes ago
In general, I wrote a bunch of nonsense there... Please take a look, the first function is at the top, and the two loose triggers are at the bottom. According to my idea, I wrote NEW_DAY_TRIGGER, which, upon reaching the desired date, would issue a defeat without any questions, and I wouldn't reset this trigger, but I would insert the reset into the task execution function... At first, when there was only one loose trigger, everything worked as it should, but then when there were two triggers, because another "timed" task appeared, both of them stopped working. Please help, how can I make loose2 and loose3 work, I really need it, it's a matter of life and death :smile45: