Root170670 30 Опубликовано 22 Марта 2017 (изменено) В файле: params.script находим текстfunction set_torch_param(id,r,g,b,sw)lightman.set_lamp_rgb(id,r,g, if not sw then return endlocal range = 18*r*sw - увеличиваем значение дальностьlocal spot = 1.4/(sw) - меняем значение радиусlightman.set_light_range(id, range)lightman.set_spot_angle(id, spot);endПроверено на сборке от mikelik. В файле sak.script: находим текст function cant_trade(obj,sect,id,flag) if flag==1 or flag==2 then params.cant_trade_add(id) else if strpos(sect,"wpn_",1,true) or strpos(sect,"_outfit",1,true) then local cond=obj:condition() if (cond<0.65 and trade_flag==false) then -- поставить нули params.cant_trade_add(id) else params.can_trade_add(id) end Проверено на сборке от mikelik. Вечные фонарик, артефакты, батарея подсказка от "mikelik" 16 пост. В начале игры фонарик один раз зарядить и всё.-----------------------------------------------------------------в файле sak.script:function empted_akkum(flag)if db.actor:item_in_slot(11) thenlocal obj_id=db.actor:item_in_slot(11):id()local obj=sim:object(obj_id)if obj thennv_on=params.get_nv_on_off(torch_id) or 0local antitushif sak_inventory.sash["af_full_antitush"] thenantitush=20elseantitush=0endlocal razrad=(af_kolvo+nv_on+antitush)*0.005*loka_on <-------------------- изменить на нулиlocal pk = get_netpk(obj,1)local data = pk:get()local cond=data.condition+0.0004 <-------------------- изменить на нулиif cond>=1 then cond=0.9999 endif cond > 0.06 thenif flag then arts_operate=true return endlocal new_cond=cond-razradparams.obj_condition(obj_id, new_cond)data.condition = new_condpk:set(data)arts_operate=trueelseif arts_operate==true thensend_tip("Аккумулятная батарея разряжена.","Аккумулятор",2,10,"pribor","pda_news", "red")lightman.toggle_NVD(torch_id)arts_operate=falserazgruzka.open_inv_raz_pod=false---------------------------------------------в файле sak.script:function torch_brock(switcher,sw)if torch_id and (params.get_torch_on_off(torch_id)==1 or switcher) thenif lua_random()<0.15 and not sw thenlocal r_t=(r_old*(lua_random(3,10))/10)params.set_torch_param(torch_id,r_t,r_t,r_t,mode_switch)local time_flash=lua_random(1,3)timers.start_timer("t_torch_flash",time_flash,"sak.torch_brock()")returnendr_old=r_old+(mode_switch-1)*0.1local r_new,g_new=r_old,(r_old-0.07) <-------------------- изменить на нулиif r_new>0.11 and not sw thenr_new = r_new-(0.007*(mode_switch*2)) <-------------------- изменить на нули (0.0*(mode_switch*2))g_new = g_new-(0.007*(mode_switch*2)) <-------------------- изменить на нули (0.0*(mode_switch*2))endПроверено на сборке от mikelik Для быстрого использования в файле: vergas_medical_elastic.script - подсказка от "mikelik" 16 пост function init_treatment()help_id = -1snd_eat_med()wprintf("[~T]. #DBG: init_treatment called with object~C0A %s~C07 ", obj_name)local heal_coef = 7 / (3 + level.get_game_difficulty()) -- коэффициент лечения от сложности игрыheal_time = vergas_lib.set_pr_from_config(obj_name,"mr_time")delta_health = vergas_lib.set_pr_from_config(obj_name,"mr_eat_health") / heal_time / 60.0 <----------- Ставим 1.0delta_power = vergas_lib.set_pr_from_config(obj_name,"mr_eat_power") / heal_time / 20.0 <----------- Ставим 1.0delta_radiation = vergas_lib.set_pr_from_config(obj_name,"mr_eat_radiation") / heal_time / 60.0 <----------- Ставим 1.0post_eff = vergas_lib.set_pr_from_config(obj_name,"post_eff")--wprintf("[~T]. #DBG: init_treatment heal_coef = %.3f, heal_time = %d, delta_health = %.5f ", heal_coef, heal_time, delta_health)heal_time = heal_time * 60.0 ------------------------------------- Ставим 1.0delta_health = delta_health * heal_coefdelta_power = delta_power * heal_coefdelta_radiation = delta_radiation * heal_coefheal_start = game.get_game_time()heal_last = game.get_game_time()msg_last = 0--if obj_name~="bandage" thenif heal_time > 0 thenlevel.add_pp_effector(vis_post_eff[post_eff], 1021, true)end--endin_progress = trueif obj_name == "mixture" thenparams.psy_health_v_add(20)endmedical_procedures()endfunction medical_procedures()local portion = 0if not in_progress or type(heal_last) ~= "userdata" or type(heal_start) ~= "userdata" thenwprintf("~C0C #WARN:~C07 in_progress = %s, heal_start = %s, heal_last = %s - no actions ", DumpVar(in_progress), DumpVar(heal_start), DumpVar(heal_last))returnendschedule.add("med_procedur", "vergas_medical_elastic.medical_procedures()", 200)local time_cur = game.get_game_time()local d_sec = time_cur:diffSec(heal_last)local d_heal = time_cur:diffSec(heal_start)if d_sec < 10 then <------------------------------------- Ставим 1-- wprintf("~C09 d_sec =~C0D %.2f ~C07", d_sec)returnendheal_last = time_cur----------------------------------Полностью нули не ставить.Проверено на сборке от mikelik. в файле sak.script:if arts_operate and not level.main_input_receiver() thenlocal section=obj:section_name()local pk = get_netpk(obj,1)local data = pk:get()local cond=data.condition+0.0004 <-------------------- изменить на нулиif cond>=1 then cond=0.9999 endlocal cond1=math.floor(cond*100)if cond>0.25 thenlocal new_cond=(cond-0.002) <-------------------- изменить на нулиif strpos(section,"_buliz",1,true) thennew_cond=cond-0.0025 <-------------------- изменить на нулиelseif strpos(section,"dummy_",1,true) thennew_cond=cond-0.01 <-------------------- изменить на нулиelseif strpos(section,"af_full_antitush",1,true) thennew_cond=cond-0.1 <-------------------- изменить на нулиelseif strpos(section,"_1",1,true) thennew_cond=cond-0.005 <-------------------- изменить на нулиelseif strpos(section,"_2",1,true) thennew_cond=cond-0.0025 <-------------------- изменить на нулиelseif strpos(section,"_3",1,true) thennew_cond=cond-0.001 <-------------------- изменить на нулиelseif strpos(section,"_4",1,true) thennew_cond=cond-0.00075 <-------------------- изменить на нулиendparams.obj_condition(obj_id, new_cond)data.condition = new_condpk:set(data)elselocal new_artif strpos(section,"_dyn",-6,true) thennew_art=string.sub(section,1,-7).."_dyn6d"elseif strpos(section,"dummy_",1,true) thennew_art=section.."_fake"elseif strpos(section,"af_full_antitush",1,true) thennew_art=section.."_fake"elseif strpos(section,"_1",-2,true) thennew_art=string.gsub(section, "_1", "_5")elseif strpos(section,"_2",-2,true) thennew_art=string.gsub(section, "_2", "_6")elseif strpos(section,"_3",-2,true) thennew_art=string.gsub(section, "_3", "_7")elseif strpos(section,"_4",-2,true) thennew_art=string.gsub(section, "_4", "_8")endcoord_params.set_obj_section(obj_id, new_art)consumable_artefacts=nilendrazgruzka.open_inv_raz_pod=falseendelseconsumable_artefacts=nilendendendelsearts_operate=falseendif flag then return endif level.name()=="aver" then return endlocal npc=db.actorlocal act_pos=npc:position()if not amk_anoms.check_coordinates(act_pos) then return endif sak_inventory.rucksack["af_dummy_black_tip"] thenlocal obj_id=sak_inventory.rucksack["af_dummy_black_tip"][1]local obj=sim:object(obj_id)if obj thenlocal pk = get_netpk(obj,1)local data = pk:get()local cond=data.condition+0.0004 <-------------------- изменить на нулиif cond>=1 then cond=0.9999 endif cond>0.25 thenlocal new_cond=cond-0.0025 <-------------------- изменить на нулиparams.obj_condition(obj_id, new_cond)data.condition = new_condpk:set(data)elsemisc.release_obj(obj_id, 'sak.script:1346')db.actor:disable_info_portion("info_black_tip")nlc_vars.black_off = 0.8endendendendfunction new_art_cond(obj_id,cnd,sect)local objg=client_obj(obj_id)local cond = cnd or 0.25if objg then objg:set_condition(cond) endarc_arts.register_artefact(sect.."_99",-1)endfunction sleep_razrjad_akkum(hour)sleep_razrjad_torch(hour)if arts_operate thenlocal obj_id=db.actor:item_in_slot(11):id()local obj=sim:object(obj_id)local tm_sl=hour*10if obj thenlocal razrad=(af_kolvo)*0.005*loka_on*tm_sl <-------------------- изменить на нулиlocal pk = get_netpk(obj,1)local data = pk:get()local cond=data.condition+0.0004 <-------------------- изменить на нулиif cond>=1 then cond=0.9999 endif cond > 0.06 thenif flag then arts_operate=true return endlocal new_cond=cond-razradparams.obj_condition(obj_id, new_cond)data.condition = new_condpk:set(data)arts_operate=trueelseif torch_id and arts_operate==true thenlightman.toggle_NVD(torch_id)arts_operate=falserazgruzka.open_inv_raz_pod=falseendendendfor i,k in pairs(sak_inventory.sash) dolocal ini=system_ini()if ini:section_exist(i) thenlocal class=ini:r_clsid(i, "class")if class==CLID_ART thenlocal kolvo=table.getn(k)if (string.find(i,"dummy_",1,true) or string.find(i,"_1",1,true) or string.find(i,"_2",1,true) or string.find(i,"_3",1,true) or string.find(i,"_4",1,true) or strpos(i,"_dyn",-6,true)) and (not strpos(i,"_dyn6d",1,true) and not strpos(i,"_fake",1,true) and not strpos(i,"_capsule",1,true)) thenfor s=1,kolvo dotable.insert(consumable_artefacts, k)endendendendendlocal af_del_kolvo=table.getn(consumable_artefacts)if af_del_kolvo>=1 thenfor i,k in pairs(consumable_artefacts) doobj_id=consumable_artefactsobj=sim:object(obj_id)if obj thenlocal section=obj:section_name()local pk = get_netpk(obj,1)local data = pk:get()local cond=data.condition+0.0004 <-------------------- изменить на нулиif cond>=1 then cond=0.9999 endlocal cond1=math.floor(cond*100)if cond>0.25 thenlocal new_cond=(cond-0.002*tm_sl) <-------------------- изменить на нулиif strpos(section,"_buliz",1,true) thennew_cond=cond-0.0005*tm_sl <-------------------- изменить на нулиelseif strpos(section,"dummy_",1,true) thennew_cond=cond-0.01*tm_sl <-------------------- изменить на нулиelseif strpos(section,"af_full_antitush",1,true) thennew_cond=cond-0.1*tm_sl <-------------------- изменить на нулиelseif strpos(section,"_1",1,true) thennew_cond=cond-0.005*tm_sl <-------------------- изменить на нулиelseif strpos(section,"_2",1,true) thennew_cond=cond-0.0025*tm_sl <-------------------- изменить на нулиelseif strpos(section,"_3",1,true) thennew_cond=cond-0.001*tm_sl <-------------------- изменить на нулиelseif strpos(section,"_4",1,true) thennew_cond=cond-0.0005*tm_sl <-------------------- изменить на нулиend Ремонт полностью убитого оружия и брони ---------------------------------------В файле sak.script:function repair_box_repair(obj)if obj thenlocal self=level.main_input_receiver()if self thenself:GetHolder():start_stop_menu(self,true)endlocal actor=db.actorlocal slot_1=actor:item_in_slot(1)local slot_2=actor:item_in_slot(2)local armor=actor:item_in_slot(6)local sounds=lua_random(1,3)if obj and obj:section()=="repair_item_weapon" thenif (slot_1 and slot_1:condition() >=0.8 and slot_1:condition() <0.985) or (slot_2 and slot_2:condition() >=0.8 and slot_2:condition() <0.985) then <------------ вместо "0.8" поставить "0.0"actor_hide_weapon()if (slot_1 and slot_1:condition() >=0.8 and slot_1:condition() <0.985) then <------------ вместо "0.8" поставить "0.0"rep_percent=wpn_proc[slot_1:section()] or 0.02local rep_point=slot_1:condition() + rep_percentif (rep_point>1) then rep_point=1 endslot_1:set_condition(rep_point)sound=repair_sound[1]..soundssnd_obj=xr_sound.get_safe_sound_object(sound)snd_obj:play_no_feedback(db.actor, sound_object.s2d, 0, vector(), 1.0)send_tip("Оружие немного приведено в порядок",nil,12,5,"g_g","no", "green")elseif (slot_2 and slot_2:condition() >=0.8 and slot_2:condition() <0.985) then <------------ вместо "0.8" поставить "0.0"rep_percent=wpn_proc[slot_2:section()] or 0.02local rep_point=slot_2:condition() + rep_percentif (rep_point>1) then rep_point=1 endslot_2:set_condition(rep_point)sound=repair_sound[2]..soundssnd_obj=xr_sound.get_safe_sound_object(sound)snd_obj:play_no_feedback(db.actor, sound_object.s2d, 0, vector(), 1.0)send_tip("Оружие немного подремонтировано",nil,12,5,"g_g","no", "green")endtimers.start_timer("time_rep",13,"sak.restore_weap()")elseif (slot_1 and slot_1:condition() <0.8) or (slot_2 and slot_2:condition() <0.8) then <------------ вместо "0.8" поставить "0.0"send_tip("Слишком сильное повреждение оружия!",nil,2,5,"g_g","no", "red")misc.spawn_into(obj:section().."_feik", actor)elsesend_tip("Оружие не нуждается в починке!",nil,2,5,"g_g","no", "blue")misc.spawn_into(obj:section().."_feik", actor)endelseif obj and obj:section()=="repair_itemoutfit" thenif armor thenif strpos(armor:section(), "bandit_veteran_",1,true) or strpos(armor:section(), "bandit_master_",1,true) thensend_tip("Для кожаного плаща не подходит!",nil,2,5,"g_g","no", "yellow")misc.spawn_into(obj:section().."_feik", actor)elserep_percent=outfit_proc[armor:section()] or 0.02if armor:condition() >=0.8 and armor:condition() <0.985 then <------------ вместо "0.8" поставить "0.0"actor_hide_weapon()vergas_masks.set_flag_minimap(false)local rep_point=armor:condition() + rep_percentif (rep_point>1) then rep_point=1 endamk_mod.repair_armor(rep_point)sound=repair_sound[3]..soundssnd_obj=xr_sound.get_safe_sound_object(sound)snd_obj:play_no_feedback(db.actor, sound_object.s2d, 0, vector(), 1.0)send_tip("Броня отремонтирована.",nil,12,5,"g_g","no", "green")schedule.add("tm_rep", "sak.return_mask()", 12500)elseif armor:condition() <0.8 then <------------ вместо "0.8" поставить "0.0"send_tip("Слишком сильное повреждение брони!",nil,2,5,"g_g","no", "red")misc.spawn_into(obj:section().."_feik", actor)elsesend_tip("Броня не нуждается в починке!",nil,2,5,"g_g","no", "blue")misc.spawn_into(obj:section().."_feik", actor)------------------------------------------------------------------------------------------Если хотите чтобы ремонтировалось за один раз, а не юзать мышкой по несколько раз на одно изделие,то нужно изменить процентность ремонта в секции:local outfit_proc={ - броня, например:["novice_outfit"]=0.2, - поставить 0.9["novice_q_outfit"]=0.12, - поставить 0.9["outfit_novice_m1"]=0.2, - поставить 0.9 и т.д.--------------------------------------------------local wpn_proc = { - оружие, например:["wpn_pm"]=0.2, - поставить 0.9["wpn_q_pm"]=0.12, - поставить 0.9["wpn_pb"]=0.18, - поставить 0.9 и т.д.--------------------------------------------------Весь список выкладывать не буду правте в ручную, может у кого-то оружие, броня добавлены, изменены и т. д.Проверено на сборке от mikelik. amk_mod.script: ----------------------------------------function test_for_need_sleep_matras(oid)Спать в любое время в спальнике:if ( nlc_vars.gg_need_sleep or 0 ) > 6 then <-------- поставить "0"Чтобы второй раз сразу лечь, нужно забрать спальник в инвентарь и выложить.---------------------------------------------------------------------------------------------------------------Спать в любое время в отведённом месте:function esc_sleep_matras()if (nlc_vars.gg_need_sleep or 0 )>6 then <-------- поставить "0" Сборка от mikelik в файле bind_monster.script: if classid==CLID_BOAR thenif step==1 thenlocal npc=db.actorif npc and npc:position():distance_to(sfobj:position())<3 then <------------------------------ ставим <0local snd_rand=lua_random(1,4)sak.snd_rand_geiger(snd_rand)local h = hit()h.type = hit.radiationh.power = 0.0005+(0.0002*game_difficulty)+0.008*(sak.dog_psy)h.impulse = 0.0h.draftsman = sfobjh.direction = sfobj:direction()npc:hit(h) Изменено 23 Апреля 2017 пользователем shahvkit 2 11 1 2 Поделиться этим сообщением Ссылка на сообщение