string Name = "『流星奇迹』_兵兵";
int Model =  900;
int Weapon =  44;
int Weapon2 =  17;
int Team = 0;
int View = 12500000;
int Think =16000000;
int Attack1 = 30;
int Attack2 = 25;
int Attack3 = 45;
int Guard = 30;
int Dodge = 0;
int Jump = 1+Rand(19);
int Look = 1000;
int Burst = 100;
int Aim = 100;
int GetItem = 0;
int Spawn = Rand(120);
int HP = 32000;

int gg;
int t1;
int t2;
int t3;
int npc;
int trg0;
int trg1;
int player;
int g_selfAddr;

npczd1(int id){

Perform(id, "use", 41);
Perform(id, "use", 40);
Perform(id, "use", 36);
Perform(id, "use", 34);
Perform(id, "use", 19);
Perform(id, "use", 8);
Perform(id, "use", 5);
Perform(id, "use", 4);
Perform(id, "use", 3);

} 
julipanduan(int k1,int k2)
{
   SetTarget(0, "char", k1);
   SetTarget(1, "char", k2);
   return Distance(0,1);
}
OnInit(int this)
{
	g_selfAddr = this;
}
OnStart()
{
	npc = GetSelf(g_selfAddr);
	ChangeBehavior(npc, "idle");
}
OnUpdate()
{

      if(trg0==0)
      {
		trg0++;
	        Perform(npc,"use",36);
		return 0;
      }
      if(trg0==1)
      {
          if (GetHP(npc) < GetMaxHP(npc)/2)
          {
	     Perform(npc,"use",15);
	     Perform(npc,"use",15);
	     Perform(npc,"use",15);
	     Perform(npc,"use",15);
	     Say(npc, " 小子真是不知道好歹，这么想跟我打，我就陪你玩玩。   ");
	     trg0++;
          }
     }
     if(trg0==2 && GetGameTime() > t1)
     {
	     Perform(npc,"use",15);
	     Perform(npc,"use",15);
	     Perform(npc,"use",15);

             t1 = GetGameTime() + 20;
      }
      if(trg0==2 && GetGameTime() > t2)
      {
	    player = GetAnyChar("player");
            if (npc>=0 && julipanduan(npc,player)<100) 
	    {

                        ChangeBehavior(npc, "follow", player);
	                Perform(npc,"use",8);
	  	   	t2 = GetGameTime() + 5; 

	     }
      }
      if(trg0==2 && GetGameTime() > t3)
      {
	    player = GetAnyChar("player");
            if (npc>=0 && julipanduan(npc,player)>150) 
	    {

                    	ChangeBehavior(npc, "idle");
	  	   	t3 = GetGameTime() + 10; 

	     }
      }
      if (GetGameTime() > gg)
      {

         npczd1(npc);
         gg = GetGameTime() + 60;

      }
}