void main( void )
{
 int &talker;
 &talker = 0;
 int &bsword;
 int &b2sword;
 int &bclaw;
 int &bnut; 
 int &bad;
 if (&story > 10)
 {
  &talker = 2;
  return;
 }
 &bad = random(3, 1);
 if (&bad == 1)
 {
  &bad = random(3, 1);
  if (&bad == 1)
  {
  say_stop("`2欢迎光临 Jill 当铺。", &current_sprite);
  }
  if (&bad == 2)
  {
  say_stop("`2哦，我们也有吃的。", &current_sprite);
  }
  if (&bad == 3)
  {
  say_stop("`2那些鸭子 ... 臭鸭子 ...", &current_sprite);
  }
 }
}

void talk( void )
{
 freeze(1);
 freeze(&current_sprite);
 choice_start()
(&talker == 0)"看看有什么新闻"
(&talker == 1)"看看有什么货物"
(&talker == 2)"打招呼"
 "卖货"
 "离开"
 choice_end()
  if (&result == 1)
  {
   say_stop("最近生意如何啊？", 1);
   wait(250);
   say_stop("`2还不错还不错，多谢关心。", &current_sprite);
   wait(250);
   say_stop("这里的鸭子是怎么回事啊？", 1);
   wait(250);
   say_stop("`2他们是我们的朋友和保护者", &current_sprite);
   say_stop("`2是他们给了我们一切。", &current_sprite);
   wait(1000);
   say_stop("哦，这句话听上去怎么这么奇怪啊。", 1);
   wait(250);
   say_stop("`2要善良得对待本镇的鸭子。", &current_sprite);
   wait(250);
   say_stop("哦，知道了。-_-#", 1);
   &talker = 1;
  }
  if (&result == 2)
  {
   say_stop("额，你有什么东西卖吗？", 1);
   wait(250);
   say_stop("`2那，对不起，现在没有。", &current_sprite);
   wait(250);
   say_stop("怎么会没了？", 1);
   wait(250);
   say_stop("`2鸭子们又加税了，", &current_sprite);
   wait(250);
   say_stop("`2为了交税我已把我有的都卖掉了。", &current_sprite);
   wait(250);
   say_stop("我明白了。", 1);
   wait(250);
   say_stop("`2过一阵子再来可能会有点货，", &current_sprite);
   wait(250);
   say_stop("`2可现在真的是空了。", &current_sprite);
  }
  if (&result == 3)
  {
   say_stop("你好啊，Jill，小日子过得不错嘛。", 1);
   wait(250);
   say_stop("`2哦，是丁克啊，多谢你了，是你救了我们。", &current_sprite);
   wait(250);
   say_stop("`2我当时不知道这小镇会发生什么事。", &current_sprite);
   wait(250);
   say_stop("`2不过现在好多了，我日子过得好起来了。", &current_sprite);
   wait(250);
   say_stop("`2谢谢。", &current_sprite);
  }
  if (&result == 4)
  {
   goto sell;
  }
 unfreeze(1);
 unfreeze(&current_sprite);
}

void hit( void )
{
 if (&story > 10)
 {
  say_stop("`2你，你这奇怪的叛徒！", &current_sprite);
  return;
 }
 say_stop("`2请，请不要打我了！", &current_sprite);
 wait(250);
}

void sell(void )
{
//let's sell some stuff back

sell:

//how many items do they have?

&bsword = count_item("item-sw1");
&b2sword = count_item("item-sw2");
&bclaw = count_item("item-cl");
&bnut = count_item("item-nut");

         choice_start()
        set_y 240
        set_title_color 6
        title_start();
"我们可以卖些东西，您有什么呢？(s4-st1p.c)"
        title_end();
       (&bsword > 0)  "卖一把长剑 - $200"
       (&bnut > 0)  "卖一只 nut - $2"
       (&b2sword > 0)  "变卖利爪剑 - $1000"
       (&bclaw > 0)  "变卖 Slayer 爪 - $150"
        "什么都不卖"
        choice_end()

if (&result == 1)
    {
     kill_this_item("item-sw1");
     &gold += 200;
    goto sell;
    }

if (&result == 2)
    {
     kill_this_item("item-nut");
     &gold += 2;
    goto sell;
    }

if (&result == 3)
    {
     kill_this_item("item-sw2");
     &gold += 1000;
    goto sell;
    }
if (&result == 4)
    {
     kill_this_item("item-cl");
     &gold += 150;
    goto sell;
    }

   unfreeze(1);
   goto mainloop;
   return;
}
