event_inherited();

dist_tor = 144;
dist_y_tor = 48;
indi_y_offset = -192;

npc_name = "warden";
session_count = 0;
chat = false;

callback = function()
{
    var _flags = global.save_data.world.npc_flags[$ npc_name];
    
    for(var i = 0; i < array_length(_flags); i++)	
        if _flags[i] == 0
        {
            var _lines = global.dialogue[$ npc_name][i];
            var _index = min(session_count, array_length(_lines) - 1);
            
            if ++session_count >= array_length(_lines)
			{
				session_count = 0;
                _flags[i] = 1;
			}
            
            type(_lines[_index], unlock_player);
			return;
        }
	chat = true;
    type(global.dialogue[$ npc_name][0], unlock_player);
}
depth = 10;