# DH_QuestManager if $ARGS[0] = 'UpdateStoryCard': !! Character Card if (ARRPOS('$dhCh_Chars_', 'Player') ! -1): func('Screen', 'Replace', 'PLAYER_LEVEL', '<>') func('Screen', 'Replace', 'PLAYER_XP', '<>') func('Screen', 'Replace', 'PLAYER_HP', '<>') func('Screen', 'Replace', 'PLAYER_SP', '<>') func('Screen', 'Replace', 'PLAYER_MP', '<>') func('Screen', 'Replace', 'PLAYER_RP', '<>') func('Screen', 'Replace', 'PLAYER_EP', '<>') func('Screen', 'Replace', 'PLAYER_MAXXP', '<>') func('Screen', 'Replace', 'PLAYER_MAXHP', '<>') func('Screen', 'Replace', 'PLAYER_MAXSP', '<>') func('Screen', 'Replace', 'PLAYER_MAXMP', '<>') func('Screen', 'Replace', 'PLAYER_MAXRP', '<>') func('Screen', 'Replace', 'PLAYER_MAXEP', '<>') func('Screen', 'Replace', 'PLAYER_GOLD', '<>') func('Screen', 'Replace', 'EXP_PERCENT', 'calc(<>%/<>*100)') func('Screen', '<>', 'storyCardMP') func('Screen', '<>', 'storyCardRP') func('Screen', '<>', 'storyCardEP') else func('Screen', 'Replace', 'PLAYER_LEVEL', '0') func('Screen', 'Replace', 'PLAYER_XP', '0') func('Screen', 'Replace', 'PLAYER_HP', '2') func('Screen', 'Replace', 'PLAYER_SP', '1') func('Screen', 'Replace', 'PLAYER_MP', '?') func('Screen', 'Replace', 'PLAYER_RP', '?') func('Screen', 'Replace', 'PLAYER_EP', '?') func('Screen', 'Replace', 'PLAYER_MAXXP', '10') func('Screen', 'Replace', 'PLAYER_MAXHP', '5') func('Screen', 'Replace', 'PLAYER_MAXSP', '5') func('Screen', 'Replace', 'PLAYER_MAXMP', '???') func('Screen', 'Replace', 'PLAYER_MAXRP', '???') func('Screen', 'Replace', 'PLAYER_MAXEP', '???') func('Screen', 'Replace', 'PLAYER_GOLD', '0') func('Screen', 'Replace', 'EXP_PERCENT', '0%') func('Screen', 'Hide', 'storyCardMP') func('Screen', 'Hide', 'storyCardRP') func('Screen', 'Hide', 'storyCardEP') end end if $ARGS[0] = 'Init': KILLVAR '$DhQst_List_' KILLVAR '$DhQst_Msg_' $DhQst_List_[] = 'NewBeginnings' $DhQst_List_[] = 'CharacterCreation' $DhQst_Msg_['NoQuest'] = 'Warning: No Quest by the name of ''{0}'' exists.' $DhQst_Msg_['NoSubQuest'] = 'Warning: No SubQuest by the name of ''{0}'' exists in the quest ''{1}''.' $DhQst_Msg_['QuestStarted'] = 'Warning: ''{0}'' has already been started.' $DhQst_Msg_['QuestComplete'] = 'Warning: ''{0}'' has already been completed.' $DhQst_Msg_['QuestNotStarted'] = 'Warning: ''{0}'' has not been started yet.' $dhQst_Current = '' KILLVAR '$dhQst_Title' KILLVAR '$dhQst_Started' KILLVAR '$dhQst_Finished' KILLVAR '$dhQst_Progress' KILLVAR '$dhQst_SubQst_' gs 'DH_QuestManager', 'UpdateStoryCard' end if $ARGS[0] = 'Start': $.questName = $ARGS[1] !! Check if quest exists if ARRPOS('$DhQst_List_', $.questName) = -1: $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['NoQuest'], $.questName) msg($RESULT) exit end if dhQst_Started[$.questName] = False: $RESULT = 'Quest Started' $scr_Layout = 'dhScr_Def' func('Screen', 'ClearAll') gs 'DH_Quest_<<$.questName>>', 'Start' else $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['QuestStarted'], $.questName) msg($RESULT) exit end end if $ARGS[0] = 'Restart': $.questName = $ARGS[1] !! Check if quest exists if ARRPOS('$DhQst_List_', $.questName) = -1: $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['NoQuest'], $.questName) msg($RESULT) exit end if dhQst_Started[$.questName] = True: $scr_Layout = 'dhScr_Def' func('Screen', 'ClearAll') gs 'DH_QuestManager', 'UpdateStoryCard' gs 'DH_Quest_<<$.questName>>', 'Start' else $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['QuestNotStarted'], $.questName) msg($RESULT) exit end end if $ARGS[0] = 'Continue': $.questName = $ARGS[1] !! Check if quest exists if ARRPOS('$DhQst_List_', $.questName) = -1: $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['NoQuest'], $.questName) msg($RESULT) exit end !! Check if quest has been started yet if dhQst_Started[$.questName] = False: $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['QuestNotStarted'], $.questName) msg($RESULT) exit end if dhQst_Finished[$.questName] = False: $scr_Layout = 'dhScr_Def' func('Screen', 'ClearAll') gs 'DH_QuestManager', 'UpdateStoryCard' gs 'DH_Quest_<<$.questName>>', $dhQst_Progress[$.questName] else $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['QuestComplete'], $.questName) msg($RESULT) exit end end if $ARGS[0] = 'GoTo': $.questName = $ARGS[1] $.subQuest = $ARGS[2] .clearScreen = ARGS[3] !! Check if quest exists if ARRPOS('$DhQst_List_', $.questName) = -1: $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['NoQuest'], $.questName) msg($RESULT) exit end !! Check if quest has been started yet if dhQst_Started[$.questName] = False: $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['QuestNotStarted'], $.questName) msg($RESULT) exit end !! Check if sub quest exists func('DH_Quest_<<$.questName>>', 'GetSubQuests') if (ARRPOS('$dhQst_SubQst_', $.subQuest) = -1): $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['NoSubQuest'], $.subQuest, $.questName) msg($RESULT) exit end if dhQst_Finished[$.questName] = False: $scr_Layout = 'dhScr_Def' IF (.clearScreen = True): func('Screen', 'ClearAll') else func('Screen', 'Clear', 'actions') KILLVAR '$dhDyn' gs 'DH_Quest_<<$.questName>>', $.subQuest gs 'DH_QuestManager', 'UpdateStoryCard' else $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['QuestComplete'], $.questName) msg($RESULT) exit end end if $ARGS[0] = 'Complete': $.questName = $ARGS[1] !! Check if quest exists if ARRPOS('$DhQst_List_', $.questName) = -1: $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['NoQuest'], $.questName) exit end if dhQst_Finished[$.questName] = False: dhQst_Started[$.questName] = True !! $scr_Theme = 'dhScr_Def' !! Not sure if this should just set the quest complete or go to the complete screen? gt 'DH_Quest_<<$.questName>>', 'Complete' else $RESULT = FUNC('DH_Functions', 'FormatStr', $dhQst_Msg_['QuestComplete'], $.questName) exit end end if $ARGS[0] = 'ProgressAct': $.actionText = $ARGS[1] $.questName = $ARGS[2] $.subQuest = $ARGS[3] $.textColor = $ARGS[4] func('write', 'actions', '') func('write', 'actions', $.actionText, $.textColor) func('writeL', 'actions', '') func('Screen', 'Update') end if $ARGS[0] = 'DynamicAct': $.actionText = $ARGS[1] $.dynamicId = $ARGS[2] $.textColor = $ARGS[3] func('write', 'actions', '') func('write', 'actions', $.actionText, $.textColor) func('writeL', 'actions', '') func('Screen', 'Update') end --- DH_QuestManager ---------------------------------