IF
	Global("Lich","GLOBAL",0)
	See(NearestEnemyOf(Myself(Myself)))
THEN
	RESPONSE #100
		ForceSpellPoint([2516.678],WIZARD_DIMENSION_DOOR) // SPWI402.SPL (Dimension Door)
		Wait(1)
		ForceSpell(NearestEnemyOf(Myself(Myself)),WIZARD_EMOTION_HOPELESSNESS)
		SmallWait(5)
		SetGlobal("Lich","GLOBAL",1)
END

IF
	Global("Lich","GLOBAL",1)
	See(NearestEnemyOf(Myself(Myself)))
THEN
	RESPONSE #100
		PlaySound("DS#GHOT4")
		ForceSpell(NearestEnemyOf(Myself(Myself)),SUMMON_SKELETON_WARRIOR3) // SPWI935.SPL (No such index)
		SmallWait(5)
		ForceSpell(SecondNearestEnemyOf(Myself(Myself)),SUMMON_SKELETON_WARRIOR2) // SPWI936.SPL (No such index)
		SmallWait(5)
		ForceSpell(ThirdNearestEnemyOf(Myself(Myself)),SUMMON_SKELETON_WARRIOR) // SPWI937.SPL (No such index)
		SmallWait(5)
		ForceSpell(Myself,CLERIC_ARMOR_OF_DARKNESS)
		SmallWait(5)
		ForceSpell(Myself,CLERIC_DARK_RITUAL)
		SetGlobal("Lich","GLOBAL",2)
END

IF
	Global("Lich","GLOBAL",2)
	See(NearestEnemyOf(Myself(Myself)))
THEN
	RESPONSE #100
		PlaySound("DS#LICH2")
		ForceSpell(FourthNearestEnemyOf(Myself(Myself)),WIZARD_LARLOCH_MINOR_DRAIN) // SPWI119.SPL (Larloch's Minor Drain)
		SmallWait(5)
		ForceSpell(FifthNearestEnemyOf(Myself(Myself)),WIZARD_HORROR) // SPWI205.SPL (Horror)
		SmallWait(5)
		ForceSpell(SixthNearestEnemyOf(Myself(Myself)),WIZARD_GLOBE_OF_DARKNESS)
		SmallWait(5)
		SetGlobal("Lich","GLOBAL",3)
END

IF
	See(NearestEnemyOf(Myself(Myself)))
	Global("Lich","GLOBAL",3)
THEN
	RESPONSE #100
		ForceSpell(NearestEnemyOf(Myself(Myself)),WIZARD_HOLD_PERSON) // SPWI306.SPL (Hold Person)
	RESPONSE #100
		PlaySound("DS#GHOT1")
		Wait(1)
		ForceSpell(SecondNearestEnemyOf(Myself(Myself)),WIZARD_SLOW) // SPWI312.SPL (Slow)
		SetGlobal("Lich","GLOBAL",4)
END

IF
	See(NearestEnemyOf(Myself(Myself)))
	Global("Lich","GLOBAL",4)
THEN
	RESPONSE #100
		ForceSpell(MostDamagedOf(NearestEnemyOf(Myself)),WIZARD_MORDENKAINENS_SWORD) // SPWI716.SPL (Mordenkainen's Sword)
		SetGlobal("Lich","GLOBAL",5)
END

IF
	See(NearestEnemyOf(Myself(Myself)))
	Global("Lich","GLOBAL",5)
THEN
	RESPONSE #100
		ForceSpell(StrongestOf(NearestEnemyOf(Myself)),WIZARD_EMOTION_HOPELESSNESS) // SPWI411.SPL (Emotion: Hopelessness)
		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_DEATH_SPELL) // SPWI605.SPL (Death Spell)
		SmallWait(5)
		ForceSpell(StrongestOf(NearestEnemyOf(Myself)),SPIDER_SUMMON) // SPWI986.SPL (No such index)
		SetGlobal("Lich","GLOBAL",7)
END

IF
	See(NearestEnemyOf(Myself(Myself)))
	Global("Lich","GLOBAL",7)
THEN
	RESPONSE #100
		ForceSpell(MostDamagedOf(NearestEnemyOf(Myself)),WIZARD_VARASHARS_LIFE_DRAIN)
		SetGlobal("Lich","GLOBAL",8)
END

IF
	See(NearestEnemyOf(Myself(Myself)))
	HPPercentLT(Myself(Myself),50)
THEN
	RESPONSE #100
		ForceSpell(NearestEnemyOf(Myself),CLERIC_CAUSE_SERIOUS_WOUNDS)
		Continue()
END

IF
	See(NearestEnemyOf(Myself(Myself)))
	GlobalGT("Lich","GLOBAL",7)
	GlobalLT("Lich","GLOBAL",10)
THEN
	RESPONSE #35
		EquipMostDamagingMelee()
		AttackOneRound(NearestEnemyOf(Myself(Myself)))
		IncrementGlobal("Lich","GLOBAL",1)
	RESPONSE #50
		PlaySound("DS#GHOT4")
		ForceSpell(NearestEnemyOf(Myself),CLERIC_HARM) // SPPR608.SPL (Harm)
		IncrementGlobal("Lich","GLOBAL",1)
	RESPONSE #30
		ForceSpell(NearestEnemyOf(Myself),CLERIC_CAUSE_LIGHT_WOUNDS)
		IncrementGlobal("Lich","GLOBAL",1)
	RESPONSE #20
		PlaySound("DS#GHOT2")
		ForceSpell(NearestEnemyOf(Myself),CLERIC_CAUSE_SERIOUS_WOUNDS)
		IncrementGlobal("Lich","GLOBAL",1)
END

IF
	See(NearestEnemyOf(Myself(Myself)))
	Global("Lich","GLOBAL",10)
THEN
	RESPONSE #75
		EquipMostDamagingMelee()
		AttackOneRound(NearestEnemyOf(Myself(Myself)))
		Continue()
	RESPONSE #20
		ForceSpell(NearestEnemyOf(Myself(Myself)),CLERIC_CAUSE_LIGHT_WOUNDS)
		Continue()
END

