mod_addedflavour_charsche.qsrc 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. # mod_addedflavour_charsche
  2. if $ARGS[0] = 'addchar':
  3. if arrpos('charsche_charlist',charsche_ID) = -1 : charsche_charlist[] = charsche_ID
  4. $charsche_character_ID[arrpos('charsche_charlist',charsche_ID)] = charsche_ID
  5. $charsche_character_HomeLoc[arrpos('charsche_charlist',charsche_ID)] = $charsche_HomeLoc
  6. $charsche_character_CurActLoc[arrpos('charsche_charlist',charsche_ID)] = $charsche_CurActLoc
  7. $charsche_character_CurActDesc[arrpos('charsche_charlist',charsche_ID)] = $charsche_CurActDesc
  8. charsche_character_CurActTime[arrpos('charsche_charlist',charsche_ID)] = charsche_CurActTime
  9. charsche_character_CurActPriority[arrpos('charsche_charlist',charsche_ID)] = charsche_CurActPriority
  10. $charsche_character_PrevActLoc[arrpos('charsche_charlist',charsche_ID)] = $charsche_PrevActLoc
  11. $charsche_character_PrevActDesc[arrpos('charsche_charlist',charsche_ID)] = $charsche_PrevActDesc
  12. charsche_character_LastCheck[arrpos('charsche_charlist',charsche_ID)] = charsche_LastCheck
  13. KILLVAR '$charsche_charloc'
  14. KILLVAR 'charsche_ID'
  15. KILLVAR '$charsche_HomeLoc'
  16. KILLVAR '$charsche_CurActLoc'
  17. KILLVAR '$charsche_CurActDesc'
  18. KILLVAR 'charsche_CurActTime'
  19. KILLVAR 'charsche_CurActPriority'
  20. KILLVAR '$charsche_PrevActLoc'
  21. KILLVAR '$charsche_PrevActDesc'
  22. KILLVAR 'charsche_LastCheck'
  23. end
  24. if $ARGS[0] = 'addsleep':
  25. if arrpos('$charsche_sleeplist',$charsche_Name) = -1 : $charsche_sleeplist[] = $charsche_Name
  26. $charsche_sleepcycle_Name[arrpos('$charsche_sleeplist',$charsche_Name)] = $charsche_Name
  27. charsche_sleepcycle_ID[arrpos('$charsche_sleeplist',$charsche_Name)] = charsche_ID
  28. charsche_sleepcycle_StartTime[arrpos('$charsche_sleeplist',$charsche_Name)] = charsche_StartTime
  29. charsche_sleepcycle_EndTime[arrpos('$charsche_sleeplist',$charsche_Name)] = charsche_EndTime
  30. $charsche_sleepcycle_Days[arrpos('$charsche_sleeplist',$charsche_Name)] = $charsche_Days
  31. KILLVAR '$charsche_Name'
  32. KILLVAR 'charsche_ID'
  33. KILLVAR 'charsche_StartTime'
  34. KILLVAR 'charsche_EndTime'
  35. KILLVAR '$charsche_Days'
  36. end
  37. if $ARGS[0] = 'chksleep':
  38. charsche_chksleeploop = 0
  39. :chksleeploopstart
  40. if charsche_chksleeploop >= 1000 : $modVar_AF_LoopErrorLoc = 'chksleeploop' & jump 'chksleeploopend'
  41. if charsche_chksleeploop >= arrsize('$charsche_sleeplist') : jump 'chksleeploopend'
  42. if charsche_sleepcycle_ID[charsche_chksleeploop] = charsche_ID:
  43. if strpos($charsche_sleepcycle_Days[charsche_chksleeploop],week) > 0:
  44. charsche_sleepcycle_StartTime_Adj = charsche_sleepcycle_StartTime[charsche_chksleeploop]
  45. charsche_sleepcycle_EndTime_Adj = charsche_sleepcycle_EndTime[charsche_chksleeploop]
  46. if (charsche_timestamp < charsche_sleepcycle_StartTime[charsche_chksleeploop] and charsche_timestamp < charsche_sleepcycle_EndTime[charsche_chksleeploop]) and charsche_sleepcycle_StartTime[charsche_chksleeploop] > charsche_sleepcycle_EndTime[charsche_chksleeploop] : charsche_sleepcycle_StartTime_Adj = 0
  47. if (charsche_timestamp > charsche_sleepcycle_StartTime[charsche_chksleeploop] and charsche_timestamp > charsche_sleepcycle_EndTime[charsche_chksleeploop]) and charsche_sleepcycle_StartTime[charsche_chksleeploop] > charsche_sleepcycle_EndTime[charsche_chksleeploop] : charsche_sleepcycle_EndTime_Adj += 1440
  48. if charsche_timestamp >= charsche_sleepcycle_StartTime_Adj and charsche_timestamp < charsche_sleepcycle_EndTime_Adj:
  49. charsche_actinplace = 1
  50. $charsche_CurActLoc = $charsche_HomeLoc
  51. $charsche_CurActDesc = 'Sleeping'
  52. charsche_sleepcycle_EndTime_Adj = charsche_sleepcycle_EndTime[charsche_chksleeploop]
  53. if charsche_sleepcycle_EndTime_Adj < charsche_timestamp : charsche_sleepcycle_EndTime_Adj += 1440
  54. charsche_CurActTime = charsche_sleepcycle_EndTime_Adj - charsche_timestamp
  55. charsche_CurActPriority = 1
  56. jump 'chksleeploopend'
  57. end
  58. end
  59. end
  60. charsche_chksleeploop += 1
  61. jump 'chksleeploopstart'
  62. :chksleeploopend
  63. end
  64. if $ARGS[0] = 'addwork':
  65. if arrpos('$charsche_worklist',$charsche_Name) = -1 : $charsche_worklist[] = $charsche_Name
  66. $charsche_workcycle_Name[arrpos('$charsche_worklist',$charsche_Name)] = $charsche_Name
  67. $charsche_workcycle_Location[arrpos('$charsche_worklist',$charsche_Name)] = $charsche_Location
  68. charsche_workcycle_StartTime[arrpos('$charsche_worklist',$charsche_Name)] = charsche_StartTime
  69. charsche_workcycle_EndTime[arrpos('$charsche_worklist',$charsche_Name)] = charsche_EndTime
  70. $charsche_workcycle_Chars[arrpos('$charsche_worklist',$charsche_Name)] = $charsche_Chars
  71. $charsche_workcycle_Days[arrpos('$charsche_worklist',$charsche_Name)] = $charsche_Days
  72. KILLVAR '$charsche_Name'
  73. KILLVAR '$charsche_Location'
  74. KILLVAR 'charsche_StartTime'
  75. KILLVAR 'charsche_EndTime'
  76. KILLVAR '$charsche_Chars'
  77. KILLVAR '$charsche_Days'
  78. end
  79. if $ARGS[0] = 'chkwork':
  80. charsche_chkworkloop = 0
  81. :chkworkloopstart
  82. if charsche_chkworkloop >= 1000 : $modVar_AF_LoopErrorLoc = 'chkworkloop' & jump 'chkworkloopend'
  83. if charsche_chkworkloop >= arrsize('$charsche_worklist') : jump 'chkworkloopend'
  84. if strpos($charsche_workcycle_Chars[charsche_chkworkloop],'A<<charsche_ID>>X') ! 0:
  85. if strpos($charsche_workcycle_Days[charsche_chkworkloop],week) ! 0:
  86. charsche_workcycle_EndTime_Adj = charsche_workcycle_EndTime[charsche_chkworkloop]
  87. if charsche_workcycle_EndTime_Adj < charsche_workcycle_StartTime[charsche_chkworkloop] : charsche_workcycle_EndTime_Adj += 1440
  88. if charsche_workcycle_StartTime[charsche_chkworkloop] <= charsche_timestamp and charsche_workcycle_EndTime_Adj > charsche_timestamp:
  89. charsche_actinplace = 1
  90. $charsche_CurActLoc = $charsche_workcycle_Location[charsche_chkworkloop]
  91. $charsche_CurActDesc = 'Working'
  92. charsche_workcycle_EndTime_Adj = charsche_workcycle_EndTime[charsche_chkworkloop]
  93. if charsche_workcycle_EndTime[charsche_chkworkloop] < charsche_timestamp : charsche_workcycle_EndTime_Adj += 1440
  94. charsche_CurActTime = charsche_workcycle_EndTime_Adj - charsche_timestamp
  95. charsche_CurActPriority = 1
  96. jump 'chkworkloopend'
  97. end
  98. end
  99. end
  100. charsche_chkworkloop += 1
  101. jump 'chkworkloopstart'
  102. :chkworkloopend
  103. end
  104. if $ARGS[0] = 'addact':
  105. if arrpos('$charsche_actlist',$charsche_Name) = -1 : $charsche_actlist[] = $charsche_Name
  106. $charsche_activity_Name[arrpos('$charsche_actlist',$charsche_Name)] = $charsche_Name
  107. $charsche_activity_Location[arrpos('$charsche_actlist',$charsche_Name)] = $charsche_Location
  108. $charsche_activity_Action[arrpos('$charsche_actlist',$charsche_Name)] = $charsche_Action
  109. charsche_activity_StartTime[arrpos('$charsche_actlist',$charsche_Name)] = charsche_StartTime
  110. charsche_activity_EndTime[arrpos('$charsche_actlist',$charsche_Name)] = charsche_EndTime
  111. charsche_activity_MinLen[arrpos('$charsche_actlist',$charsche_Name)] = charsche_MinLen
  112. charsche_activity_MaxLen[arrpos('$charsche_actlist',$charsche_Name)] = charsche_MaxLen
  113. charsche_activity_Priority[arrpos('$charsche_actlist',$charsche_Name)] = charsche_Priority
  114. charsche_activity_Active[arrpos('$charsche_actlist',$charsche_Name)] = charsche_Active
  115. charsche_activity_LocConflict[arrpos('$charsche_actlist',$charsche_Name)] = charsche_LocConflict
  116. $charsche_activity_Chars[arrpos('$charsche_actlist',$charsche_Name)] = $charsche_Chars
  117. $charsche_activity_Days[arrpos('$charsche_actlist',$charsche_Name)] = $charsche_Days
  118. KILLVAR '$charsche_Name'
  119. KILLVAR '$charsche_Location'
  120. KILLVAR '$charsche_Action'
  121. KILLVAR 'charsche_StartTime'
  122. KILLVAR 'charsche_EndTime'
  123. KILLVAR 'charsche_MinLen'
  124. KILLVAR 'charsche_MaxLen'
  125. KILLVAR 'charsche_Priority'
  126. KILLVAR 'charsche_Active'
  127. KILLVAR 'charsche_LocConflict'
  128. KILLVAR '$charsche_Chars'
  129. KILLVAR '$charsche_Days'
  130. end
  131. if $ARGS[0] = 'acttools':
  132. if $ARGS[1] = 'actchars':
  133. !! Call Definition = gs 'mod_addedflavour_charsche' , 'acttools' , 'actchars' , [Act Name] , [Add or Remove] , [Char ID] !!
  134. !! Ex: gs 'mod_addedflavour_charsche' , 'acttools' , 'actchars' , 'Base Idle' , 'Add' , 34 !!
  135. if $ARGS[3] = 'Add':
  136. if strpos($charsche_activity_Chars[arrpos('$charsche_actlist',$ARGS[2])],'A<<ARGS[4]>>X') = 0:
  137. $charsche_activity_Chars[arrpos('$charsche_actlist',$ARGS[2])] = '<<$charsche_activity_Chars[arrpos(''$charsche_actlist'',$ARGS[2])]>>A<<ARGS[4]>>X'
  138. end
  139. elseif $ARGS[3] = 'Remove':
  140. if strpos($charsche_activity_Chars[arrpos('$charsche_actlist',$ARGS[2])],'A<<ARGS[4]>>X') ! 0:
  141. $mod_addedflavour_TempStrLeft = $MID($charsche_activity_Chars[arrpos('$charsche_actlist',$ARGS[2])],1,(strpos($charsche_activity_Chars[arrpos('$charsche_actlist',$ARGS[2])],'A<<ARGS[4]>>X') - 1))
  142. $mod_addedflavour_TempStrRight = $MID($charsche_activity_Chars[arrpos('$charsche_actlist',$ARGS[2])],(strpos($charsche_activity_Chars[arrpos('$charsche_actlist',$ARGS[2])],'A<<ARGS[4]>>X') + len('A<<ARGS[4]>>X')))
  143. $charsche_activity_Chars[arrpos('$charsche_actlist',$ARGS[2])] = '<<$mod_addedflavour_TempStrLeft>><<$mod_addedflavour_TempStrRight>>'
  144. end
  145. end
  146. end
  147. if $ARGS[1] = 'forceact':
  148. !! Call Definition = gs 'mod_addedflavour_charsche' , 'acttools' , 'forceact' , CharacterID , Location , Action , LengthOfTimeInMinutes !!
  149. !! Ex: gs 'mod_addedflavour_charsche' , 'acttools' , 'forceact' , 29 , 'bedrPar' , 'Sleeping' , 360 !!
  150. charsche_forceact_charloc = arrpos('charsche_charlist',ARGS[2])
  151. $charsche_character_PrevActLoc[charsche_forceact_charloc] = $charsche_character_CurActLoc[charsche_forceact_charloc]
  152. $charsche_character_PrevActDesc[charsche_forceact_charloc] = $charsche_character_CurActDesc[charsche_forceact_charloc]
  153. $charsche_character_CurActLoc[charsche_forceact_charloc] = $ARGS[3]
  154. $charsche_character_CurActDesc[charsche_forceact_charloc] = $ARGS[4]
  155. charsche_character_CurActTime[charsche_forceact_charloc] = ARGS[5]
  156. charsche_character_CurActPriority[charsche_forceact_charloc] = 1
  157. charsche_character_LastCheck[charsche_forceact_charloc] = (hour * 60) + minut
  158. KILLVAR 'charsche_forceact_charloc'
  159. end
  160. if $ARGS[1] = 'listrecords':
  161. !! Call Definition = gs 'mod_addedflavour_charsche' , 'acttools' , 'listrecords' , [Optional - Subject]
  162. if $ARGS[2] = 'character' or $ARGS[2] = 'All':
  163. '<center><h2>Characters</h2></center>'
  164. listrecordsloopcount = 0
  165. :listrecordscharloopstart
  166. if listrecordsloopcount >= arrsize('charsche_charlist') : jump 'listrecordscharloopend'
  167. 'ID = <<$charsche_character_ID[listrecordsloopcount]>>'
  168. 'Home Location (Sleep Place) = <<$charsche_character_HomeLoc[listrecordsloopcount]>>'
  169. 'Current Location = <<$charsche_character_CurActLoc[listrecordsloopcount]>>'
  170. 'Current Action = <<$charsche_character_CurActDesc[listrecordsloopcount]>>'
  171. 'Time Remaining on Current Action = <<charsche_character_CurActTime[listrecordsloopcount]>>'
  172. 'Priority of Current Action = <<charsche_character_CurActPriority[listrecordsloopcount]>>'
  173. 'Previous Location = <<$charsche_character_PrevActLoc[listrecordsloopcount]>>'
  174. 'Previous Action = <<$charsche_character_PrevActDesc[listrecordsloopcount]>>'
  175. *nl
  176. listrecordsloopcount += 1
  177. jump 'listrecordscharloopstart'
  178. :listrecordscharloopend
  179. end
  180. if $ARGS[2] = 'sleep' or $ARGS[2] = 'All':
  181. '<center><h2>Sleep Cycles</h2></center>'
  182. listrecordsloopcount = 0
  183. :listrecordssleeploopstart
  184. if listrecordsloopcount >= arrsize('$charsche_sleeplist') : jump 'listrecordssleeploopend'
  185. 'Sleep Cycle Name = <<$charsche_sleepcycle_Name[listrecordsloopcount]>>'
  186. 'ID of NPC that uses this Sleep Cycle = <<charsche_sleepcycle_ID[listrecordsloopcount]>>'
  187. 'Start Time = <<charsche_sleepcycle_StartTime[listrecordsloopcount] / 60>> : <<charsche_sleepcycle_StartTime[listrecordsloopcount] mod 60>>'
  188. 'End Time = <<charsche_sleepcycle_EndTime[listrecordsloopcount] / 60>> : <<charsche_sleepcycle_EndTime[listrecordsloopcount] mod 60>>'
  189. 'Days the Sleep Cycle is Applied to = <<$charsche_sleepcycle_Days[listrecordsloopcount]>>'
  190. *nl
  191. listrecordsloopcount += 1
  192. jump 'listrecordssleeploopstart'
  193. :listrecordssleeploopend
  194. end
  195. if $ARGS[2] = 'work' or $ARGS[2] = 'All':
  196. '<center><h2>Work Cycles</h2></center>'
  197. listrecordsloopcount = 0
  198. :listrecordsworkloopstart
  199. if listrecordsloopcount >= arrsize('$charsche_worklist') : jump 'listrecordsworkloopend'
  200. 'Work Cycle Name = <<$charsche_workcycle_Name[listrecordsloopcount]>>'
  201. 'Location for Work Cycle = <<$charsche_workcycle_Location[listrecordsloopcount]>>'
  202. 'Start Time = <<charsche_workcycle_StartTime[listrecordsloopcount] / 60>> : <<charsche_workcycle_StartTime[listrecordsloopcount] mod 60>>'
  203. 'End Time = <<charsche_workcycle_EndTime[listrecordsloopcount] / 60>> : <<charsche_workcycle_EndTime[listrecordsloopcount] mod 60>>'
  204. 'ID''s of NPC''s that use this Work Cycle = <<$charsche_workcycle_Chars[listrecordsloopcount]>>'
  205. 'Days the Work Cycle is Applied to = <<$charsche_workcycle_Days[listrecordsloopcount]>>'
  206. *nl
  207. listrecordsloopcount += 1
  208. jump 'listrecordsworkloopstart'
  209. :listrecordsworkloopend
  210. end
  211. if $ARGS[2] = 'activity' or $ARGS[2] = 'All':
  212. '<center><h2>Activities</h2></center>'
  213. listrecordsloopcount = 0
  214. :listrecordsactsloopstart
  215. if listrecordsloopcount >= arrsize('$charsche_actlist') : jump 'listrecordsactsloopend'
  216. 'Activity Name = <<$charsche_activity_Name[listrecordsloopcount]>>'
  217. 'Activity Location = <<$charsche_activity_Location[listrecordsloopcount]>>'
  218. 'Activity Action = <<$charsche_activity_Action[listrecordsloopcount]>>'
  219. 'Start Time = <<charsche_activity_StartTime[listrecordsloopcount] / 60>> / <<charsche_activity_StartTime[listrecordsloopcount] mod 60>>'
  220. 'End Time = <<charsche_activity_EndTime[listrecordsloopcount] / 60>> / <<charsche_activity_EndTime[listrecordsloopcount] mod 60>>'
  221. 'Minimum Length of Activity (Minutes) = ' + iif(charsche_activity_MinLen[listrecordsloopcount] = '','[Fixed Length]','<<charsche_activity_MinLen[listrecordsloopcount]>>')
  222. 'Maximum Length of Activity (Minutes) = ' + iif(charsche_activity_MaxLen[listrecordsloopcount] = '','[Fixed Length]','<<charsche_activity_MaxLen[listrecordsloopcount]>>')
  223. 'Activity Priority = <<charsche_activity_Priority[listrecordsloopcount]>>'
  224. 'Is the Activity Available? = ' + iif(charsche_activity_Active[listrecordsloopcount] = 1,'<font color="Green">Yes</font>','<font color="Red">No</font>')
  225. 'Is the Activity Location Restricted to One Person? = ' + iif(charsche_activity_LocConflict[listrecordsloopcount] = 1,'<font color="Red">Yes</font>','<font color="Green">No</font>')
  226. 'ID''s of NPC''s that can do this Activity = <<$charsche_activity_Chars[listrecordsloopcount]>>'
  227. 'Days the Activity is Available = <<$charsche_activity_Days[listrecordsloopcount]>>'
  228. *nl
  229. listrecordsloopcount += 1
  230. jump 'listrecordsactsloopstart'
  231. :listrecordsactsloopend
  232. end
  233. end
  234. end
  235. if $ARGS[0] = 'chkschedule':
  236. charsche_chkscheduleloop = 0
  237. :chkscheloopstart
  238. if charsche_chkscheduleloop >= 1000 : $modVar_AF_LoopErrorLoc = 'chkscheloop' & jump 'chkscheloopend'
  239. if charsche_chkscheduleloop >= arrsize('charsche_charlist') : jump 'chkscheloopend'
  240. charsche_charloc = charsche_chkscheduleloop
  241. charsche_ID = $charsche_character_ID[charsche_chkscheduleloop]
  242. $charsche_HomeLoc = $charsche_character_HomeLoc[charsche_chkscheduleloop]
  243. $charsche_CurActLoc = $charsche_character_CurActLoc[charsche_chkscheduleloop]
  244. $charsche_CurActDesc = $charsche_character_CurActDesc[charsche_chkscheduleloop]
  245. charsche_CurActTime = charsche_character_CurActTime[charsche_chkscheduleloop]
  246. charsche_CurActPriority = charsche_character_CurActPriority[charsche_chkscheduleloop]
  247. charsche_LastCheck = charsche_character_LastCheck[charsche_chkscheduleloop]
  248. gs 'mod_addedflavour_charsche' , 'charscheduler'
  249. charsche_chkscheduleloop += 1
  250. jump 'chkscheloopstart'
  251. :chkscheloopend
  252. KILLVAR 'charsche_ID'
  253. KILLVAR '$charsche_Workplace'
  254. KILLVAR '$charsche_HomeLoc'
  255. KILLVAR '$charsche_CurActLoc'
  256. KILLVAR '$charsche_CurActDesc'
  257. KILLVAR 'charsche_CurActTime'
  258. KILLVAR 'charsche_CurActPriority'
  259. KILLVAR 'charsche_LastCheck'
  260. gs 'mod_addedflavour_charchor' , 'choreographer-overall'
  261. end
  262. if $ARGS[0] = 'charscheduler':
  263. charsche_actinplace = 0
  264. charsche_timestamp = (hour * 60) + minut
  265. charsche_timestamp_Adj = charsche_timestamp
  266. if charsche_CurActTime < 0 or charsche_CurActTime > 1440 : charsche_CurActTime = 0
  267. if charsche_LastCheck < 0: charsche_LastCheck = 0
  268. if charsche_LastCheck > charsche_timestamp : charsche_timestamp_Adj += 1440
  269. if (charsche_LastCheck + charsche_CurActTime > charsche_timestamp_Adj) and charsche_CurActPriority = 1:
  270. charsche_CurActTime = charsche_CurActTime - (charsche_timestamp_Adj - charsche_LastCheck)
  271. if charsche_CurActTime <= 0:
  272. charsche_CurActTime = 0
  273. else
  274. charsche_actinplace = 1
  275. end
  276. end
  277. if charsche_actinplace = 0 : gs 'mod_addedflavour_charsche' , 'chksleep'
  278. if charsche_actinplace = 0 : gs 'mod_addedflavour_charsche' , 'chkwork'
  279. if charsche_actinplace = 0 : gs 'mod_addedflavour_charsche' , 'chkact' , 1
  280. if charsche_actinplace = 0 and (charsche_LastCheck + charsche_CurActTime > charsche_timestamp_Adj) and charsche_CurActPriority = 2:
  281. charsche_CurActTime = charsche_CurActTime - (charsche_timestamp_Adj - charsche_LastCheck)
  282. if charsche_CurActTime <= 0:
  283. charsche_CurActTime = 0
  284. else
  285. charsche_actinplace = 1
  286. end
  287. end
  288. if charsche_actinplace = 0 : gs 'mod_addedflavour_charsche' , 'chkact' , 2
  289. if charsche_actinplace = 0:
  290. $modVar_AF_LoopErrorLoc = '<<charsche_ID>> charscheduler NoOptions'
  291. $charsche_CurActLoc = $charsche_HomeLoc
  292. $charsche_CurActDesc = 'Idle'
  293. charsche_CurActTime = 15
  294. charsche_CurActPriority = 2
  295. end
  296. charsche_LastCheck = charsche_timestamp
  297. charsche_character_LastCheck[charsche_charloc] = charsche_LastCheck
  298. charsche_character_CurActTime[charsche_charloc] = charsche_CurActTime
  299. if $charsche_character_CurActLoc[charsche_charloc] ! $charsche_CurActLoc or $charsche_character_CurActDesc[charsche_charloc] ! $charsche_CurActDesc:
  300. $charsche_character_PrevActLoc[charsche_charloc] = $charsche_character_CurActLoc[charsche_charloc]
  301. $charsche_character_CurActLoc[charsche_charloc] = $charsche_CurActLoc
  302. $charsche_character_PrevActDesc[charsche_charloc] = $charsche_character_CurActDesc[charsche_charloc]
  303. $charsche_character_CurActDesc[charsche_charloc] = $charsche_CurActDesc
  304. end
  305. charsche_character_CurActPriority[charsche_charloc] = charsche_CurActPriority
  306. KILLVAR 'charsche_actinplace'
  307. KILLVAR 'charsche_timestamp'
  308. KILLVAR 'charsche_timestamp_Adj'
  309. gs 'mod_addedflavour_charchor' , 'choreographer-individual' , charsche_ID
  310. end
  311. if $ARGS[0] = 'chkact':
  312. charsche_chkactloop = 0
  313. KILLVAR '$charsche_actoptions'
  314. :chkactloopstart
  315. if charsche_chkactloop >= 1000 : $modVar_AF_LoopErrorLoc = '<<charsche_ID>> charsche_actoptions' & jump 'chkactloopend'
  316. if charsche_chkactloop >= arrsize('$charsche_actlist') : jump 'chkactloopend'
  317. if charsche_activity_Active[charsche_chkactloop] = 1:
  318. if strpos($charsche_activity_Chars[charsche_chkactloop],'A<<charsche_ID>>X') > 0:
  319. if strpos($charsche_activity_Days[charsche_chkactloop],week) > 0:
  320. if charsche_activity_Priority[charsche_chkactloop] = ARGS[1]:
  321. charsche_activity_EndTime_Adj = charsche_activity_EndTime[charsche_chkactloop]
  322. if charsche_activity_EndTime_Adj < charsche_activity_StartTime[charsche_chkactloop] : charsche_activity_EndTime_Adj += 1440
  323. if charsche_activity_StartTime[charsche_chkactloop] <= charsche_timestamp and charsche_activity_EndTime_Adj > charsche_timestamp:
  324. if ARGS[1] = 1:
  325. charsche_actinplace = 1
  326. $charsche_CurActLoc = $charsche_activity_Location[charsche_chkactloop]
  327. $charsche_CurActDesc = $charsche_activity_Action[charsche_chkactloop]
  328. if charsche_activity_MinLen[charsche_chkactloop] >= 1:
  329. charsche_CurActTime = rand(charsche_activity_MinLen[charsche_chkactloop],charsche_activity_MaxLen[charsche_chkactloop])
  330. if charsche_CurActTime > charsche_activity_EndTime_Adj : charsche_CurActTime = charsche_activity_EndTime_Adj - charsche_timestamp
  331. else
  332. charsche_CurActTime = charsche_workcycle_EndTime_Adj - charsche_timestamp
  333. end
  334. charsche_CurActPriority = 1
  335. jump 'chkactloopend'
  336. elseif ARGS[1] = 2:
  337. charsche_chklocconflict = 0
  338. if charsche_activity_LocConflict[charsche_chkactloop] = 1:
  339. gs 'mod_addedflavour_charsche' , 'chklocconflict'
  340. end
  341. if charsche_chklocconflict = 0:
  342. $charsche_actoptions[] = $charsche_activity_Name[charsche_chkactloop]
  343. end
  344. end
  345. end
  346. end
  347. end
  348. end
  349. end
  350. charsche_chkactloop += 1
  351. jump 'chkactloopstart'
  352. :chkactloopend
  353. if ARGS[1] = 2:
  354. if arrsize('$charsche_actoptions') = 0 : $charsche_actoptions[] = 'Base Idle'
  355. charsche_chkact_action = rand(1,arrsize('$charsche_actoptions')) - 1
  356. charsche_chkact_actionloc = arrpos('$charsche_actlist',$charsche_actoptions[charsche_chkact_action])
  357. charsche_actinplace = 1
  358. $charsche_CurActLoc = $charsche_activity_Location[charsche_chkact_actionloc]
  359. $charsche_CurActDesc = $charsche_activity_Action[charsche_chkact_actionloc]
  360. charsche_activity_EndTime_Adj = charsche_activity_EndTime[charsche_chkact_actionloc]
  361. if charsche_activity_EndTime_Adj < charsche_activity_StartTime[charsche_chkact_actionloc] : charsche_activity_EndTime_Adj += 1440
  362. if charsche_activity_MinLen[charsche_chkact_actionloc] >= 1:
  363. charsche_CurActTime = rand(charsche_activity_MinLen[charsche_chkact_actionloc],charsche_activity_MaxLen[charsche_chkact_actionloc])
  364. if charsche_CurActTime > charsche_activity_EndTime_Adj : charsche_CurActTime = charsche_activity_EndTime_Adj - charsche_timestamp
  365. else
  366. charsche_CurActTime = charsche_workcycle_EndTime_Adj - charsche_timestamp_Adj
  367. end
  368. charsche_CurActPriority = 2
  369. end
  370. if $charsche_CurActLoc = 'HomeLoc' : $charsche_CurActLoc = $charsche_HomeLoc
  371. end
  372. if $ARGS[0] = 'chklocconflict':
  373. charsche_chklocconflictloop = 0
  374. :chklocconflictloopstart
  375. if charsche_chklocconflictloop >= 1000 : $modVar_AF_LoopErrorLoc = 'chklocconflictloop' & jump 'chklocconflictloopend'
  376. if charsche_chklocconflictloop < arrsize('charsche_charlist'):
  377. if $charsche_character_CurActLoc[charsche_chklocconflictloop] = $charsche_activity_Location[charsche_chkactloop] or $loc = $charsche_activity_Location[charsche_chkactloop]:
  378. charsche_chklocconflict = 1
  379. else
  380. charsche_chklocconflictloop += 1
  381. jump 'chklocconflictloopstart'
  382. end
  383. end
  384. :chklocconflictloopend
  385. end
  386. --- mod_addedflavour_charsche ---------------------------------