Skip to content

OnSiegeEngineDestroyed

A siege engine was wrecked - by another engine’s shots, or by the mode.

Its structure fell to 0 (SetSiegeEngineHealth says how much it has). A wreck stands where it was: nobody can work it until SetSiegeEngineHealth repairs it, or DestroyEntity removes it. A broken siege ladder lies on the ground in pieces, and whoever climbed it came down with it.

function OnSiegeEngineDestroyed(id, by)
-- ...
end
Parameter Type
id number the engine
by number the player whose shot wrecked it; -1 = the mode (SetSiegeEngineHealth with 0) or a shot nobody fired

nothing

function OnSiegeEngineDestroyed(id, by)
if by >= 0 then SendClientMessageToAll(COLOR_YELLOW, GetPlayerName(by) .. " wrecked a " .. GetEntityTemplate(id) .. "!") end
SetTimer(function() SetSiegeEngineHealth(id, 100) end, 120000) -- rebuilt two minutes later
end

SetSiegeEngineHealth · OnSiegeImpact · the Siege engines group of the index