IF

	Global("Lich","GLOBAL",0)

	See(NearestEnemyOf(Myself(Myself)))

THEN

	RESPONSE #100

		PlaySound("DS#LICH2")

		ForceSpell(NearestEnemyOf(Myself(Myself)),WIZARD_HORROR)

		SmallWait(5)

		ForceSpell(Myself,CLERIC_ARMOR_OF_DARKNESS)

		SmallWait(5)

		ForceSpell(NearestEnemyOf(Myself(Myself)),CLERIC_ANIMATE_DEAD)

		SmallWait(5)

		ForceSpell(Myself,CLERIC_DARK_RITUAL)

		SetGlobal("Lich","GLOBAL",1)

END



IF

	Global("Lich","GLOBAL",1)

	See(NearestEnemyOf(Myself(Myself)))

THEN

	RESPONSE #100

		PlaySound("DS#GHOT1")

		ForceSpell(NearestEnemyOf(Myself(Myself)),WIZARD_LARLOCH_MINOR_DRAIN)

		SmallWait(5)

		ForceSpell(NearestEnemyOf(Myself(Myself)),WIZARD_HORROR)

		SmallWait(5)

		ForceSpell(NearestEnemyOf(Myself(Myself)),WIZARD_GLOBE_OF_DARKNESS)

		SmallWait(5)

		SetGlobal("Lich","GLOBAL",2)

END



IF

	See(NearestEnemyOf(Myself(Myself)))

	Global("Lich","GLOBAL",2)

THEN

	RESPONSE #100

		PlaySound("DS#GHOT2")

		ForceSpell(NearestEnemyOf(Myself(Myself)),WIZARD_HOLD_PERSON)

		Wait(1)

		ForceSpell(SecondNearestEnemyOf(Myself(Myself)),WIZARD_SLOW)

		SmallWait(1)

		ForceSpell(NearestEnemyOf(Myself(Myself)),CLERIC_ARMOR_MELT)

		SmallWait(1)

		ForceSpell(SecondNearestEnemyOf(Myself(Myself)),CLERIC_CURE_MODERATE_WOUNDS)

		SetGlobal("Lich","GLOBAL",3)

END



IF

	See(NearestEnemyOf(Myself(Myself)))

	Global("Lich","GLOBAL",3)

THEN

	RESPONSE #100

		ForceSpellPoint([2406.97],WIZARD_DIMENSION_DOOR)

		SetGlobal("Lich","GLOBAL",4)

END



IF

	See(NearestEnemyOf(Myself(Myself)))

	Global("Lich","GLOBAL",4)

THEN

	RESPONSE #100

		ForceSpell(StrongestOf(NearestEnemyOf(Myself)),WIZARD_EMOTION_HOPELESSNESS)

		SetGlobal("Lich","GLOBAL",5)

END



IF

	!See([PC])

	Global("Lich","GLOBAL",5)

THEN

	RESPONSE #100

		ForceSpellPoint([2036.247],FAST_SKULLTRAP)

		SmallWait(5)

		ForceSpellPoint([2225.429],FAST_SKULLTRAP)

		SmallWait(5)

		ForceSpellPoint([2484.484],FAST_SKULLTRAP)

		SmallWait(5)

		ForceSpellPoint([2735.335],FAST_SKULLTRAP)

		SmallWait(5)

		ForceSpellPoint([2320.252],FAST_SKULLTRAP)

		SmallWait(5)

		ForceSpellPoint([2515.207],FAST_SKULLTRAP)

		SetGlobal("Lich","GLOBAL",6)

END



IF

	See(NearestEnemyOf(Myself(Myself)))

	Global("Lich","GLOBAL",6)

THEN

	RESPONSE #100

		PlaySound("DS#GHOT3")

		ForceSpell(StrongestOf(NearestEnemyOf(Myself)),WIZARD_EMOTION_HOPELESSNESS)

		SmallWait(5)

		ForceSpell(MostDamagedOf(NearestEnemyOf(Myself)),CLERIC_CALL_UNDEAD)

		SetGlobal("Lich","GLOBAL",7)

END



IF

	See(NearestEnemyOf(Myself(Myself)))

	GlobalGT("Lich","GLOBAL",6)

	GlobalLT("Lich","GLOBAL",12)

THEN

	RESPONSE #35

		PlaySound("DS#GHOT4")

		EquipMostDamagingMelee()

		AttackOneRound(NearestEnemyOf(Myself(Myself)))

		IncrementGlobal("Lich","GLOBAL",1)

	RESPONSE #50

		PlaySound("DS#GHOT1")

		ForceSpell(NearestEnemyOf(Myself),CLERIC_PAIN)

		IncrementGlobal("Lich","GLOBAL",1)

	RESPONSE #40

		PlaySound("DS#GHOT2")

		ForceSpell(NearestEnemyOf(Myself),CLERIC_HARM)

		IncrementGlobal("Lich","GLOBAL",1)

	RESPONSE #30

		PlaySound("DS#GHOT3")

		ForceSpell(NearestEnemyOf(Myself),CLERIC_CAUSE_SERIOUS_WOUNDS)

		IncrementGlobal("Lich","GLOBAL",1)

	RESPONSE #20

		PlaySound("DS#GHOT4")

		ForceSpell(NearestEnemyOf(Myself),CLERIC_CAUSE_SERIOUS_WOUNDS)

		IncrementGlobal("Lich","GLOBAL",1)

END



IF

	See(NearestEnemyOf(Myself(Myself)))

	Global("Lich","GLOBAL",12)

THEN

	RESPONSE #75

		EquipMostDamagingMelee()

		AttackOneRound(NearestEnemyOf(Myself(Myself)))

		Continue()

	RESPONSE #20

		ForceSpell(NearestEnemyOf(Myself(Myself)),WIZARD_HORROR)

		Continue()

END






