Всем привет! На днях занялся тестированием сценария, и во время тестов обнаружил проблему - скрипт, который восстанавливает разрушенный мост, работает, но финал меня разочаровал. Мост строится, но Пройти по нему почему-то невозможно!
Заранее спасибо за помощь.
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')