#include <acknex.h>
#include <default.c>
var i;
var yes;
var no;
var string1;
var string2;
var string3;
var string4;
var string5;
STRING* string_one = "";
STRING* string_two = "";
STRING* string_three = "";
STRING* string_four = "";
STRING* string_five = "";
STRING* npc_message = "";
BMAP* message_window = "message_window.tga";
PANEL* main_pan =
{
digits(30,20, "String1: %s","Arial#14",1,string_one);
digits(30,30, "String2: %s","Arial#14",1,string_two);
digits(30,40, "String3: %s","Arial#14",1,string_three);
digits(30,50, "String4: %s","Arial#14",1,string_four);
digits(30,60, "String5: %s","Arial#14",1,string_five);
layer = 10;
flags = SHOW;
}
function message_win()
{
i = 1;
while((i > 0)&&(i <= 6))
{
if(i == 1)
{
str_cpy(string_one,npc_message); string1 = yes; i += 1;
}
if((i == 2))
{
str_cpy(string_two,npc_message); string2 = yes; i += 1;
}
if((i == 3))
{
str_cpy(string_three,npc_message); string3 = yes; i += 1;
}
if((i == 4))
{
str_cpy(string_four,npc_message); string4 = yes; i += 1;
}
if((i == 5))
{
str_cpy(string_five,npc_message); string5 = yes; i += 1;
}
if((i == 6)&&(string5 == yes)&&(string4 == yes)&&(string3 == yes)&&(string2 == yes)&&(string1 == yes))
{
str_cpy(string_five, npc_message);
}
wait(1);
}
i = 1;
}
function npc_chat()
{
var choice;
random_seed(0);
choice = integer(random(5));clamp(choice, 1, 3);
if(choice == 1)str_cpy(npc_message, "This is choice 1");
if(choice == 2)str_cpy(npc_message, "This is choice 2");
if(choice >= 3)str_cpy(npc_message, "This is choice 3");
str_cpy(string_one, string_two);
str_cpy(string_two, string_three);
str_cpy(string_three, string_four);
str_cpy(string_four, string_five);
}
function main()
{
screen_size.x = 1024;
screen_size.y = 768;
screen_color.blue = 50;
main_pan.pos_x = (screen_size.x - bmap_width(message_window))/2;
main_pan.pos_y = (screen_size.y - bmap_height(message_window)-10);
message_win();
on_m = npc_chat;
}