#include "lx_adsl.pst"
string Name	= "½õÒÂÎÀ_6";
int Model =	20;
int Weapon = GetSNAnyNPCWeapon1();
int Weapon2 = GetSNAnyNPCWeapon2();
int Team = 2;
int View = 0;
int Think = 100;
int	Attack1	= 35;
int Attack2 = 30;
int Attack3 = 30;
int	Guard =	5;
int	Dodge =	0;
int Jump = 15;
int Look = 40;
int Burst = 30;
int Aim = 10;
int GetItem = 10;
int Spawn = GetSN15NPCSpawn();
int HP = 1500;
	

int g_selfAddr;
int g_self;
int NPC1;
int Stat;

OnInit(int this)
{
	g_selfAddr = this;
}

OnStart()
{
	g_self = GetSelf(g_selfAddr);
	ChangeBehavior(g_self, "idle");
}


OnUpdate()
{
	NPC1 = GetAnyChar("´óµµÍ·_¼ÄÌì·ç");
if (Stat==0){Stat++;}

if (Stat==1)
{
SetTarget(0, "waypoint", 130);
SetTarget(1, "char", g_self);
SetTarget(2, "waypoint", 123);
	if(Distance(0,1) < 100 || Distance(2,1) < 100)
	{
View = 200;
UpdateAIAttrib(g_self);Stat=21;
	}
}

if (Stat==21 && GetHP(NPC1)>0 && NPC1>0)
{
Stat=2;
}

if (Stat==2 && GetHP(NPC1)<500)
{
 				SetTarget(0, "waypoint", 130);
 				SetTarget(1, "waypoint", 123);
 				SetTarget(2, "char", g_self);
 				SetTarget(3, "waypoint", 133);
 				SetTarget(4, "waypoint", 136);
	if(Distance(0,2) < Distance(1,2))
	{
ChangeBehavior(g_self, "attacktarget", 3,100);
				Perform(g_self, "say", "É±°¡£¡£¡£¡£¡");
View = 0;
UpdateAIAttrib(g_self);Stat=3;
	}
			else
			{
ChangeBehavior(g_self, "attacktarget", 4,100);
				Perform(g_self, "say", "É±°¡£¡£¡£¡£¡");
View = 0;
UpdateAIAttrib(g_self);Stat=3;
			}
}

if(Stat==3){
 				SetTarget(0, "waypoint", 133);
 				SetTarget(1, "char", g_self);
 				SetTarget(2, "waypoint", 136);
	if(Distance(0,1) < 60 || Distance(2,1) < 60)
	{
View = 200;
UpdateAIAttrib(g_self);Stat=4;}

}
if(Stat==4){
 				SetTarget(0, "waypoint", 133);
 				SetTarget(1, "char", g_self);
 				SetTarget(2, "waypoint", 136);
	if(Distance(0,1) > 150 && Distance(2,1) > 150)
	{
		if(Distance(0,1) < Distance(1,2))
		{
	ChangeBehavior(g_self, "attacktarget", 0,100);
View = 0;
UpdateAIAttrib(g_self);Stat=3;
		}
			else
			{
ChangeBehavior(g_self, "attacktarget", 2,100);
View = 0;
UpdateAIAttrib(g_self);Stat=3;
			}
	}

}

}