_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
New here? I'm Roha — want a quick tour?
Could you rephrase the task? I didn't understand when it should happen.
I think you'll understand everything if I tell you this: your weeks, considering every other one, form a cyclic group of order 2, isomorphic to the group of residues modulo two.
In short, if the remainder when dividing the week number by two is two, and the day of the week is Monday, then....
if (( GetDate(WEEK) == 2 ) or ( GetDate(WEEK) == 4 )) and ( GetDate(DAY_OF_WEEK) == 1 ) thenAnd now everything works as it should.
BlueHeavenHero, you can check the relevant question from the FAQ in my signature.
function FirstTalkBox()
TalkBoxForPlayers(PLAYER_1, "/Textures/Interface/CombatArena/Faces/Heaven/ico_Marksman_128.xdb#xpointer(/Texture)", nil, "/Text/TalkBox.txt", nil, "FirstTalkBoxCallback", 0, "/Text/Robber.txt", nil, 0, "/Text/Ans1.txt", "/Text/Ans2.txt", "/Text/Ans3.txt")
Trigger(OBJECT_TOUCH_TRIGGER,"rodder", nil)
end;
Trigger(OBJECT_TOUCH_TRIGGER,"rodder", "FirstTalkBox")
function FirstTalkBoxCallback(player, answer)
if (answer == 1) then
MessageBox("/Text/Rimours.txt")
SetObjectiveState("prim3",OBJECTIVE_ACTIVE,1)
elseif (answer == 2) then
QuestionBox("/Text/RobberJoin.txt", "RobberJoin", "SecondTalkBox")
elseif (answer == 3) then
MessageBox("/Text/RobberAttack.txt")
StartCombat("Hafad", nil, 3, 3, 9+1*diff, 5, 5+1*diff, 2, 13+1*diff, nil, nil, nil, nil)
end;
end;
function SecondTalkBox()
TalkBoxForPlayers(PLAYER_1, "/Textures/Interface/CombatArena/Faces/Heaven/ico_Marksman_128.xdb#xpointer(/Texture)", nil, "/Text/TalkBox.txt", nil, "SecondTalkBoxCallback", 0, "/Text/Robber.txt", nil, 0, "/Text/Ans4.txt", "/Text/Ans5.txt")
end;
function SecondTalkBoxCallback(player, answer)
if (answer == 1) then
MessageBox("/Text/Rimours.txt")
sleep(1)
SetObjectiveState("prim3",OBJECTIVE_ACTIVE,1)
elseif (answer == 2) then
MessageBox("/Text/Objectives/CaptureCastle.txt")
sleep(1)
OpenCircleFog(126, 139, 0, 4, 1)
MoveCamera(126, 139, 0, 3, 0, 0, 1, 1)
sleep(1)
MessageBox("/Text/Rimours.txt")
SetObjectiveState("prim3",OBJECTIVE_ACTIVE,1)
end;
function RobberJoin()
AddHeroCreatures("Hafad", 1, 13)
AddHeroCreatures("Hafad", 3, 9)
AddHeroCreatures("Hafad", 5, 5)
sleep(1)
TalkBoxForPlayers(PLAYER_1, "/Textures/Interface/CombatArena/Faces/Heaven/ico_Marksman_128.xdb#xpointer(/Texture)", nil, "/Text/TalkBox.txt", nil, "SecondTalkBoxCallback", 0, "/Text/Robber.txt", nil, 0, "/Text/Ans4.txt", "/Text/Ans5.txt")
end;
end;
The `end` statements are incorrectly placed. There are two `end` statements after the `RobberJoin` function (there should be only one), and one `end` statement after the second talkbox callback (there should be two). Because of this, the function became local, so it is not visible from other functions, and attempting to call it after the talkbox results in an error.
As far as I know, it’s impossible to create a custom spell to summon creatures during a battle. Such a summon will only work on the adventure map.
function RazedBridge(hero)
FirstStartRaskopok = GetDate(DAY)
if GetObjectiveState("BuildBridge") == OBJECTIVE_UNKNOWN then
SetObjectiveState("BuildBridge",OBJECTIVE_ACTIVE, 1)
MessageBox("/Text/RazedBridge.txt")
end;
if GetObjectiveState("BuildBridge") == OBJECTIVE_ACTIVE and GetHeroCreatures(hero,1) >= 200 then
RemoveHeroCreatures(hero,1,200)
SetObjectiveState("BuildBridge",OBJECTIVE_COMPLETED)
sleep(2)
startThread(BuildBridge)
Trigger(REGION_ENTER_AND_STOP_TRIGGER,"razedbridge", nil)
end;
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER,"razedbridge", "RazedBridge")
function BuildBridge()
Play3DSound("/Sounds/_(Sound)/SFX/Seige-Destr/destr01.xdb#xpointer(/Sound)", 56, 97, 0)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 94, 2, 0, GROUND)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 97, 2, 0, GROUND)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 100, 2, 0, GROUND)
sleep(5)
Play3DSound("/Sounds/_(Sound)/SFX/Seige-Destr/destr01.xdb#xpointer(/Sound)", 56, 97, 0)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 94, 2, 0, GROUND)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 97, 2, 0, GROUND)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 100, 2, 0, GROUND)
end;
function newday()
if GetObjectiveState("BuildBridge") == OBJECTIVE_COMPLETED then
if GetDate(DAY) - FirstStartRaskopok == 1 then
MessageBox("/Text/Five.txt")
Play3DSound("/Sounds/_(Sound)/SFX/Seige-Destr/destr01.xdb#xpointer(/Sound)", 56, 97, 0)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 94, 2, 0, GROUND)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 97, 2, 0, GROUND)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 100, 2, 0, GROUND)
end;
if GetDate(DAY) - FirstStartRaskopok == 2 then
MessageBox("/Text/Four.txt")
Play3DSound("/Sounds/_(Sound)/SFX/Seige-Destr/destr01.xdb#xpointer(/Sound)", 56, 97, 0)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 94, 2, 0, GROUND)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 97, 2, 0, GROUND)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 100, 2, 0, GROUND)
end;
if GetDate(DAY) - FirstStartRaskopok == 3 then
MessageBox("/Text/Three.txt")
Play3DSound("/Sounds/_(Sound)/SFX/Seige-Destr/destr01.xdb#xpointer(/Sound)", 56, 97, 0)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 94, 2, 0, GROUND)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 97, 2, 0, GROUND)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 100, 2, 0, GROUND)
end;
if GetDate(DAY) - FirstStartRaskopok == 4 then
MessageBox("/Text/Two.txt")
Play3DSound("/Sounds/_(Sound)/SFX/Seige-Destr/destr01.xdb#xpointer(/Sound)", 56, 97, 0)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 94, 2, 0, GROUND)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 97, 2, 0, GROUND)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 100, 2, 0, GROUND)
end;
if GetDate(DAY) - FirstStartRaskopok == 5 then
MessageBox("/Text/One.txt")
Play3DSound("/Sounds/_(Sound)/SFX/Seige-Destr/destr01.xdb#xpointer(/Sound)", 56, 97, 0)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 94, 2, 0, GROUND)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 97, 2, 0, GROUND)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 100, 2, 0, GROUND)
end;
if GetDate(DAY) - FirstStartRaskopok == 6 then
MessageBox("/Text/BuildBridge.txt")
Play3DSound("/Sounds/_(Sound)/SFX/Seige-Destr/destr01.xdb#xpointer(/Sound)", 56, 97, 0)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 94, 2, 0, GROUND)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 97, 2, 0, GROUND)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 100, 2, 0, GROUND)
sleep(1)
RemoveObject("razedbridge1")
RemoveObject("razedbridge2")
RemoveObject("razedbridge3")
sleep(1)
Play3DSound("/Sounds/_(Sound)/SFX/Seige-Destr/destr01.xdb#xpointer(/Sound)", 56, 97, 0)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 94, 2, 0, GROUND)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 97, 2, 0, GROUND)
PlayVisualEffect( "/Effects/_(Effect)/Buildings/Capture/Start_dust_S.xdb#xpointer(/Effect)", "", "tag1", 56, 100, 2, 0, GROUND)
sleep(1)
SetObjectPosition("bridge1", 56, 97, 0)
SetObjectPosition("bridge2", 56, 97, 0)
SetObjectPosition("bridge3", 56, 100, 0)
end;
end;
end;
Trigger(NEW_DAY_TRIGGER, 'newday')