IF
	Global("SemajDim","GLOBAL",0)
	Global("SarevokBehavior","GLOBAL",3)
THEN
	RESPONSE #100
		ForceSpellPoint([821.966],WIZARD_DIMENSION_DOOR)
		SetGlobal("SemajDim","GLOBAL",1)
END

IF
	StateCheck(Myself,STATE_SILENCED)
THEN
	RESPONSE #100
		ForceSpell(Myself,WIZARD_VOCALIZE)
END

IF
	Global("SemajBehavior","GLOBAL",0)
	See([PC])
THEN
	RESPONSE #100
		DisplayString(Myself,24097) // Contingency Released
		ReallyForceSpell(NearestEnemyOf(Myself),WIZARD_THUNDER_BOLT)
		DisplayString(Myself,24097) // Contingency Released
		ReallyForceSpell([PC],WIZARD_GREATER_MALISON)
		Wait(1)
		DisplayString(Myself,24098) // Tattoo of Power Released
		ReallyForceSpell([PC],WIZARD_POWER_WORD_BLIND)
		SetGlobal("SemajBehavior","GLOBAL",1)
END

IF
	Global("SemajBehavior","GLOBAL",1)
	See([PC])
THEN
	RESPONSE #100
		Spell([PC],WIZARD_DOMINATION)
		SetGlobal("SemajBehavior","GLOBAL",2)
END

IF
	Global("SemajBehavior","GLOBAL",1)
	See(NearestEnemyOf(Myself))
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),WIZARD_FIREBALL)
		SetGlobal("SemajBehavior","GLOBAL",2)
END

IF
	Global("SemajBehavior","GLOBAL",2)
	See(NearestEnemyOf(Myself))
THEN
	RESPONSE #100
		SpellPoint([1018.912],WIZARD_DIMENSION_DOOR)
		SetGlobal("SemajBehavior","GLOBAL",3)
END

IF
	Global("SemajBehavior","GLOBAL",3)
	See([PC])
THEN
	RESPONSE #100
		DisplayString(Myself,24099) // Magic Staff Released
		ReallyForceSpell(Myself,WIZARD_MIRROR_IMAGE)
		DisplayString(Myself,24098) // Tattoo of Power Released
		ReallyForceSpell([PC],WIZARD_CHAOS)
		Spell([PC],WIZARD_CLOUDKILL)
		SetGlobal("SemajBehavior","GLOBAL",4)
END

IF
	Global("SemajBehavior","GLOBAL",3)
	See(NearestEnemyOf(Myself))
THEN
	RESPONSE #100
		DisplayString(Myself,24099) // Magic Staff Released
		ReallyForceSpell(Myself,WIZARD_MIRROR_IMAGE)
		DisplayString(Myself,24098) // Tattoo of Power Released
		ReallyForceSpell(NearestEnemyOf(Myself),WIZARD_CHAOS)
		Spell(NearestEnemyOf(Myself),WIZARD_CLOUDKILL)
		SetGlobal("SemajBehavior","GLOBAL",4)
END

IF
	Global("SemajBehavior","GLOBAL",4)
	See(NearestEnemyOf(Myself))
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),WIZARD_FIREBALL)
		SetGlobal("SemajBehavior","GLOBAL",5)
END

IF
	Global("SemajBehavior","GLOBAL",5)
	See(NearestEnemyOf(Myself))
THEN
	RESPONSE #100
		SpellPoint([875.582],WIZARD_DIMENSION_DOOR)
		SetGlobal("SemajBehavior","GLOBAL",6)
END

IF
	Global("SemajBehavior","GLOBAL",6)
	See(NearestEnemyOf(Myself))
THEN
	RESPONSE #100
		DisplayString(Myself,24098) // Tattoo of Power Released
		ReallyForceSpell(Myself,WIZARD_MIRROR_IMAGE)
		Spell(NearestEnemyOf(Myself),WIZARD_LIGHTNING_BOLT)
		SetGlobal("SemajBehavior","GLOBAL",7)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(WIZARD_LIGHTNING_BOLT)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),WIZARD_LIGHTNING_BOLT)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(WIZARD_FIREBALL)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),WIZARD_FIREBALL)
END

IF
	See(NearestEnemyOf(Myself))
THEN
	RESPONSE #100
		AttackReevaluate(NearestEnemyOf(Myself),45)
END


