Thank you very much, it helped. Could you please give me another piece of advice? How can I implement the following idea: initially, a certain building cannot be constructed in a town, but it can be unlocked and upgraded by completing a side quest. I have already created the initial dialogue window with the NPC and configured the quest (destroying a group of neutral creatures). However, I have some questions: how can I, upon completing the quest and returning to the NPC, disable the initial function with dialogue #1 and activate the function with dialogue #2 in the same region, and unlock the building as a reward?
----
Function for the introduction, with dialogue #1
----
function Barracks_build(hero)
Barracks_hero = hero
MessageBox("/Maps/SingleMissions/Time of Troubles1/Barracks_building.txt",nil)
QuestionBox("/Maps/SingleMissions/Time of Troubles1/Barracks_buildingQB.txt", "Barracks_build_ok",nil);
end
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "QuestSword", "Barracks_build",nil)
----
Function for agreement, with dialogue #2
----
function Barracks_build_ok()
MessageBox("/Maps/SingleMissions/Time of Troubles1/Barracks_building1.txt");
SetObjectiveState("zadanie1", OBJECTIVE_ACTIVE,1);
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "QuestSword", "Barracks_build",nil)
end
----
Auto-translated