Actor DarkZealot : McM_Monster replaces ArchVile {
	Health 650
	MONSTER
	+MISSILEMORE
	+DONTHURTSPECIES
	+QUICKTORETALIATE
	+NOBLOOD
	+DONTBLAST
	+NOTARGET
	+NOINFIGHTING
	Species "AV"
	SeeSound "DarkServant/See"
	PainSound "DarkServant/Pain"
	ActiveSound "DarkServant/Act"
	DeathSound "DarkServant/Die"
	Obituary "%o was tormented to death by a Dark Zealot."
	PainChance 48
	Radius 20
	Height 56
	ProjectilePassHeight 68
	Speed 10
	XScale 1.1
	YScale 1.25
	Mass 1500
	var int user_teleport;
	const int zealot_tp_count = 25;
	const int zealot_health = 650;
	Tag "Dark Zealot"
	States {
		Idle:
			TNT1 A 0 A_SetUserVar("user_teleport", 0)
			TNT1 A 0 A_SetShootable
			TNT1 A 0 A_SetTranslucent(1.0, 0)
		IdleLoop:
			RSON AB 10 A_Look
		Loop
		See:
			RSON A 3 A_Chase
			RSON A 3 A_Chase("")
			RSON B 3 A_Chase
			RSON B 3 A_Chase("")
			RSON C 3 A_Chase
			RSON C 3 A_Chase("")
			RSON D 3 A_Chase
			RSON D 3 A_Chase("")
		Loop
		Melee:
		Missile:
			TNT1 A 0 A_JumpIfHealthLower(zealot_health, "Decide")
			TNT1 A 0 A_Jump(48, "Shield")
			TNT1 A 0 A_Jump(192, "Attack1", "Attack2", "Teleport")
		Goto Attack1
		Decide:
			TNT1 A 0 A_Jump(192, "Heal", "Shield")
			TNT1 A 0 A_Jump(64, "Attack1")
			TNT1 A 0 A_Jump(224, "Attack2", "Teleport")
		Goto Attack1
		Attack1:
			RSON FF 4 Bright A_FaceTarget
			RSON G 5 Bright A_CustomMissile("DarkZealotPierce", 44)
			RSON TT 4 Bright A_FaceTarget
			RSON U 5 Bright A_CustomMissile("DarkZealotPierce", 44)
			RSON FF 4 Bright A_FaceTarget
			RSON G 5 Bright A_CustomMissile("DarkZealotPierce", 44)			
		Goto See
		Attack2:
			TNT1 A 0 A_JumpIfInventory("ZealotBoltCooldown", 1, "Attack1")
			TNT1 A 0 A_GiveInventory("ZealotBoltCooldown", 1)
			TNT1 A 0 A_PlaySound("DarkServant/Attack1", CHAN_WEAPON)
			RSON F 8 Bright A_FaceTarget
			RSON G 9 Bright A_CustomMissile("HadesBolt", 0, 0, 16)
			TNT1 A 0 A_FaceTarget
			RSON G 9 Bright A_CustomMissile("HadesBolt", 0, 0, 4)
			TNT1 A 0 A_FaceTarget
			RSON G 9 Bright A_CustomMissile("HadesBolt", 0, 0, -4)
			TNT1 A 0 A_FaceTarget
			RSON G 9 Bright A_CustomMissile("HadesBolt", 0, 0, -16)
			TNT1 A 0 A_FaceTarget
			RSON G 9 Bright A_CustomMissile("HadesBolt", 0, 0)
		Goto See
		Heal:
			TNT1 A 0 A_JumpIfInventory("ZealotHealCooldown", 1, "AggressiveDecide")
			TNT1 A 0 A_JumpIfInventory("MCM_BehaviorToggle", 1, "HealCont")
		Goto AggressiveDecide
		HealCont:
			RSON TT 6 Bright A_FaceTarget
			TNT1 A 0 A_GiveInventory("ZealotHealCooldown", 1)
			TNT1 A 0 A_PlaySound("DarkServant/Heal", CHAN_WEAPON)
			RSON U 8 Bright A_RadiusGive("ZealotHealer", 384, RGF_MONSTERS | RGF_GIVESELF, 1)
		Goto See
		AggressiveDecide:
			TNT1 A 0 A_Jump(128, "Attack2")
		Goto Attack1
		Redecide:
			TNT1 A 0 A_Jump(52, "Heal")
			TNT1 A 0 A_Jump(96, "Attack1")
			TNT1 A 0 A_Jump(192, "Attack2", "Teleport")
		Goto Attack1
		Shield:
			TNT1 A 0 A_JumpIfInventory("ZealotShieldCooldown", 1, "Redecide")
			TNT1 A 0 A_JumpIfInventory("ZealotShielded", 1, "Redecide")
			TNT1 A 0 A_JumpIfInventory("MCM_BehaviorToggle", 1, "ShieldCont")
		Goto AggressiveDecide
		ShieldCont:
			RSON F 1 Bright
			TNT1 A 0 A_ChangeFlag("NOPAIN", 1)
			TNT1 A 0 A_GiveInventory("ZealotShielded", 1)
			RSON FF 6 Bright A_FaceTarget
			TNT1 A 0 A_PlaySound("DarkServant/Magic", CHAN_WEAPON)
			TNT1 A 0 A_GiveInventory("ZealotShieldCooldown", 1)
			TNT1 A 0 ACS_NamedExecuteAlways("Dark Zealot UnsetReflect")
			TNT1 A 0 ACS_NamedExecuteAlways("Dark Zealot Shield")
			TNT1 A 0 A_Blast(0, 3, 84, 24)
			RSON G 8 Bright A_SetReflectiveInvulnerable
		Goto See
		Pain:
			TNT1 A 0 A_Jump(96, "Teleport")
			RSON E 3
			RSON E 3 A_Pain
		Goto See
		Teleport:
			TNT1 A 0 A_JumpIfInventory("ZealotTeleportCooldown", 1, "Redecide")
			TNT1 A 0 A_JumpIfInventory("MCM_BehaviorToggle", 1, "TeleportCont")
		Goto AggressiveDecide
		TeleportCont:
			TNT1 A 0 A_PlaySound("DarkServant/Laugh")
			TNT1 A 0 A_UnsetShootable
			RSON OPQRS 3 Bright
		TeleportLoop:
			TNT1 A 0 A_JumpIf(user_teleport == zealot_tp_count, "TeleportFinish")
			TNT1 AAAA 0 A_SpawnItemEx("DarkServantTrail2", frandom(-36.0, 36.0), frandom(-36.0, 36.0), frandom(8.0, 56.0), 0, 0, 0, 0, SXF_NOCHECKPOSITION | SXF_CLIENTSIDE)
			TNT1 AA 0 A_Wander
			TNT1 A 2 A_Wander
			TNT1 A 0 A_CustomMissile("DarkZealotLightning", 36, 0, random(0, 359), CMF_AIMDIRECTION, frandom(-8.0, 8.0))
			TNT1 A 0 A_SetUserVar("user_teleport", user_teleport + 1)
		Loop
		TeleportFinish:
			TNT1 A 0 A_ScaleVelocity(0.5)
			TNT1 A 0 A_SetUserVar("user_teleport", 0)
			TNT1 A 0 A_GiveInventory("ZealotTeleportCooldown", 1)
			RSON SRQPO 3 Bright
			TNT1 A 0 A_SetShootable
		Goto See
		Death:
			RSON H 6
			TNT1 A 0 A_SetTranslucent(1.0, 0)
			RSON I 6 A_Scream
			TNT1 A 0 A_SpawnItem("DissipationEffect")
			RSON J 6
			RSON K 6 A_NoBlocking
			RSON LM 6
			RSON N -1
		Stop
		Death.Corpse:
			RSON N -1
		Stop
	}
}

Actor ZealotShieldCooldown : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration -10
}

Actor ZealotBoltCooldown : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration -4
}

Actor ZealotHealCooldown : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration -8
}

Actor ZealotTeleportCooldown : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration 120 // +15
}

Actor ZealotShielded : MCM_Bool { }

Actor DarkServantTrail2 {
	+CLIENTSIDEONLY
	+NOINTERACTION
	Renderstyle Add
	Height 1
	Radius 1
	States {
		Spawn:
			ZLTT HHIIHHIIJJKK 1 Bright A_FadeOut(0.05)
			ZLTT L 2 Bright
		Stop
	}
}

Actor HadesBolt {
	Damage (5)
	Speed 6
	Radius 8
	PROJECTILE
	Height 24
	YScale 4.0
	XScale 2.0
	SeeSound "DarkServant/LightningBegin"
	DeathSound "monster/hadsit"
	ReactionTime 27
	const int exp_damage = 6;
	+FloorHugger
	+HexenBounce
	+Ripper
	-NoGravity
	States {
		Spawn:
			LFX2 F 1 Bright A_Explode(exp_damage, 64, 0)
			TNT1 A 0 A_PlaySound("Monster/hadtel", 5)
			LFX2 F 0 Bright A_CustomMissile("HadesBolt2",0,0,0,6,90)
			LFX2 F 0 ThrustThing(random(0,255),1,0,0)
			LFX2 G 1 Bright A_Explode(exp_damage, 64, 0)
			LFX2 G 0 Bright A_CustomMissile("HadesBolt2",0,0,0,6,90)
			LFX2 H 1 Bright A_Explode(exp_damage, 64, 0)
			LFX2 H 0 Bright A_CustomMissile("HadesBolt2",0,0,0,6,90)
			LFX2 I 1 Bright A_Explode(exp_damage, 64, 0)
			LFX2 I 0 Bright A_CustomMissile("HadesBolt2",0,0,0,6,90)
			LFX2 J 1 Bright A_Explode(exp_damage, 64, 0)
			TNT1 A 0 A_PlaySound("Monster/hadtel", 5)
			LFX2 J 0 Bright A_CustomMissile("HadesBolt2",0,0,0,6,90)
			LFX2 J 0 Bright A_CountDown
		Loop
		Death:
			LFX2 FGHIJ 2 Bright A_Explode(16, 64, 0)
		Stop
	}
}

Actor HadesBolt2 {
	Damage (8)
	Speed 184
	PROJECTILE
	RenderStyle None
	+ThruActors
	SeeSound ""
	DeathSound "Monster/hadsit"
	Radius 6
	Height 12
	+DONTBLAST
	States {
		Spawn:
			TNT1 A 1 A_Explode(6, 64, 0)
		Loop
		Death:
			TNT1 A 1
		Stop
	}
}

Actor ZealotHealer : MCM_Activator {
	States {
		Pickup:
			TNT1 A 0 ACS_NamedExecuteAlways("Dark Zealot Heal", 0, 25)
		Stop
	}
}

Actor ZealotShield {
	Height 1
	Radius 1
	+THRUACTORS
	+CLIENTSIDEONLY
	Renderstyle Add
	States {
		Spawn:
			TXP2 ABCDEFGH 2 Bright A_FadeOut(0.0825)
			TXP2 IJKLMNOP 2 Bright A_FadeIn(0.0825)
		Loop
		Death:
			TXP2 "#########" 1 A_SetScale(scalex - 0.075, scaley - 0.075)
		Stop
	}
}

Actor ZealotUnsetReflection : MCM_Activator {
	States {
		Pickup:
			TNT1 A 0 A_ChangeFlag("NOPAIN", 0)
			TNT1 A 0 A_TakeInventory("ZealotShielded", 1)
			TNT1 A 0 A_UnsetReflectiveInvulnerable
		Stop
	}
}

Actor DarkZealotLightningTrail {
	Renderstyle Add
	Alpha 1.0
	+NOINTERACTION
	+CLIENTSIDEONLY
	States {
		Spawn:
			LFX1 XYZ 2 A_FadeOut(0.1)
		Loop
	}
}

Actor DarkZealotLightning {
	PROJECTILE
	Height 18
	Radius 12
	Speed 40
	Damage (5 * random(2, 3))
	+PIERCEARMOR
	+NODAMAGETHRUST
	DamageType "VileMagic"
	SeeSound "DarkServant/Lightning"
	DeathSound "DarkServant/LightningHit"
	States {
		Spawn:
			LFX1 XYZ 3 Bright A_SpawnItem("DarkZealotLightningTrail")
		Loop
		Death:
			DLIT J 4 Bright
			DLIT KL 3 Bright
			DLIT MNO 2
		Stop
	}
}

Actor DarkZealotPierce {
	PROJECTILE
	Speed 32
	Height 16
	Radius 8
	Damage (random(4, 8))
	Scale 0.7
	+RIPPER
	+THRUGHOST
	+PIERCEARMOR
	+BLOODLESSIMPACT
	+NODAMAGETHRUST
	SeeSound "DarkServant/LightningBegin"
	DeathSound "DarkServant/LightningHit"
	Renderstyle Add
	Alpha 0.85
	States {
		Spawn:
			HSPL ABCDEFGHIJ 2 Bright A_FadeOut(0.05)
		Loop
		Death:
			HSP2 "#" 1 Bright A_FadeOut(0.075)
		Loop
	}
}