//Weredragon

Actor NewBeast : Beast replaces Beast
{
	PainChance "Convert", 255
	/*+NODAMAGETHRUST*/
	//DropItem "NewMana1", 84, 30
	Health 300
	Mass 600
	DropItem "ReagentRed", 64
	Meleerange 64
	Tag "Weredragon"
	Damagetype "Physical"
	DamageFactor "Fire", 0.75
	DamageFactor "FirePlayer", 0.75
	DamageFactor "FireTime", 0.75
	+USEKILLSCRIPTS
	States
	{
	Spawn:
		BEAS A 0
		BEAS A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,79,0)
	Idle:
		BEAS AB 10 A_Look
		Loop
	Pain.Morale:
		TNT1 A 0 A_Changeflag("Frightened", 1)
		Goto Pain
	Pain.Convert:
		TNT1 A 0 A_JumpIfInTargetInventory("Visions",Random(0,6),"ConvertMe")
		goto Pain
	ConvertMe:
		TNT1 A 0 ACS_ExecuteAlways(WOC_VISIONSSCRIPT,0,0,0,0)
		goto See
	Melee:
	Missile:
		BEAS H 8 A_FaceTarget
		BEAS I 8 A_CustomComboAttack("BeastBall", 42, ACS_NamedExecuteWithResult("WOC Monster Damage Scale",ACTIVATOR,FRandom(17,37)), "beast/attack", "Physical")
		Goto See
	Pain:
		BEAS G 3
		BEAS G 3 A_Pain
		Goto See
	XDeath:
		BEAS J 5 A_SpawnItemEX("GIBBER")
		BEAS K 6 A_Scream
		BEAS L 5
		BEAS M 6
		BEAS N 5
		BEAS O 6 A_NoBlocking
		BEAS P 5
		BEAS Q -1
		Stop
	Raise:
		BEAS Y 0 ACS_NamedExecuteAlways("WOC Monster Init",0,79,0)
		BEAS YXWVUTSR 6
		Goto See
	}
}

Actor NewBeastBall : BeastBall replaces BeastBall
{
	Damagetype "Fire"
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(17,37)))
	/*+NODAMAGETHRUST*/
	Speed 18
	FastSpeed 25
	States
	{
	Spawn:
		FRB1 AAAABBBBCCCC 1 A_SpawnItemEx("NewPuffy", random2[BeastPuff]()*0.015625, random2[BeastPuff]()*0.015625,
                                random2[BeastPuff]()*0.015625, 0, 0, 0, 0, SXF_NOCHECKPOSITION|SXF_ABSOLUTEPOSITION)
		Loop
	Death:
		FRB1 DEFGH 4
		Stop
	}
}

Actor NewPuffy : Puffy
{
	+NOINTERACTION
	+CLIENTSIDEONLY +DONTBLAST
	+DONTSPLASH
	States
	{
	Spawn:
		FRB1 DDEEFFGGHH 1 A_FadeOut(0.04)
		Stop
	}
}

//Sabreclaw

Actor NewClinkHeretic : Clink replaces Clink
{
	DropItem "ReagentTan", 64
	PainChance "Convert", 255
	Damage (FRandom(6,18) * ACS_NamedExecuteWithResult("WOC Monster Damage Scale",ACTIVATOR))
	/*+NODAMAGETHRUST*/
	Tag "Sabreclaw"
	+USEKILLSCRIPTS
	Obituary "$OB_CLINK" // "%o was slashed by a sabreclaw."
	MeleeRange 52
	MaxTargetRange 200
	Damagetype "Physical"
	Speed 16
	Mass 100
	AttackSound ""
	DamageFactor "Physical", 0.75
	DamageFactor "PhysicalPlayer", 0.75
	DamageFactor "Lightning", 1.5
	DamageFactor "LightningPlayer", 1.5
	DamageFactor "LightningTime", 1.5
	DamageFactor "Bleed", 0
	DamageFactor "PoisonTime", 0
	States
	{
	Spawn:
		CLNK A 0
		CLNK A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,56,0)//increase health on higher difficulties
	Idle:
		CLNK AB 10 A_Look
		Loop
	See:
		CLNK A 2 A_Chase
		CLNK B 3 A_Chase
		CLNK C 2 A_Chase
		CLNK D 3 A_Chase
		Loop
	Melee:
		CLNK E 5 A_FaceTarget
		CLNK F 0 A_PlayWeaponSound("Clink/Swing")
		CLNK F 4 A_FaceTarget
		CLNK G 7 A_CustomMeleeAttack(ACS_NamedExecuteWithResult("WOC Monster Damage Scale",ACTIVATOR,FRandom(8,15)), "Clink/Attack", "", "Physical", 1)
		Goto See
	Missile:
		CLNK P 6 A_FaceTarget
		CLNK P 0 A_FaceTarget
		CLNK Q 1 ThrustThingZ(0,40,0,1)
		CLNK Q 0 A_SpawnItemEx("SabreclawGhostTrail",0,0,0,0,0,0,0,128,0)
		CLNK E 0 A_FaceTarget
		CLNK Q 0 A_Recoil (-10)
		CLNK QQQQ 1 A_JumpIfCloser(71, "MeleeStrike")
		CLNK Q 0 A_SpawnItemEx("SabreclawGhostTrail",0,0,0,0,0,0,0,128,0)
		CLNK QQQQ 1 A_JumpIfCloser(71, "MeleeStrike")
		CLNK Q 0 A_SpawnItemEx("SabreclawGhostTrail",0,0,0,0,0,0,0,128,0)
		CLNK QQQQ 1 A_JumpIfCloser(71, "MeleeStrike")
		CLNK Q 0 A_SpawnItemEx("SabreclawGhostTrail",0,0,0,0,0,0,0,128,0)
		CLNK QQQP 1 A_JumpIfCloser(71, "MeleeStrike")
		CLNK P 0 A_SpawnItemEx("SabreclawGhostTrail2",0,0,0,0,0,0,0,128,0)
		CLNK PPPP 1 A_JumpIfCloser(71, "MeleeStrike")
		CLNK P 0 A_SpawnItemEx("SabreclawGhostTrail2",0,0,0,0,0,0,0,128,0)
		CLNK P 1 A_JumpIfTargetInsideMeleeRange("MeleeStrike")
		Goto See
	MeleeStrike:
		CLNK G 0 A_FaceTarget
		CLNK G 7 A_CustomMeleeAttack(ACS_NamedExecuteWithResult("WOC Monster Damage Scale",ACTIVATOR,FRandom(8,15)), "clink/attack", "clink/swing", "Physical", 1)
		Goto See
	Pain:
		CLNK H 3
		CLNK H 3 A_Pain
		Goto See
	Raise:
		CLNK A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,56,0)
		CLNK NMLKJI 6
		Goto See
	}
}

ACTOR SabreclawGhostTrail
{
	Radius 16
	Height 56
	Speed 1
	Damage 0
	RenderStyle Translucent
	Alpha 0.7
	PROJECTILE
	+CLIENTSIDEONLY +DONTBLAST
	states
	{
	Spawn:
        CLNK Q 0
		CLNK Q 1 A_FadeOut(0.10)
		goto Spawn+1
	}
}

ACTOR SabreclawGhostTrail2 : SabreclawGhostTrail
{
	states
	{
	Spawn:
        CLNK P 0
		CLNK P 1 A_FadeOut(0.10)
		goto Spawn+1
	}
}

// Iron-Lich
Actor NewIronLich : IronLich Replaces IronLich
{
	//DropItem "NewMana1", 84, 15
	Dropitem "NewArtiEgg", 51
	Damagefactor "DeathBlow", 0
	/*+NODAMAGETHRUST*/
	+NOFEAR
	DropItem "AccessoryRandomSpawner" 8
	Tag "Iron Lich"
	+USEKILLSCRIPTS
	Damagetype "Physical"
	Health 1000
	Mass 1000
	DamageFactor "Arcane", 0.75
	DamageFactor "Fire", 0.75
	DamageFactor "FirePlayer", 0.75
	DamageFactor "FireTime", 0.75
	DamageFactor "Ice", 0.75
	DamageFactor "IcePlayer", 0.75
	DamageFactor "IceTime", 0.75
	DamageFactor "Lightning", 0.75
	DamageFactor "LightningPlayer", 0.75
	DamageFactor "LightningTime", 0.75
	DamageFactor "Poison", 0.75
	DamageFactor "PoisonPlayer", 0.75
	DamageFactor "Holy", 1.5
	DamageFactor "HolyPlayer", 1.5
	DamageFactor "HolyTime", 1.5
	DamageFactor "PoisonTime", 0
	DamageFactor "Bleed", 0
	States
	{
	Spawn:
		LICH A 0
		LICH A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,86,WOC_STATUSIMMUNE)
	Idle:
		LICH A 10 A_Look
		Loop
	Death:
		LICH C 1 A_SpawnItemEx ("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
		LICH C 1 A_SpawnItemEx ("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
		LICH C 1 A_SpawnItemEx ("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
		LICH C 1 A_SpawnItemEx ("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
		LICH C 1 A_SpawnItemEx ("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
		LICH C 1 A_SpawnItemEx ("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
		LICH C 1 A_SpawnItemEx ("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
		LICH D 7 A_Scream
		LICH EF 7
		LICH G 7 A_NoBlocking
		LICH H 7
		LICH I -1 A_BossDeath
		Stop
	}
}

Actor NewHeadFX1 : HeadFX1 replaces HeadFX1
{
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(1,8)))
	Damagetype "Ice"
	DeathSound "ironlich/attack2hit"
	/*+NODAMAGETHRUST*/
	Speed 15
	FastSpeed 20
	States
    {
    Spawn:
		FX05 AAABBBCCC 1 Bright A_SpawnItemEx("IceCometTrail",0,0,0,0,0,0,0,128)
		Loop
	}
}

Actor NewHeadFX2 : HeadFX2 replaces HeadFX2
{
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(3,24)))
	Damagetype "Ice"
	/*+NODAMAGETHRUST*/
	Speed 20
	FastSpeed 20
}

Actor NewHeadFX3 : HeadFX3 replaces HeadFX3
{
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(15,30)))
	DeathSound "ironlich/attack1hit"
	/*+NODAMAGETHRUST*/
	Speed 15
	FastSpeed 20
}

Actor NewWhirlWind : Whirlwind replaces WhirlWind
{
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(1,8)))
	Damagetype "Physical"
	States
	{
	Spawn:
		FX07 DEFG 3 
	Chase:
		FX07 A 0 A_SpawnItemEx("NewWhirlWindExplosionDamage")
		FX07 A 1 A_WhirlwindSeek
		FX07 A 1 A_SpawnItemEx("NewWhirlWindExplosionDamage")
		FX07 AAA 0 A_SpawnItemEx("LeafFX",0,0,random(0,8),random(-5,0), random(-5,0),random(0,2),random(90,270))
		FX07 A 1 A_SpawnItemEx("NewWhirlWindExplosionDamage")
		FX07 A 0 A_SpawnItemEx("NewWhirlWindExplosionDamage")
		FX07 B 1 A_WhirlwindSeek
		FX07 BBB 0 A_SpawnItemEx("LeafFX",0,0,random(0,8),random(-5,0), random(-5,0),random(0,1),random(90,270))
		FX07 B 1 A_SpawnItemEx("NewWhirlWindExplosionDamage")
		FX07 B 1 A_SpawnItemEx("NewWhirlWindExplosionDamage")
		FX07 C 0 A_SpawnItemEx("NewWhirlWindExplosionDamage")
		FX07 C 1 A_WhirlwindSeek
		FX07 CC 0 A_SpawnItemEx("LeafFX",0,0,random(0,8),random(-5,0), random(-5,0),random(0,4),random(90,270))
		FX07 C 1 A_SpawnItemEx("NewWhirlWindExplosionDamage")
		FX07 C 1 A_SpawnItemEx("NewWhirlWindExplosionDamage")
		FX07 CCC 0 A_SpawnItemEx("LeafFX",0,0,random(0,8),random(-5,0), random(-5,0),random(0,1),random(90,270))
		Loop
	Death:
		TNT1 AAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("LeafFX",0,0,random(0,8),random(-5,0), random(-5,0),random(0,7),random(0,360))
		FX07 G 4 A_RadiusThrust(ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,2000),64,RTF_NOIMPACTDAMAGE)
		TNT1 AAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("LeafFX",0,0,random(0,8),random(-5,0), random(-5,0),random(0,7),random(0,360))
		FX07 F 4 A_RadiusThrust(ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,2000),64,RTF_NOIMPACTDAMAGE)
		TNT1 AAAAAAAAAAAAAAA 0 A_SpawnItemEx("LeafFX",0,0,random(0,8),random(-5,0), random(-5,0),random(0,7),random(0,360))
		FX07 E 4 A_RadiusThrust(ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,2000),64,RTF_NOIMPACTDAMAGE)
		TNT1 AAAAAAAAAAAAA 0 A_SpawnItemEx("LeafFX",0,0,random(0,8),random(-5,0), random(-5,0),random(0,7),random(0,360))
		FX07 D 4 A_RadiusThrust(ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,2000),64,RTF_NOIMPACTDAMAGE)
		Stop
	}
}

Actor NewWhirlWindExplosionDamage
{
	Speed 0
	Height 4
	Radius 4
	Damage (0)
	+MISSILE
	+DONTBLAST
	+NOBLOCKMAP
	+NOGRAVITY
	+DONTSPLASH
	-TELESTOMP
	+NODAMAGETHRUST
	+PAINLESS
	Damagetype "Physical"
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 1 A_Explode(ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(1,8)),16,0,0,16)
		Stop
	}
}

ACTOR LeafFX
{
  +NOBLOCKMAP
  +NOGRAVITY
  +NOTELEPORT
  +CANNOTPUSH
  +CLIENTSIDEONLY +DONTBLAST
  +NOINTERACTION
  scale 1.1
  States
  {
  Spawn:
    SMOK A 0 
	TNT1 A 1 A_Jump(256,"LEF1A0","LEF2A0","LEF3A0")
	Loop
  LEF1A0:
    LEF1 ABCDEFGHIABCDEFGHI 2
  FadeLoopA:
    LEF1 ABCDEFGHI 1 A_FadeOut
	Loop
  LEF2A0:
    LEF2 ABCDEFGHIABCDEFGHIABCDEFGHI 2
  FadeLoopB:
    LEF2 ABCDEFGHI 1 A_FadeOut
	Loop
  LEF3A0:
    LEF3 ABCDE 2
  FadeLoopB:
    LEF3 ABCDE 1 A_FadeOut
	Loop
  }
}

//Undead Knight

Actor NewKnight : Knight Replaces Knight
{
	+NOBLOOD
	Meleerange 72
	PainChance "Convert", 255
	//DropItem "NewMana1", 84, 15
	DropItem "ReagentGreen", 64
	DropItem "Money" 64
	DropItem "Money" 64
	DropItem "Money" 64
	DropItem "Money" 64
	DropItem "Money1" 64
	DropItem "Money1" 8
	DropItem "Money2" 4
	DropItem "Money3" 2
	DropItem "ChestKey" 2
	/*+NODAMAGETHRUST*/
	Tag "Undead Knight"
	+USEKILLSCRIPTS
	Damagetype "Physical"
	Speed 15
	AttackSound "none"
	Mass 500
	DamageFactor "Holy", 1.5
	DamageFactor "HolyPlayer", 1.5
	DamageFactor "HolyTime", 1.5
	DamageFactor "PoisonTime", 0
	DamageFactor "Bleed", 0
	States
	{
	Spawn:
		KNIG A 0
		KNIG A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,86,0)
	Idle:
		KNIG AB 10 A_Look
		Loop
	Pain.Morale:
		TNT1 A 0 A_Changeflag("Frightened", 1)
		Goto Pain
	Pain.Convert:
		TNT1 A 0 A_JumpIfInTargetInventory("Visions",Random(0,7),"ConvertMe")
		goto Pain
	ConvertMe:
		TNT1 A 0 ACS_ExecuteAlways(WOC_VISIONSSCRIPT,0,0,0,0)
		goto See
	See:
		KNIG A 3 A_Chase
		KNIG B 4 A_Chase
		KNIG C 3 A_Chase
		KNIG D 4 A_Chase
		Loop
	Melee:
	Missile:
		KNIG E 6 A_FaceTarget
		KNIG F 2 A_FaceTarget
		KNIG F 4 A_PlayWeaponSound("hknight/swing")
		KNIG F 0 A_Jump(41, "RedAxe")
		KNIG G 6 A_CustomComboAttack("KnightAxe", 32, ACS_NamedExecuteWithResult("WOC Monster Damage Scale",ACTIVATOR,FRandom(15,30)), "hknight/melee", "Physical")
		KNIG FE 3 A_FaceTarget
		KNIG F 2 A_FaceTarget
		KNIG F 4 A_PlayWeaponSound("hknight/swing")
		KNIG F 0 A_Jump(41, "RedAxe2")
		KNIG G 6 A_CustomComboAttack("KnightAxe", 32, ACS_NamedExecuteWithResult("WOC Monster Damage Scale",ACTIVATOR,FRandom(15,30)), "hknight/melee", "Physical")
		Goto See
	Pain:
		KNIG H 3
		KNIG H 3 A_Pain
		Goto See
	RedAxe:
		KNIG G 6 A_CustomComboAttack("RedAxe", 32, ACS_NamedExecuteWithResult("WOC Monster Damage Scale",ACTIVATOR,FRandom(15,30)), "hknight/melee", "Physical")
		Goto Missile+5
	RedAxe2:
		KNIG G 6 A_CustomComboAttack("RedAxe", 32, ACS_NamedExecuteWithResult("WOC Monster Damage Scale",ACTIVATOR,FRandom(15,30)), "hknight/melee", "Physical")
		Goto See
	Raise:
		KNIG O 0 ACS_NamedExecuteAlways("WOC Monster Init",0,86,0)
		KNIG ONMLKJI 6
		Goto See
	}
}

ACTOR NewKnightGhost : NewKnight replaces KnightGhost 65
{
	Game Heretic
	SpawnID 129
	+SHADOW
	+GHOST
	+NOICEDEATH
	-SOLID
	-WINDTHRUST
	Translation "209:224=145:160"
	RenderStyle Translucent
	Alpha 0.4
	Tag "Undead Knight Ghost"
	Damagetype "Shadow"
	DeathSound "SpiritDie"
	DamageFactor "Arcane", 1.5
	DamageFactor "ArcanePlayer", 1.5
	DamageFactor "ArcaneTime", 1.5
	DamageFactor "Holy", 1.0
	DamageFactor "HolyPlayer", 1.0
	DamageFactor "HolyTime", 1.0
	States
	{
	Melee:
	Missile:
		KNIG E 6 A_FaceTarget
		KNIG F 2 A_FaceTarget
		KNIG F 4 A_PlayWeaponSound("hknight/swing")
		KNIG G 6 A_CustomComboAttack("RedAxe", 32, ACS_NamedExecuteWithResult("WOC Monster Damage Scale",ACTIVATOR,FRandom(15,30)), "hknight/melee", "Shadow")
		KNIG FE 3 A_FaceTarget
		KNIG F 2 A_FaceTarget
		KNIG F 4 A_PlayWeaponSound("hknight/swing")
		KNIG G 6 A_CustomComboAttack("RedAxe", 32, ACS_NamedExecuteWithResult("WOC Monster Damage Scale",ACTIVATOR,FRandom(15,30)), "hknight/melee", "Shadow")
		Goto See
	Death:
		KNIG H 0 A_SpawnItemEx("EtherealWisp",0,0,0,0,0,0,0,128)
		TNT1 A 10 A_ScreamAndUnblock
		Stop
	}
}

Actor NewKnightAxe : KnightAxe replaces KnightAxe
{
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(2,16)))
	/*+NODAMAGETHRUST*/
	Damagetype "Physical"
	Speed 16
	FastSpeed 25
}

Actor NewRedAxe : RedAxe replaces RedAxe
{
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(2,16))) //(ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(21,41)))
	/*+NODAMAGETHRUST*/
	Damagetype "Physical"
	Speed 16
	FastSpeed 25
	+HITTRACER
	States
	{
	Death:
		RAXE C 0 Bright ACS_NamedExecuteWithResult("WOC DAMAGE OVER TIME", ACS_ExecuteWithResult(WOC_DECORATE,STATS,WOCTID,WOCTRACER), ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(15,30)), 5, PHYSICALDOT)
		RAXE CDE 6 Bright
		Stop
	}
}


//Maulotaur
ACTOR NewMinotaurHeretic : Minotaur replaces Minotaur
{
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",ACTIVATOR,FRandom(35,55)))
	DamageFactor "DeathBlow", 0
	Damagefactor "PoisonCloud", 0.25
	health 6000
	+NOPAIN
	meleerange 164
	mass 1000
	-NORADIUSDMG
	+DONTHURTSPECIES
	/*+NODAMAGETHRUST*/
	+LOOKALLAROUND
	DropItem "NewArtiSuperHealth", 51
	//DropItem "NewMana2", 84, 45
	DropItem "AccessoryRandomSpawner" 16
	Obituary "%o was burnt to a crisp by the Maulotaur."
	HitObituary "%o was crushed by the Maulotaur."
	Tag "Maulotaur"
	+USEKILLSCRIPTS
	Damagetype "Physical"
	AttackSound ""
	Speed 20
	DamageFactor "Fire", 0.75
	DamageFactor "FirePlayer", 0.75
	DamageFactor "FireTime", 0.75
	states
	{
	Spawn:
		MNTR A 0
		MNTR A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,110,WOC_STATUSIMMUNE|WOC_MAXLEVEL)//increase health on higher difficulties//A_JumpIf(ACS_ExecuteWithResult(536,0,0,0)==1,"Mutate")
	Idle:
		MNTR AB 10 A_Look
		Loop
	Melee:
		MNTR U 0 A_UnSetInvulnerable
		MNTR U 0 A_TakeInventory("Hammercheck", 1)
		MNTR V 8 A_FaceTarget
		MNTR W 4 A_FaceTarget
		MNTR W 4 A_PlayWeaponSound("minotaur/swing")
		MNTR X 10 A_CustomMeleeAttack (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",ACTIVATOR,FRandom(35,55)), "minotaur/melee", "", "Physical")
		Goto See
	Missile:
		MNTR U 0 A_UnSetInvulnerable
		MNTR V 0 A_Jump(51, 2)
		MNTR V 0 A_JumpIfCloser(800, "Hammer")
		MNTR V 0 A_TakeInventory("Hammercheck", 1)
		MNTR V 0 A_Jump(104, 2)
		MNTR V 0 A_JumpIfCloser(2000, "Charge")
		MNTR V 8
		MNTR V 0 A_PlayWeaponSound("minotaur/swing")
		MNTR Y 4 A_FaceTarget
		MNTR Z 0 A_CustomMissile("HMinotaurFX1", 40, 0, 0)
		MNTR Z 0 A_CustomMissile("HMinotaurFX1", 40, 0, 2.8125)
		MNTR Z 0 A_CustomMissile("HMinotaurFX1", 40, 0, -2.8125)
		MNTR Z 0 A_CustomMissile("HMinotaurFX1", 40, 0, 5.625)
		MNTR Z 0 A_CustomMissile("HMinotaurFX1", 40, 0, -5.625)
		MNTR Z 9
	Goto See
	Hammer:
		MNTR U 0 A_UnSetInvulnerable
		MNTR V 0 A_JumpIfInventory("Hammercheck", 1, "Missile")
		MNTR V 8 A_FaceTarget
		MNTR W 4 A_FaceTarget
		MNTR W 4 A_PlayWeaponSound("minotaur/swing")
		MNTR W 0 A_PlaySound("minotaur/attack3", CHAN_VOICE)
		MNTR X 0 A_PlaySound("minotaur/attack1", CHAN_WEAPON)
		MNTR X 10 A_CustomMissile("HMinotaurFX2", 0, 0, 0)
		MNTR V 0 A_Jump(192, "HammerLoop")
		Goto See
	HammerLoop:
		MNTR X 10 A_GiveInventory("Hammercheck", 1)
		Goto Hammer
	Charge:
		MNTR U 0 A_SetInvulnerable
		MNTR U 0 A_FaceTarget
		MNTR U 0 A_SkullAttack(25)
		MNTR U 0 A_SpawnItemEx("MinoPuff",0,0,0,0,0,2)
		MNTR U 2
		MNTR U 0 A_JumpIf(z - floorz >= 15, "ChargeStop")
		goto Charge+3
	ChargeStop:
		SPOS A 0 A_Stop
		goto See
	See:
		MNTR A 0 A_UnSetInvulnerable
		MNTR ABCD 4 A_Chase
		Loop
	Death:
		MNTR F 0 A_SpawnItem("BOSSGIBBER")
		MNTR F 1 A_SpawnItemEx("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
		MNTR F 1 A_SpawnItemEx("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
		MNTR F 1 A_SpawnItemEx("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
		MNTR F 1 A_SpawnItemEx("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
		MNTR F 1 A_SpawnItemEx("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
		MNTR F 1 A_SpawnItemEx("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
		MNTR F 1 A_SpawnItemEx("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
		MNTR F 1 A_SpawnItemEx("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
		MNTR F 1 A_SpawnItemEx("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
		MNTR G 5
		MNTR H 6 A_Scream
		MNTR I 5
		MNTR J 6
		MNTR K 5
		MNTR L 6
		MNTR M 0 A_SpawnItem("BOSSGIBBER")
		MNTR M 5 A_NoBlocking
		MNTR N 6
		MNTR O 5
		MNTR P 6
		MNTR Q 5
		MNTR R 6
		MNTR S 5
		MNTR T -1 A_BossDeath
		Stop
	}
}

Actor HMinotaurFX1 : MinotaurFX1
{
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(3,24)))
	/*+NODAMAGETHRUST*/
}

Actor HMinotaurFX2 : MinotaurFX2
{
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(8,28)))
	/*+NODAMAGETHRUST*/
	Speed 15
	States
	{
	Spawn:
		FX13 A 2 Bright A_SpawnItemEx("HMinotaurFX3",random(-2,2),random(-2,2),0)
		Loop
	Death:
		FX13 I 4 Bright A_Explode(ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,128), 128, 0)
		FX13 JKLM 4 Bright
		Stop
	}
}

Actor HMinotaurFX3 : MinotaurFX3
{
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(8,28)))
	/*+NODAMAGETHRUST*/
	States
	{
	Death:
		FX13 I 4 Bright A_Explode(ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,128), 128, 0)
		FX13 JKLM 4 Bright
		Stop
	}
}

//Golems

Actor NewMummy : Mummy replaces Mummy
{
	Meleerange 52
	PainChance "Convert", 255
	DropItem "ReagentRed", 64
	//DropItem "NewMana1", 84, 5
	/*+NODAMAGETHRUST*/
	Tag "Golem"
	+USEKILLSCRIPTS
	Damagetype "Physical"
	Health 100
	Speed 15
	Mass 100
	States
	{
	Spawn:
		MUMM A 0
		MUMM A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,65,0)//increase health on higher difficulties
	Idle:
		MUMM AB 10 A_Look
		Loop
	Pain.Morale:
		TNT1 A 0 A_Changeflag("Frightened", 1)
		Goto Pain
	Pain.Convert:
		TNT1 A 0 A_JumpIfInTargetInventory("Visions",Random(0,4),"ConvertMe")
		goto Pain
	ConvertMe:
		TNT1 A 0 ACS_ExecuteAlways(WOC_VISIONSSCRIPT,0,0,0,0)
		goto See
	See:
		MUMM A 3 A_Chase
		MUMM B 4 A_Chase
		MUMM C 3 A_Chase
		MUMM D 4 A_Chase
		Loop
	Melee:
		MUMM E 5 A_FaceTarget
		MUMM F 6 A_CustomMeleeAttack(ACS_NamedExecuteWithResult("WOC Monster Damage Scale",ACTIVATOR,FRandom(8,9)), "mummy/attack2", "", "Physical")
		MUMM G 4
		Goto See
	Pain:
		MUMM H 3
		MUMM H 3 A_Pain
		Goto See
	Death:
		MUMM I 1 A_SpawnItemEx("GIB1", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		MUMM I 1 A_SpawnItemEx("GIB2", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		MUMM I 1 A_SpawnItemEx("GIB3", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		MUMM I 1 A_SpawnItemEx("GIB4", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		MUMM I 1 A_SpawnItemEx("GIB5", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		MUMM J 1 A_Scream
		MUMM JJ 1 A_SpawnItemEx("GIB2", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		MUMM J 1 A_SpawnItemEx("GIB1", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		MUMM J 1 A_SpawnItemEx("GIB3", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		MUMM K 0 A_SpawnItemEx("MummySoul", 0,0,10, 0,0,1, random(0,360), 128)
		MUMM K 1 A_SpawnItemEx("GIB4", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		MUMM K 1 A_SpawnItemEx("GIB5", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		MUMM K 3 A_SpawnItemEx("GIB2", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		MUMM L 5
		MUMM M 5 A_NoBlocking
		MUMM NO 5
		MUMM P -1
		Stop
	Raise:
		MUMM A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,65,0)
		MUMM ONMLKJI 6
		Goto See
	}
}

ACTOR NewMummyGhost : NewMummy replaces MummyGhost 69
{
	Game Heretic
	SpawnID 8
	+SHADOW
	+GHOST
	+NOBLOOD
	+NOICEDEATH
	-SOLID
	-WINDTHRUST
	DeathSound "SpiritDie"
	RenderStyle Translucent
	Alpha 0.4
	Tag "Golem Ghost"
	Damagetype "Shadow"
	HitObituary "$OB_MUMMY"
	DamageFactor "Arcane", 1.5
	DamageFactor "ArcanePlayer", 1.5
	DamageFactor "ArcaneTime", 1.5
	DamageFactor "PoisonTime", 0
	DamageFactor "Bleed", 0
	States
	{
	Melee:
		MUMM E 5 A_FaceTarget
		MUMM F 6 A_CustomMeleeAttack(ACS_NamedExecuteWithResult("WOC Monster Damage Scale",ACTIVATOR,FRandom(8,9)), "mummy/attack2", "", "Shadow")
		MUMM G 4
		Goto See
	Death:
		MUMM H 0 A_SpawnItemEx("EtherealWisp",0,0,0,0,0,0,0,128)
		TNT1 A 10 A_ScreamAndUnblock
		Stop
	}
}

ACTOR NewMummyLeader : NewMummy replaces MummyLeader 45
{
	Game Heretic
	SpawnID 2
	PainChance 64
    Obituary "$OB_MUMMYLEADER"
    /*+NODAMAGETHRUST*/
	Health 100
    Tag "Nitrogolem"
    States
    {
	Spawn:
		MUMM A 0
		MUMM A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,65,0)
		Goto Idle
	Missile:
		MUMM X 5 A_FaceTarget
		MUMM Y 5 Bright A_FaceTarget
		MUMM X 5 A_FaceTarget
		MUMM Y 5 Bright A_FaceTarget
		MUMM X 5 A_FaceTarget
		MUMM Y 5 Bright A_CustomMissile("MummyFX1")
		Goto See
	Raise:
		MUMM A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,65,0)
		MUMM ONMLKJI 6
		Goto See
	}
}

Actor NewMummyFX1 : MummyFX1 replaces MummyFX1
{
    Radius 8
    Height 6
    Speed 14
	FastSpeed 20
	Scale 0.35
    Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(3,24)))
	/*+NODAMAGETHRUST*/
    PROJECTILE
    RenderStyle Add
    SeeSound "whiteballbsee"
    DeathSound "whiteballbdeth"
    Decal PlasmaScorchLower
	Damagetype "Fire"
    States
    {
    Spawn:
		GSMM AAABB 1 Bright A_CustomMissile("GSLM2Trail",0,0,0)
		GSMM B 0 Bright A_SeekerMissile(10, 20, SMF_PRECISE)
		GSMM BCCCD 1 Bright A_CustomMissile("GSLM2Trail",0,0,0)
		GSMM DDEEE 1 Bright A_CustomMissile("GSLM2Trail",0,0,0)
		GSMM E 0 Bright A_SeekerMissile(10, 20, SMF_PRECISE)
		GSMM FFF 1 Bright A_CustomMissile("GSLM2Trail",0,0,0)
		Goto Spawn+10
    Death:
		GSMM GGHHIIJJKKLLMM 2 Bright A_FadeOut(0.05)
		Stop
    }
}

ACTOR GSLM2Trail
{
    PROJECTILE
    +NOCLIP
	+CLIENTSIDEONLY +DONTBLAST
	+NOINTERACTION
    Damage 0
    RenderStyle Add
    Alpha 0.45
    Scale 0.9
    States
    {
    Spawn:
		//TNT1 A 2
		PUF6 CDFHJLNPRTVXZ 1 BRIGHT A_FadeOut(0.02)
		PUF7 B 1 BRIGHT
		Stop
    }
}

ACTOR NewMummyLeaderGhost : NewMummyLeader replaces MummyLeaderGhost 46
{
	Game Heretic
	SpawnID 9
	+SHADOW
	+GHOST
	+NOBLOOD
	+NOICEDEATH
	RenderStyle Translucent
	Alpha 0.4
	Tag "Nitrogolem Ghost"
	Damagetype "Shadow"
	Deathsound "SpiritDie"
	-SOLID
	-WINDTHRUST
	DamageFactor "Arcane", 1.5
	DamageFactor "ArcanePlayer", 1.5
	DamageFactor "ArcaneTime", 1.5
	DamageFactor "PoisonTime", 0
	DamageFactor "Bleed", 0
	States
	{
	Melee:
		MUMM E 5 A_FaceTarget
		MUMM F 6 A_CustomMeleeAttack(ACS_NamedExecuteWithResult("WOC Monster Damage Scale",ACTIVATOR,FRandom(8,9)), "mummy/attack2", "", "Shadow")
		MUMM G 4
		Goto See
	Death:
		MUMM H 0 A_SpawnItemEx("EtherealWisp",0,0,0,0,0,0,0,128)
		TNT1 A 10 A_ScreamAndUnblock
		Stop
	}
}

//Ophidian

Actor NewSnake : Snake replaces Snake
{
	//DropItem "NewMana2", 84, 30
	DropItem "ArtiAquaFlask", 8
	DropItem "AccessoryRandomSpawner" 4
	PainChance "Convert", 255
	/*+NODAMAGETHRUST*/
	Tag "Ophidian"
	+USEKILLSCRIPTS
	+AVOIDMELEE
	Speed 12
	Health 400
	Mass 400
	States
	{
	Spawn:
		SNKE A 0
		SNKE A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,70,0)
	Idle:
		SNKE AB 10 A_Look
		Loop
	Pain.Morale:
		TNT1 A 0 A_Changeflag("Frightened", 1)
		Goto Pain
	Pain.Convert:
		TNT1 A 0 A_JumpIfInTargetInventory("Visions",Random(0,8),"ConvertMe")
		goto Pain
	ConvertMe:
		TNT1 A 0 ACS_ExecuteAlways(WOC_VISIONSSCRIPT,0,0,0,0)
		goto See	   
	Death:
		SNKE G 5 A_SpawnItem("GIBBER")
		SNKE H 5 A_Scream
		SNKE IJKL 5
		SNKE M 5 A_NoBlocking
		SNKE NO 5
		SNKE P -1
		Stop
	Raise:
		SNKE A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,70,0)
		SNKE ONMLKJIHG 5
		Goto See
	}
}

Actor NewSnakeProjA : SnakeProjA replaces SnakeProjA
{
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(1,8)))
	DamageType "Ice"
	/*+NODAMAGETHRUST*/
	+THRUGHOST
	+WINDTHRUST
	Renderstyle Add
	SeeSound "snake/iceshot"
	DeathSound "snake/icehit"
	Speed 30
	FastSpeed 35
	States
	{
	Spawn:
		SHRD AA 1 Bright A_SpawnItemEx("FrostMissileFog", 0, 0, 1, 4, 0, FRandom(-0.5, 0.5), FRandom(-10, 10), 128)
		SHRD AAA 1 Bright A_SpawnItemEx("FrostMissileFog", 0, 0, 1, 4, 0, FRandom(-0.5, 0.5), FRandom(-10, 10), 128)
		SHRD BBB 1 Bright A_SpawnItemEx("FrostMissileFog", 0, 0, 1, 4, 0, FRandom(-0.5, 0.5), FRandom(-10, 10), 128)
		SHRD CCC 1 Bright A_SpawnItemEx("FrostMissileFog", 0, 0, 1, 4, 0, FRandom(-0.5, 0.5), FRandom(-10, 10), 128)
		Loop
	Death:
		SHEX ABCDE 5 Bright
		Stop
	}
}

Actor NewSnakeProjB : SnakeProjB replaces SnakeProjB
{
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(3,24)))
	/*+NODAMAGETHRUST*/
	Seesound "snake/fireshot"
	DeathSound "snake/firehit"
	Decal BaronScorch
	Speed 30
	FastSpeed 35
	States
	{
	Spawn: 
		BRB2 A 1 BRIGHT A_CustomMissile("FireDemonTrail1",0,0,Random(-200,200),50,Random(-200,200))
		BRB2 A 1 BRIGHT A_CustomMissile("FireDemonTrail2",0,0,0,0)
		BRB2 A 1 BRIGHT A_CustomMissile("FireDemonTrail1",0,0,Random(-200,200),50,Random(-200,200))
		BRB2 A 1 BRIGHT A_CustomMissile("FireDemonTrail2",0,0,0,0)
		BRB2 A 1 BRIGHT A_CustomMissile("FireDemonTrail1",0,0,Random(-200,200),50,Random(-200,200))
		BRB2 A 1 BRIGHT A_CustomMissile("FireDemonTrail2",0,0,0,0)
		BRB2 B 1 BRIGHT A_CustomMissile("FireDemonTrail1",0,0,Random(-200,200),50,Random(-200,200))
		BRB2 B 1 BRIGHT A_CustomMissile("FireDemonTrail2",0,0,0,0)
		BRB2 B 1 BRIGHT A_CustomMissile("FireDemonTrail1",0,0,Random(-200,200),50,Random(-200,200))
		BRB2 B 1 BRIGHT A_CustomMissile("FireDemonTrail2",0,0,0,0)
		BRB2 B 1 BRIGHT A_CustomMissile("FireDemonTrail1",0,0,Random(-200,200),50,Random(-200,200))
		BRB2 B 1 BRIGHT A_CustomMissile("FireDemonTrail2",0,0,0,0)
		Loop
	Death:
		BRB2 CDEFGHI 3 Bright
		Stop
	}
}

Actor NewSorcerer1 : Sorcerer1 replaces Sorcerer1
{
	Health 20000
	+NOPAIN
	-NORADIUSDMG
	Damagefactor "DeathBlow", 0
	Damagefactor "PoisonCloud", 0.25
	DamageFactor "Ice", 1.25
	DamageFactor "IcePlayer", 1.25
	DamageFactor "IceTime", 1.25
	DamageFactor "Fire", 0.75
	DamageFactor "FirePlayer", 0.75
	DamageFactor "FireTime", 0.75
	/*+NODAMAGETHRUST*/
	+LOOKALLAROUND
	Tag "D'Sparil's Serpent"
	+USEKILLSCRIPTS
	Damagetype "Physical"
	Mass 1000
	States
	{
	Spawn:
		SRCR A 0
		SRCR A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,130,WOC_BOSS)
	Idle:
		SRCR AB 10 A_Look
		Loop
	See:
		SRCR A 4 A_Chase
		SRCR B 3 A_Chase
		SRCR C 4 A_Chase
		SRCR D 3 A_Chase
		Loop
	Missile:
	    SRCR Q 0 A_JumpIfHealthLower(2*acs_executewithresult(553,0,0,0)/3, "Missile2")
		SRCR Q 5 A_FaceTarget
		SRCR R 6 A_FaceTarget
		SRCR S 5 A_CustomMissile("SorcererFX1", 70, 0)
		Goto See
	Missile2:
		SRCR S 5 A_FaceTarget
		SRCR Q 5 A_FaceTarget
		SRCR R 6 A_FaceTarget
		SRCR S 0 A_CustomMissile("SorcererFX1", 70, 0, -3)
		SRCR S 0 A_CustomMissile("SorcererFX1", 70, 0, 3)
		SRCR S 5 A_CustomMissile("SorcererFX1", 70, 0)
		Goto See
	Death:
		SRCR E 7
		SRCR E 0 A_SpawnItem("GIBBER")
		SRCR F 7 A_Scream
		SRCR G 7
		SRCR HIJK 6
		SRCR L 25 A_PlaySoundEx("dsparil/zap", "body")
		SRCR MN 5
		SRCR O 4
		SRCR L 20 A_PlaySoundEx("dsparil/zap", "body")
		SRCR MN 5
		SRCR O 4
		SRCR L 12
		SRCR P -1 A_SorcererRise
	}
}

Actor NewSorcerer2 : Sorcerer2 replaces Sorcerer2
{
	Health 35000
	-NORADIUSDMG
	+NOPAIN
	Damagefactor "DeathBlow", 0
	Damagefactor "PoisonCloud", 0.25
	DropItem "AccessoryRandomSpawner" 32
	/*+NODAMAGETHRUST*/
	+DONTHURTSPECIES
	+LOOKALLAROUND
	Tag "D'Sparil"
	+USEKILLSCRIPTS
	+AVOIDMELEE
	Species "Dsparil"
	Speed 16
	Bloodtype "EtherealBloodBlue"
	var int user_timer;
	Mass 600
	DamageFactor "Arcane", 0.75
	DamageFactor "ArcanePlayer", 0.75
	DamageFactor "ArcaneTime", 0.75
	DamageFactor "Lightning", 0.75
	DamageFactor "LightningPlayer", 0.75
	DamageFactor "LightningTime", 0.75
	DamageFactor "Physical", 1.25
	DamageFactor "PhysicalPlayer", 1.25
	DamageFactor "Bleed", 1.25
	DamageFactor "Poison", 1.25
	DamageFactor "PoisonPlayer", 1.25
	DamageFactor "PoisonTime", 1.25
	States
	{
	Spawn:
		SOR2 A 0
		SOR2 A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,75,WOC_BOSS)
	Idle:
		SOR2 AB 10 A_Look
		Loop
	Rise:
		SOR2 A 0
		SOR2 A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,70,WOC_BOSS)
		SOR2 AB 4
		SOR2 C 4 A_PlaySound("dsparil/rise", CHAN_BODY, 1, FALSE, ATTN_NONE)
		SOR2 DEF 4
		SOR2 G 12 A_PlaySound("dsparil/sight", CHAN_BODY, 1, FALSE, ATTN_NONE)
		Goto See
	See:
		SOR2 M 4 A_Chase
		SOR2 N 3 A_Chase
		SOR2 O 4 A_Chase
		SOR2 P 3 A_Chase
		Loop
	Missile:
		SOR2 R 0 A_Srcr2Decide
	CastSpell:
		SOR2 T 0 A_JumpIfHealthLower(ACS_ExecuteWithResult(WOC_DECORATE,STATS,MAXHEALTH)/2,"SpellDecide")
		SOR2 R 0 A_Jump(48, "Summon")
	Lightning:
		TNT1 A 0 A_Jump(64, "LightningColumns")
		TNT1 A 0 A_Jump(96, "GroundSeekers")
		TNT1 A 0 A_Jump(64, "Filibuster")
		TNT1 A 0 A_Jump(128, "LightningStream")
		TNT1 A 0 A_Jump(128, "LightningBall")
		SOR2 R 6 A_FaceTarget
		SOR2 S 6 A_FaceTarget
		SOR2 T 0 A_PlaySound("dsparil/attack")
		SOR2 T 15 A_CustomMissile("NewSorcerer2FX1",50)
		Goto See
	LightningBall:
		SOR2 R 5
		SOR2 S 5 A_FaceTarget
		SOR2 T 5 BRIGHT A_CustomMissile("LightningBallL",32,0,0,2,0)
		SOR2 T 5
		Goto See
	//attack 2; lightning streams
	LightningStream:
		SOR2 RS 5 A_FaceTarget
		SOR2 T 5 A_FaceTarget
		SOR2 T 1 BRIGHT A_CustomMissile("MiniLightningPuff",55,40,0,0) 
		SOR2 T 1 BRIGHT A_CustomMissile("MiniLightningPuff",55,-45,0,0) 
		SOR2 T 1 BRIGHT A_CustomMissile("MiniLightningPuff",55,40,0,0) 
		SOR2 T 1 BRIGHT A_CustomMissile("MiniLightningPuff",55,-45,0,0) 
		SOR2 T 1 BRIGHT A_CustomMissile("MiniLightningPuff",55,40,0,0) 
		SOR2 T 1 BRIGHT A_CustomMissile("MiniLightningPuff",55,-45,0,0) 
		SOR2 T 1 BRIGHT A_CustomMissile("MiniLightningPuff",55,40,0,0) 
		SOR2 T 1 BRIGHT A_CustomMissile("MiniLightningPuff",55,-45,0,0) 
		SOR2 T 1 BRIGHT A_CustomMissile("MiniLightningPuff",55,40,0,0) 
		SOR2 T 1 BRIGHT A_CustomMissile("MiniLightningPuff",55,-45,0,0) 
		SOR2 T 1 BRIGHT A_CustomMissile("MiniLightningPuff",55,40,0,0) 
		SOR2 T 1 BRIGHT A_CustomMissile("MiniLightningPuff",55,-45,0,0)  
		TNT1 A 0 A_SetUserVar("user_timer", user_timer+1)
		TNT1 A 0 A_JumpIf(user_timer >= 9, "EndStream")
		Goto LightningStream+2
	EndStream:
		TNT1 A 0 A_SetUserVar("user_timer", 0)
		SOR2 T 5
		Goto See
	//attack 3, stationary/invulnerable mode
	Filibuster:
		SOR2 ZY 5 A_FaceTarget
		SOR2 Z 8 BRIGHT A_FaceTarget
		SOR2 Z 0 A_CustomMissile("GroundLightning",0,0,45,0,0)
		SOR2 Z 0 A_CustomMissile("GroundLightning",0,0,135,0,0)
		SOR2 Z 0 A_CustomMissile("GroundLightning",0,0,225,0,0)
		SOR2 Z 0 A_CustomMissile("GroundLightning",0,0,315,0,0)
		SOR2 Z 0 A_CustomMissile("GroundLightning",0,0,0,0,0)
		SOR2 Z 0 A_CustomMissile("GroundLightning",0,0,90,0,0)
		SOR2 Z 0 A_CustomMissile("GroundLightning",0,0,160,0,0)
		SOR2 Z 0 A_CustomMissile("GroundLightning",0,0,270,0,0)
		Goto FilibusterLoop
	FilibusterLoop:    
		SOR2 Z 35 A_Stop
		SOR2 RS 3 A_FaceTarget
		SOR2 T 8 BRIGHT A_CustomMissile("LightningRod1",55,45,0,0,0)
		SOR2 T 0 BRIGHT A_CustomMissile("LightningRod1",55,-45,0,0,0)
		SOR2 T 2 BRIGHT A_CustomMissile("LightningBallS",55,45,0,0,0)
		SOR2 T 0 BRIGHT A_CustomMissile("LightningBallS",55,-45,0,0,0)
		SOR2 T 2 BRIGHT A_CustomMissile("LightningBallS",55,45,0,0,0)
		SOR2 T 0 BRIGHT A_CustomMissile("LightningBallS",55,-45,0,0,0)
		TNT1 A 0 A_SetUserVar("user_timer", user_timer+1)
		TNT1 A 0 A_JumpIf(user_timer >= 3, "EndStream")
		SOR2 SR 3
		Goto FilibusterLoop
	FilibusterEnd:
		TNT1 A 0 A_SetUserVar("user_timer", 0)
		SOR2 SR 3
		SOR2 YZM 10
		Goto See
	//attack 4, floor-hugging seekers
	GroundSeekers:
		SOR2 ZY 5 A_FaceTarget
		SOR2 Z 8 BRIGHT A_FaceTarget
		SOR2 Z 0 BRIGHT A_CustomMissile("GroundLightningTracer",0,random(-20,20),random(-45,45),0,0)
		SOR2 Z 0 BRIGHT A_CustomMissile("GroundLightningTracer",0,random(-20,20),random(-45,45),0,0)
		SOR2 Z 0 BRIGHT A_CustomMissile("GroundLightningTracer",0,random(-20,20),random(-45,45),0,0)
		SOR2 Z 8 Bright A_FaceTarget
		Goto See
	//attack 5, lightning columns
	LightningColumns:
		SOR2 RS 5 A_FaceTarget
		TNT1 A 0 A_CustomMissile("LightningRod3", 0, 0, 0, CMF_AIMOFFSET)
		TNT1 A 0 A_CustomMissile("LightningRod3", 0, 45, random(-25, -15), CMF_AIMOFFSET)
		TNT1 A 0 A_CustomMissile("LightningRod3", 0, -45, random(15, 25), CMF_AIMOFFSET)
		SOR2 T 5 Bright A_FaceTarget
		SOR2 T 5
		Goto See
	SpellDecide:
		SOR2 R 0 A_Jump(96, "Summon")
		Goto Lightning
	Summon:
		SOR2 RS 6 A_FaceTarget
		SOR2 T 0 A_PlaySound("dsparil/attack")
		SOR2 T 0 A_CustomMissile("Sorcerer2FX2", 50, 0, -40, 2)
		SOR2 T 15 A_CustomMissile("Sorcerer2FX2", 50, 0, 40, 2)
		Goto See
	Teleport:
		SOR2 LKJIHG 6
		Goto See
	Death:
		SDTH A 8 Bright A_Sor2DthInit
		SDTH B 8 Bright
		SDTH C 8 Bright A_PlaySoundEx("dsparil/scream", "Body")
		SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH D 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH E 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
        SDTH F 2 Bright A_SpawnItemEx("KaZap", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
		SDTH G 6 A_PlaySoundEx("dsparil/explode", "Body")
		SDTH AAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("KaZap", 0, 0, 48, (0.1)*Random(100, 400), 0, (0.1)*Random(-400, 400), Random(0, 720), 128)
		SDTH AAAAAAAAA 0 A_SpawnItemEx("KaZap", 0, 0, 48, (0.1)*Random(100, 400), 0, (0.1)*Random(-400, 400), Random(0, 720), 128)
		SDTH H 6
		SDTH I 18
		SDTH J 6 A_NoBlocking
		SDTH K 6 A_PlaySoundEx("dsparil/bones", "Body")
		SDTH LMN 6
		SDTH O -1 A_BossDeath
		Stop
	}
}

//decorative particle shared by a few actors
ACTOR LightningBallC1T
{
    RENDERSTYLE ADD
    //Alpha 0.4
    PROJECTILE
    +NOINTERACTION
	+NOCLIP
	+CLIENTSIDEONLY
    states
    {
    Spawn:
        TFFP GHIJKLMNOPQR 1 BRIGHT
        Stop
    }
}

//limited-range projectile spawned by his "filibuster" attack mode
//has no collision; primary purpose is to continuously spawn damaging particles
ACTOR GroundLightning
{
  Radius 4
  Height 6
  Speed 20
  //Damage 6
  RENDERSTYLE Add
  //Alpha 0.40
  ReactionTime 20//53
  SEESOUND "dsparil/attackr1"
  PROJECTILE
  +FloorHugger
  +Noclip
  +Ripper
  states
  {
  Spawn:
    ICWS ABCDEFGHI 1 BRIGHT A_SpawnItemEx("GroundTrail",0,0,0,0,0,0,0,128)
    ICWS A 0 BRIGHT
    ICWS A 0 BRIGHT A_Stop
	Goto ProjectileLoop
  ProjectileLoop:
    ICWS ABCDEFGHI 1 BRIGHT A_CustomMissile("GroundSmoke",0,10,random(0,360),6,random(80,100))
    ICWS A 0 BRIGHT A_CustomMissile("GroundSmoke",0,0,0,6,360)
	TNT1 A 0 A_CountDown
	Loop
  Death:
    ICWS ABCDEFGHI 1 BRIGHT A_CustomMissile("GroundSmoke",0,10,random(0,360),6,random(80,100))
    ICWS A 0 BRIGHT
    Stop
  }
}

//trail spawned by the GroundLightning actor; harmless
ACTOR GroundTrail
{
  Radius 2
  Height 3
  RENDERSTYLE Add
  //Alpha 0.20
  ReactionTime 20//49
  PROJECTILE
  +FloorHugger
  states
  {
  Spawn:
    ICWS JKLMNOPQR 1 BRIGHT
    ICWS A 0 BRIGHT
	TNT1 A 0 A_CountDown
	Loop
  Death:
    ICWS JKLMNOPQR 1 BRIGHT
    Stop
  }
}

//actor spawned by the GroundLightning projectile; deals damage, and occasionally (25%) spawns additional particles
ACTOR GroundSmoke
{
  Radius 12
  Height 12
  Speed 15
  Damage 0
  RENDERSTYLE Add
  //Alpha 0.30
  SEESOUND "dsparil/smoke"
  PROJECTILE
  +RIPPER
  +NODAMAGETHRUST
  +BLOODLESSIMPACT
  Damagetype "Lightning"
  states
  {
  Spawn:
    TFFP ABCDEFGHIJKLMNOPQR 1 BRIGHT A_Explode(ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,4), 12, 0)
    TFFP A 0 BRIGHT A_Jump(64,1)
    Stop
    TFFP A 1 BRIGHT A_CustomMissile("SmokeLightning",0,0,0,6,-250)
    TFFP A 1 BRIGHT A_CustomMissile("SmokeLightning",0,0,45,6,-250)
    TFFP A 1 BRIGHT A_CustomMissile("SmokeLightning",0,0,90,6,-250)
    TFFP A 1 BRIGHT A_CustomMissile("SmokeLightning",0,0,135,6,-250)
    TFFP A 1 BRIGHT A_CustomMissile("SmokeLightning",0,0,180,6,-250)
    TFFP A 1 BRIGHT A_CustomMissile("SmokeLightning",0,0,225,6,-250)
    TFFP A 1 BRIGHT A_CustomMissile("SmokeLightning",0,0,270,6,-250)
    TFFP A 1 BRIGHT A_CustomMissile("SmokeLightning",0,0,315,6,-250)
    Stop
  }
}

//particles periodically spawned by the GroundSmoke projectile generated by the GroundLightning projectile
ACTOR SmokeLightning
{
	Radius 16
	Height 16
	Speed 20
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(2,16)))
	RENDERSTYLE Add
	//Alpha 0.40
	Scale 0.75
	SEESOUND "dsparil/spawnl"
	DEATHSOUND "dsparil/hitl"
	ACTIVESOUND "dsparil/activel"
	PROJECTILE
	/*+NODAMAGETHRUST*/
	Damagetype "Lightning"
	states
	{
	Spawn:
		ZOT3 ABC 2 BRIGHT
		Loop
	Death:
		ZOT3 A 0 BRIGHT //A_Explode(50,150)
		Stop
	}
}

//small projectile
ACTOR LightningBallS
{
	Radius 16
	Height 16
	Speed 20
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(15,30)))
	RENDERSTYLE Add
	//Alpha 0.40
	Scale 0.75
	SEESOUND "dsparil/spawnl"
	DEATHSOUND "dsparil/hitl"
	ACTIVESOUND "dsparil/activel"
	PROJECTILE
	/*+NODAMAGETHRUST*/
	Damagetype "Lightning"
	Decal RevenantScorch
	states
	{
	Spawn:
		ZOT3 ABCE 2 BRIGHT A_SpawnItemEx("LightningBallC1T", 0, 0, 0, 0, 0, 0, 0, 128)
		Loop
	Death:
		ZAPS GHIJKL 2 BRIGHT
		Stop
	}
}

//faster small projectile
ACTOR LightningRod1
{
	Radius 24
	Height 24
	Speed 30
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(3,24)))
	RENDERSTYLE Add
	//Alpha 0.50
	Scale 0.75
	SEESOUND "dsparil/spawnl"
	DEATHSOUND "dsparil/hitl"
	ACTIVESOUND "dsparil/activel"
	MissileHeight 0
	PROJECTILE
	/*+NODAMAGETHRUST*/
	Decal RevenantScorch
	Damagetype "Lightning"
	states
	{
	Spawn:
		ZAP6 ABC 2 BRIGHT
		Loop
	Death:
		PUF4 ABCDEF 2 BRIGHT
		Stop
	}
}

//large projectile; spams smaller projectiles
ACTOR LightningBallL
{
	Radius 30
	Height 30
	Speed 12
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(80,100)))
	RENDERSTYLE Add
	//Alpha 0.75
	ReactionTime 6
	SEESOUND "dsparil/attackr3"
	DEATHSOUND "dsparil/hitl"
	ACTIVESOUND "dsparil/activel"
	Decal "Scorch"
	+SeekerMissile
	+DoomBounce
	/*+NODAMAGETHRUST*/
	PROJECTILE
	Damagetype "Lightning"
	states
	{
	Spawn:
		ZAP7 ABCDE 1 BRIGHT //A_SeekerMissile(20,20)
		ZAP7 ABCDE 1 BRIGHT //A_SeekerMissile(20,20)
		ZAP7 ABCDE 1 BRIGHT //A_SeekerMissile(20,20)
		ZAP7 ABCDE 1 BRIGHT //A_SeekerMissile(20,20)
		ZAP7 ABCDE 1 BRIGHT //A_SeekerMissile(20,20)
		ZAP7 ABCDE 1 BRIGHT //A_SeekerMissile(20,20)
		ZAP7 ABCDE 1 BRIGHT //A_SeekerMissile(20,20)
		ZAP7 ABCDE 1 BRIGHT //A_SeekerMissile(20,20)
		ZAP7 ABCDE 1 BRIGHT //A_SeekerMissile(20,20)
		ZAP7 ABCDE 1 BRIGHT //A_SeekerMissile(20,20)
		Goto ProjectileLoop
	ProjectileLoop:
		ZAP7 A 1 BRIGHT A_CustomMissile("LightningRod1",0,0,0,4,0)
		ZAP7 B 1 BRIGHT A_CustomMissile("LightningRod1",0,0,20,4,0)
		ZAP7 C 1 BRIGHT A_CustomMissile("LightningRod1",0,0,40,4,0)
		ZAP7 D 1 BRIGHT A_CustomMissile("LightningRod1",0,0,60,4,0)
		ZAP7 E 1 BRIGHT A_CustomMissile("LightningRod1",0,0,80,4,0)
		ZAP7 A 1 BRIGHT A_CustomMissile("LightningRod1",0,0,100,4,0)
		ZAP7 C 1 BRIGHT A_CustomMissile("LightningRod1",0,0,120,4,0)
		ZAP7 D 1 BRIGHT A_CustomMissile("LightningRod1",0,0,140,4,0)
		ZAP7 E 1 BRIGHT A_CustomMissile("LightningRod1",0,0,160,4,0)
		ZAP7 A 1 BRIGHT A_CustomMissile("LightningRod1",0,0,180,4,0)
		ZAP7 B 1 BRIGHT A_CustomMissile("LightningRod1",0,0,200,4,0)
		ZAP7 C 1 BRIGHT A_CustomMissile("LightningRod1",0,0,220,4,0)
		ZAP7 D 1 BRIGHT A_CustomMissile("LightningRod1",0,0,240,4,0)
		ZAP7 E 1 BRIGHT A_CustomMissile("LightningRod1",0,0,260,4,0)
		ZAP7 A 1 BRIGHT A_CustomMissile("LightningRod1",0,0,280,4,0)
		ZAP7 B 1 BRIGHT A_CustomMissile("LightningRod1",0,0,300,4,0)
		ZAP7 C 1 BRIGHT A_CustomMissile("LightningRod1",0,0,320,4,0)
		ZAP7 D 1 BRIGHT A_CustomMissile("LightningRod1",0,0,340,4,0)
		ZAP7 E 1 BRIGHT A_CustomMissile("LightningRod1",0,0,360,4,0)
		ZAP7 ABCDEABCDEABCDEABCDEABCDE 1 BRIGHT//reduces spamminess
		TNT1 A 0 A_CountDown
		Loop
	Death:
		ZAPL ABCDEFG 2 BRIGHT
		Stop
	}
}

//small projectile produced by his "stream" attacks
ACTOR MiniLightningPuff
{
    Radius 6
    Height 10
    Speed 14
    Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(1,8)))
    PROJECTILE
	/*+NODAMAGETHRUST*/
    RENDERSTYLE ADD
    //Alpha 0.67
    SEESOUND "dsparil/smoke"
    Decal PlasmaScorchLower
	Damagetype "Lightning"
    states
    {
    Spawn:
        TFFP ABCDEFGH 4 BRIGHT
    Death:
        TFFP IJKLMNOPQR 4 BRIGHT
        Stop
    }
}

//floor-hugging tracer projectile
ACTOR GroundLightningTracer
{
	Radius 4
	Height 6
	Speed 10
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(17,37)))
	RENDERSTYLE Add
	//Alpha 0.40
	ReactionTime 15//34
	SEESOUND "dsparil/attackr2"
	PROJECTILE
	+FloorHugger
	/*+NODAMAGETHRUST*/
	+SeekerMissile
	Damagetype "Lightning"
	states
	{
	Spawn:
		ICWS ABCDEFGHI 1 BRIGHT A_SpawnItemEx("TracerTrail",0,0,0,0,0,0,0,128)
		TNT1 A 0 A_Jump(128, 2)
		ICWS A 0 BRIGHT A_SeekerMissile(90,90)
		TNT1 A 0 A_CountDown
		Loop
	Death:
		ICWS ABCDEFGHI 5 BRIGHT A_Stop
		ICWS ABCDEFGHI 1 BRIGHT A_CustomMissile("GroundSmoke",0,10,random(0,360),6,random(80,100))
		ICWS ABCDEFGHI 1 BRIGHT A_CustomMissile("GroundSmoke",0,10,random(0,360),6,random(80,100))
		ICWS ABCDEFGHI 1 BRIGHT A_CustomMissile("GroundSmoke",0,10,random(0,360),6,random(80,100))
		ICWS ABCDEFGHI 1 BRIGHT A_CustomMissile("GroundSmoke",0,10,random(0,360),6,random(80,100))
		ICWS ABCDEFGHI 1 BRIGHT A_CustomMissile("GroundSmoke",0,10,random(0,360),6,random(80,100))
		ICWS ABCDEFGHI 1 BRIGHT A_CustomMissile("GroundSmoke",0,10,random(0,360),6,random(80,100))
		ICWS ABCDEFGHI 1 BRIGHT A_CustomMissile("GroundSmoke",0,10,random(0,360),6,random(80,100))
		ICWS ABCDEFGHI 1 BRIGHT A_CustomMissile("GroundSmoke",0,10,random(0,360),6,random(80,100))
		ICWS ABCDEFGHI 1 BRIGHT A_CustomMissile("GroundSmoke",0,10,random(0,360),6,random(80,100))
		ICWS ABCDEFGHI 1 BRIGHT A_CustomMissile("GroundSmoke",0,10,random(0,360),6,random(80,100))
		Stop
	}
}

//modified trail with shorter duration
ACTOR TracerTrail : GroundTrail
{
	ReactionTime 10
}

//this was originally unused; I used it in "LightningColumns"
ACTOR LightningRod3
{
	Radius 24
	Height 8
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(15,30)))
	Speed 20
	RENDERSTYLE Add
	//Alpha 0.40
	SEESOUND "dsparil/spawnl"
	DEATHSOUND "dsparil/hitl"
	ACTIVESOUND "dsparil/activel"
	PROJECTILE
	Decal Scorch
	/*+NODAMAGETHRUST*/
	+FLOORHUGGER
	Damagetype "Lightning"
	states
	{
	Spawn:
		ZOT1 ABCDE 2 BRIGHT
		ZOT1 A 0 BRIGHT A_SpawnItemEx("LightningBallC1T", 0, 0, 0, 0, 0, 0, 0, 128)
		Loop
	Death:
		FX18 ABCDEF 2 BRIGHT A_Explode(ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,60),50,0)
		Stop
	}
}

Actor NewSorcererFX1 : SorcererFX1 replaces SorcererFX1
{
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(35,55)))
	/*+NODAMAGETHRUST*/
	Damagetype "Fire"
	SeeSound "DemonMissileFire"
	DeathSound "DemonMissileExplode"
	States
	{
	Spawn:
		FX14 AABBCC 2 Bright A_spawnitemEx("Sorcerer1FX1Trail")
		Loop
	}
}

ACTOR Sorcerer1FX1Trail
{
    Radius 1
    Height 1
	Gravity 0
	Speed 1
	Scale 0.3
    +NOBLOCKMAP
    +NOTELEPORT
    +DONTSPLASH
	+MISSILE
	+CLIENTSIDEONLY +DONTBLAST
	+FORCEXYBILLBOARD
	Renderstyle Add
    States
    {
    Spawn:
        FX14 DEFGH 2 bright
        Stop
    }
}

ACTOR NewSorcerer2FX1 : Sorcerer2FX1 replaces Sorcerer2FX1
{
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(35,55)))
	/*+NODAMAGETHRUST*/
	+FORCERADIUSDMG
	Damagetype "Lightning"
	DeathSound "dsparil/hit"
	Speed 24
	FastSpeed 30
	States
	{
	Spawn:
		FX16 ABC 3 Bright A_BlueSpark
		Loop
	Death:
		FX16 G 5 Bright A_Explode(ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(80,111)),128,0)
		FX16 HIJKL 5 Bright
		Stop
	}
}

Actor NewSorcerer2FX2 : Sorcerer2FX2 replaces Sorcerer2FX2
{
	/*+NODAMAGETHRUST*/
	Damagetype "Arcane"
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(35,55)))
	States
	{
	Spawn:
		FX11 ABABABA 5 Bright
		FX11 A 0 A_Stop
		FX11 A 0 Bright 
		Goto Death
	Death:
		FX11 C 0 A_SpawnItemEx("NewWizardDsparil",0,0,0,0,0,0,0,SXF_SETMASTER)
		FX11 C 0 A_Stop
		FX11 CDEFG 5 Bright
		Stop
	}
}

//Disciple of D'Sparil

Actor NewWizard : Wizard replaces Wizard
{
	PainChance "Convert", 255
	//DropItem "NewMana1", 84, 15
	Dropitem "NewArtiHealingRadius", 4
	Dropitem "NewArtiSpeedBoots", 4
	Dropitem "ForceCube", 4
	Dropitem "ArtiPurpleFlask", 16
	DropItem "Money" 64
	DropItem "Money" 64
	DropItem "Money" 64
	DropItem "Money" 64
	DropItem "Money1" 8
	DropItem "Money2" 4
	DropItem "Money3" 2
	DropItem "ChestKey" 2
	/*+NODAMAGETHRUST*/
	Tag "Disciple of D'Sparil"
	+USEKILLSCRIPTS
	+AVOIDMELEE
	-DONTOVERLAP
	Species "Dsparil"
	Obituary "%o was cursed by a disciple of D'Sparil"
	Bloodtype "EtherealBloodPurple"
	DamageFactor "Arcane", 0.75
	DamageFactor "ArcanePlayer", 0.75
	DamageFactor "ArcaneTime", 0.75
	DamageFactor "Physical", 1.25
	DamageFactor "PhysicalPlayer", 1.25
	DamageFactor "Bleed", 1.25
	DamageFactor "Poison", 1.25
	DamageFactor "PoisonPlayer", 1.25
	DamageFactor "PoisonTime", 1.25
	States
	{
	Spawn:
		WZRD A 0
		WZRD A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,68,0)
	Idle:
		WZRD AB 10 A_Look
		Loop
	Pain.Morale:
		TNT1 A 0 A_Changeflag("Frightened", 1)
		Goto Pain
	Pain.Convert:
		TNT1 A 0 A_JumpIfInTargetInventory("Visions",Random(0,9),"ConvertMe")
		goto Pain
	ConvertMe:
		TNT1 A 0 ACS_ExecuteAlways(WOC_VISIONSSCRIPT,0,0,0,0)
		goto See
	See:
		WZRD A 3 A_Chase
		WZRD A 3 A_Chase
		WZRD A 3 A_Chase
		WZRD A 3 A_Chase
		WZRD B 3 A_Chase
		WZRD B 3 A_Chase
		WZRD B 3 A_Chase
		WZRD B 3 A_Chase
		Loop
	Missile:
		WZRD C 0 A_SetTranslucent(1, 0)
		WZRD C 0 A_FaceTarget
		WZRD C 4 A_ChangeFlag("GHOST", 0)
		WZRD C 4 A_WizAtk2
		WZRD C 0 A_SetTranslucent(1, 0)
		WZRD C 0 A_FaceTarget
		WZRD C 4 A_ChangeFlag("GHOST", 0)
		WZRD C 4 A_WizAtk2
		WZRD C 0 A_SetTranslucent(1, 0)
		WZRD C 0 A_FaceTarget
		WZRD C 4 A_ChangeFlag("GHOST", 0)
		WZRD C 4 A_WizAtk2
		WZRD C 0 A_SetTranslucent(1, 0)
		WZRD C 0 A_FaceTarget
		WZRD C 4 A_ChangeFlag("GHOST", 0)
		WZRD C 4 A_WizAtk2
		WZRD C 0 A_SetTranslucent(1, 0)
		WZRD C 0 A_FaceTarget
		WZRD C 0 A_ChangeFlag("GHOST", 0)
		WZRD D 0 A_PlaySound("wizard/attack")
		WZRD D 0 A_CustomMissile("WizardFX1", 32, 0, 5.625)
		WZRD D 0 A_CustomMissile("WizardFX1", 32, 0, -5.625)
		WZRD D 12 A_CustomMissile("WizardFX1", 32, 0, 0)
		Goto See
	Pain:
		WZRD E 0 A_SetTranslucent(1, 0)
		WZRD E 3 A_ChangeFlag("GHOST", 0)
		WZRD E 3 A_Pain
		Goto See
	Death:
		WZRD C 0 A_SetTranslucent(1, 0)
		WZRD F 6 A_ChangeFlag("GHOST", 0)
		WZRD G 6 A_Scream
		WZRD HI 6
		WZRD J 6 A_NoBlocking
		WZRD KL 6
		WZRD M -1 A_SetFloorClip
		Stop
	Raise:
		WZRD A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,68,0)
		WZRD LKJIHG 6
		Goto See
	}
}

Actor NewWizardFX1 : WizardFX1 replaces WizardFX1
{
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,FRandom(3,24)))
	/*+NODAMAGETHRUST*/
	Damagetype "Arcane"
}

Actor NewWizardDsparil : NewWizard
{
	States
	{
	Spawn:
		WZRD A 0
		WZRD A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,68,WOC_MINIONSUMMON)
	Idle:
		WZRD AB 10 A_Look
		Loop
	Raise:
		WZRD A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,68,WOC_MINIONSUMMON)
		WZRD LKJIHG 6
		Goto See
	}
}

//Fatso

Actor NewHereticImp : HereticImp replaces HereticImp
{
	PainChance "Convert", 255
	Dropitem "ReagentRed", 64
	/*+NODAMAGETHRUST*/
	Tag "Gargoyle"
	+FLOATBOB
	-DONTOVERLAP
	//+USEKILLSCRIPTS
	Damagetype "Physical"
	Meleerange 46
	AttackSound "himp/leaderattack"
	Health 40
	States
	{
	Spawn:
		IMPX A 0
		IMPX A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,36)
	Idle:
		IMPX ABCB 10 A_Look
		Loop
	Pain.Morale:
		TNT1 A 0 A_Changeflag("Frightened", 1)
		Goto Pain
	Pain.Convert:
		TNT1 A 0 A_JumpIfInTargetInventory("Visions",Random(0,3),"ConvertMe")
		goto Pain
	ConvertMe:
		TNT1 A 0 ACS_ExecuteAlways(WOC_VISIONSSCRIPT,0,0,0,0)
		goto See
	See:
		IMPX A 0 A_CheckFloor(10)
		IMPX A 0 A_ChangeFlag("FloatBob", 1)
		IMPX A 2 A_Chase
		IMPX A 3 A_Chase
		IMPX B 2 A_Chase
		IMPX B 3 A_Chase
		IMPX C 2 A_Chase
		IMPX C 3 A_Chase
		IMPX B 2 A_Chase
		IMPX B 3 A_Chase
		Loop
		IMPX A 0 A_ChangeFlag("FloatBob", 0)
		Goto See+2
	Melee:
		IMPX DE 5 A_FaceTarget
		IMPX F 6 A_CustomMeleeAttack(ACS_NamedExecuteWithResult("WOC Monster Damage Scale",ACTIVATOR,frandom(5,12)), "himp/attack", "himp/attack", "Physical")
		Goto See
	Missile:
		IMPX A 0 A_JumpIfCloser(256, 1)
		Goto See
		IMPX A 5 A_FaceTarget
		IMPX C 15 A_SkullAttack
		IMPX C 0 A_Stop
		Goto See
	Death:
		IMPX G 0 A_ChangeFlag("FloatBob", 0)
		IMPX G 1
		IMPX G 1 A_SpawnItemEx ("GIB1", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		IMPX G 1 A_SpawnItemEx ("GIB2", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		IMPX G 1 A_SpawnItemEx ("GIB3", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		IMPX H 1 A_SpawnItemEx ("GIB4", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		IMPX H 1 A_SpawnItemEx ("GIB5", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		IMPX H 1 A_SpawnItemEx ("GIB2", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		IMPX H 2
		Wait
	Crash:
		IMPX H 0 A_ChangeFlag("NOGRAVITY", 0)
		IMPX H 0 A_ChangeFlag("FloatBob", 0)
		IMPX HH 0 A_SpawnItemEx("GIB5", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		IMPX H 0 A_JumpIfHealthLower(-40,"XCrash")
		IMPX I 5
		IMPX J 5 A_Scream
		IMPX K 5 A_NoBlocking
		IMPX L -1
		Stop
	XDeath:
		IMPX S 0 A_ChangeFlag("FloatBob", 0)
		IMPX S 0 A_ChangeFlag("SOLID",0)
		IMPX S 0 A_ChangeFlag("FLOORCLIP",0)
		IMPX S 5
		IMPX TU 5
		IMPX V 5 A_Gravity
		IMPX W 5 
		Wait
	XCrash:
		IMPX X 5 A_ChangeFlag("FloatBob", 0)
		IMPX Y 5 A_NoBlocking
		IMPX Z -1
		Stop
	Ice:
		"----" H 0 A_ChangeFlag("FloatBob", 0)
		"----" G 5 A_GenericFreezeDeath
		"----" G 1 A_FreezeDeathChunks
		Wait
	}
}

ACTOR NewHereticImpLeader : NewHereticImp replaces HereticImpLeader 5
{
	Game Heretic
	SpawnID 7
	Tag "Fire Gargoyle"
	DamageFactor "Fire", 0.75
	DamageFactor "FirePlayer", 0.75
	DamageFactor "FireTime", 0.75
	States
	{
	Spawn:
		FIMP A 0
		FIMP A 0 ACS_NamedExecuteAlways("WOC Monster Init",0,36)
	Idle:
	    FIMP A 0 A_CheckFloor(6)
		FIMP A 0 A_ChangeFlag("FloatBob", 1)
		FIMP ABCB 10 A_Look
		Loop
		FIMP A 0 A_ChangeFlag("FloatBob", 0)
		Goto Idle+2
	Pain.Morale:
		TNT1 A 0 A_Changeflag("Frightened", 1)
		Goto Pain
	Pain.Convert:
		TNT1 A 0 A_JumpIfInTargetInventory("Visions",Random(0,3),"ConvertMe")
		goto Pain
	ConvertMe:
		TNT1 A 0 ACS_ExecuteAlways(WOC_VISIONSSCRIPT,0,0,0,0)
		goto See
	See:
		FIMP A 0 A_CheckFloor(10)
		FIMP A 0 A_ChangeFlag("FloatBob", 1)
		FIMP A 2 A_Chase
		FIMP A 3 A_Chase
		FIMP B 2 A_Chase
		FIMP B 3 A_Chase
		FIMP C 2 A_Chase
		FIMP C 3 A_Chase
		FIMP B 2 A_Chase
		FIMP B 3 A_Chase
		Loop
		FIMP A 0 A_ChangeFlag("FloatBob", 0)
		Goto See+2
	Pain:
		FIMP G 3
		FIMP G 3 A_Pain
		Goto See
	Melee:
		FIMP DE 5 A_FaceTarget
		FIMP F 6 A_CustomMeleeAttack(ACS_NamedExecuteWithResult("WOC Monster Damage Scale",ACTIVATOR,FRandom(5,12)), "himp/attack", "himp/attack", "Physical")
		Goto See
	Missile:
		FIMP A 0 A_Jump(128, 5)
		FIMP A 0 A_JumpIfCloser(256, 1)
		Goto See
		FIMP A 10 A_FaceTarget
		FIMP C 15 A_SkullAttack
		FIMP C 0 A_Stop
		Goto See
		FIMP DE 5 A_FaceTarget
		FIMP F 6 A_CustomMissile("NewHereticImpBall", 10, 0)
		Goto See
	Death:
		FIMP G 0 A_ChangeFlag("FloatBob", 0)
		FIMP G 1
		FIMP G 1 A_SpawnItemEx ("GIB1", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		FIMP G 1 A_SpawnItemEx ("GIB2", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		FIMP G 1 A_SpawnItemEx ("GIB3", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		FIMP H 1 A_SpawnItemEx ("GIB4", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		FIMP H 1 A_SpawnItemEx ("GIB5", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		FIMP H 1 A_SpawnItemEx ("GIB2", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		FIMP H 2
		Wait
	Crash:
		FIMP H 0 A_ChangeFlag("NOGRAVITY", 0)
		FIMP H 0 A_ChangeFlag("FloatBob", 0)
		FIMP HH 0 A_SpawnItemEx("GIB5", 0, 0, random(0,42), 0, 0, random(2,6), random(0,360), 128)
		FIMP H 0 A_JumpIfHealthLower(-40,"XCrash")
		FIMP I 5
		FIMP J 5 A_Scream
		FIMP K 5 A_NoBlocking
		FIMP L -1
		Stop
	XDeath:
		FIMP S 0 A_ChangeFlag("FloatBob", 0)
		FIMP S 0 A_ChangeFlag("SOLID",0)
		FIMP S 0 A_ChangeFlag("FLOORCLIP",0)
		//FIMP S 0 A_ChangeFlag("NOGRAVITY",1)
		FIMP S 5
		FIMP TU 5
		FIMP V 5 A_Gravity
		FIMP W 5 
		Wait
	XCrash:
		FIMP X 5 A_ChangeFlag("FloatBob", 0)
		FIMP Y 5 A_NoBlocking
		FIMP Z -1
		Stop
	Ice:
		"----" H 0 A_ChangeFlag("FloatBob", 0)
		"----" G 5 A_GenericFreezeDeath
		"----" G 1 A_FreezeDeathChunks
		Wait
	}
}

ACTOR NewHereticImpBall
{
	Speed 14
	FastSpeed 25
	Radius 8
	Height 8
	Damage (ACS_NamedExecuteWithResult("WOC Monster Damage Scale",WOCTARGET,frandom(1,8)))
	DamageType "Fire"
	/*+NODAMAGETHRUST*/
	Renderstyle Add
	Projectile
	Seesound "himp/leaderattack"
	DeathSound "FireDemonMissileHit"
	Scale 0.5

	States
	{
	Spawn: 
		BRB2 A 1 BRIGHT A_CustomMissile("FireDemonTrail1",0,0,Random(-200,200),50,Random(-200,200))
		BRB2 A 1 BRIGHT A_CustomMissile("FireDemonTrail2",0,0,0,0)
		BRB2 A 1 BRIGHT A_CustomMissile("FireDemonTrail1",0,0,Random(-200,200),50,Random(-200,200))
		BRB2 A 1 BRIGHT A_CustomMissile("FireDemonTrail2",0,0,0,0)
		BRB2 A 1 BRIGHT A_CustomMissile("FireDemonTrail1",0,0,Random(-200,200),50,Random(-200,200))
		BRB2 A 1 BRIGHT A_CustomMissile("FireDemonTrail2",0,0,0,0)
		BRB2 B 1 BRIGHT A_CustomMissile("FireDemonTrail1",0,0,Random(-200,200),50,Random(-200,200))
		BRB2 B 1 BRIGHT A_CustomMissile("FireDemonTrail2",0,0,0,0)
		BRB2 B 1 BRIGHT A_CustomMissile("FireDemonTrail1",0,0,Random(-200,200),50,Random(-200,200))
		BRB2 B 1 BRIGHT A_CustomMissile("FireDemonTrail2",0,0,0,0)
		BRB2 B 1 BRIGHT A_CustomMissile("FireDemonTrail1",0,0,Random(-200,200),50,Random(-200,200))
		BRB2 B 1 BRIGHT A_CustomMissile("FireDemonTrail2",0,0,0,0)
		Loop
	Death:
		BRB2 CDEFGHI 3 Bright
		Stop
	}
}

Actor NewPod : Pod replaces Pod
{
	States
	{
	Spawn:
		PPOD A 10
		Loop
	Pain:
		PPOD B 14 A_PodPain
		Goto Spawn
	Death:
		PPOD C 5 Bright A_RemovePod
		PPOD D 5 Bright A_Scream
		PPOD E 5 Bright A_SpawnItemEx("PodExplode", 0, 0, 28, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
		PPOD F 10 Bright
		Stop
	Grow:
		PPOD IJKLMNOP 3
		Goto Spawn
	}
}

Actor PodExplode
{
	Speed 0
	Height 4
	Radius 4
	PROJECTILE
	Damage (0)
	PROJECTILE
	+DONTBLAST
	Damagetype "Poison"
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 3 A_Explode(ACS_NamedExecuteWithResult("WOC Player Scale", 128, CURRENTLEVEL, 0, WOCTARGET), 128, 1)
		Stop
	}
}