Skip to content
User Avatar
#3869
Auto-translated
Hello everyone! I recently started testing a scenario, and during the tests, I found a problem: the script that restores the destroyed bridge works, but the ending disappointed me. The bridge is built, but for some reason, it is impossible to cross it! Thank you in advance for your help.
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')
Attachments 1
1 file attached • Total size: 669.9 KB

Мои карты:
Падший рыцарь
Сердце Хаоса

Мои моды:
Визуальные:
Изменение внешнего вида героев-некромантов
Существа-жители и кое-что по мелочи в городах Ордена Порядка, Некрополиса и Инферно

NCF-существа:
Странствующие рыцари
Наемники