#include "lxqj_gg.pst"
npcdjpd(){

int lxqj =Rand(6);
if (lxqj==0){lxqj=381;}
if (lxqj==1){lxqj=75;}
if (lxqj==2){lxqj=106;}
if (lxqj==3){lxqj=388;}
if (lxqj==4){lxqj=13;}
if (lxqj==5){lxqj=373;}

	return lxqj-0;
}
string Name = "ºº¼é";
int Model = 16;
int Weapon =  npcggjwuqi2();
int Weapon2 = 0;
int Team = 2;
int View = 200;
int Think =Rand(5000);
int Attack1 = 30;
int Attack2 = 25;
int Attack3 = 45;
int Guard = 15+Rand(15);
int Dodge = Rand(25);
int Jump = 5+Rand(15);
int Look = 1000;
int Burst = 100;
int Aim = 100;
int GetItem = Rand(50);
int Spawn = npcdjpd();
int HP = 3000+Rand(2000);
int neili = 20-Rand(18);
int t1;
int t2;
int gg;
int gg1;
int npc;
int Stat;
int trg0;
int trg1;
int player;
int HPlast= 0;
int realHP= 0;	
int g_selfAddr;
OnInit(int this)
{

	g_selfAddr = this;
}


OnStart()
{
	npc = GetSelf(g_selfAddr);
	ChangeBehavior(npc, "wait");

}
OnUpdate()
{
        if(Stat==0)
	{
		Stat++;
		realHP=GetHP(npc);
		HPlast=realHP;
		return 0;
	}
	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;
	}   
}