"Как добавить броню в лут NPC?"

Мы с командой, создаём мод на всю броню в сталкер (и не только). И я столкнулся с проблемой, добавляю в character_desc_escape.xlm под строкой [spawn] тех-название брони, начинаю новую игру, прохожу пару квестов, забираю награду у Волка, беру спец задание у Сидоровича, убиваю всех NPC которым я прописал броню, обыскиваю и ничего, ни у кого нет. Как это исправить? Или я вообще всё сделал неправильно?

18
16
Комментарии:  16
Ваш комментарий

Запаздал чёто с ответом, только щас тему увидел. КРч, качайте мод на снятие броника с этого сайта: https://www.amk-team.ru/forum/topic/375-smart-marauder-mod-14-for-amk-14/

Потом адапатируем amkшные скрипты под свои требование, смотрите какие юзаются скрипты в death_manager.script и amk.script - это главные рабочие скрипты, по сути на них держится вся система и нужны только они.

В death_manager.script находим функцию: drop_manager:create_release_item()

если никаких изменений в ней нет, то просто копируйте эту:

Спойлер

function drop_manager:create_release_item()

--' Спрашиваем у серверного объекта генерились ли предметы

local se_obj = alife():object(self.npc:id())

if se_obj.death_droped == true then

return

end

se_obj.death_droped = true

--' Запускаем итератор на удаление предметов

self.npc:iterate_inventory(keep_item, self.npc)

--' Проверка на отсутствие спауна лута

local ini = self.npc:spawn_ini()

if ini and ini:section_exist("dont_spawn_loot") then

return

end

--' Доспавниваем необходимое количество итемов:

--' Необходимо составить список объектов которые могут быть заспавнены для персонажа

local spawn_items = item_by_community[self.npc:character_community()]

for k,v in pairs(spawn_items) do

--' По каждому объекту необходимо получить зависимости

if check_item_dependence(self.npc, k) == true then

--' По каждому объекту необходимо получить количество

local number = math.ceil(math.random(count_by_level[k].min, count_by_level[k].max))

--' Необходимо заспавнить нужное количество.

create_items(self.npc, k, number, v)

--DEXXX' Smart_Marauder_Mod--

local sect

local t = amk.read_stalker_params(se_obj)

if t ~= nil then

local vis = t.visual

vis = amk.str_explode("\\",vis)

vis = vis[3]

if self.npc:character_community()=="stalker" then

if self.npc:character_rank()>=0 and self.npc:character_rank()<=300 then

create_items(self.npc, "novice_outfit", 1, 1)

end

if self.npc:character_rank()>300 and self.npc:character_rank()<=600 then

create_items(self.npc, "stalker_outfit", 1, 1)

end

if self.npc:character_rank()>600 and self.npc:character_rank()<=900 then

create_items(self.npc, "stalker_outfit", 1, 1)

end

if self.npc:character_rank()>900 then

create_items(self.npc, "exo_outfit", 1, 1)

end

end

if self.npc:character_community()=="bandit" then

if self.npc:character_rank()>=0 and self.npc:character_rank()<=300 then

create_items(self.npc, "bandit_outfit", 1, 1)

end

if self.npc:character_rank()>300 and self.npc:character_rank()<=600 then

create_items(self.npc, "bandit_outfit", 1, 1)

end

if self.npc:character_rank()>600 and self.npc:character_rank()<=900 then

create_items(self.npc, "bandit_veteran_outfit", 1, 1)

end

if self.npc:character_rank()>900 then

create_items(self.npc, "bandit_master_outfit", 1, 1)

end

end

if self.npc:character_community()=="military" then

if self.npc:character_rank()>=0 and self.npc:character_rank()<=300 then

create_items(self.npc, "soldier_outfit", 1, 1)

end

if self.npc:character_rank()>300 and self.npc:character_rank()<=600 then

create_items(self.npc, "soldier_outfit", 1, 1)

end

if self.npc:character_rank()>600 and self.npc:character_rank()<=900 then

create_items(self.npc, "specops_outfit", 1, 1)

end

if self.npc:character_rank()>900 then

create_items(self.npc, "military_outfit", 1, 1)

end

end

if self.npc:character_community()=="killer" then

if self.npc:character_rank()>=0 and self.npc:character_rank()<=300 then

create_items(self.npc, "killer_outfit", 1, 1)

end

if self.npc:character_rank()>300 and self.npc:character_rank()<=600 then

create_items(self.npc, "killer_outfit", 1, 1)

end

if self.npc:character_rank()>600 and self.npc:character_rank()<=900 then

create_items(self.npc, "killer_outfit", 1, 1)

end

if self.npc:character_rank()>900 then

create_items(self.npc, "killer_blue_exoskeleton", 1, 1)

end

end

if self.npc:character_community()=="dolg" then

if self.npc:character_rank()>=0 and self.npc:character_rank()<=300 then

create_items(self.npc, "dolg_outfit", 1, 1)

end

if self.npc:character_rank()>300 and self.npc:character_rank()<=600 then

create_items(self.npc, "dolg_outfit", 1, 1)

end

if self.npc:character_rank()>600 and self.npc:character_rank()<=900 then

create_items(self.npc, "dolg_outfit", 1, 1)

end

if self.npc:character_rank()>900 then

create_items(self.npc, "dolg_black_exoskeleton", 1, 1)

end

end

if self.npc:character_community()=="freedom" then

if vis == "stalker_sv_rukzak_1_1" or vis == "stalker_sv_rukzak_3" or vis == "stalker_svoboda_light" then sect = "svoboda_light_outfit" end

if string.find(vis,"stalker_sv_balon_1") or vis == "stalker_sv_rukzak_1" or vis == "stalker_sv_rukzak_2" or vis == "stalker_sv_rukzak_3_1" or vis == "stalker_sv_cook" or vis == "stalker_sv_max" or vis == "stalker_svoboda_heavy" then sect = "svoboda_heavy_outfit" end

if vis == "stalker_sv_hood_91" then sect = "svoboda_gaz_outfit_m1" end

if vis == "stalker_sv_hood_9" then sect = "svoboda_heavy_gaz_outfit_m1" end

if vis == "stalker_sv_nauchniy" then sect = "freedom_scientific_outfit" end

if vis == "stalker_sv_exoskeleton" then sect = "svoboda_exoskeleton" end

if vis == "stalker_sv_leader" then sect = "outfit_svoboda_m1" end

end

end

if self.npc:character_community()=="monolith" then

if self.npc:character_rank()>=0 and self.npc:character_rank()<=300 then

create_items(self.npc, "monolit_outfit", 1, 1)

end

if self.npc:character_rank()>300 and self.npc:character_rank()<=600 then

create_items(self.npc, "monolit_outfit", 1, 1)

end

if self.npc:character_rank()>600 and self.npc:character_rank()<=900 then

create_items(self.npc, "monolit_scientific_outfit", 1, 1)

end

if self.npc:character_rank()>900 then

create_items(self.npc, "monolit_exoskeleton", 1, 1)

end

end

if self.npc:character_community()=="ecolog" then

if self.npc:character_rank()>=0 and self.npc:character_rank()<=300 then

create_items(self.npc, "ecolog_outfit", 1, 1)

end

if self.npc:character_rank()>300 and self.npc:character_rank()<=600 then

create_items(self.npc, "ecolog_outfit", 1, 1)

end

if self.npc:character_rank()>600 and self.npc:character_rank()<=900 then

create_items(self.npc, "ecolog_outfit", 1, 1)

end

if self.npc:character_rank()>900 then

create_items(self.npc, "protection_outfit", 1, 1)

end

end

--DEXXX' Smart_Marauder_Mod--

end

end

if not string.find(self.npc:section(),"arena") and

self.npc:character_community()~="arena_enemy" and

self.npc:name()~="yan_specnaz_dead" and

self.npc:name()~="x16_stalker_ghost" then

local otf_1

local otf_2

local otf_3

local otf_4

local otf_5

local sect

local t = amk.read_stalker_params(se_obj)

if t ~= nil then

local vis = t.visual

vis = amk.str_explode("\\",vis)

vis = vis[3]

--skunk.dbglog("vis = '%s'", vis)

-- bandit

if string.find(vis,"stalker_bandit") then sect = "bandit_outfit" end

if vis == "stalker_bandit_drunk" then sect = "outfit_bandit_m1" end

if vis == "stalker_bandit_8" then sect = "bandit_gaz_outfit_m1" end

if vis == "stalker_bandit_veteran" then sect = "bandit_veteran_outfit" end

if vis == "stalker_bandit_borov" or vis == "stalker_bandit_master" then sect = "bandit_master_outfit" end

if vis == "stalker_bandit_exoskeleton" then sect = "exo_bandit_outfit" end

-- dolg

if string.find(vis,"stalker_do") then sect = "dolg_outfit" end

if vis == "stalker_do_antigas" then sect = "dolg_gaz_outfit_m1" end

if vis == "stalker_do_komandir" then sect = "outfit_dolg_m1" end

if vis == "stalker_do_nauchniy" then sect = "dolg_scientific_outfit" end

if vis == "stalker_do_exoskeleton" then sect = "dolg_black_exoskeleton" end

-- ecolog

if vis == "stalker_ecolog" or vis == "nauchniy_1" or vis == "protect_suit2" then sect = "ecolog_outfit" end

if vis == "stalker_ecolog_military" or vis == "stalker_chemical" or vis == "nauchniy_0" or vis == "protect_suit1" then sect = "protection_outfit" end

-- izgoy

if vis == "izgoy" then sect = "bandit_veteran_outfit" end

-- killer

if string.find(vis,"stalker_ki") then sect = "killer_outfit" end

if vis == "stalker_ki_head_1" then sect = "outfit_killer_m1" end

if vis == "stalker_ki_antigas" then sect = "killer_gaz_outfit_m1" end

if vis == "stalker_ki_nauchniy" then sect = "merc_scientific_outfit" end

if vis == "stalker_ki_exoskeleton" then sect = "killer_blue_exoskeleton" end

-- militari

if vis == "stalker_militari_1" or vis == "stalker_militari_antigas_1" or vis == "stalker_military" or vis == "stalker_military_green" then sect = "military_outfit" end

if vis == "stalker_militari_2" or vis == "stalker_militari_antigas_2" or vis == "stalker_commander" or vis == "stalker_military_black" then sect = "militaryspec_outfit" end

-- monolit

if string.find(vis,"stalker_mo") or vis == "stalker_monolit" then sect = "monolit_outfit" end

if vis == "stalker_mo_hood_9" then sect = "monolit_gaz_outfit_m1" end

if vis == "stalker_mo_nauchniy" then sect = "monolit_scientific_outfit" end

if vis == "stalker_mo_exo" then sect = "monolit_exoskeleton" end

-- nauchniy (see ecolog)

-- neytral

if string.find(vis,"stalker_neytral") or vis == "stalker_hood" then sect = "stalker_outfit" end

if string.find(vis,"stalker_neytral_rukzak") then sect = "outfit_stalker_m2" end

if vis == "stalker_bar_security" then sect = "stalker_guard_outfit" end

if vis == "stalker_neytral_hood_9" then sect = "neytral_gaz_outfit_m1" end

if string.find(vis,"neytral") ~= nil then

if self.npc:name()=="esc_wolf" or self.npc:name()=="esc_stalker_fanat" or self.npc:name()=="esc_fox" or self.npc:name()=="esc_provodnik" or self.npc:name()=="gar_hellcar" or self.npc:name()=="gar_seryi" or self.npc:name()=="agr_krot" then sect = "neytral_gaz_outfit_m2" end

end

if vis == "stalker_prizrak" then sect = "outfit_stalker_m1" end

if vis == "stalker_neytral_nauchniy" or vis == "stalker_scien" then sect = "scientific_outfit" end

if vis == "stalker_neytral_exoskeleton" or vis == "stalker_exoskeleton" then sect = "exo_outfit" end

-- novice

if string.find(vis,"green_stalker") or vis == "stalker_novice" then sect = "novice_outfit" end

if vis == "green_stalker_1" or vis == "green_stalker_5" or vis == "green_stalker_10" or vis == "green_stalker_11" then sect = "neytral_novice_outfit_m1" end

if vis == "green_stalker_antigas" then sect = "neytral_novice_gaz_outfit_m1" end

-- protect (see ecolog)

-- soldier

if string.find(vis,"soldier_bandana") or string.find(vis,"soldier_beret") or vis == "soldier_mask" or vis == "soldier_obichniy" or vis == "stalker_soldier" then sect = "outfit_soldier_m1" end

if vis == "soldier_spetsnaz" or vis == "stalker_specops" then sect = "specops_outfit" end

if vis == "soldier_antigas" then sect = "outfit_specnaz_m1" end

-- stalker_zombi

if vis == "stalker_zombie1" then sect = "bandit_outfit" end

if vis == "stalker_zombie2" or vis == "zombie_fresh_1" then sect = "dolg_outfit" end

if vis == "stalker_zombie3" or vis == "stalker_zombie6" or vis == "zombie_fresh_2" then sect = "stalker_outfit" end

if vis == "stalker_zombie4" then sect = "killer_outfit" end

if vis == "stalker_zombie5" then sect = "stalker_guard_outfit" end

if vis == "stalker_zombie7" then sect = "novice_outfit" end

if vis == "stalker_zombie8" then sect = "neytral_novice_outfit_m1" end

if vis == "stalker_zombie_specnaz" then sect = "specops_outfit" end

if vis == "zombie_fresh_0" then sect = "svoboda_heavy_outfit" end

if vis == "zombie_exoskeleton" then sect = "broken_exoskeleton" end

-- svoboda

if vis == "stalker_sv_rukzak_1_1" or vis == "stalker_sv_rukzak_3" or vis == "stalker_svoboda_light" then sect = "svoboda_light_outfit" end

if string.find(vis,"stalker_sv_balon_1") or vis == "stalker_sv_rukzak_1" or vis == "stalker_sv_rukzak_2" or vis == "stalker_sv_rukzak_3_1" or vis == "stalker_sv_cook" or vis == "stalker_sv_max" or vis == "stalker_svoboda_heavy" then sect = "svoboda_heavy_outfit" end

if vis == "stalker_sv_hood_91" then sect = "svoboda_gaz_outfit_m1" end

if vis == "stalker_sv_hood_9" then sect = "svoboda_heavy_gaz_outfit_m1" end

if vis == "stalker_sv_nauchniy" then sect = "freedom_scientific_outfit" end

if vis == "stalker_sv_exoskeleton" then sect = "svoboda_exoskeleton" end

if vis == "stalker_sv_leader" then sect = "outfit_svoboda_m1" end

if sect~=nil then

if sect == "bandit_outfit" or sect == "outfit_bandit_m1" or sect == "bandit_gaz_outfit_m1" or sect == "bandit_veteran_outfit" or sect == "bandit_master_outfit" or sect == "novice_outfit" or sect == "neytral_novice_outfit_m1" or sect == "neytral_novice_gaz_outfit_m1" then

otf_1 = create_items(self.npc, sect, 1, 650)

if otf_1~= nil then

amk.start_timer("outfit_cond_1",1,otf_1.id) end

elseif sect == "stalker_outfit" or sect == "killer_outfit" or sect == "outfit_soldier_m1" or sect == "svoboda_light_outfit" or sect == "svoboda_gaz_outfit_m1" then

otf_2 = create_items(self.npc, sect, 1, 550)

if otf_2~= nil then

amk.start_timer("outfit_cond_2",1,otf_2.id) end

elseif sect == "dolg_outfit" or sect == "dolg_gaz_outfit_m1" or sect == "ecolog_outfit" or sect == "outfit_dolg_m1" or sect == "outfit_killer_m1" or sect == "killer_gaz_outfit_m1" or sect == "specops_outfit" or sect == "outfit_specnaz_m1" or sect == "monolit_outfit" or sect == "monolit_gaz_outfit_m1" or sect == "stalker_guard_outfit" or sect == "outfit_stalker_m1" or sect == "outfit_stalker_m2" or sect == "neytral_gaz_outfit_m1" or sect == "neytral_gaz_outfit_m2" or sect == "svoboda_heavy_outfit" or sect == "svoboda_heavy_gaz_outfit_m1" or sect == "outfit_svoboda_m1" then

otf_3 = create_items(self.npc, sect, 1, 450)

if otf_3~= nil then

amk.start_timer("outfit_cond_3",1,otf_3.id) end

elseif sect == "dolg_scientific_outfit" or sect == "ecolog_outfit" or sect == "protection_outfit" or sect == "merc_scientific_outfit" or sect == "military_outfit" or sect == "militaryspec_outfit" or sect == "monolit_scientific_outfit" or sect == "scientific_outfit" or sect == "freedom_scientific_outfit" then

otf_4 = create_items(self.npc, sect, 1, 350)

if otf_4~= nil then

amk.start_timer("outfit_cond_4",1,otf_4.id) end

else

otf_5 = create_items(self.npc, sect, 1, 250)

if otf_5~= nil then

amk.start_timer("outfit_cond_5",1,otf_5.id) end

end

end

end

end

end

В функции меняем название моделей (они первые идут) и выпадающий костюм (после визуала нпс). Если ни чё не напутал, то должно пахать как часики.

Sinkent правильно сказал, куда надо прописывать. Однако есть одна недоработка. Например, если ты пропишешь бандитам куртку бандита, то спавнится она будет также и у бандитов мастеров, ветеранов (Если коротко: визуал не будет соответствовать твоему луту). Так можно сказать и про долг со свободой... (Типо у экзоскелетников будет обычной броник, прим. Ветер свободы или традиционный ихний лёгкий комбез)

Там в character_desc_escape написан визуал. Я проверял на новичках с разными куртками, у меня всё работает прекрасно

Это если в генерацию предметов у НПС вписать, однако если добавить строчку своей брони(и не только) в конце death_generic, а потом прописать в инвентарь какому-нибудь НПС, то будет вполне адекватно. Однако здесь тоже есть минус - будет дропаться тогда целая броня, а это хорошо повлияет на дисбаланс игры...

Комментарий удален
Комментарий удален

Да просто они меня до этого довели

Для тех кому "мешает" этот форум. Я не могу его УДАЛИТЬ, удалить его может только модератор, как с ним связаться, я не знаю. ХВАТИТ СТАВИТЬ ДИЗЫ ЭТО НИЧЕГО НЕ ИЗМЕНИТ

удалить его может только модератор, как с ним связаться, я не знаю

Через кнопку "Обратная связь" (находиться внизу страницы).

П.С.: Дизы, действительно, почти ничего не меняют, в отличии от гневных сообщений, вызванных их получением- за флуд и мат предупреждение/бан прилетает быстро.

Комментарий удален
Новое на форуме S.T.A.L.K.E.R.: Shadow of Chernobyl