Skip to content
User Avatar
#3290
Auto-translated
I have one large script. qwert(1, 2, and 3) are quests. Next, I defined 2 variables with the values of identifiers (monks and angels). gar_(1, 2, 3, and 4) are garrisons. Calid and Nymus are 2 demons. Next, I have a check: if the garrison belongs to player 4 (demons), then they will move to the Castle located at coordinates 41, 14. Then, if the quest qwert3 is completed, the variables that are responsible for the angel and monk identifiers will be incremented by one, and they will become upgraded creatures. Next, if the day of the week is 6 and the quest qwert1 is completed, then 15 monks should arrive in all 4 garrisons, and if the quest qwert3 is completed, they will be inquisitors, and if the quest qwert2 is completed and the day of the week is 5, then angels will arrive in the garrisons, also, if quest 3 is completed, they will be upgraded. Next, the second part of the function: If the day is 7, then a demon appears on the map, it moves towards the garrison, and also on day 14, Nymus appears, who also moves towards the garrison, but to a different one, the one closest to him. The script worked perfectly at the initial stage, but when I added the script that is at the beginning, which is responsible for the priority point of the demons, everything broke down (First, they should appear initially and run to the garrison, capture it, stand in the garrison for 1 day, and on the new day, their priority point becomes the Castle, and they run to it). I would be very grateful to anyone who can help me figure it out. function demon() local p1 = GetObjectiveState('qwert1', PLAYER_1); local p = GetObjectiveState('qwert2', PLAYER_1); local opr = 9 local opr3 = 13 local p2 = GetObjectiveState('qwert3', 1); local ggg = GetObjectOwner('gar_1'); local ggg1 = GetObjectOwner('gar_2'); local ggg2 = GetObjectOwner('gar_3'); local ggg3 = GetObjectOwner('gar_4'); if ggg = 4 then MoveHero('Calid', 41, 14, 0); MoveHero('Nymus', 41, 14, 0); elseif ggg1 = 4 then MoveHero('Calid', 41, 14, 0); MoveHero('Nymus', 41, 14, 0); elseif ggg2 = 4 then MoveHero('Calid', 41, 14, 0); MoveHero('Nymus', 41, 14, 0); elseif ggg3 < 4 then MoveHero('Calid', 41, 14, 0); MoveHero('Nymus', 41, 14, 0); end; end; local p2 = GetObjectiveState('qwert3', 1); if p2 == OBJECTIVE_COMPLETED then opr = opr + 1 if p2 == OBJECTIVE_COMPLETED then opr = opr3 + 1 if p1 == OBJECTIVE_COMPLETED and GetDate(DAY_OF_WEEK) == 6 then AddObjectCreatures('gar_1', opr, 15); AddObjectCreatures('gar_2', opr, 15); AddObjectCreatures('gar_3', opr, 15); AddObjectCreatures('gar_4', opr, 15); elseif p == OBJECTIVE_COMPLETED and GetDate(DAY_OF_WEEK) == 5 then AddObjectCreatures('gar_1', opr3, 3); AddObjectCreatures('gar_2', opr3, 3); AddObjectCreatures('gar_3', opr3, 3); AddObjectCreatures('gar_4', opr3, 3); elseif GetDate(0) == 7 then DeployReserveHero('Calid', 2, 16, 0, 0); sleep(5); MoveHero('Calid', 7, 15, 0); elseif GetDate(0) == 14 then DeployReserveHero('Nymus', 5, 1, 0, 0); sleep(5); MoveHero('Nymus', 5, 4, 0); Also, regarding the previous script that I asked about. In one of the Heroes 5 campaigns, in the mission for the League of Shadows, there was a quest: The player has a dragon in their army, and it must not die; if it died in any battle, the player would lose. I want to make a similar script: 4 peasants appear in my army, then I have to go with them to one place, and when I get there, they should disappear (I can do everything I wrote). But how do I make it so that after any of the battles, if they die, the quest fails?

Statistics

Welcome our newest member: leyu