x211402_g_scriptId = 211402

--杀的怪的sceneNpc id
x211402_g_MonsterFlagId = { 999350, 999351, 999352, 999353, 999354, 999355, 999356, 999357, 999358, 999359, 999360, 999361, 999362, 999363 }

x211402_g_missionId = 291

function x211402_OnMissionAccept(scene, selfId)
    if AddMissionNN(scene, selfId, x211402_g_missionId) then
        --添加任务，不同步
        DispatchMission(scene, selfId, x211402_g_missionId, 0)      --同步任务
        if GetEMissionFlagId(scene, selfId) then
            SetMissionState(scene, selfId, x211402_g_missionId, 2)
        else
            SetMissionState(scene, selfId, x211402_g_missionId, 1)
            SetMissionCaredEvent(scene, selfId, x211402_g_missionId, 0, true)
        end
    end
end

function x211402_OnKillMonster(scene, selfId, monsterId)
    if GetEMissionFlagId(scene, selfId) == true then
        local status = GetMissionState(scene, selfId, x211402_g_missionId)
        if status == 1 then
            SetMissionState(scene, selfId, x211402_g_missionId, 2)         --设置任务状态为可交 Mission_Completed
        end
    else
        for i = 1, #x211402_g_MonsterFlagId do
            if monsterId == x211402_g_MonsterFlagId[i] then
                SetMissionState(scene, selfId, x211402_g_missionId, 2)         --设置任务状态为可交 Mission_Completed
                break
            end
        end
    end
end

--检查任务是否可以完成
function x211402_CheckCompleted( scene,selfId )
    -- body
    return true
end