// this is the enums for one character .. the other ones should be defined in a parent object
enum _char_peter {_start, _opening, _introduction,_quest_preview }
enum _chat { _if,_option,_dia,_end,_display_options,_goto }
enum _need { _reputation,_unused,_progress }
enum _do { _use,_goto,_offer_quest }
/*
[ _chat._if ,
[_need,operator,value], // requirement
[_do,data], // action if true
[_do,data] // action if false
]
[ _chat._option,
"string",
[_need._something ], // requirement to display string
[_do] // action when pressing string
]
[ _chat.dia, "string" ] // just displays string and continues
[ _chat.end ] // simply ends the chatbox
[ _chat.goto, index] // jumps to a defined goto mark
[_chat._offer_quest,
"string", // short about the quest
QUEST.index, // quest index
["responce",_do?], // responce if you accepted quest
["responce",_do?] // responce if you declined quest
]
*/
var i=0;
goto[_char_peter._start] = i;
chat[i++] = [_chat._if,
[_need._reputation,">",20],
[_do._goto, _char_peter._opening],
[_do._continue]
]
chat[i++] = [_chat._dia,"Sorry, but we want nothing to do with you"]
chat[i++] = [_chat._end]
goto[_char_peter._opening] = i;
chat[i++] = [_chat._option,
"Hello",
[_need._progress,"=",0],
[[_do._goto,_char_peter._introduction],[_do._progress,1]]
]
chat[i++] = [_chat._option,
"Need any help?",
[[_need._progress,">",0],[_need._quest_status,QUEST.save_peters_farm,QUEST_STATUS._none]],
[_do._goto,_char_peter._quest_preview]
]
chat[i++] = [_chat._option,
"Any news?",
[_need._unused,i,_need._progress,1],
[_do._goto,_char_peter._introduction,_do._use,i]
]
chat[i++] = [_chat._option,"bye",,]
chat[i++] = [_chat._display_options]
chat[i++] = [_chat._end]
goto[_char_peter._introduction] = i;
chat[i++] = [_chat._dia,"I've lived with my father on this farm ever since my mother passed away"];
chat[i++] = [_chat._dia,"But now I haven't seen him for a week."];
chat[i++] = [_chat._goto,_char_peter._opening]
goto[_char_peter._quest_preview] = i;
chat[i++] = [_chat._offer_quest,
"Can you ask around in town and see if you can find locate him?",
QUEST.save_peters_farm,
["Thank you",[_do._quest_set,QUEST.save_peters_farm]],
["Maybe later?",]
]
chat[i++] = [_chat._goto,_char_peter._opening]