How do I make a town get destroyed when it's captured?
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.
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4