Advertisement
Nuor

actor_disguises.script

Mar 15th, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. --[[
  2. add the following line to helm sections and closed suit sections (exo or science suits)
  3. community = "community name" (ie. stalker, army, dolg, killer, bandit, monolith ...)
  4. --]]
  5. local ini
  6. function on_game_start()
  7. ini = system_ini()
  8. RegisterScriptCallback("actor_item_to_slot",goodwill_to_outfit)
  9. RegisterScriptCallback("actor_item_to_ruck",goodwill_to_outfit)
  10. end
  11.  
  12. function goodwill_to_outfit(obj)
  13. if not (IsOutfit(obj) or IsHeadgear(obj)) then return end
  14. local suit = db.actor:item_in_slot(7)
  15. suit = suit and suit:section()
  16. local helm = suit and ini:r_bool_ex(suit,"helmet_available") or true
  17. local comm = {}
  18. if helm == true then
  19. helm = db.actor:item_in_slot(12)
  20. helm = helm and helm:section()
  21. comm = helm and alun_utils.str_explode(ini:r_string_ex(helm,"community"),",") or {}
  22. else
  23. comm = suit and alun_utils.str_explode(ini:r_string_ex(suit,"community"),",") or {}
  24. end
  25.  
  26. for i=1, #comm do
  27. if db.actor:object(comm[i].."_patch") then
  28. game_relations.set_community_goodwill_for_faction(comm[i])
  29. return
  30. end
  31. end
  32. game_relations.set_community_goodwill_for_faction(db.actor:character_community())
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement