Divergent/mods/[DEV] Backpack Drops/gamedata/scripts/xcvb_backpack_drop.script

14 lines
557 B
Plaintext
Raw Normal View History

VanillaCosmetics = death_manager.spawn_cosmetics
function death_manager.spawn_cosmetics(npc, npc_id, npc_comm, npc_rank, visual, rand_condition)
VanillaCosmetics(npc, npc_id, npc_comm, npc_rank, visual, rand_condition)
-- backpacks
local viz = visual or npc:get_visual_name()
local tbl = viz and death_manager.get_outfit_by_npc_visual(viz)
if not tbl then return end
local bp_sec = tbl[3] or tbl[2]
if not (bp_sec and IsItem("backpack", bp_sec)) then return end
death_manager.spawn_with_condition(npc, bp_sec, 0.99999)
end