npcgeneratec.qsrc 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. # npcgeneratec
  2. ! {This file expects npctempgsex which is the desired sex of the NPC to be generated, $npctempgn[0], which is the used name of the generated NPC. Rapist or Red Headed Stranger, for example. And npctempgage, which is the approximate age of the NPC in years. Everything is then randomly generated, and you are expected to fix the generated NPC yourself with any special items you need from it after it completes running. So sex, what you call them until they introduce themselves, and age.}
  3. !! {A example to use this would be gs 'npcgeneratec', 0, 'stranger', rand(18,45) which would generate a male with a used name of stranger between 18 and 45.}
  4. npctempgsex = ARGS[0]
  5. $npctempgn[0] = $ARGS[1]
  6. npctempgage = ARGS[2]
  7. !! {First we set the newly generated index number or overwrite the first blank number}
  8. !! {Checks to see if array 0 in the cleanup list is available for overwrite and makes the overwrite as that if so.}
  9. if mid($cemptyarray[0],1,1) = 'C':
  10. $npclastgenerated = $cemptyarray[0]
  11. killvar '$cemptyarray', 0
  12. else
  13. :npcgencsanityloop
  14. i = 0
  15. $npclastgenerated = 'C' + '<<carraynumber>>'
  16. $npctemparrc = 'C' + '<<(carraynumber)-(1)>>'
  17. if $npc_persType[$npctemparrc] = '' and carraynumber > 0:
  18. carraynumber -= 1
  19. i = 1
  20. elseif $npc_persType[$npclastgenerated] = '':
  21. i = 0
  22. else
  23. carraynumber += 1
  24. i = 1
  25. end
  26. if i = 1: jump 'npcgencsanityloop'
  27. end
  28. carraynumber += 1
  29. ! {moved up to here}
  30. npclastgeneratedn = mid($npclastgenerated, 2)
  31. ! {Now we need a random birthday based on the rough age given.}
  32. npctempc1[1] = year - npctempgage
  33. npctempc1[2] = rand(1,12)
  34. if npctempc1[2] = 4 or npctempc1[2] = 6 or npctempc1[2] = 9 or npctempc1[2] = 11:
  35. npctempc1[3] = rand(1,30)
  36. elseif npctempc1[2] = 1 or npctempc1[2] = 3 or npctempc1[2] = 5 or npctempc1[2] = 7 or npctempc1[2] = 8 or npctempc1[2] = 10 or npctempc1[2] = 12:
  37. npctempc1[3] = rand(1,31)
  38. elseif ((npctempc1[1] mod 4 = 0) and (npctempc1[1] mod 100 ! 0)) or (npctempc1[1] mod 400 = 0):
  39. npctempc1[3] = rand(1,29)
  40. else
  41. npctempc1[3] = rand(1,28)
  42. end
  43. npc_dob[$npclastgenerated] = npctempc1[1] * 10000
  44. npc_dob[$npclastgenerated] += (npctempc1[2] * 100)
  45. npc_dob[$npclastgenerated] += npctempc1[3]
  46. ! {we save the unique number of the npc, to be able to get the index of the array via arrpos}
  47. $npc_dob[$npclastgenerated] = '<<npclastgeneratedn>>'
  48. ! {Now, we set the variable for the stat randomization as well as calculate chance of virginity.}
  49. if npctempgage < 18:
  50. npctempc2[0] = 30
  51. npctempc2[1] = rand(0,20)
  52. else
  53. npctempc2[0] = 50
  54. npctempc2[1] = rand(19,24)
  55. end
  56. ! {We flag virginity based on the results of the check. Overwrite it after generation if you want to be sure of status.}
  57. if npctempc2[1] < 20:
  58. npc_sexskill[$npclastgenerated] = 0
  59. end
  60. ! {index}
  61. $npc_sexskill[$npclastgenerated] = '<<npclastgeneratedn>>'
  62. ! {Then we need to give them a name, and establish their official gender}
  63. if npctempgsex = 0:
  64. ! {Male}
  65. gs 'npcrnamefile', 'rusMale'
  66. gs 'npcgenext', 'dick'
  67. npc_gender[$npclastgenerated] = 0
  68. npc_spermpot[$npclastgenerated] = 10000
  69. $npc_thdick[$npclastgenerated] = $npctempgn[4]
  70. npc_dick[$npclastgenerated] = npctempgn[5]
  71. $npc_notes[$npclastgenerated] = 'A male.'
  72. npc_bust[$npclastgenerated] = 0
  73. elseif npctempgsex = 1:
  74. ! {Female}
  75. gs 'npcrnamefile', 'rusFemale'
  76. npc_gender[$npclastgenerated] = 1
  77. npc_spermpot[$npclastgenerated] = -1
  78. $npc_thdick[$npclastgenerated] = 'clitoris'
  79. npc_dick[$npclastgenerated] = rand(0,1)
  80. $npc_notes[$npclastgenerated] = 'A female.'
  81. !!0 - 60 curve around 22,5 (C/D cups)
  82. npc_bust[$npclastgenerated] = rand(0,15) + rand(0,15) + rand(0,15) & if rand(1,10) = 1: npc_bust[$npclastgenerated] += rand(0,15)
  83. elseif npctempgsex = 2:
  84. ! {HermFemale}
  85. gs 'npcrnamefile', 'rusFemale'
  86. gs 'npcgenext', 'dick'
  87. npc_gender[$npclastgenerated] = 1
  88. npc_spermpot[$npclastgenerated] = -1
  89. $npc_thdick[$npclastgenerated] = 'clitoris'
  90. npc_dick[$npclastgenerated] = npctempgn[5]
  91. $npc_notes[$npclastgenerated] = 'A female Hermaphrodite.'
  92. !!0 - 60 curve around 22,5 (C/D cups)
  93. npc_bust[$npclastgenerated] = rand(0,15) + rand(0,15) + rand(0,15)
  94. else
  95. ! {HermMale}
  96. gs 'npcrnamefile', 'rusMale'
  97. gs 'npcgenext', 'dick'
  98. npc_gender[$npclastgenerated] = 0
  99. npc_spermpot[$npclastgenerated] = 10000
  100. $npc_thdick[$npclastgenerated] = $npctempgn[4]
  101. npc_dick[$npclastgenerated] = npctempgn[5]
  102. $npc_notes[$npclastgenerated] = 'A male Hermaphrodite.'
  103. npc_bust[$npclastgenerated]= rand(0,10)
  104. end
  105. ! {index}
  106. $npc_gender[$npclastgenerated] = '<<npclastgeneratedn>>'
  107. $npc_spermpot[$npclastgenerated] = '<<npclastgeneratedn>>'
  108. npc_thdick[$npclastgenerated] = npclastgeneratedn
  109. $npc_dick[$npclastgenerated] = '<<npclastgeneratedn>>'
  110. npc_notes[$npclastgenerated] = npclastgeneratedn
  111. $npc_bust[$npclastgenerated] = '<<npclastgeneratedn>>'
  112. ! {Then we set the names, and the stat high ends as determined earlier.}
  113. gs 'npcrnamefile', 'rusSur'
  114. $npc_firstname[$npclastgenerated] = $npctempgn[1]
  115. $npc_nickname[$npclastgenerated] = $npctempgn[2]
  116. $npc_lastname[$npclastgenerated] = $npctempgn[3]
  117. $npc_usedname[$npclastgenerated] = $npctempgn[0]
  118. npc_intel[$npclastgenerated] = rand(1,npctempc2)
  119. ! {index}
  120. npc_firstname[$npclastgenerated] = npclastgeneratedn
  121. npc_nickname[$npclastgenerated] = npclastgeneratedn
  122. npc_lastname[$npclastgenerated] = npclastgeneratedn
  123. npc_usedname[$npclastgenerated] = npclastgeneratedn
  124. $npc_intel[$npclastgenerated] = '<<npclastgeneratedn>>'
  125. ! {Then we call out other stats}
  126. npc_drunk[$npclastgenerated] = 0
  127. ! {index}
  128. $npc_drunk[$npclastgenerated] = '<<npclastgeneratedn>>'
  129. ! {NPCs start with random horniness}
  130. npc_horny[$npclastgenerated] = rand(0,60)
  131. ! {index}
  132. $npc_horny[$npclastgenerated] = '<<npclastgeneratedn>>'
  133. ! {Random attractiveness}
  134. npc_apprnc[$npclastgenerated] = rand(30,60)
  135. ! {index}
  136. $npc_apprnc[$npclastgenerated] = '<<npclastgeneratedn>>'
  137. ! {Random skin quality and body hair}
  138. npc_height[$npclastgenerated] = 0
  139. ! {index}
  140. $npc_height[$npclastgenerated] = '<<npclastgeneratedn>>'
  141. ! {Random pubic hair}
  142. npc_haircol[$npclastgenerated] = 0
  143. ! {index}
  144. $npc_haircol[$npclastgenerated] = '<<npclastgeneratedn>>'
  145. ! {Starting at 0 quest state and love for the character, and slightly disliked.}
  146. npc_QW[$npclastgenerated]= 0
  147. npc_rel[$npclastgenerated] = 40
  148. npc_love[$npclastgenerated] = 0
  149. ! {index}
  150. $npc_QW[$npclastgenerated] = '<<npclastgeneratedn>>'
  151. $npc_rel[$npclastgenerated] = '<<npclastgeneratedn>>'
  152. $npc_love[$npclastgenerated] = '<<npclastgeneratedn>>'
  153. ! {Start unemployed and unspecified location}
  154. npc_occupation[$npclastgenerated] = 0
  155. npc_outfit[$npclastgenerated] = 0
  156. ! {index}
  157. $npc_occupation[$npclastgenerated] = '<<npclastgeneratedn>>'
  158. $npc_outfit[$npclastgenerated] = '<<npclastgeneratedn>>'
  159. ! {Unspecified dad and <<$npc_nickname[''A29'']>>, and picture. We could have a stock group of pictures and have it pick based on certain attribute types, but...}
  160. $npc_pic[$npclastgenerated] = 'xPICx'
  161. ! {index}
  162. npc_pic[$npclastgenerated] = npclastgeneratedn
  163. ! {STDs are not randomly given here. For characters with a STD, you need to gs npcgenext rstd. It will be expecting an npclastgeneratedn variable.}
  164. npc_herpes[$npclastgenerated] = 0
  165. npc_syth[$npclastgenerated] = 0
  166. npc_gon[$npclastgenerated] = 0
  167. npc_thrush[$npclastgenerated] = 0
  168. ! {index}
  169. $npc_herpes[$npclastgenerated] = '<<npclastgeneratedn>>'
  170. $npc_syth[$npclastgenerated] = '<<npclastgeneratedn>>'
  171. $npc_gon[$npclastgenerated] = '<<npclastgeneratedn>>'
  172. $npc_thrush[$npclastgenerated] = '<<npclastgeneratedn>>'
  173. ! {Chemestry and clothing preference are unspecified}
  174. npc_style[$npclastgenerated] = 0
  175. ! {index}
  176. $npc_style[$npclastgenerated] = '<<npclastgeneratedn>>'
  177. ! {Personality is called up}
  178. gs 'npcgenext', 'pers'
  179. $npc_PersType[$npclastgenerated] = $npctempgn[6]
  180. ! {index}
  181. npc_PersType[$npclastgenerated] = npclastgeneratedn
  182. ! {Creating the DNA of the character. If it is someone specific, like father, mother, daughter, sone, etc. then should be overwritten.}
  183. $npc_dna[$npclastgenerated] = func('DNA','create')
  184. ! {index}
  185. npc_dna[$npclastgenerated] = npclastgeneratedn
  186. ! {Variables are cleaned up.}
  187. killvar '$npctempgn'
  188. killvar 'npctempc1'
  189. killvar 'npctempc2'
  190. killvar 'npctempgsex'
  191. killvar '$npctempgn'
  192. killvar 'npctempgage'
  193. killvar '$npctemparrc'
  194. --- npcgeneratec ---------------------------------