#include "lxqj_gg.pst"
npcdjpd(){

int lxq =Rand(3);
if (lxq==0){lxq=478;}
if (lxq==1){lxq=115;}
if (lxq==2){lxq=385;}
return lxq-0;
}
npcsjsh(int c){

int lxqj =Rand(10);
if (lxqj==0){Say(c, "  八噶路.. ");}
if (lxqj==1){Say(c, "  你地.桫椤桫椤地。  ");}
if (lxqj==2){Say(c, "  你地  好好地做. ");}
if (lxqj==3){Say(c, "   前途大大地. ");}
if (lxqj==4){Say(c, "  有没有花姑娘的..  ");}
if (lxqj==5){Say(c, "  弹棉花列. . ");}
if (lxqj==6){Say(c, "  你地  ..八噶路.干火。  ");}
if (lxqj==7){Say(c, "   嘎嘎。你地。八.八噶路. ");}
if (lxqj==8){Say(c, "   弹棉花列 . 弹出大大地花姑娘 ");}
if (lxqj==9){Say(c, "   能不能给我大大的花姑娘。大大地。. ");}
}
string Name = "皇军";
int Model = 15;
int Weapon = npcggjwuqi1();
int Weapon2 = npcggjwuqi2();
int Team = 2;
int View = 100;
int Think =15000+Rand(15000);
int Attack1 = 30;
int Attack2 = 25;
int Attack3 = 45;
int Guard = 0;
int Dodge = 0;
int Jump = Rand(15);
int Look = 1000;
int Burst = Rand(30);
int Aim = 100;
int GetItem = 0;
int Spawn = npcdjpd();
int HP = 32000;
int t1;
int t2;
int npc;
int player;
int HPlast= 0;
int realHP= 0;	
int g_selfAddr;
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, "patrol", Spawn);

}
OnUpdate()
{

	if (GetGameTime() > t1)
	{
	        player = GetAnyChar("player");
		if (npc>=0 && julipanduan(npc,player)<50) 
		{

                        npcsjsh(npc);
	  	   	t1 = GetGameTime() + 10; 

		}
	}
	if (GetGameTime() > t2)
        {
        npcdj(npc);
        Perform(npc, "use", 16);
        Perform(npc, "use", 16); // 杀小日本要猛。
        t2 = GetGameTime() + 60; 
	}
	int HPnow=GetHP(npc);
	if(HPnow<HPlast)
	{
		int AtkP=HPlast-HPnow;
		npcxljs(npc, HPnow, AtkP);
		HPlast=HPnow;
	}
	if(HPnow>HPlast)
	{
		int AtkP2=HPnow-HPlast;
		npcxljs(npc, HPnow, AtkP2);
		HPlast=HPnow;
	}	
	if(HPnow==realHP&&HPlast<realHP)
	{
		HPlast=realHP;
	}   
 
}