randAnpc.qsrc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # randAnpc
  2. !! arguments: <gender> <excluded_first_name> <grupTipeEnabled>...
  3. !! gender : 0 for male, 1 for female, 2 for any gender
  4. !! excluded_first_name : can be '' or you can provide result of previous invocation, so you can compose non-repeating pairs of people
  5. !! <grupTipeEnabled>... : 1 if you include grupTipe, 0 otherwise, look at examples below
  6. !!
  7. !! example:
  8. !! $rand_girl = func('randAnpc', 1, '', 1, 1, 0, 1, 0, 0, 0, 0)
  9. !! $rand_girl1 = func('randAnpc', 1, $rand_girl, 1, 1, 0, 1)
  10. !!
  11. !! Having grupTipes (social groups)
  12. !! 1 - cool kids
  13. !! 2 - jocks
  14. !! 3 - nerds
  15. !! 4 - Gopnik
  16. !! 5 - outcasts
  17. !! 6 - teachers
  18. !! 7 - family
  19. !! 8 - other Pavlovsk
  20. !! examples above instruct to choose random person from: cool kids, jocks and gopniks
  21. !! NOTE that in $rand_girl1 zero values for outcasts, teachers, family and other Pavlovk npcs are not defined - undefined values will be zero by language
  22. !! Thanks to that you can include new social group and you don''t need to make changes in all places
  23. :selectloop
  24. r = rand(1, aarraynumber)
  25. if ARGS[1] ! 2:
  26. if npc_gender['A<<r>>'] ! ARGS[1]: jump 'selectloop'
  27. end
  28. if npc_grupTipe['A<<r>>'] = 1:
  29. if ARGS[3] = 0: jump 'selectloop'
  30. elseif npc_grupTipe['A<<r>>'] = 2:
  31. if ARGS[4] = 0: jump 'selectloop'
  32. elseif npc_grupTipe['A<<r>>'] = 3:
  33. if ARGS[5] = 0: jump 'selectloop'
  34. elseif npc_grupTipe['A<<r>>'] = 4:
  35. if ARGS[6] = 0: jump 'selectloop'
  36. elseif npc_grupTipe['A<<r>>'] = 5:
  37. if ARGS[7] = 0: jump 'selectloop'
  38. elseif npc_grupTipe['A<<r>>'] = 6:
  39. if ARGS[8] = 0: jump 'selectloop'
  40. elseif npc_grupTipe['A<<r>>'] = 7:
  41. if ARGS[9] = 0: jump 'selectloop'
  42. elseif npc_grupTipe['A<<r>>'] = 8:
  43. if ARGS[10] = 0: jump 'selectloop'
  44. end
  45. if $npc_firstname['A<<r>>'] = $ARGS[2]: jump 'selectloop'
  46. numnpc = r
  47. --- randAnpc ---------------------------------