if dik = DIK_keys.DIK_J then
local oSim = alife();
local oActor = db.actor;
if not oSim then -- На всякий случай..
return true;
end
local iId = story_objects.get_story_objects_registry():get( 'zat_b7_bandit_boss_sultan');
local oNpc = level.object_by_id( iId);
local function runDialog( object)
if oActor then -- Тоже всякий случай..
oActor:run_talk_dialog( object, true);
end
end
if not oNpc then
oSim:set_switch_online( iId, true);
oSim:set_switch_offline( iId, false);
level.client_spawn_manager():add( iId, 0, runDialog); -- Отлавливаем переход нпс в онлайн и вызываем функцию
else
runDialog( oNpc);
end
end