123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397 |
- # mod_addedflavour_charsche
- if $ARGS[0] = 'addchar':
- if arrpos('charsche_charlist',charsche_ID) = -1 : charsche_charlist[] = charsche_ID
- $charsche_character_ID[arrpos('charsche_charlist',charsche_ID)] = charsche_ID
- $charsche_character_HomeLoc[arrpos('charsche_charlist',charsche_ID)] = $charsche_HomeLoc
- $charsche_character_CurActLoc[arrpos('charsche_charlist',charsche_ID)] = $charsche_CurActLoc
- $charsche_character_CurActDesc[arrpos('charsche_charlist',charsche_ID)] = $charsche_CurActDesc
- charsche_character_CurActTime[arrpos('charsche_charlist',charsche_ID)] = charsche_CurActTime
- charsche_character_CurActPriority[arrpos('charsche_charlist',charsche_ID)] = charsche_CurActPriority
- $charsche_character_PrevActLoc[arrpos('charsche_charlist',charsche_ID)] = $charsche_PrevActLoc
- $charsche_character_PrevActDesc[arrpos('charsche_charlist',charsche_ID)] = $charsche_PrevActDesc
- charsche_character_LastCheck[arrpos('charsche_charlist',charsche_ID)] = charsche_LastCheck
- KILLVAR '$charsche_charloc'
- KILLVAR 'charsche_ID'
- KILLVAR '$charsche_HomeLoc'
- KILLVAR '$charsche_CurActLoc'
- KILLVAR '$charsche_CurActDesc'
- KILLVAR 'charsche_CurActTime'
- KILLVAR 'charsche_CurActPriority'
- KILLVAR '$charsche_PrevActLoc'
- KILLVAR '$charsche_PrevActDesc'
- KILLVAR 'charsche_LastCheck'
- end
-
- if $ARGS[0] = 'addsleep':
- if arrpos('$charsche_sleeplist',$charsche_Name) = -1 : $charsche_sleeplist[] = $charsche_Name
- $charsche_sleepcycle_Name[arrpos('$charsche_sleeplist',$charsche_Name)] = $charsche_Name
- charsche_sleepcycle_ID[arrpos('$charsche_sleeplist',$charsche_Name)] = charsche_ID
- charsche_sleepcycle_StartTime[arrpos('$charsche_sleeplist',$charsche_Name)] = charsche_StartTime
- charsche_sleepcycle_EndTime[arrpos('$charsche_sleeplist',$charsche_Name)] = charsche_EndTime
- $charsche_sleepcycle_Days[arrpos('$charsche_sleeplist',$charsche_Name)] = $charsche_Days
- KILLVAR '$charsche_Name'
- KILLVAR 'charsche_ID'
- KILLVAR 'charsche_StartTime'
- KILLVAR 'charsche_EndTime'
- KILLVAR '$charsche_Days'
- end
-
- if $ARGS[0] = 'chksleep':
- charsche_chksleeploop = 0
- :chksleeploopstart
- if charsche_chksleeploop >= 1000 : $modVar_AF_LoopErrorLoc = 'chksleeploop' & jump 'chksleeploopend'
- if charsche_chksleeploop >= arrsize('$charsche_sleeplist') : jump 'chksleeploopend'
- if charsche_sleepcycle_ID[charsche_chksleeploop] = charsche_ID:
- if strpos($charsche_sleepcycle_Days[charsche_chksleeploop],week) > 0:
- charsche_sleepcycle_StartTime_Adj = charsche_sleepcycle_StartTime[charsche_chksleeploop]
- charsche_sleepcycle_EndTime_Adj = charsche_sleepcycle_EndTime[charsche_chksleeploop]
- 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
- 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
- if charsche_timestamp >= charsche_sleepcycle_StartTime_Adj and charsche_timestamp < charsche_sleepcycle_EndTime_Adj:
- charsche_actinplace = 1
- $charsche_CurActLoc = $charsche_HomeLoc
- $charsche_CurActDesc = 'Sleeping'
- charsche_sleepcycle_EndTime_Adj = charsche_sleepcycle_EndTime[charsche_chksleeploop]
- if charsche_sleepcycle_EndTime_Adj < charsche_timestamp : charsche_sleepcycle_EndTime_Adj += 1440
- charsche_CurActTime = charsche_sleepcycle_EndTime_Adj - charsche_timestamp
- charsche_CurActPriority = 1
- jump 'chksleeploopend'
- end
- end
- end
- charsche_chksleeploop += 1
- jump 'chksleeploopstart'
- :chksleeploopend
- end
-
- if $ARGS[0] = 'addwork':
- if arrpos('$charsche_worklist',$charsche_Name) = -1 : $charsche_worklist[] = $charsche_Name
- $charsche_workcycle_Name[arrpos('$charsche_worklist',$charsche_Name)] = $charsche_Name
- $charsche_workcycle_Location[arrpos('$charsche_worklist',$charsche_Name)] = $charsche_Location
- charsche_workcycle_StartTime[arrpos('$charsche_worklist',$charsche_Name)] = charsche_StartTime
- charsche_workcycle_EndTime[arrpos('$charsche_worklist',$charsche_Name)] = charsche_EndTime
- $charsche_workcycle_Chars[arrpos('$charsche_worklist',$charsche_Name)] = $charsche_Chars
- $charsche_workcycle_Days[arrpos('$charsche_worklist',$charsche_Name)] = $charsche_Days
- KILLVAR '$charsche_Name'
- KILLVAR '$charsche_Location'
- KILLVAR 'charsche_StartTime'
- KILLVAR 'charsche_EndTime'
- KILLVAR '$charsche_Chars'
- KILLVAR '$charsche_Days'
- end
-
- if $ARGS[0] = 'chkwork':
- charsche_chkworkloop = 0
- :chkworkloopstart
- if charsche_chkworkloop >= 1000 : $modVar_AF_LoopErrorLoc = 'chkworkloop' & jump 'chkworkloopend'
- if charsche_chkworkloop >= arrsize('$charsche_worklist') : jump 'chkworkloopend'
- if strpos($charsche_workcycle_Chars[charsche_chkworkloop],'A<<charsche_ID>>X') ! 0:
- if strpos($charsche_workcycle_Days[charsche_chkworkloop],week) ! 0:
- charsche_workcycle_EndTime_Adj = charsche_workcycle_EndTime[charsche_chkworkloop]
- if charsche_workcycle_EndTime_Adj < charsche_workcycle_StartTime[charsche_chkworkloop] : charsche_workcycle_EndTime_Adj += 1440
- if charsche_workcycle_StartTime[charsche_chkworkloop] <= charsche_timestamp and charsche_workcycle_EndTime_Adj > charsche_timestamp:
- charsche_actinplace = 1
- $charsche_CurActLoc = $charsche_workcycle_Location[charsche_chkworkloop]
- $charsche_CurActDesc = 'Working'
- charsche_workcycle_EndTime_Adj = charsche_workcycle_EndTime[charsche_chkworkloop]
- if charsche_workcycle_EndTime[charsche_chkworkloop] < charsche_timestamp : charsche_workcycle_EndTime_Adj += 1440
- charsche_CurActTime = charsche_workcycle_EndTime_Adj - charsche_timestamp
- charsche_CurActPriority = 1
- jump 'chkworkloopend'
- end
- end
- end
- charsche_chkworkloop += 1
- jump 'chkworkloopstart'
- :chkworkloopend
- end
-
- if $ARGS[0] = 'addact':
- if arrpos('$charsche_actlist',$charsche_Name) = -1 : $charsche_actlist[] = $charsche_Name
- $charsche_activity_Name[arrpos('$charsche_actlist',$charsche_Name)] = $charsche_Name
- $charsche_activity_Location[arrpos('$charsche_actlist',$charsche_Name)] = $charsche_Location
- $charsche_activity_Action[arrpos('$charsche_actlist',$charsche_Name)] = $charsche_Action
- charsche_activity_StartTime[arrpos('$charsche_actlist',$charsche_Name)] = charsche_StartTime
- charsche_activity_EndTime[arrpos('$charsche_actlist',$charsche_Name)] = charsche_EndTime
- charsche_activity_MinLen[arrpos('$charsche_actlist',$charsche_Name)] = charsche_MinLen
- charsche_activity_MaxLen[arrpos('$charsche_actlist',$charsche_Name)] = charsche_MaxLen
- charsche_activity_Priority[arrpos('$charsche_actlist',$charsche_Name)] = charsche_Priority
- charsche_activity_Active[arrpos('$charsche_actlist',$charsche_Name)] = charsche_Active
- charsche_activity_LocConflict[arrpos('$charsche_actlist',$charsche_Name)] = charsche_LocConflict
- $charsche_activity_Chars[arrpos('$charsche_actlist',$charsche_Name)] = $charsche_Chars
- $charsche_activity_Days[arrpos('$charsche_actlist',$charsche_Name)] = $charsche_Days
- KILLVAR '$charsche_Name'
- KILLVAR '$charsche_Location'
- KILLVAR '$charsche_Action'
- KILLVAR 'charsche_StartTime'
- KILLVAR 'charsche_EndTime'
- KILLVAR 'charsche_MinLen'
- KILLVAR 'charsche_MaxLen'
- KILLVAR 'charsche_Priority'
- KILLVAR 'charsche_Active'
- KILLVAR 'charsche_LocConflict'
- KILLVAR '$charsche_Chars'
- KILLVAR '$charsche_Days'
- end
-
- if $ARGS[0] = 'acttools':
- if $ARGS[1] = 'actchars':
- !! Call Definition = gs 'mod_addedflavour_charsche' , 'acttools' , 'actchars' , [Act Name] , [Add or Remove] , [Char ID] !!
- !! Ex: gs 'mod_addedflavour_charsche' , 'acttools' , 'actchars' , 'Base Idle' , 'Add' , 34 !!
- if $ARGS[3] = 'Add':
- if strpos($charsche_activity_Chars[arrpos('$charsche_actlist',$ARGS[2])],'A<<ARGS[4]>>X') = 0:
- $charsche_activity_Chars[arrpos('$charsche_actlist',$ARGS[2])] = '<<$charsche_activity_Chars[arrpos(''$charsche_actlist'',$ARGS[2])]>>A<<ARGS[4]>>X'
- end
- elseif $ARGS[3] = 'Remove':
- if strpos($charsche_activity_Chars[arrpos('$charsche_actlist',$ARGS[2])],'A<<ARGS[4]>>X') ! 0:
- $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))
- $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')))
- $charsche_activity_Chars[arrpos('$charsche_actlist',$ARGS[2])] = '<<$mod_addedflavour_TempStrLeft>><<$mod_addedflavour_TempStrRight>>'
- end
- end
- end
- if $ARGS[1] = 'forceact':
- !! Call Definition = gs 'mod_addedflavour_charsche' , 'acttools' , 'forceact' , CharacterID , Location , Action , LengthOfTimeInMinutes !!
- !! Ex: gs 'mod_addedflavour_charsche' , 'acttools' , 'forceact' , 29 , 'bedrPar' , 'Sleeping' , 360 !!
- charsche_forceact_charloc = arrpos('charsche_charlist',ARGS[2])
- $charsche_character_PrevActLoc[charsche_forceact_charloc] = $charsche_character_CurActLoc[charsche_forceact_charloc]
- $charsche_character_PrevActDesc[charsche_forceact_charloc] = $charsche_character_CurActDesc[charsche_forceact_charloc]
- $charsche_character_CurActLoc[charsche_forceact_charloc] = $ARGS[3]
- $charsche_character_CurActDesc[charsche_forceact_charloc] = $ARGS[4]
- charsche_character_CurActTime[charsche_forceact_charloc] = ARGS[5]
- charsche_character_CurActPriority[charsche_forceact_charloc] = 1
- charsche_character_LastCheck[charsche_forceact_charloc] = (hour * 60) + minut
- KILLVAR 'charsche_forceact_charloc'
- end
- if $ARGS[1] = 'listrecords':
- !! Call Definition = gs 'mod_addedflavour_charsche' , 'acttools' , 'listrecords' , [Optional - Subject]
- if $ARGS[2] = 'character' or $ARGS[2] = 'All':
- '<center><h2>Characters</h2></center>'
- listrecordsloopcount = 0
- :listrecordscharloopstart
- if listrecordsloopcount >= arrsize('charsche_charlist') : jump 'listrecordscharloopend'
- 'ID = <<$charsche_character_ID[listrecordsloopcount]>>'
- 'Home Location (Sleep Place) = <<$charsche_character_HomeLoc[listrecordsloopcount]>>'
- 'Current Location = <<$charsche_character_CurActLoc[listrecordsloopcount]>>'
- 'Current Action = <<$charsche_character_CurActDesc[listrecordsloopcount]>>'
- 'Time Remaining on Current Action = <<charsche_character_CurActTime[listrecordsloopcount]>>'
- 'Priority of Current Action = <<charsche_character_CurActPriority[listrecordsloopcount]>>'
- 'Previous Location = <<$charsche_character_PrevActLoc[listrecordsloopcount]>>'
- 'Previous Action = <<$charsche_character_PrevActDesc[listrecordsloopcount]>>'
- *nl
- listrecordsloopcount += 1
- jump 'listrecordscharloopstart'
- :listrecordscharloopend
- end
- if $ARGS[2] = 'sleep' or $ARGS[2] = 'All':
- '<center><h2>Sleep Cycles</h2></center>'
- listrecordsloopcount = 0
- :listrecordssleeploopstart
- if listrecordsloopcount >= arrsize('$charsche_sleeplist') : jump 'listrecordssleeploopend'
- 'Sleep Cycle Name = <<$charsche_sleepcycle_Name[listrecordsloopcount]>>'
- 'ID of NPC that uses this Sleep Cycle = <<charsche_sleepcycle_ID[listrecordsloopcount]>>'
- 'Start Time = <<charsche_sleepcycle_StartTime[listrecordsloopcount] / 60>> : <<charsche_sleepcycle_StartTime[listrecordsloopcount] mod 60>>'
- 'End Time = <<charsche_sleepcycle_EndTime[listrecordsloopcount] / 60>> : <<charsche_sleepcycle_EndTime[listrecordsloopcount] mod 60>>'
- 'Days the Sleep Cycle is Applied to = <<$charsche_sleepcycle_Days[listrecordsloopcount]>>'
- *nl
- listrecordsloopcount += 1
- jump 'listrecordssleeploopstart'
- :listrecordssleeploopend
- end
- if $ARGS[2] = 'work' or $ARGS[2] = 'All':
- '<center><h2>Work Cycles</h2></center>'
- listrecordsloopcount = 0
- :listrecordsworkloopstart
- if listrecordsloopcount >= arrsize('$charsche_worklist') : jump 'listrecordsworkloopend'
- 'Work Cycle Name = <<$charsche_workcycle_Name[listrecordsloopcount]>>'
- 'Location for Work Cycle = <<$charsche_workcycle_Location[listrecordsloopcount]>>'
- 'Start Time = <<charsche_workcycle_StartTime[listrecordsloopcount] / 60>> : <<charsche_workcycle_StartTime[listrecordsloopcount] mod 60>>'
- 'End Time = <<charsche_workcycle_EndTime[listrecordsloopcount] / 60>> : <<charsche_workcycle_EndTime[listrecordsloopcount] mod 60>>'
- 'ID''s of NPC''s that use this Work Cycle = <<$charsche_workcycle_Chars[listrecordsloopcount]>>'
- 'Days the Work Cycle is Applied to = <<$charsche_workcycle_Days[listrecordsloopcount]>>'
- *nl
- listrecordsloopcount += 1
- jump 'listrecordsworkloopstart'
- :listrecordsworkloopend
- end
- if $ARGS[2] = 'activity' or $ARGS[2] = 'All':
- '<center><h2>Activities</h2></center>'
- listrecordsloopcount = 0
- :listrecordsactsloopstart
- if listrecordsloopcount >= arrsize('$charsche_actlist') : jump 'listrecordsactsloopend'
- 'Activity Name = <<$charsche_activity_Name[listrecordsloopcount]>>'
- 'Activity Location = <<$charsche_activity_Location[listrecordsloopcount]>>'
- 'Activity Action = <<$charsche_activity_Action[listrecordsloopcount]>>'
- 'Start Time = <<charsche_activity_StartTime[listrecordsloopcount] / 60>> / <<charsche_activity_StartTime[listrecordsloopcount] mod 60>>'
- 'End Time = <<charsche_activity_EndTime[listrecordsloopcount] / 60>> / <<charsche_activity_EndTime[listrecordsloopcount] mod 60>>'
- 'Minimum Length of Activity (Minutes) = ' + iif(charsche_activity_MinLen[listrecordsloopcount] = '','[Fixed Length]','<<charsche_activity_MinLen[listrecordsloopcount]>>')
- 'Maximum Length of Activity (Minutes) = ' + iif(charsche_activity_MaxLen[listrecordsloopcount] = '','[Fixed Length]','<<charsche_activity_MaxLen[listrecordsloopcount]>>')
- 'Activity Priority = <<charsche_activity_Priority[listrecordsloopcount]>>'
- 'Is the Activity Available? = ' + iif(charsche_activity_Active[listrecordsloopcount] = 1,'<font color="Green">Yes</font>','<font color="Red">No</font>')
- 'Is the Activity Location Restricted to One Person? = ' + iif(charsche_activity_LocConflict[listrecordsloopcount] = 1,'<font color="Red">Yes</font>','<font color="Green">No</font>')
- 'ID''s of NPC''s that can do this Activity = <<$charsche_activity_Chars[listrecordsloopcount]>>'
- 'Days the Activity is Available = <<$charsche_activity_Days[listrecordsloopcount]>>'
- *nl
- listrecordsloopcount += 1
- jump 'listrecordsactsloopstart'
- :listrecordsactsloopend
- end
- end
- end
-
- if $ARGS[0] = 'chkschedule':
- charsche_chkscheduleloop = 0
- :chkscheloopstart
- if charsche_chkscheduleloop >= 1000 : $modVar_AF_LoopErrorLoc = 'chkscheloop' & jump 'chkscheloopend'
- if charsche_chkscheduleloop >= arrsize('charsche_charlist') : jump 'chkscheloopend'
- charsche_charloc = charsche_chkscheduleloop
- charsche_ID = $charsche_character_ID[charsche_chkscheduleloop]
- $charsche_HomeLoc = $charsche_character_HomeLoc[charsche_chkscheduleloop]
- $charsche_CurActLoc = $charsche_character_CurActLoc[charsche_chkscheduleloop]
- $charsche_CurActDesc = $charsche_character_CurActDesc[charsche_chkscheduleloop]
- charsche_CurActTime = charsche_character_CurActTime[charsche_chkscheduleloop]
- charsche_CurActPriority = charsche_character_CurActPriority[charsche_chkscheduleloop]
- charsche_LastCheck = charsche_character_LastCheck[charsche_chkscheduleloop]
- gs 'mod_addedflavour_charsche' , 'charscheduler'
- charsche_chkscheduleloop += 1
- jump 'chkscheloopstart'
- :chkscheloopend
- KILLVAR 'charsche_ID'
- KILLVAR '$charsche_Workplace'
- KILLVAR '$charsche_HomeLoc'
- KILLVAR '$charsche_CurActLoc'
- KILLVAR '$charsche_CurActDesc'
- KILLVAR 'charsche_CurActTime'
- KILLVAR 'charsche_CurActPriority'
- KILLVAR 'charsche_LastCheck'
- gs 'mod_addedflavour_charchor' , 'choreographer-overall'
- end
-
- if $ARGS[0] = 'charscheduler':
- charsche_actinplace = 0
- charsche_timestamp = (hour * 60) + minut
- charsche_timestamp_Adj = charsche_timestamp
- if charsche_CurActTime < 0 or charsche_CurActTime > 1440 : charsche_CurActTime = 0
- if charsche_LastCheck < 0: charsche_LastCheck = 0
- if charsche_LastCheck > charsche_timestamp : charsche_timestamp_Adj += 1440
- if (charsche_LastCheck + charsche_CurActTime > charsche_timestamp_Adj) and charsche_CurActPriority = 1:
- charsche_CurActTime = charsche_CurActTime - (charsche_timestamp_Adj - charsche_LastCheck)
- if charsche_CurActTime <= 0:
- charsche_CurActTime = 0
- else
- charsche_actinplace = 1
- end
- end
- if charsche_actinplace = 0 : gs 'mod_addedflavour_charsche' , 'chksleep'
- if charsche_actinplace = 0 : gs 'mod_addedflavour_charsche' , 'chkwork'
- if charsche_actinplace = 0 : gs 'mod_addedflavour_charsche' , 'chkact' , 1
- if charsche_actinplace = 0 and (charsche_LastCheck + charsche_CurActTime > charsche_timestamp_Adj) and charsche_CurActPriority = 2:
- charsche_CurActTime = charsche_CurActTime - (charsche_timestamp_Adj - charsche_LastCheck)
- if charsche_CurActTime <= 0:
- charsche_CurActTime = 0
- else
- charsche_actinplace = 1
- end
- end
- if charsche_actinplace = 0 : gs 'mod_addedflavour_charsche' , 'chkact' , 2
- if charsche_actinplace = 0:
- $modVar_AF_LoopErrorLoc = '<<charsche_ID>> charscheduler NoOptions'
- $charsche_CurActLoc = $charsche_HomeLoc
- $charsche_CurActDesc = 'Idle'
- charsche_CurActTime = 15
- charsche_CurActPriority = 2
- end
- charsche_LastCheck = charsche_timestamp
- charsche_character_LastCheck[charsche_charloc] = charsche_LastCheck
- charsche_character_CurActTime[charsche_charloc] = charsche_CurActTime
- if $charsche_character_CurActLoc[charsche_charloc] ! $charsche_CurActLoc or $charsche_character_CurActDesc[charsche_charloc] ! $charsche_CurActDesc:
- $charsche_character_PrevActLoc[charsche_charloc] = $charsche_character_CurActLoc[charsche_charloc]
- $charsche_character_CurActLoc[charsche_charloc] = $charsche_CurActLoc
- $charsche_character_PrevActDesc[charsche_charloc] = $charsche_character_CurActDesc[charsche_charloc]
- $charsche_character_CurActDesc[charsche_charloc] = $charsche_CurActDesc
- end
- charsche_character_CurActPriority[charsche_charloc] = charsche_CurActPriority
- KILLVAR 'charsche_actinplace'
- KILLVAR 'charsche_timestamp'
- KILLVAR 'charsche_timestamp_Adj'
- gs 'mod_addedflavour_charchor' , 'choreographer-individual' , charsche_ID
- end
-
- if $ARGS[0] = 'chkact':
- charsche_chkactloop = 0
- KILLVAR '$charsche_actoptions'
- :chkactloopstart
- if charsche_chkactloop >= 1000 : $modVar_AF_LoopErrorLoc = '<<charsche_ID>> charsche_actoptions' & jump 'chkactloopend'
- if charsche_chkactloop >= arrsize('$charsche_actlist') : jump 'chkactloopend'
- if charsche_activity_Active[charsche_chkactloop] = 1:
- if strpos($charsche_activity_Chars[charsche_chkactloop],'A<<charsche_ID>>X') > 0:
- if strpos($charsche_activity_Days[charsche_chkactloop],week) > 0:
- if charsche_activity_Priority[charsche_chkactloop] = ARGS[1]:
- charsche_activity_EndTime_Adj = charsche_activity_EndTime[charsche_chkactloop]
- if charsche_activity_EndTime_Adj < charsche_activity_StartTime[charsche_chkactloop] : charsche_activity_EndTime_Adj += 1440
- if charsche_activity_StartTime[charsche_chkactloop] <= charsche_timestamp and charsche_activity_EndTime_Adj > charsche_timestamp:
- if ARGS[1] = 1:
- charsche_actinplace = 1
- $charsche_CurActLoc = $charsche_activity_Location[charsche_chkactloop]
- $charsche_CurActDesc = $charsche_activity_Action[charsche_chkactloop]
- if charsche_activity_MinLen[charsche_chkactloop] >= 1:
- charsche_CurActTime = rand(charsche_activity_MinLen[charsche_chkactloop],charsche_activity_MaxLen[charsche_chkactloop])
- if charsche_CurActTime > charsche_activity_EndTime_Adj : charsche_CurActTime = charsche_activity_EndTime_Adj - charsche_timestamp
- else
- charsche_CurActTime = charsche_workcycle_EndTime_Adj - charsche_timestamp
- end
- charsche_CurActPriority = 1
- jump 'chkactloopend'
- elseif ARGS[1] = 2:
- charsche_chklocconflict = 0
- if charsche_activity_LocConflict[charsche_chkactloop] = 1:
- gs 'mod_addedflavour_charsche' , 'chklocconflict'
- end
- if charsche_chklocconflict = 0:
- $charsche_actoptions[] = $charsche_activity_Name[charsche_chkactloop]
- end
- end
- end
- end
- end
- end
- end
- charsche_chkactloop += 1
- jump 'chkactloopstart'
- :chkactloopend
- if ARGS[1] = 2:
- if arrsize('$charsche_actoptions') = 0 : $charsche_actoptions[] = 'Base Idle'
- charsche_chkact_action = rand(1,arrsize('$charsche_actoptions')) - 1
- charsche_chkact_actionloc = arrpos('$charsche_actlist',$charsche_actoptions[charsche_chkact_action])
- charsche_actinplace = 1
- $charsche_CurActLoc = $charsche_activity_Location[charsche_chkact_actionloc]
- $charsche_CurActDesc = $charsche_activity_Action[charsche_chkact_actionloc]
- charsche_activity_EndTime_Adj = charsche_activity_EndTime[charsche_chkact_actionloc]
- if charsche_activity_EndTime_Adj < charsche_activity_StartTime[charsche_chkact_actionloc] : charsche_activity_EndTime_Adj += 1440
- if charsche_activity_MinLen[charsche_chkact_actionloc] >= 1:
- charsche_CurActTime = rand(charsche_activity_MinLen[charsche_chkact_actionloc],charsche_activity_MaxLen[charsche_chkact_actionloc])
- if charsche_CurActTime > charsche_activity_EndTime_Adj : charsche_CurActTime = charsche_activity_EndTime_Adj - charsche_timestamp
- else
- charsche_CurActTime = charsche_workcycle_EndTime_Adj - charsche_timestamp_Adj
- end
- charsche_CurActPriority = 2
- end
- if $charsche_CurActLoc = 'HomeLoc' : $charsche_CurActLoc = $charsche_HomeLoc
- end
-
- if $ARGS[0] = 'chklocconflict':
- charsche_chklocconflictloop = 0
- :chklocconflictloopstart
- if charsche_chklocconflictloop >= 1000 : $modVar_AF_LoopErrorLoc = 'chklocconflictloop' & jump 'chklocconflictloopend'
- if charsche_chklocconflictloop < arrsize('charsche_charlist'):
- if $charsche_character_CurActLoc[charsche_chklocconflictloop] = $charsche_activity_Location[charsche_chkactloop] or $loc = $charsche_activity_Location[charsche_chkactloop]:
- charsche_chklocconflict = 1
- else
- charsche_chklocconflictloop += 1
- jump 'chklocconflictloopstart'
- end
- end
- :chklocconflictloopend
- end
- --- mod_addedflavour_charsche ---------------------------------
|