а были же где-то всплывающие иконки монстров? на каком-то объекте? или мне казалось...
Whatever
Впервые здесь? Я Роха — провести быструю экскурсию?
function burn()
----
for i, hut in GetObjectNamesByType('PEASANT_HUT') do
Trigger(4, hut, 'hutF')
end
-----
startThread(burn2)
end
startThread(burn)
---
fires = 0
function burn2(hero, hut)
while 1 do
sleep(1)
if GetCurrentPlayer() == 1 and fires == 0 then
SetObjectEnabled(hut , nil)
fires = 1
elseif GetCurrentPlayer() == 2 or GetCurrentPlayer() == 3 or GetCurrentPlayer() == 4 then
SetObjectEnabled(hut , true)
fires = 0
end
end
end
----
hutt = 0
----
fire2 = 0
function hutF(hero, hut)
if GetCurrentPlayer() == 1 and fire2 == 0 then
sleep(1)
QuestionBox ( "/Maps/SingleMissions/NewRandomMap 43/burn1.txt" , 'burnok' , 'burnno');
sleep(1)
end
end
function burnok(hero, hut)
sleep(1)
BlockGame()
--burn hut effects
hutt = hutt + 1
Trigger(4, hut, nil)
UnblockGame()
end
function burnno(hero, hut)
sleep(1)
fire2 = 1
SetObjectEnabled(hut, true)
sleep(1)
MakeHeroInteractWithObject('Nymus' , hut)
sleep(1)
SetObjectEnabled(hut, nil)
fire2 = 0
endКстати, а зачем столько минусов между строк?
надо. я уставший и начинаю путаться, не могу отличить одно от другого. Вот и ставлю enterы и минусики)))
Ещё: startThread(burn2) нужно писать внутри цикла.
HAVEN_DWLS = {}
hutt = 0
function burn()
for i, dw_type in {"PEASANT_HUT", "ARCHERS_HOUSE", "BARRACKS", "HEAVEN_MILITARY_POST"} do
for j, dw in GetObjectNamesByType(dw_type) do
HAVEN_DWLS[dw] = "откл"
SetObjectEnabled(dw, nil)
Trigger(4, dw, "BurnHavenDwelling")
end
end
startThread(burn2)
end
startThread(burn)
function burn2()
while 1 do
repeat
sleep()
until IsPlayerCurrent(1)
for dwelling, state in HAVEN_DWLS do
if state == "вкл" then
HAVEN_DWLS[dwelling] = "откл"
SetObjectEnabled(dwelling, nil)
Trigger(4, dwelling, "BurnHavenDwelling")
end
end
repeat
sleep()
until not IsPlayerCurrent(1)
for dwelling, state in HAVEN_DWLS do
if state == "откл" then
HAVEN_DWLS[dwelling] = "вкл"
SetObjectEnabled(dwelling, 1)
Trigger(4, dwelling, nil)
end
end
end
end
function BurnHavenDwelling(hero, hut)
if GetCurrentPlayer() == 1 then
QuestionBox ( "/Maps/SingleMissions/NewRandomMap 43/burn1.txt" , 'burnok("'..hut..'")' , 'burnno("'..hut..'")');
end
end
function burnok(hut)
Trigger(4, hut, nil)
hutt = hutt + 1
HAVEN_DWLS[hut] = nil
end
function burnno(hut)
SetObjectEnabled(hut, 1)
Trigger(4, hut, nil)
sleep(1)
MakeHeroInteractWithObject('Nymus' , hut)
sleep(1)
SetObjectEnabled(hut, nil)
Trigger(4, hut, "BurnHavenDwelling")
end