Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- add the following line to helm sections and closed suit sections (exo or science suits)
- community = "community name" (ie. stalker, army, dolg, killer, bandit, monolith ...)
- --]]
- local ini
- function on_game_start()
- ini = system_ini()
- RegisterScriptCallback("actor_item_to_slot",goodwill_to_outfit)
- RegisterScriptCallback("actor_item_to_ruck",goodwill_to_outfit)
- end
- function goodwill_to_outfit(obj)
- if not (IsOutfit(obj) or IsHeadgear(obj)) then return end
- local suit = db.actor:item_in_slot(7)
- suit = suit and suit:section()
- local helm = suit and ini:r_bool_ex(suit,"helmet_available") or true
- local comm = {}
- if helm == true then
- helm = db.actor:item_in_slot(12)
- helm = helm and helm:section()
- comm = helm and alun_utils.str_explode(ini:r_string_ex(helm,"community"),",") or {}
- else
- comm = suit and alun_utils.str_explode(ini:r_string_ex(suit,"community"),",") or {}
- end
- for i=1, #comm do
- if db.actor:object(comm[i].."_patch") then
- game_relations.set_community_goodwill_for_faction(comm[i])
- return
- end
- end
- game_relations.set_community_goodwill_for_faction(db.actor:character_community())
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement