1
0

npccleanc.qsrc 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. # npccleanc
  2. !! {This code should be called to purge a specific NPC. It expects an ARGS[0] of the code of the C array.}
  3. $tempcclean = $ARGS[0]
  4. if mid($tempcclean, 1, 1) = 'C' and npc_firstname['$tempcclean'] > 0:
  5. !! {create arrays to loop through}
  6. ! {array for strings}
  7. $tmpStrArr[0] = 'npc_firstname'
  8. $tmpStrArr[] = 'npc_nickname'
  9. $tmpStrArr[] = 'npc_lastname'
  10. $tmpStrArr[] = 'npc_usedname'
  11. $tmpStrArr[] = 'npc_notes'
  12. $tmpStrArr[] = 'npc_firstpart'
  13. $tmpStrArr[] = 'npc_lastpart'
  14. $tmpStrArr[] = 'npc_kidpater'
  15. $tmpStrArr[] = 'npc_thdick'
  16. $tmpStrArr[] = 'npc_dad'
  17. $tmpStrArr[] = 'npc_mom'
  18. $tmpStrArr[] = 'npc_pic'
  19. $tmpStrArr[] = 'npc_PersType'
  20. $tmpStrArr[] = 'npc_dna'
  21. ! {array for ints}
  22. $tmpIntArr[0] = 'npc_dob'
  23. $tmpIntArr[] = 'npc_vital'
  24. $tmpIntArr[] = 'npc_stren'
  25. $tmpIntArr[] = 'npc_intel'
  26. $tmpIntArr[] = 'npc_agil'
  27. $tmpIntArr[] = 'npc_sprt'
  28. $tmpIntArr[] = 'npc_magik'
  29. $tmpIntArr[] = 'npc_drunk'
  30. $tmpIntArr[] = 'npc_pantys'
  31. $tmpIntArr[] = 'npc_cyc'
  32. $tmpIntArr[] = 'npc_fert'
  33. $tmpIntArr[] = 'npc_gender'
  34. $tmpIntArr[] = 'npc_dick'
  35. $tmpIntArr[] = 'npc_sexskill'
  36. $tmpIntArr[] = 'npc_spermpot'
  37. $tmpIntArr[] = 'npc_vag'
  38. $tmpIntArr[] = 'npc_ass'
  39. $tmpIntArr[] = 'npc_hymen'
  40. $tmpIntArr[] = 'npc_horny'
  41. $tmpIntArr[] = 'npc_Pavrep'
  42. $tmpIntArr[] = 'npc_Godrep'
  43. $tmpIntArr[] = 'npc_apprnc'
  44. $tmpIntArr[] = 'npc_lipbalm'
  45. $tmpIntArr[] = 'npc_makeup'
  46. $tmpIntArr[] = 'npc_sweat'
  47. $tmpIntArr[] = 'npc_dye'
  48. $tmpIntArr[] = 'npc_hairbsh'
  49. $tmpIntArr[] = 'npc_skin'
  50. $tmpIntArr[] = 'npc_bodyhair'
  51. $tmpIntArr[] = 'npc_breath'
  52. $tmpIntArr[] = 'npc_hipcurv'
  53. $tmpIntArr[] = 'npc_hgt'
  54. $tmpIntArr[] = 'npc_bust'
  55. $tmpIntArr[] = 'npc_nips'
  56. $tmpIntArr[] = 'npc_fat'
  57. $tmpIntArr[] = 'npc_haircol'
  58. $tmpIntArr[] = 'npc_tan'
  59. $tmpIntArr[] = 'npc_lip'
  60. $tmpIntArr[] = 'npc_lashes'
  61. $tmpIntArr[] = 'npc_eyesize'
  62. $tmpIntArr[] = 'npc_eyecol'
  63. $tmpIntArr[] = 'npc_dom'
  64. $tmpIntArr[] = 'npc_sub'
  65. $tmpIntArr[] = 'npc_QW'
  66. $tmpIntArr[] = 'npc_rel'
  67. $tmpIntArr[] = 'npc_love'
  68. $tmpIntArr[] = 'npc_job'
  69. $tmpIntArr[] = 'npc_cloc'
  70. $tmpIntArr[] = 'npc_herpes'
  71. $tmpIntArr[] = 'npc_syth'
  72. $tmpIntArr[] = 'npc_gon'
  73. $tmpIntArr[] = 'npc_thrush'
  74. $tmpIntArr[] = 'npc_chem'
  75. $tmpIntArr[] = 'npc_clothpref'
  76. ! {loop through the arrays to kill entries}
  77. tmpArrIndex = 0
  78. :cleanupstrloop
  79. if tmpArrIndex < arrsize('$tmpStrArr'):
  80. tmpNpcIndex = arrpos(('<<$tmpStrArr[tmpArrIndex]>>'), val('<<mid($tempcclean, 2)>>'))
  81. if tmpNpcIndex >= 0:
  82. killvar '<<$tmpStrArr[tmpArrIndex]>>', tmpNpcIndex
  83. end
  84. tmpArrIndex += 1
  85. jump 'cleanupstrloop'
  86. end
  87. tmpArrIndex = 0
  88. :cleanupintloop
  89. if tmpArrIndex < arrsize('$tmpIntArr'):
  90. tmpNpcIndex = arrpos(('$<<$tmpIntArr[tmpArrIndex]>>'), '<<mid($tempcclean, 2)>>')
  91. if tmpNpcIndex >= 0:
  92. killvar ('$<<$tmpIntArr[tmpArrIndex]>>'), tmpNpcIndex
  93. end
  94. tmpArrIndex += 1
  95. jump 'cleanupintloop'
  96. end
  97. ! {cleanup}
  98. killvar 'tmpArrIndex'
  99. killvar 'tmpNpcIndex'
  100. killvar 'tmpStrArr'
  101. killvar 'tmpIntArr'
  102. else
  103. ! {legacy code in case there is no corresponding index: just sets values to default}
  104. $npc_firstname[$tempcclean] = ''
  105. $npc_nickname[$tempcclean] = ''
  106. $npc_lastname[$tempcclean] = ''
  107. $npc_usedname[$tempcclean] = ''
  108. $npc_notes[$tempcclean] = ''
  109. npc_dob[$tempcclean] = 0
  110. npc_vital[$tempcclean] = 0
  111. npc_stren[$tempcclean] = 0
  112. npc_intel[$tempcclean] = 0
  113. npc_agil[$tempcclean] = 0
  114. npc_sprt[$tempcclean] = 0
  115. npc_magik[$tempcclean] = 0
  116. npc_drunk[$tempcclean] = 0
  117. npc_pantys[$tempcclean] = 0
  118. npc_cyc[$tempcclean] = 0
  119. npc_fert[$tempcclean] = 0
  120. $npc_firstpart[$tempcclean] = ''
  121. $npc_lastpart[$tempcclean] = ''
  122. $npc_kidpater[$tempcclean] = ''
  123. npc_gender[$tempcclean] = 0
  124. $npc_thdick[$tempcclean] = ''
  125. npc_dick[$tempcclean] = 0
  126. npc_sexskill[$tempcclean] = 0
  127. npc_spermpot[$tempcclean] = 0
  128. npc_vag[$tempcclean] = 0
  129. npc_ass[$tempcclean] = 0
  130. npc_hymen[$tempcclean] = 0
  131. npc_horny[$tempcclean] = 0
  132. npc_Pavrep[$tempcclean] = 0
  133. npc_Godrep[$tempcclean] = 0
  134. npc_apprnc[$tempcclean] = 0
  135. npc_lipbalm[$tempcclean] = 0
  136. npc_makeup[$tempcclean] = 0
  137. npc_sweat[$tempcclean] = 0
  138. npc_dye[$tempcclean] = 0
  139. npc_hairbsh[$tempcclean] = 0
  140. npc_skin[$tempcclean] = 0
  141. npc_bodyhair[$tempcclean] = 0
  142. npc_breath[$tempcclean] = 0
  143. npc_hipcurv[$tempcclean] = 0
  144. npc_hgt[$tempcclean] = 0
  145. npc_bust[$tempcclean] = 0
  146. npc_nips[$tempcclean] = 0
  147. npc_fat[$tempcclean] = 0
  148. npc_haircol[$tempcclean] = 0
  149. npc_tan[$tempcclean] = 0
  150. npc_lip[$tempcclean] = 0
  151. npc_lashes[$tempcclean] = 0
  152. npc_eyesize[$tempcclean] = 0
  153. npc_eyecol[$tempcclean] = 0
  154. npc_dom[$tempcclean] = 0
  155. npc_sub[$tempcclean] = 0
  156. npc_QW[$tempcclean] = 0
  157. npc_rel[$tempcclean] = 0
  158. npc_love[$tempcclean] = 0
  159. npc_job[$tempcclean] = 0
  160. npc_cloc[$tempcclean] = 0
  161. $npc_dad[$tempcclean] = ''
  162. $npc_mom[$tempcclean] = ''
  163. $npc_pic[$tempcclean] = ''
  164. npc_herpes[$tempcclean] = 0
  165. npc_syth[$tempcclean] = 0
  166. npc_gon[$tempcclean] = 0
  167. npc_thrush[$tempcclean] = 0
  168. npc_chem[$tempcclean] = 0
  169. npc_clothpref[$tempcclean] = 0
  170. $npc_PersType[$tempcclean] = ''
  171. $npc_dna[$tempcclean] = ''
  172. end
  173. i = arrsize('$cemptyarray')
  174. $cemptyarray[i] = $tempcclean
  175. :clean_sanity_loop
  176. i = arrsize('$cemptyarray')
  177. If i > 1 and $cemptyarray[0] = $cemptyarray[i]: killvar '$cemptyarray', i & jump 'clean_sanity_loop'
  178. killvar '$tempcclean'
  179. --- npccleanc ---------------------------------