📧 Message Board Archive

hey ehasl, ive fixed the shop script with merchant skill
look, ive fixed it.



//easy shop script made by martijn



void main(void)

{

say_stop("'3Good day, how can I help you?", &current_sprite);

}



void hit(void)

{

say("'4Please dont wreck this place, thank you", &current_sprite);

}



void talk(void)

{

   if (&merchant == 1)

         {

          goto merchan;

         }



freeze(1);

say_stop("Good day", 1);

say_stop("'3Good day", &current_sprite);

start:

choice_start();

title_start();

Wanna buy something?

title_end();

"Yes"

"No"

choice_end();



    if (&result == 1)

         {

          buy();

         }

         if (&result == 2)

         {

          goto endid;

         }



endid:

unfreeze(1);

say("'3bye", &current_sprite);

}





void buy( void )

{

mainloop:

        choice_start()

       set_y 240

       set_title_color 6

       title_start();

"These longswords are the best in the whole world"

       title_end();

        "Longsword - $400"

        "Leave"

        choice_end()



         if (&result == 1)

         {

          buys1();

         }



  unfreeze(1);

  goto start;

}



void buys1( void)

{

int &junk = free_items();





if (&junk < 1)

{

        choice_start()

       set_y 240

       title_start();

You are carrying too much.

       title_end();

        "Ok"

        choice_end()

return;

}





if (&gold < 400)

{

        choice_start()

       set_y 240

       title_start();

You don't have enough gold to buy this sword.  Awk!

       title_end();

        "Ok"

        choice_end()

return;

}



&gold -= 400;

add_item("item-sw1",438, 7);

goto start;

}



merchan:

freeze(1);

say_stop("Let's go down to business", 1);

say_stop("'3Damn, a merchant", &current_sprite);

start2:

choice_start();

title_start();

What do you want, merchant?

title_end();

"Buy"

"Nothing"

choice_end();



    if (&result == 1)

         {

          buy();

         }

         if (&result == 2)

         {

          goto endid2;

         }



endid2:

unfreeze(1);

say("'3bye", &current_sprite);

}





void buy( void )

{

mainloop2:

        choice_start()

       set_y 240

       set_title_color 6

       title_start();

"These longswords are the best in the whole world"

       title_end();

        "Longsword - $200"

        "Looks like s**t"

        choice_end()



         if (&result == 1)

         {

          buys2();

         }



  unfreeze(1);

  goto start2;

}



void buys2( void)

{

int &junk = free_items();





if (&junk < 1)

{

        choice_start()

       set_y 240

       title_start();

You are carrying too much.

       title_end();

        "Ok"

        choice_end()

return;

}





if (&gold < 200)

{

        choice_start()

       set_y 240

       title_start();

You don't have enough gold to buy this sword.  Awk!

       title_end();

        "Ok"

        choice_end()

return;

}



&gold -= 200;

add_item("item-sw1",438, 7);

goto start2;

}
Re: hey ehasl, ive fixed the shop script with merchant skill
: look, ive fixed it.

: //easy shop script made by martijn

: void main(void)

: {

: say_stop("'3Good day, how can I help you?", &current_sprite);

: }

: void hit(void)

: {

: say("'4Please dont wreck this place, thank you", &current_sprite);

: }

: void talk(void)

: {

:   if (&merchant == 1)

:   {

:   goto merchan;

:   }

: freeze(1);

: say_stop("Good day", 1);

: say_stop("'3Good day", &current_sprite);

: start:

: choice_start();

: title_start();

: Wanna buy something?

: title_end();

: "Yes"

: "No"

: choice_end();

:   if (&result == 1)

:   {

:   buy();

:   }

:   if (&result == 2)

:   {

:   goto endid;

:   }

: endid:

: unfreeze(1);

: say("'3bye", &current_sprite);

: }

: void buy( void )

: {

: mainloop:

:   choice_start()

:   set_y 240

:   set_title_color 6

:   title_start();

: "These longswords are the best in the whole world"

:   title_end();

:   "Longsword - $400"

:   "Leave"

:   choice_end()

:   if (&result == 1)

:   {

:   buys1();

:   }

:   unfreeze(1);

:   goto start;

: }

: void buys1( void)

: {

: int &junk = free_items();

: if (&junk < 1)

:  {

:   choice_start()

:   set_y 240

:   title_start();

: You are carrying too much.

:   title_end();

:   "Ok"

:   choice_end()

:  return;

:  }

: if (&gold < 400)

:  {

:   choice_start()

:   set_y 240

:   title_start();

: You don't have enough gold to buy this sword. Awk!

:   title_end();

:   "Ok"

:   choice_end()

:  return;

:  }

: &gold -= 400;

: add_item("item-sw1",438, 7);

: goto start;

: }

: merchan:

: freeze(1);

: say_stop("Let's go down to business", 1);

: say_stop("'3Damn, a merchant", &current_sprite);

: start2:

: choice_start();

: title_start();

: What do you want, merchant?

: title_end();

: "Buy"

: "Nothing"

: choice_end();

:   if (&result == 1)

:   {

:   buy();

:   }

:   if (&result == 2)

:   {

:   goto endid2;

:   }

: endid2:

: unfreeze(1);

: say("'3bye", &current_sprite);

: }

: void buy( void )

: {

: mainloop2:

:   choice_start()

:   set_y 240

:   set_title_color 6

:   title_start();

: "These longswords are the best in the whole world"

:   title_end();

:   "Longsword - $200"

:   "Looks like s**t"

:   choice_end()

:   if (&result == 1)

:   {

:   buys2();

:   }

:   unfreeze(1);

:   goto start2;

: }

: void buys2( void)

: {

: int &junk = free_items();

: if (&junk < 1)

:  {

:   choice_start()

:   set_y 240

:   title_start();

: You are carrying too much.

:   title_end();

:   "Ok"

:   choice_end()

:  return;

:  }

: if (&gold < 200)

:  {

:   choice_start()

:   set_y 240

:   title_start();

: You don't have enough gold to buy this sword. Awk!

:   title_end();

:   "Ok"

:   choice_end()

:  return;

:  }

: &gold -= 200;

: add_item("item-sw1",438, 7);

: goto start2;

: }



Uhumm.. why do you have two buy procedures? I think you could have organized that script better.. I think you could have made it shorter too.. ;)
Re: hey ehasl, ive fixed the shop script with merchant skill
the bigger, the better :p