void main( void )
{
int &jerry;
int &mcounter;
int &hitme;
&jerry = 1;
sp_base_attack(&current_sprite, 720);
 sp_distance(&current_sprite, 45);
 sp_range(&current_sprite, 55);
 sp_strength(&current_sprite, 50);
sp_hitpoints(&current_sprite, 100);
if (&rebel > 0)
{
 say("`2小子居然还敢来", &current_sprite);
 sp_target(&current_sprite,1)
 sp_brain(&current_sprite, 9);
 sp_attack_wait(&current_sprite, 1);
sp_timing(&current_sprite, 0);
sp_speed(&current_sprite, 5);
}
}

void attack( void )
{
playsound(36, 22050,0,&current_sprite, 0);
&mcounter = random(4000,0);
sp_attack_wait(&current_sprite, &mcounter);

}


void hit( void )
{
if (&king > 0) 
{
say ("`2君要臣死臣不得不死",&current_sprite);
wait (500);
sp_active(&current_sprite, 0);
return ;
}


&rebel = 1;

if (&hitme == 0)
{
 &hitme = 2;
	say("`2有刺客!!快来人!", &current_sprite);
	freeze(&current_sprite);
preload_seq(291);
preload_seq(293);
preload_seq(297);
preload_seq(299);

preload_seq(722);
preload_seq(724);
preload_seq(725);
preload_seq(726);
	
  int &crap = create_sprite(180,250, 9, 0, 0);
  freeze(&crap);
	preload_seq(291);
	preload_seq(293);
	preload_seq(297);
	preload_seq(299);

	preload_seq(722);
	preload_seq(724);
	preload_seq(725);
	preload_seq(726);
 sp_base_walk(&crap, 290);
 sp_base_attack(&crap, 720); 
 sp_speed(&crap, 3);
 wait(500);
 sp_strength(&crap, 30);
 sp_distance(&crap, 45);
 sp_range(&crap, 55);
 //sp_touch_damage(&crap, 2);
 sp_timing(&crap, 0);
 move_stop(&crap, 7,250, 1);
 sp_target(&crap, 1);
 sp_hitpoints(&crap, 40);
 
 int &jcrap = create_sprite(120,250, 9, 0, 0);
 freeze(&crap);
 sp_base_walk(&jcrap, 290);
 sp_base_attack(&jcrap, 720); 
 sp_speed(&jcrap, 3);
 sp_strength(&jcrap, 20);
 //sp_touch_damage(&jcrap, 2);
 sp_distance(&jcrap, 45);
 sp_range(&jcrap, 55);
 
 sp_timing(&jcrap, 0);
 move_stop(&jcrap, 7,250, 1);
 sp_target(&jcrap, 1);
 sp_hitpoints(&jcrap, 40);
 wait(500);
 unfreeze(&current_sprite);
 unfreeze(&crap);
 unfreeze(&jcrap);
}
if (&story > 15)
  {
 say("`2哼, 通关了就开始打守卫了？胆子不小嘛！同志们上！", &current_sprite);
sp_timing(&current_sprite, 0);
sp_speed(&current_sprite, 3);
return;
  }
  
 &hitme = 2;
 say("`2他居然敢打我！杀了他杀了他！", &current_sprite);
 sp_brain(&current_sprite, 9);
 
sp_timing(&current_sprite, 0);
sp_speed(&current_sprite, 3);
}

void talk( void )
{
 freeze(1);
 freeze(&current_sprite);
         choice_start()
         "关于城堡的历史"
         "关于国王的历史"
         "要求晋见国王"
         "离开"
         choice_end()

if (&result == 1)
  {
   Say_stop("骑士朋友，请告诉我些关于此堡的故事吧。", 1); 
wait(500);  
   Say_stop("`2Goodheart 城堡已经屹立与此有几百年了。", &current_sprite);
wait(500);  
   Say_stop("`2这是一个壮观的帝国象征。", &current_sprite);
wait(500);  
   Say_stop("看上去并不大啊。", 1); 
wait(500);  
   Say_stop("`2哈哈哈，进去后你就不会这么说了。", &current_sprite);
wait(500);  
   Say_stop("啊，原来是这样。", 1); 
  }

if (&result == 2)
  {
   Say_stop("那国王又是怎么样个人呢？", 1); 
wait(500);  
   Say_stop("`2Daniel 国王的铁手统治已经持续了快十年了。", &current_sprite);
wait(500);  
   Say_stop("`2当年就是他那精彩的策划制止了23年的地精侵略。", &current_sprite);
wait(500);  
   Say_stop("他把他们都干掉了吗？", 1); 
wait(500);  
   Say_stop("`2不。战争后他给他们找了个可以安心过日子的特殊场所。", &current_sprite);
wait(500);  
   Say_stop("不愧是国王啊。", 1); 

  }


if (&result == 3)
  {
   Say_stop("我必须要见国王。", 1); 
wait(500);  

if (&story < 9)
{
   Say_stop("`2你是..？", &current_sprite);
wait(500);  
   Say_stop("丁克小森林", 1); 
wait(500);  

}
  if (&story < 8)
   {
   Say_stop("`2无名小辈啊，要当英雄回家去扮演吧。", &current_sprite);
   }

  if (&story == 8)
   {
   Say_stop("`2啊，那个救了小MM的人吗？不错啊。", &current_sprite);
wait(500);  
   Say_stop("那我可以进去了？", 1); 
wait(500);  
   Say_stop("`2啊，不好意思，国王今天有事啊。", &current_sprite);
   }

  if (&story == 9)
   {
   Say_stop("`2啊，那个救了小MM的人吗？不错啊。", &current_sprite);
wait(500);  
   Say_stop("我要举报。", 1); 
wait(500);  
   Say_stop("`2啊，不好意思，国王今天不见客。", &current_sprite);
   }


  if (&story == 10)
   {
   Say_stop("`2你好啊小森林。恭喜你成功破坏了那对 KerSin 的攻击。", &current_sprite);
   wait(500);  
   Say_stop("嘿嘿，谁都会这样做的。", 1); 
   wait(500);  
   Say_stop("`2可惜，国王正在出国访问。", &current_sprite); 
   wait(500);  
   Say_stop("又不在啊。", 1); 
   }

  if (&story == 11)
   {
   Say_stop("`2啊哈，是小森林爵士。", &current_sprite);
   wait(500);  
   Say_stop("国王在吗？", 1); 
   wait(500);  
   Say_stop("`2不在 - 他正在为Milder的黑暗大陆之旅饯行。", &current_sprite); 
   wait(500);  
   Say_stop("Milder?", 1); 
   wait(500);  
   Say_stop("`2是啊， Flatstomp 可是我国最勇敢的勇士。", &current_sprite); 
   wait(500);  
   Say_stop("可恶。", 1); 
   }



  if (&story > 11)
   {
   Say_stop("`2小森林啊，你当然可以去见国王了！", &current_sprite);
   wait(500);  
   Say_stop("`2开门啦！", &current_sprite);
   enter();
   }


  }

   unfreeze(1);
   unfreeze(&current_sprite);
 

 }                                   
}

void die( void )
{
  int &hold = sp_editor_num(&current_sprite);
  if (&hold != 0)
  editor_type(&hold, 6); 
  Say_stop("`2我死啦",&current_sprite);
	if (get_sprite_with_this_brain(9, &current_sprite) == 0) 
	{
	  Say_stop("`2你，想造反吗？", &current_sprite);
   wait(500);  
   enter();
	}

}

void enter( void )
{
 int &gate = sp(4);
 sp_seq(&gate, 68);
script_attach(1000);
wait(1000);
fade_down();
&player_map = 102;
sp_x(1, 314);
sp_y(1, 349);
load_screen(102);
draw_screen();
fade_up();
unfreeze(1);
kill_this_task();
}

