#include "../config/missions_fp.lua"
#include "helpers/entity.lua"

function init()
	id = GetString("game.levelid"):match"^(.-)[_%d]*$"

    local mission = MissionsFP[id]
	if id ~= "" and mission then
		SetString("map.title", mission.title)
		SetString("map.description", mission.mapDesc)

		desc2 = mission.desc2
		if desc2 then
			SetString("map.description2", mission.desc2)
		end
		SetString("map.security.title", mission.securityTitle)
		SetString("map.security.description", mission.securityDesc)

        -- Attention: put this script AFTER heist.lua (if used)
        if mission.alarmTime then
            SetFloat("level.alarmtimer", mission.alarmTime + GetFloat("options.game.campaign.time"))
        end
	end
    cEntity:EnqueueDeletion()
end
