--Should be called within the die function of a ment.
function p.main(inst_id)
    local ment_type = ga_ment_get_type(inst_id)

    --Adding experience points.
    game_xp.ment_add(inst_id)

    --Dropping a bent or drop box.
    if  ga_ment_var_exists(ment_type, "die_drop_bent")
    then
        local drop_bent = ga_ment_get_static_s(ment_type, "die_drop_bent")
        --
        local drop_extra_levels = 0
        if( ga_ment_var_exists(ment_type, "die_drop_extra_levels") ) then
            drop_extra_levels = ga_ment_get_static_i(ment_type, "die_drop_extra_levels")
        end
        -- --
        local drop_box_allow = false
        if  ga_ment_var_exists(ment_type, "die_drop_box_allow") then
            drop_box_allow = ga_ment_get_static_b(ment_type, "die_drop_box_allow")
        end
        --
        local drop_box_txt = "NOT SET"
        if  ga_ment_var_exists(ment_type, "die_drop_box_txt") then
            drop_box_txt = ga_ment_get_static_s(ment_type, "die_drop_box_txt")
        end
        -- --
        local start_level = ga_ment_get_i(inst_id, "__start_level")
        local sllp = ga_ment_get_sllp(inst_id)
        game_ment_drop.drop_general(
            start_level, sllp,
            drop_bent,
            drop_extra_levels,
            drop_box_allow,
            drop_box_txt)
    end

    local death_anim = ga_ment_get_s(inst_id, "__death_anim")

    --Blood explosion.
    --(Not doing if in dark-hole type death).
    if( death_anim == "" ) then
        game_ment_blood.die_explosion(inst_id)
    end

    --Sound.
    local death_sound = "monster_death"
    if( ga_ment_var_exists(ment_type, "sound_death") and
        death_anim == "" )
    then
        death_sound = ga_ment_get_static_s(ment_type, "sound_death")
    end
    game_play_monster_die_sound.play(death_sound)
end
