Reply to Re: Talking
If you don't have an account, just leave the password field blank.
Selling things takes a bit more script as you need to check if people have enough cash, enough room in their inventory and such. A working sell script would be:
void talk(void)
{
freeze(1)
freeze(¤t_sprite)
choice_start()
set_y 240
set_title_color 5
title_start();
Shop Text
Blaaa
title_end();
"Buy elixer for 100 gold"
"Leave"
choice_end()
wait(300);
if (&result == 1)
{
if (&gold < 100)
{
say_stop("`5Sorry, not enough gold..", ¤t_sprite);
goto leave;
}
int &junk = free_items();
if (&junk < 1)
{
say_stop("`5Sorry, you're carrying too much", ¤t_sprite);
goto leave;
}
add_item("item-eli",438,9);
&gold -= 100;
}
leave:
unfreeze(¤t_sprite)
unfreeze(1)
}
But then, usually your shop has a guy behind the counter so it's slightly different because not the ¤t_sprite would be talking/selling but a sprite behind the counter. I'd say look at some salescripts from the original game, they can be found in the develop directory in the source.zip file.
void talk(void)
{
freeze(1)
freeze(¤t_sprite)
choice_start()
set_y 240
set_title_color 5
title_start();
Shop Text
Blaaa
title_end();
"Buy elixer for 100 gold"
"Leave"
choice_end()
wait(300);
if (&result == 1)
{
if (&gold < 100)
{
say_stop("`5Sorry, not enough gold..", ¤t_sprite);
goto leave;
}
int &junk = free_items();
if (&junk < 1)
{
say_stop("`5Sorry, you're carrying too much", ¤t_sprite);
goto leave;
}
add_item("item-eli",438,9);
&gold -= 100;
}
leave:
unfreeze(¤t_sprite)
unfreeze(1)
}
But then, usually your shop has a guy behind the counter so it's slightly different because not the ¤t_sprite would be talking/selling but a sprite behind the counter. I'd say look at some salescripts from the original game, they can be found in the develop directory in the source.zip file.