IF
	Global("Lich","GLOBAL",0)
	See(NearestEnemyOf(Myself(Myself)))
THEN
	RESPONSE #100
		ForceSpellPoint([1348.799],WIZARD_DIMENSION_DOOR)
		Wait(5)
		ForceSpell(NearestEnemyOf(Myself(Myself)),WIZARD_EMOTION_HOPELESSNESS)
		SmallWait(5)
		ForceSpell(Myself,CLERIC_ARMOR_OF_DARKNESS)
		SmallWait(5)
		ForceSpell(Myself,CLERIC_DARK_RITUAL)
		SetGlobal("Lich","GLOBAL",1)
END

IF
	Global("Lich","GLOBAL",1)
	See(NearestEnemyOf(Myself(Myself)))
THEN
	RESPONSE #100
		ForceSpell(NearestEnemyOf(Myself(Myself)),WIZARD_MORDENKAINENS_SWORD)
		SmallWait(5)
		ForceSpell(SecondNearestEnemyOf(Myself(Myself)),SUMMON_SKELETON_WARRIOR2)
		SmallWait(5)
		ForceSpell(ThirdNearestEnemyOf(Myself(Myself)),SUMMON_SKELETON_WARRIOR)
		SmallWait(5)
		SetGlobal("Lich","GLOBAL",2)
END

IF
	Global("Lich","GLOBAL",2)
	See(NearestEnemyOf(Myself(Myself)))
THEN
	RESPONSE #100
		ForceSpell(NearestEnemyOf(Myself(Myself)),WIZARD_VARASHARS_LIFE_DRAIN)
		SmallWait(5)
		ForceSpell(ThirdNearestEnemyOf(Myself(Myself)),WIZARD_HORROR)
		SmallWait(5)
		ForceSpell(SecondNearestEnemyOf(Myself(Myself)),WIZARD_FEEBLEMIND)
		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)
	RESPONSE #100
		Wait(1)
		ForceSpell(SecondNearestEnemyOf(Myself(Myself)),WIZARD_SLOW)
		Wait(1)
		SetGlobal("Lich","GLOBAL",4)
END

IF
	See(NearestEnemyOf(Myself(Myself)))
	Global("Lich","GLOBAL",4)
THEN
	RESPONSE #100
		ForceSpell(StrongestOf(NearestEnemyOf(Myself)),WIZARD_POWER_WORD_BLIND)
		SetGlobal("Lich","GLOBAL",5)
END

IF
	See(NearestEnemyOf(Myself(Myself)))
	Global("Lich","GLOBAL",5)
THEN
	RESPONSE #100
		ForceSpell(StrongestOf(NearestEnemyOf(Myself)),WIZARD_EMOTION_HOPELESSNESS)
		SetGlobal("Lich","GLOBAL",6)
END

IF
	See(NearestEnemyOf(Myself(Myself)))
	Global("Lich","GLOBAL",6)
THEN
	RESPONSE #100
		ForceSpell(StrongestOf(NearestEnemyOf(Myself)),WIZARD_POWER_WORD_KILL)
		Wait(1)
		ForceSpell(NearestEnemyOf(Myself(Myself)),WIZARD_PRISMATIC_SPRAY)
		SetGlobal("Lich","GLOBAL",7)
END

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

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

IF
	See(NearestEnemyOf(Myself(Myself)))
	GlobalGT("Lich","GLOBAL",7)
	GlobalLT("Lich","GLOBAL",12)
THEN
	RESPONSE #35
		EquipMostDamagingMelee()
		AttackOneRound(NearestEnemyOf(Myself(Myself)))
		IncrementGlobal("Lich","GLOBAL",1)
	RESPONSE #30
		ForceSpell(NearestEnemyOf(Myself),CLERIC_CAUSE_DISEASE)
		IncrementGlobal("Lich","GLOBAL",1)
	RESPONSE #40
		ForceSpell(NearestEnemyOf(Myself),CLERIC_CAUSE_SERIOUS_WOUNDS)
		IncrementGlobal("Lich","GLOBAL",1)
	RESPONSE #30
		ForceSpell(NearestEnemyOf(Myself),CLERIC_CAUSE_SERIOUS_WOUNDS)
		IncrementGlobal("Lich","GLOBAL",1)
	RESPONSE #40
		ForceSpell(NearestEnemyOf(Myself),CLERIC_LIFE_STEAL)
		IncrementGlobal("Lich","GLOBAL",1)
END

IF
	See(NearestEnemyOf(Myself(Myself)))
	Global("Lich","GLOBAL",12)
THEN
	RESPONSE #75
		EquipMostDamagingMelee()
		AttackOneRound(NearestEnemyOf(Myself(Myself)))
		Continue()
	RESPONSE #50
		ForceSpell(NearestEnemyOf(Myself(Myself)),WIZARD_HORROR)
		Continue()
END


