Reply to Re: Mkbul's code error thread
If you don't have an account, just leave the password field blank.
Ok this should work
void main(void)
{
int &var;
int &junk;
&var = create_sprite(164, 100, 0, 341, 1);
}
void talk(void)
{
&junk = free_items();
freeze(1);
choice:
choice_start();
set_y 240
set_title_color 9
title_start();
Welcome to my store
title_end();
"Ask About The Store"
"Ask About him"
"Ask About the Earthquake"
"See what's for sale"
"Nevermind"
(&story == 4) "Can you make a siege gun?"
choice_end();
if (&result == 1)
{
say_stop("`8Well, I'm taking shipments of swords from the south", &var);
say_stop("`8But now with this god dang earthquake", &var);
say_stop("`8I can't get shipments", &var);
goto choice;
}
if (&result == 2)
{
say_stop("`8My name is Alex Pua", &var);
say_stop("Hrumph", 1);
say_stop("`8Do not laugh please", &var);
say_stop("`8I come from England", &var);
say_stop("How did you get here?", 1);
say_stop("`8I got here because I thought I'd find more customers", &var);
goto choice;
}
if (&result == 3)
{
say_stop("`8It struck suddenly like most earthquakes", &var);
say_stop("`8It was gigantic", &var);
say_stop("`8There was even lava blowing out south of my house!", &var);
say_stop("Were there any victims?", 1);
say_stop("`8Yea...a house north of here collapsed", &var);
say_stop("`8Leaving Mary and her husband dead...", &var);
say_stop("I'm sorry", 1);
goto choice;
}
if (&result == 4)
{
rechoose:
choice_start();
set_y 240
set_title_color 9
title_start();
I've got some stuff for you
title_end();
"Longsword -- 400"
"Clawsword -- 1000"
"No Thanks"
choice_end();
if (&result == 1)
{
if (&junk < 1)
{
choice_start();
set_y 240
set_title_color 9
title_start();
I don't have any room in my backpack
title_end();
"Ok"
choice_end();
goto rechoose;
}
if (&gold < 400)
{
choice_start();
set_y 240
set_title_color 9
title_start();
I dont have enough money
title_end();
"Ok"
choice_end();
goto rechoose;
}
&gold -= 400;
add_item("item-sw1", 438, 7);
}
if (&result == 2)
{
if (&junk < 1)
{
choice_start();
set_y 240
set_title_color 9
title_start();
I don't have any room in my backpack
title_end();
"Ok"
choice_end();
goto rechoose;
}
if (&gold < 1000)
{
choice_start();
set_y 240
set_title_color 9
title_start();
I dont have enough money
title_end();
"Ok"
choice_end();
goto rechoose;
}
&gold -= 1000;
add_item("item-sw2", 438, 23);
}
}
if (&result == 6)
{
say_stop("`8Are you nuts?", &var);
say_stop("`8It needs at least a thousand pieces of gold!", &var);
say_stop("Perhaps I could find the gold!", 1);
&story += 1;
goto choice;
}
unfreeze(1);
}
void hit(void)
{
//No need for two variables - can use &junk for both!
//And he says this in yellow... I guess you changed this colour somewhere?
&junk = random(5,1);
if(&junk == 1)
{
say("`@Stop hitting my bench!", &var);
}
if(&junk == 2)
{
say("`@Go away!", &var);
}
if(&junk == 3)
{
say("`@Are you nuts?", &var);
}
if(&junk == 4)
{
say("`@This sword will get in your chest!", &var);
}
if(&junk == 5)
{
say("`@Is your skull empty?", &var);
}
}






