Skip to content
User Avatar
#2131
Auto-translated
Bravo1853
How do I make a town get destroyed when it's captured?
There are two options:
function raze_captured_town(oldowner, newowner, hero, town)
Trigger(OBJECT_CAPTURE_TRIGGER, town, nil)
RazeTown(town)
end

Trigger(OBJECT_CAPTURE_TRIGGER, 'script_town_name', 'raze_captured_town')
function raze_captured_town(oldowner, newowner, hero, town)
Trigger(OBJECT_CAPTURE_TRIGGER, town, nil)
MakeTownMovable(town)
sleep()
RemoveObject(town)
end

Trigger(OBJECT_CAPTURE_TRIGGER, 'script_town_name', 'raze_captured_town')
The first option leaves behind ruins, but it only works with Haven and Inferno towns. The second option simply removes the town, but it works for towns of all factions.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4