192 lines
70 KiB
Plaintext
192 lines
70 KiB
Plaintext
|
||
void Lynn object# (0x421) ()
|
||
{
|
||
|
||
var party = UI_get_party_list();
|
||
var player_name = getAvatarName();
|
||
var polite_title = getPoliteTitle();
|
||
var hour = UI_game_hour();
|
||
var partynum = UI_get_array_size(party);
|
||
var bark;
|
||
var player_is_female;
|
||
var greeting; //When addressing party as plural or singular
|
||
var avatar_bark;
|
||
var npc_bark;
|
||
var time_of_day = timeFunction(hour);
|
||
var schedule = UI_get_schedule_type(item); //use for schedule specific convos
|
||
var current_schedule = schedule;
|
||
|
||
//shopkeeper stuff
|
||
const int DOZEN_ARROWS_PRICE = 4;
|
||
const int DOZEN_BOLTS_PRICE = 3;
|
||
|
||
var price;
|
||
var item_choice;
|
||
var item_options = ["nothing", "bolts", "arrows"];
|
||
var item_shapes = [SHAPE_BOLT, SHAPE_ARROW];
|
||
var item_prices = [3, 4];
|
||
var item_frames = [31, 31];
|
||
//
|
||
|
||
|
||
//Dialog options
|
||
var initial_choice_question = "@Which of these?@"; //arms or armor? etc
|
||
var ask_quantity = "@I sell them only by the dozen. How many dozens?@";
|
||
var askIfInterested1 = "@These sell for "; //needs to be split into array to capture price
|
||
var askIfInterested2 = " gold per dozen. Okay?@";
|
||
var cant_afford = "@Thou hast not enough gold for that many!@";
|
||
var cant_hold = "@But thou canst not carry any!@";
|
||
var saidNo = "@Which item?@";
|
||
var nothing = "@Is there aught else thou would buy?@";
|
||
var success = "Lynn takes your money and hands over the ";
|
||
var success2 = "@I appreciate thy business.@";
|
||
var has_quantity = true;
|
||
|
||
|
||
|
||
//group together dialog options in array for cleaner look
|
||
var dialog = [initial_choice_question, askIfInterested1, askIfInterested2, cant_afford, cant_hold, saidNo, nothing, success, success2];
|
||
|
||
//READ flag used to initiate conversations via TALK
|
||
var started_talking = UI_get_item_flag(item, READ);
|
||
|
||
if (event == DOUBLECLICK)
|
||
{
|
||
//Avatar and NPC greeting barks
|
||
var av_1st_greet = "@Excuse me..@";
|
||
var npc_1st_greet = "@Well, it's the Avatar!@";
|
||
|
||
var av_2nd_greet = "@Hi there..@";
|
||
var npc_2nd_greet = "@Well, hello again, Avatar!@";
|
||
|
||
//call convo script
|
||
startConvo(item, av_1st_greet, npc_1st_greet, av_2nd_greet, npc_2nd_greet);
|
||
}
|
||
|
||
if (started_talking)
|
||
{
|
||
|
||
if (!UI_get_item_flag(item, MET))
|
||
{
|
||
item.say("You see a tall, willowy woman with long blond hair.");
|
||
UI_set_item_flag(item, MET);
|
||
}
|
||
item.say("@How can I help thee this fine " + time_of_day + "?@");
|
||
|
||
//standard conversation options
|
||
var options = ["name", "job", "bye"];
|
||
|
||
|
||
/////////////////////////////////////////////////////////////////////
|
||
// Main conversation thread
|
||
|
||
/////////////////////////////////////////////////////////////////////
|
||
converse(options)
|
||
{
|
||
case "name"(remove):
|
||
say("@I'm Lynn. Thou needn't tell me thy name, " + player_name + ". The Avatar is famous throughout the land!@");
|
||
|
||
case "job"(remove):
|
||
say("@I am a fletcher. I make bolts and bolts for the armies of Lord British himself!@");
|
||
add(["buy", "sell"]);
|
||
|
||
//For shopkeepers:
|
||
case "buy":
|
||
if (UI_get_schedule_type(LYNN, TEND_SHOP))
|
||
sellItems(LYNN, item_options, item_prices, item_shapes, item_frames, dialog, has_quantity, ask_quantity);
|
||
else
|
||
say("@Come to my shop when I'm open!@");
|
||
|
||
case "sell"(remove):
|
||
say("@I have all I need, and have no reason to purchase anything more. But I appreciate thy offer.@");
|
||
|
||
case "bye":
|
||
|
||
var avatar_goodbye = "@Goodbye..@";
|
||
var npc_goodbye = "@Farewell! I hope I've aided thy quest!@";
|
||
|
||
//function that is called, do not change this:
|
||
sayGoodbye(item, npc_goodbye, avatar_goodbye);
|
||
break;
|
||
|
||
}
|
||
}
|
||
else scheduleBarks(item);
|
||
} |