IF
	Detect([ANYONE])
	!See([PC])
	StateCheck([PC],STATE_INVISIBLE)
THEN
	RESPONSE #100
		ForceSpell(Myself,PURGE_INVISIBILITY)
END

IF
	Global("Dragon","GLOBAL",0)
	See([PC])
	Range(NearestEnemyOf(Myself),100)
	!Range(NearestEnemyOf(Myself),20)
	CheckStatLT(NearestEnemyOf(Myself),50,RESISTFIRE)
THEN
	RESPONSE #75
		ForceSpell(NearestEnemyOf(Myself),FIREDRAKE_DAMAGE)
		Wait(1)
		ForceSpell(SecondNearestEnemyOf(Myself),FIREDRAKE_DAMAGE)
		SetGlobal("Dragon","GLOBAL",1)
	RESPONSE #25
		ForceSpell(NearestEnemyOf(Myself),ACID_BREATH)
		SmallWait(5)
		ForceSpell(NearestEnemyOf(Myself),ACID_BREATH)
		SetGlobal("Dragon","GLOBAL",1)
END

IF
	Global("Dragon","GLOBAL",0)
	See([PC])
	Range(NearestEnemyOf(Myself),60)
	!Range(NearestEnemyOf(Myself),1)
	CheckStatGT(NearestEnemyOf(Myself),50,RESISTFIRE)
THEN
	RESPONSE #25
		ForceSpell(NearestEnemyOf(Myself),FIREDRAKE_DAMAGE)
		Wait(1)
		ForceSpell(SecondNearestEnemyOf(Myself),FIREDRAKE_DAMAGE)
		SetGlobal("Dragon","GLOBAL",1)
	RESPONSE #75
		ForceSpell(NearestEnemyOf(Myself),ACID_BREATH)
		SmallWait(5)
		ForceSpell(NearestEnemyOf(Myself),ACID_BREATH)
		SetGlobal("Dragon","GLOBAL",1)
END

IF
	Global("Dragon","GLOBAL",1)
	See([PC])
	Range(NearestEnemyOf(Myself),150)
	!Range(NearestEnemyOf(Myself),1)
THEN
	RESPONSE #40
		ForceSpell(NearestEnemyOf(Myself),INNATE_ENTANGLE)
	RESPONSE #30
		ForceSpell(NearestEnemyOf(Myself),INNATE_VAMPIRE_DIRE_CHARM)
	RESPONSE #30
		ForceSpell(NearestEnemyOf(Myself),FEAR)
		SetGlobal("Dragon","GLOBAL",2)
END

IF
	Global("Dragon","GLOBAL",2)
	See([PC])
	Range(NearestEnemyOf(Myself),30)
	!Range(NearestEnemyOf(Myself),1)
THEN
	RESPONSE #25
		SelectWeaponAbility(SLOT_WEAPON,0)
		AttackOneRound(NearestEnemyOf(Myself))
	RESPONSE #25
		SelectWeaponAbility(SLOT_WEAPON1,0)
		AttackOneRound(NearestEnemyOf(Myself))
	RESPONSE #25
		SelectWeaponAbility(SLOT_WEAPON2,0)
		AttackOneRound(NearestEnemyOf(Myself))
	RESPONSE #25
		SelectWeaponAbility(SLOT_WEAPON3,0)
		AttackOneRound(NearestEnemyOf(Myself))
		SetGlobal("Dragon","GLOBAL",0)
		Continue()
END

IF
	RandomNum(4,1)
	Exists(NearestEnemyOf(Myself(Myself)))
	NumCreatureGT(NearestEnemyOf(Myself),6)
THEN
	RESPONSE #50
		ForceSpell(Player1,FIREDRAKE_DAMAGE)
		Wait(1)
		ForceSpell(Player2,FIREDRAKE_DAMAGE)
		SetGlobal("Dragon","GLOBAL",1)
	RESPONSE #50
		ForceSpell(Player3,ACID_BREATH)
		SmallWait(5)
		ForceSpell(Player4,ACID_BREATH)
		Continue()
END

IF
	RandomNum(4,2)
	Exists(NearestEnemyOf(Myself(Myself)))
	NumCreatureGT(NearestEnemyOf(Myself),6)
THEN
	RESPONSE #50
		ForceSpell(Player3,FIREDRAKE_DAMAGE)
		Wait(1)
		ForceSpell(Player4,FIREDRAKE_DAMAGE)
		SetGlobal("Dragon","GLOBAL",1)
	RESPONSE #50
		ForceSpell(Player5,ACID_BREATH)
		SmallWait(5)
		ForceSpell(Player6,ACID_BREATH)
		Continue()
END

IF
	RandomNum(4,3)
	Exists(NearestEnemyOf(Myself(Myself)))
	NumCreatureGT(NearestEnemyOf(Myself),6)
THEN
	RESPONSE #50
		ForceSpell(Player5,FIREDRAKE_DAMAGE)
		Wait(1)
		ForceSpell(Player6,FIREDRAKE_DAMAGE)
		SetGlobal("Dragon","GLOBAL",1)
	RESPONSE #50
		ForceSpell(Player1,ACID_BREATH)
		SmallWait(5)
		ForceSpell(Player2,ACID_BREATH)
		Continue()
END

IF
	RandomNum(4,4)
	Exists(NearestEnemyOf(Myself(Myself)))
	NumCreatureGT(NearestEnemyOf(Myself),6)
THEN
	RESPONSE #50
		ForceSpell(NearestEnemyOf(Myself),WIZARD_FIREBALL)
		Wait(1)
		ForceSpell(SecondNearestEnemyOf(Myself),FIREDRAKE_DAMAGE)
		SetGlobal("Dragon","GLOBAL",1)
	RESPONSE #50
		ForceSpell([ANYONE],WIZARD_FIREBALL)
		Continue()
END


