//-----------------------------Modified Monsters

Actor EttinSpotz : RandomSpawner replaces Ettin
{
	Game Hexen
	SpawnID 4
	DropItem "NewEttin" 255 212
	DropItem "ChainmailEttin" 255 43
	DropItem "Bormereth" 255 1
}

Actor NewEttin : Ettin// Replaces Ettin
{
speed 13
PainChance "Convert", 255
Painchance "EttinPower", 255
dropitem "ArtiEmptyFlask" 64
  dropitem "ReagentRed" 64
MeleeRange 68
+TELESTOMP
States
{
	Pain.Convert:
	ETTN I 5 A_JumpIfInTargetInventory("Visions",Random(0,3),"ConvertMe")
	goto See
	ConvertMe:
	ETTN I 0 ACS_ExecuteAlways(914,0,30)
	ETTN I 0 ACS_ExecuteAlways(560,0,0,0,0)
	goto See
  Spawn:
	ETTN A 0
    ETTN A 0 ACS_ExecuteAlways(913,0,175,9,0)//increase health on higher difficulties
    ETTN AA 10 A_Look
    Loop
  Melee:
    ETTN EF 6 A_FaceTarget
    ETTN G 8 A_CustomMeleeAttack((Random(1, 8)*2)+(ACS_ExecuteWithResult(912,3,0,0)/2))
    Goto See
  Idle:
	ETTN AA 10 A_Look
    Loop
  See:
	ETTN ABCD 5 A_Chase
    Loop
  Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,60),"Feared")
	Goto Pain
  Feared:
	TNT1 A 0 A_Changeflag("Frightened", 1)
	Goto Pain
  Pain.EttinPower:
	ETTN E 0 HealThing(1)
	ETTN E 0 A_GiveInventory("EttinBuffD")
	ETTN E 0 A_GiveInventory("EttinBuffP")
	Goto See
  Death:
	ETTN I 0 ACS_ExecuteAlways(914,0,20)
	ETTN IJ 4
	ETTN K 4 A_Scream
	ETTN L 4 A_NoBlocking
	ETTN M 4 A_QueueCorpse
	ETTN NOP 4
	ETTN Q -1
	Stop
	XDeath:
	ETTB A 0 ACS_ExecuteAlways(914,0,20)
	ETTB B 0 A_SpawnItemEx("GIBBER")
	ETTB B 4 A_Scream
	ETTB B 4 A_CustomMissile("EttinMace",2,0,-90,2)
	ETTB D 4 A_NoBlocking
	ETTB E 4 A_QueueCorpse
	ETTB FGHIJK 4
	ETTB L -1
	Stop
	Ice:
	"----" A 0 ACS_ExecuteAlways(914,0,20)
	"----" H 5 A_GenericFreezeDeath
	"----" H 1 A_FreezeDeathChunks
	Wait
	Raise:
	ETTN QPONMLKJI 4
	ETTN I 0 A_Pain
	Goto See
}
}

ACTOR NewEttinMash : NewEttin replaces EttinMash
{
  Game Hexen
  SpawnID 102
  +NOBLOOD
  +NOICEDEATH
  RenderStyle Translucent
  Alpha 0.4
}

Actor ChainmailEttin : Ettin
{
  Health 300
  Radius 25
  Height 68
  Mass 175
  Speed 13
  Damage 3
  Painchance 35
  MeleeRange 68
  Monster
  +FLOORCLIP
  +NOTARGET
  +TELESTOMP
  PainChance "Convert", 255
  SeeSound "EttinSight"
  AttackSound "EttinAttack"
  PainSound "EttinPain"
  DeathSound "EttinDeath"
  ActiveSound "EttinActive"
  HowlSound "PuppyBeat"
  Obituary "%o was smashed by an Ettin Commander."
  dropitem "ArtiEmptyFlask" 64
  dropitem "ReagentRed" 64
  DropItem "Armour1" 8
  States
  {
  Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,60),"Feared")
	Goto Pain
  Feared:
	TNT1 A 0 A_Changeflag("Frightened", 1)
	Goto Pain
  Spawn:
	CETN A 0
    CETN A 0 ACS_ExecuteAlways(913,0,300,15,0)//increase health on higher difficulties
    CETN AA 10 A_Look
    Loop
  Idle:
	CETN AA 10 A_Look
    Loop
  See:
	CETN A 0 A_Jump(64, "EttinBuff")
    CETN ABCD 5 A_Chase
    Loop
  Pain:
    CETN H 7 A_Pain
    Goto See
  Pain.Convert:
	TNT1 A 0 A_JumpIfInTargetInventory("Visions",Random(0,6),"ConvertMe")
	goto See
	ConvertMe:
	TNT1 A 0 ACS_ExecuteAlways(914,0,35)
	TNT1 A 0 ACS_ExecuteAlways(560,0,0,0,0)
	goto See
  Melee:
    CETN EF 6 A_FaceTarget
    CETN G 8 A_CustomMeleeAttack((Random(1, 8)*2)+(ACS_ExecuteWithResult(912,3,0,0)/2))
    Goto See
  Missile:
	CETN EF 6 A_FaceTarget
	CETN G 0 A_PlaySound("FighterHammerMiss")
	CETN G 8 A_CustomMissile("ThrownMace",52,0,0)
	Goto See
  EttinBuff:
    CETN E 0 A_CustomMissile("EttinBuffer")
    Goto See
  EttinPower:
	CETN E 0 HealThing(1)
	CETN E 0 A_GiveInventory("EttinBuffD")
	CETN E 0 A_GiveInventory("EttinBuffP")
	Goto See
  Death:
	CETN I 0 ACS_ExecuteAlways(914,0,35)
    CETN IJ 4
    CETN K 4 A_Scream
    CETN L 4 A_NoBlocking
    CETN M 4 A_QueueCorpse
    CETN NOP 4
    CETN Q -1
    Stop
  XDeath:
	CETN I 0 ACS_ExecuteAlways(914,0,35)
    CETB A 4 A_SpawnItemEx("GIBBER")
    CETB B 4 A_NoBlocking
    CETB C 4 A_SpawnItemEx("EttinMace", 0,0,8.5, random[DropMace](-128,127) * 0.03125, random[DropMace](-128,127) * 0.03125, 10 + random[DropMace](0,255) * 0.015625, 0, SXF_ABSOLUTEMOMENTUM)
    CETB D 4 A_Scream
    CETB E 4 A_QueueCorpse
    CETB FGHIJK 4
    ETTB L -1
    Stop
  Ice:
	"----" I 0 ACS_ExecuteAlways(914,0,35)
    "----" E 5 A_GenericFreezeDeath
    "----" E 1 A_FreezeDeathChunks
    Wait
  }
}

ACTOR ThrownMace
{
    Speed 15
    Radius 6
    Height 8
    PROJECTILE
    +NOTELEPORT
    Damage ((Random(1,8)*3)+(ACS_ExecuteWithResult(912,2,0,0)))
	+HEXENBOUNCE
	-NOGRAVITY
    BounceCount 4
    BounceFactor 1
    WallBounceFactor 1
    DeathSound "Fireball"
    States
    {
    Spawn:
	AEMC ABCDEFG 3
	AEMC H 0 A_PlaySound("FighterHammerContinuous")
	AEMC H 3
	Loop
    Death:
	CFCF Q 0 Bright A_SetTranslucent(1,1)
	CFCF Q 1 Bright A_NoGravity
	CFCF QQQ 1 Bright A_SpawnItemEx("FlailPuffParticleFXSpawner")
	CFCF RRR 1 Bright A_SpawnItemEx("FlailPuffParticleFXSpawner")
	CFCF SSSS 1 Bright A_SpawnItemEx("FlailPuffParticleFXSpawner")
    CFCF T 3 Bright
    CFCF U 4 Bright
    CFCF W 3 Bright
    CFCF X 4 Bright
    CFCF Z 3 Bright
    Stop
    }
}


Actor EttinBuffD : PowerUpGiver
{
	Powerup.Duration -20
	Powerup.Type EttinDamage
	Powerup.Color "Grey", 0.2
	+DROPPED
	States
  	{
  	Spawn:
    	APT0 A 1
    	Loop
  }
}

Actor PowerEttinDamage : PowerDamage
{
	Damagefactor "Normal", 1.5
}

Actor EttinBuffP : PowerUpGiver
{
	Powerup.Duration -20
	Powerup.Type EttinProtect
	Powerup.Color "Grey", 0.2
	+DROPPED
	States
  	{
  	Spawn:
    	APT0 A 1
    	Loop
  }
}

Actor PowerEttinProtect : PowerProtection
{
	Damagefactor "Normal", .5
}

Actor EttinBuffer
{
	Projectile
	+RIPPER
	+PAINLESS
	+BLOODLESSIMPACT
	Damagetype "EttinPower"
	States
	{
	Spawn:
	Death:
	TNT1 A 1
	TNT1 A 0 A_Explode(1,512,0)
	Stop
	}
}


ACTOR Bormereth
{
    Health 1200
    Radius 25
    Height 64
    Speed 13
    PainChance 75
    Mass 2500
    MONSTER
	Species "Ettin"
	DropItem "NewArtiBoostMana" 64
	DropItem "ArtiInvulnurability" 64
	DropItem "NewArtiSuperHealth" 64
	DropItem "ArtiOrangeFlask" 128
	DropItem "ArtiRedFlask"
	DropItem "ArtiYellowFlask"
	DamageFactor "Deathblow", 0
    //Meleedamage 8
    +MISSILEEVENMORE
    +FLOORCLIP
	+NEVERRESPAWN
    SeeSound "DMage/Attack"
    PainSound "DMage/Pain"
    ActiveSound "DMage/idle"
    DeathSound "DMage/death"
    Obituary "%o was incinerated by the rage of Bormereth."
    HitObituary "%o was smashed by Bormereth."
    States
    {
    Spawn:
		BRMN A 0
		BRMN A 0 ACS_ExecuteAlways(913,0,1200,100,0)
        BRMN AA 10 A_Look
        Loop
	Idle:
		BRMN AA 10 A_Look
        Loop
    See:
//        BRMN AABBCCDD 4 A_VileChase  //well, if you think he should... i removed that because he is already a bit hard.
		BRMN A 0 A_UnSetInvulnerable
        BRMN ABCD 5 A_Chase
        Loop
    Missile:
	  TNT1 A 0 A_Jump(60,"Missile2")

	  TNT1 A 0 A_Jump(128,17)
	  BRMN E 6 A_FaceTarget
	  BRMN F 6 A_FaceTarget
	  TNT1 A 0 A_PlaySoundEx("bormereth/missilesimple","SoundSlot5")
	  BRMN G 6 Bright A_CustomMissile("WraithFX12",25,0,0)
	  BRMN E 6 A_FaceTarget
	  BRMN F 6 A_FaceTarget
	  TNT1 A 0 A_PlaySoundEx("bormereth/missilesimple","SoundSlot5")
	  BRMN G 6 Bright A_CustomMissile("WraithFX12",25,0,0)
	  BRMN E 6 A_FaceTarget
	  BRMN F 6 A_FaceTarget
	  TNT1 A 0 A_PlaySoundEx("bormereth/missilesimple","SoundSlot5")
	  BRMN G 6 Bright A_CustomMissile("WraithFX12",25,0,0)
	  BRMN E 6 A_FaceTarget
	  BRMN F 6 A_FaceTarget
	  TNT1 A 0 A_PlaySoundEx("bormereth/missilesimple","SoundSlot5")
	  BRMN G 6 Bright A_CustomMissile("WraithFX12",25,0,0)
	  Goto see

	  TNT1 A 0 A_Jump(128,9)
	  BRMN E 6 A_FaceTarget
	  BRMN F 3 A_FaceTarget
	  TNT1 A 0 A_PlaySoundEx("bormereth/missilesimple","SoundSlot5")
	  BRMN F 3 Bright A_CustomMissile("WraithFX12",31,10,0)
	  TNT1 A 0 A_PlaySoundEx("bormereth/missilesimple","SoundSlot5")
	  BRMN G 3 Bright A_CustomMissile("WraithFX12",28,5,0)
	  TNT1 A 0 A_PlaySoundEx("bormereth/missilesimple","SoundSlot5")
	  BRMN G 3 Bright A_CustomMissile("WraithFX12",25,0,0)
	  Goto see

	  BRMN E 6 A_FaceTarget
	  BRMN F 6 A_FaceTarget
	  TNT1 A 0 A_PlaySoundEx("bormereth/missilesimple","SoundSlot5")
	  BRMN G 0 A_CustomMissile("WraithFX12",25,0,20)
	  BRMN G 0 A_CustomMissile("WraithFX12",25,0,0)
	  BRMN G 0 A_CustomMissile("WraithFX12",25,0,-20)
	  BRMN G 6 Bright
	  Goto see
    Missile2:
	  BRMN F 5 A_FaceTarget
	  TNT1 A 0 A_PlaySoundEx("bormereth/missile2prepare","SoundSlot5")
	  TNT1 A 0 A_SpawnItemEx("PossBRMFakeFireBall",5,25,64,0,0,0,0,128)
	  BRMN EEEEE 5 A_FaceTarget
	  BRMN E 3 A_FaceTarget
	  TNT1 A 0 A_CustomMissile("PossBRMFireBall",64,25,0)
	  BRMN F 5 A_FaceTarget
	  BRMN G 5 A_FaceTarget
	  goto see
    Melee:
	  BRMN E 6 A_FaceTarget
	  BRMN F 6 A_FaceTarget
	  BRMN G 6 A_CustomMeleeAttack(Random(24,38)+(ACS_ExecuteWithResult(912,6,0,0)))
	  BRMN E 0 A_CPosRefire
	  Goto see
    Pain:
	  TNT1 A 0 A_CustomMissile("FirePillarStarter",32,0,0)
	  TNT1 A 0 A_CustomMissile("FirePillarStarter",32,0,90)
	  TNT1 A 0 A_CustomMissile("FirePillarStarter",32,0,180)
	  TNT1 A 0 A_CustomMissile("FirePillarStarter",32,0,270)
	  TNT1 A 0 A_CustomMissile("FirePillarStarter",32,0,45)
	  TNT1 A 0 A_CustomMissile("FirePillarStarter",32,0,135)
	  TNT1 A 0 A_CustomMissile("FirePillarStarter",32,0,-45)
	  TNT1 A 0 A_CustomMissile("FirePillarStarter",32,0,-135)
        BRMN H 2 A_SetInvulnerable
        BRMN H 2 A_Pain
        BRMN H 20
        BRMN H 2 A_UnSetInvulnerable
        Goto See
/*    Death:
        BRMN I 5
        BRMN J 5 A_Scream
        BRMN K 5 A_NoBlocking
        BRMN L 5 A_Fall
        BRMN MNOP 5
        BRMN Q -1
        Stop
*/
    Death:		//I just like this death too much! :P
	  TNT1 A 0 A_PlaySound("misc/gibbed")
		BRMB A 0 A_SpawnItemEx("GIBBER")
		BRMB A 0 ACS_ExecuteAlways(914,0, 650)
        BRMB A 5 A_Scream
        BRMB B 5 A_SpawnItemEx("DBigEttinMace", 0, 0, 32, 3, 0, 0, -90, 128)
        BRMB C 5 A_NoBlocking
        BRMB D 5 A_Fall
        BRMB EFGHIJK 5
        BRMB L -1
        Stop
	Ice:
		"----" H 0 ACS_ExecuteAlways(914,0, 650)
		"----" H 5 A_GenericFreezeDeath
		"----" H 1 A_FreezeDeathChunks
		Wait
    Raise:
        BRMN QPONMLKJI 5
        Goto See
    }
}


actor DBigettinMace
{
    +DOOMBOUNCE
    Speed 3
    States
    {
    Spawn:
        BRMB MNOPQR 5
        BRMB S -1
        Stop
    }
}

Actor WraithFX12 : WraithFX1
{
	DeathSound "bormereth/missilesimpledeath"
	Scale 0.85
	Damage ((Random(1,8)*5)+(ACS_ExecuteWithResult(912,4,0,0)))
	Renderstyle Add
	Decal DoomImpScorch
}

Actor PossBRMFakeFireBall : WraithFX1
{
	+NOCLIP
	Damage 0
	Speed 0
	Scale 1.1
	Renderstyle Add
	States
	{
	Spawn:
		TNT1 AA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360))
		WRBL A 1 Bright A_Settranslucent(0.1,1)
		WRBL A 1 Bright A_Settranslucent(0.15,1)
		WRBL A 1 Bright A_Settranslucent(0.2,1)
		TNT1 AAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360))
		WRBL B 1 Bright A_Settranslucent(0.25,1)
		WRBL B 1 Bright A_Settranslucent(0.3,1)
		WRBL B 1 Bright A_Settranslucent(0.35,1)
		TNT1 AAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360))
		WRBL C 1 Bright A_Settranslucent(0.4,1)
		WRBL C 1 Bright A_Settranslucent(0.45,1)
		WRBL C 1 Bright A_Settranslucent(0.5,1)
		TNT1 AAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360))
		WRBL A 1 Bright A_Settranslucent(0.55,1)
		WRBL A 1 Bright A_Settranslucent(0.6,1)
		WRBL A 1 Bright A_Settranslucent(0.65,1)
		TNT1 AAAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360))
		WRBL B 1 Bright A_Settranslucent(0.7,1)
		WRBL B 1 Bright A_Settranslucent(0.75,1)
		WRBL B 1 Bright A_Settranslucent(0.8,1)
		TNT1 AAAAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360))
		WRBL C 1 Bright A_Settranslucent(0.85,1)
		WRBL C 1 Bright A_Settranslucent(0.9,1)
		WRBL C 1 Bright A_Settranslucent(0.95,1)
		TNT1 AAAAAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360))
		WRBL A 3 Bright
		TNT1 AAAAAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360))
		WRBL B 3 Bright
		TNT1 AAAAAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360))
		WRBL C 3 Bright
		Stop
	}
}


Actor PossBRMFireBall: WraithFX1
{
	Damage ((Random(1,8)*10)+(ACS_ExecuteWithResult(912,5,0,0)))
	Scale 1.1
	Speed 20
	+SEEKERMISSILE
	Renderstyle Add
	SeeSound "bormereth/missile2fired"
	DeathSound "bormereth/missile2death"
	Decal DoomImpScorch
	States
	{
	Spawn:
		TNT1 AAAAAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360),128)
		WRBL A 1 Bright A_SeekerMissile(5,5)
		TNT1 A 0 A_SpawnItemEx("PEFBTrail",0,0,0,0,0,0,0,128)
		WRBL A 1 Bright A_SeekerMissile(5,5)
		TNT1 A 0 A_SpawnItemEx("PEFBTrail",0,0,0,0,0,0,0,128)
		WRBL A 1 Bright A_SeekerMissile(5,5)
		TNT1 A 0 A_SpawnItemEx("PEFBTrail",0,0,0,0,0,0,0,128)
		TNT1 AAAAAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360),128)
		WRBL B 1 Bright A_SeekerMissile(5,5)
		TNT1 A 0 A_SpawnItemEx("PEFBTrail",0,0,0,0,0,0,0,128)
		WRBL B 1 Bright A_SeekerMissile(5,5)
		TNT1 A 0 A_SpawnItemEx("PEFBTrail",0,0,0,0,0,0,0,128)
		WRBL B 1 Bright A_SeekerMissile(5,5)
		TNT1 A 0 A_SpawnItemEx("PEFBTrail",0,0,0,0,0,0,0,128)
		TNT1 AAAAAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360),128)
		WRBL C 1 Bright A_SeekerMissile(5,5)
		TNT1 A 0 A_SpawnItemEx("PEFBTrail",0,0,0,0,0,0,0,128)
		WRBL C 1 Bright A_SeekerMissile(5,5)
		TNT1 A 0 A_SpawnItemEx("PEFBTrail",0,0,0,0,0,0,0,128)
		WRBL C 1 Bright A_SeekerMissile(5,5)
		TNT1 A 0 A_SpawnItemEx("PEFBTrail",0,0,0,0,0,0,0,128)
		Loop
	Death:
		TNT1 A 0 A_CustomMissile("PEFBExplo",0,0,0)
		TNT1 A 0 A_Explode(80,80)
		TNT1 AAAAAAAAAAAAAAA 0 A_SpawnItemEx("WraithFX23",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360),128)
		TNT1 AAAAAAAAAAAAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360),128)
		WRBL DEF 3 Bright
		WRBL GHI 3
		Stop
}
}

Actor WraithFX22
{
	Projectile
	Damage 0
	+RIPPER
	+BLOODLESSIMPACT
	Speed 0
	Radius 1
	Height 1
	Scale 0.75
	States
	{
	Spawn:
		WRBL KLKL 2 Bright
		TNT1 A 0 A_Jump(128,1)
		Loop
		WRBL MNOP 2 Bright
		WRBL P 1 Bright A_FadeOut
		Wait
	Death:
		TNT1 A 1
		Stop
	}
}

Actor WraithFX23
{
	Projectile
	Damage 0
	+RIPPER
	+BLOODLESSIMPACT
	Speed 0
	Radius 1
	Height 1
	States
	{
	Spawn:
		WRBL KLKL 2 Bright
		TNT1 A 0 A_Jump(128,1)
		Loop
		WRBL MNOP 2 Bright
		WRBL P 1 Bright A_FadeOut
		Wait
	Death:
		TNT1 A 1
		Stop
	}
}

Actor PEFBExplo
{
	Projectile
	Speed 0
	Damage 0
	+NOCLIP
	Renderstyle Add
	RenderStyle Add
	Alpha 0.6
	States
	{
	Spawn:
		FX58 ABCDEFGHIJKLMNOPQ 1 Bright
		Stop
	}
}

Actor PEFBTrail
{
	Projectile
	Speed 0
	Damage 0
	+NOCLIP
	Renderstyle Add
	RenderStyle Add
	Scale 0.4
	Alpha 0.45
	States
	{
	Spawn:
		FX50 ABCDEFG 1
		FX50 HIJKLMNOPQR 1
		Stop
	}
}


//-------------------------------------------------------
Actor FirePillarStarter
{
	Projectile
	+RIPPER
	Speed 28
	Damage 0
	+NOTARGET
	+RIPPER
	+BLOODLESSIMPACT
	RenderStyle None
	States
	{
	Spawn:
		TNT1 A 3
		Goto Death
	Death:
		TNT1 A 3 A_CustomMissile("FirePillarBase",-20,0,0)
		Stop
	}
}

Actor FirePillarBase
{
	Projectile
	Speed 0
	+NOCLIP
	Damage 0
	RenderStyle None
	States
	{
	Spawn:
		TNT1 A 2 A_CustomMissile("FirePillarShot",5,0,0)
		TNT1 A 2 A_CustomMissile("FirePillarShot2",5,0,0)
		TNT1 A 2 A_CustomMissile("FirePillarShot",5,0,0)
		TNT1 A 2 A_CustomMissile("FirePillarShot2",5,0,0)
		TNT1 A 2 A_CustomMissile("FirePillarShot",5,0,0)
		TNT1 A 2 A_CustomMissile("FirePillarShot2",5,0,0)
		TNT1 A 2 A_CustomMissile("FirePillarShot",5,0,0)
		TNT1 A 2 A_CustomMissile("FirePillarShot2",5,0,0)
		TNT1 A 2 A_CustomMissile("FirePillarShot",5,0,0)
		TNT1 A 2 A_CustomMissile("FirePillarShot2",5,0,0)
		TNT1 A 2 A_CustomMissile("FirePillarShot",5,0,0)
		Stop
	}
}

Actor FirePillarShot
{
	Projectile
	Speed 0
	Radius 4
	Height 3
	Damage (Random(1,8)+(ACS_ExecuteWithResult(912,2,0,0)))
	DamageType Fire
	Scale 0.5
	RenderStyle Add
	Alpha 0.6
	States
	{
	Spawn:
		TNT1 AAAA 0
		INFE ABCD 1 Bright ThrustThingZ(0,7,0,1)
		INFE EFGHIJKLMNOPQRST 1 Bright
		Stop
	}
}

Actor FirePillarShot2 : FirePillarShot	//this one wont have light definition
{
	Alpha 0.59
}


//////////////////////////////////////////////////////Afrits
Actor AfritSpotZ : RandomSpawner replaces FireDemon
{
	Game Hexen
	SpawnID 5
	DropItem "NewFireDemon" 255 150
	DropItem "FireDemonLeader" 255 65
	DropItem "FireDemonCommander" 255 40
	DropItem "FireDemonQueen" 255 1
}

Actor NewFireDemon : FireDemon
{
PainChance 25
speed 13
Species "Afrit"
PainChance "Convert", 255
+TELESTOMP
dropitem "ReagentRed" 32
States
{
Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,60),"Feared")
	Goto Pain
  Feared:
	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(914,0,12)
	TNT1 A 0 ACS_ExecuteAlways(560,0,0,0,0)
	goto Chase
	Chase:
		FDMN A 0 A_UnsetInvulnerable
		FDMN ABC 5 A_FireDChase
		Loop
	Pain:
	FDMN A 0 A_UnsetInvulnerable
    FDMN D 6 Bright A_Pain
    Goto Chase
	Spawn:
		FDMN X 0
	   FDMN X 0 ACS_ExecuteAlways(913,0,80,4,0)//increase health on higher difficulties//A_JumpIf(ACS_ExecuteWithResult(522,0,0,0)==1,"Mutate")
	   FDMN X 5 Bright
	   FDMN E 0 ACS_ExecuteAlways(913,0,80,4,0)//increase health on higher difficulties//A_JumpIf(ACS_ExecuteWithResult(522,0,0,0)==1,"Mutate")
       FDMN EFG 10 Bright A_Look
       Goto Spawn+3
	Death:
	FDMN A 0 ACS_ExecuteAlways(914,0,12)
	FDMN D 4 A_FaceTarget
	FDMN L 4 A_Scream
	FDMN L 4 A_NoBlocking
	FDMN L 200
	Stop
	Crash:
	FDMN M 5 A_FaceTarget
	FDMN N 5 A_NoBlocking
	FDMN O 0 A_CustomMissile("FireDemonSplotch1",2,0,Random(0,360),2)
	FDMN O 0 A_CustomMissile("FireDemonSplotch2",2,0,Random(0,360),2)
	FDMN O 5
	Stop
	XDeath:
	FDMN A 0 ACS_ExecuteAlways(914,0,12)
	FDMN M 5 A_FaceTarget
	FDMN N 5 A_NoBlocking
	FDMN O 0 A_CustomMissile("FireDemonSplotch1",2,0,Random(0,360),2)
	FDMN O 0 A_CustomMissile("FireDemonSplotch2",2,0,Random(0,360),2)
	FDMN O 5
	Stop
	Pain.Morale:
	FDMN G 0 A_JumpIfInTargetInventory("Warcry",5,"See")
	FDMN G 2 ACS_ExecuteAlways(0,569,0,0,0)
	Goto Chase
	Ice:
	"----" A 0 ACS_ExecuteAlways(914,0,12)
	"----" D 5 A_GenericFreezeDeath
	"----" D 1 A_FreezeDeathChunks
	Wait
}
}

Actor NewFireDemonMissile : FireDemonMissile replaces FireDemonMissile
{
	Damage (Random(1,8)+(ACS_ExecuteWithResult(912,1,0,0)/3))
	States
	{
	Spawn:
      FDMB A 1 Bright A_CustomMissile("FireDemonTrail1",0,0,Random(-200,200),50,Random(-200,200))
	  FDMB A 1 Bright A_CustomMissile("FireDemonTrail2",0,0,0,0)
      Loop
	}
}

ACTOR FireDemonTrail1
{   
   Radius 2
   Height 2
   Speed 1
   ReactionTime 60
   PROJECTILE
   RENDERSTYLE ADD
   Alpha 0.75
   +CLIENTSIDEONLY
   +NOGRAVITY
   +DOOMBOUNCE
   +EXPLODEONWATER
   -CANBOUNCEWATER
   -SOLID
   +DONTSPLASH
   +NOINTERACTION
   States
   {
   Spawn:
      FDSP AB 3 BRIGHT A_FadeOut(0.1)
      loop
   Death:
      FDSP CDE 3 BRIGHT
      Stop 
   }
}

ACTOR FireDemonTrail2
{   
   Radius 2
   Height 2
   Speed 0
   Scale 1.0
   PROJECTILE
   RENDERSTYLE ADD
   +CLIENTSIDEONLY
   +NOINTERACTION
   ALPHA 0.67
   States
   {
   Spawn:
      NULL A 3 Bright
      FDFX ABCDE 3 BRIGHT
      Stop 
   }
}

Actor FireDemonLeader : FireDemon
{
   Health 90
   ReactionTime 8
   PainChance 1
   Speed 13
   Radius 20
   Height 68
   Mass 75
   Damage 1
   Monster
   +DROPOFF
   +NOGRAVITY
   +FLOAT
   +FLOORCLIP
   +INVULNERABLE
   +TELESTOMP
   Species "Afrit"
   PainChance "Convert", 255
   SeeSound "FireDemonSpawn"
   PainSound "FireDemonPain"
   DeathSound "FireDemonDeath"
   ActiveSound "FireDemonActive"
   Obituary "%o tasted an Afrit Leader's fire."
   dropitem "ReagentRed" 32
   States
   {
   Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,60),"Feared")
	Goto Pain
  Feared:
	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(914,0,18)
	TNT1 A 0 ACS_ExecuteAlways(560,0,0,0,0)
	goto Chase
   Spawn:
		FDNL X 0 Bright
		FDNL X 0 ACS_ExecuteAlways(913,0,90,5,0)//increase health on higher difficulties//A_JumpIf(ACS_ExecuteWithResult(522,0,0,0)==1,"Mutate")
       FDNL X 5 Bright
	   FDNL E 0 ACS_ExecuteAlways(913,0,90,5,0)//increase health on higher difficulties//A_JumpIf(ACS_ExecuteWithResult(522,0,0,0)==1,"Mutate")
       FDNL EFG 10 Bright A_Look
       Goto Spawn +3
   See:
       FDNL E 8 Bright
       FDNL F 6 Bright
       FDNL G 5 Bright
       FDNL F 8 Bright
       FDNL E 6 Bright
       FDNL G 7 Bright A_FiredRocks
       FDNL HI 5 Bright
       FDNL J 5 Bright A_UnSetInvulnerable
   Chase:
	   FDNL A 0 A_UnsetInvulnerable
       FDNL ABC 5 Bright A_FireDChase
       Loop
   Pain:
	   FDNL A 0 A_UnsetInvulnerable
       FDNL D 6 Bright A_Pain
       Goto Chase
   Missile:
       FDNL K 3 Bright A_FaceTarget
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNL K 5 Bright A_CustomMissile("FireDemonLeaderMissile",32)
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNL K 5 Bright A_CustomMissile("FireDemonLeaderMissile",32)
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNL K 5 Bright A_CustomMissile("FireDemonLeaderMissile",32)
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNL K 5 Bright A_CustomMissile("FireDemonLeaderMissile",32)
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNL K 5 Bright A_CustomMissile("FireDemonLeaderMissile",32)
       Goto Chase
   Crash:
		FDNL M 5 A_FaceTarget
       FDNL N 5 A_NoBlocking
	   TNT1 A 0 A_SpawnItemEx("FireDemonLeaderSplotch1",0,0,0,Random(1,2),Random(1,2),Random(3,5),Random(1,360))
       FDNL O 5 A_SpawnItemEx("FireDemonLeaderSplotch2",0,0,0,Random(1,2),Random(1,2),Random(3,5),Random(1,360))
       Stop
   XDeath:
		FDNL M 0 ACS_ExecuteAlways(914,0,18)
       FDNL M 5 A_FaceTarget
       FDNL N 5 A_NoBlocking
	   TNT1 A 0 A_SpawnItemEx("FireDemonLeaderSplotch1",0,0,0,Random(1,2),Random(1,2),Random(3,5),Random(1,360))
       FDNL O 5 A_SpawnItemEx("FireDemonLeaderSplotch2",0,0,0,Random(1,2),Random(1,2),Random(3,5),Random(1,360))
       Stop
   Death:
		FDNL M 0 ACS_ExecuteAlways(914,0,18)
       FDNL D 4 Bright A_FaceTarget
       FDNL L 4 Bright A_Scream
       FDNL L 4 Bright A_NoBlocking
       FDNL L 200 Bright
       Stop
   Ice:
		"----" A 0 ACS_ExecuteAlways(914,0,18)
       "----" D 5 A_GenericFreezeDeath
       "----" D 1 A_FreezeDeathChunks
       Wait
   }
}

Actor FireDemonLeaderMissile
{
  Health 1000
  ReactionTime 8
  Speed 10
  Radius 10
  Height 6
  Mass 5
  Damage (Random(1,8)+(ACS_ExecuteWithResult(912,1,0,0)/3))
  DamageType "Fire"
  Projectile
  +FLOORCLIP
  +SEEKERMISSILE
  RenderStyle Add
  DeathSound "FireDemonMissileHit"
  States
  {
  Spawn:
    FDLB A 1 Bright A_CustomMissile("FireDemonLeaderTrail1",0,0,Random(-200,200),50,Random(-200,200))
	FDLB A 1 Bright A_CustomMissile("FireDemonLeaderTrail2",0,0,0,0)
      Loop
  Death:
    FDLB BCDE 5 Bright
    Stop
  }
}

ACTOR FireDemonLeaderTrail1
{   
   Radius 2
   Height 2
   Speed 1
   ReactionTime 60
   PROJECTILE
   RENDERSTYLE ADD
   Alpha 0.75
   +CLIENTSIDEONLY
   +NOGRAVITY
   +DOOMBOUNCE
   +EXPLODEONWATER
   -CANBOUNCEWATER
   -SOLID
   +DONTSPLASH
   +NOINTERACTION
   States
   {
   Spawn:
      FLSP AB 3 BRIGHT A_FadeOut(0.1)
      loop
   Death:
      FLSP CDE 3 BRIGHT
      Stop 
   }
}

ACTOR FireDemonLeaderTrail2
{   
   Radius 2
   Height 2
   Speed 0
   Scale 1.0
   PROJECTILE
   RENDERSTYLE ADD
   +CLIENTSIDEONLY
   +NOINTERACTION
   ALPHA 0.67
   States
   {
   Spawn:
      NULL A 3 Bright
      FLFX ABCDE 3 BRIGHT
      Stop 
   }
}

Actor FireDemonLeaderSplotch1
{
   Health 1000
   ReactionTime 8
   Radius 3
   Height 16
   Mass 100
   +DROPOFF
   +CORPSE
   +NOTELEPORT
   +FLOORCLIP
   States
   {
   Spawn:
       FDNL P 3
       FDNL P 6 A_QueueCorpse
       FDNL Y -1
       Stop
   }
}

Actor FireDemonLeaderSplotch2 : FireDemonLeaderSplotch1
{
   States
   {
   Spawn:
       FDNL Q 3
       FDNL Q 6 A_QueueCorpse
       FDNL Z -1
       Stop
   }
}

Actor FireDemonCommander : FireDemon
{
   Health 100
   ReactionTime 8
   PainChance 1
   Speed 13
   Radius 20
   Height 68
   Mass 75
   Damage 1
   Species "Afrit"
   Monster
   +DROPOFF
   +NOGRAVITY
   +FLOAT
   +FLOORCLIP
   +INVULNERABLE
   +TELESTOMP
   dropitem "ReagentRed" 32
   SeeSound "FireDemonSpawn"
   PainSound "FireDemonPain"
   DeathSound "FireDemonDeath"
   ActiveSound "FireDemonActive"
   Obituary "%o tasted an Afrit Commander's fire."
   States
   {
   Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,60),"Feared")
	Goto Pain
  Feared:
	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(914,0,25)
	TNT1 A 0 ACS_ExecuteAlways(560,0,0,0,0)
	goto Chase
   Spawn:
		FDNC X 0 Bright
		FDNC X 0 ACS_ExecuteAlways(913,0,100,8,0)//increase health on higher difficulties//A_JumpIf(ACS_ExecuteWithResult(522,0,0,0)==1,"Mutate")
       FDNC X 5 Bright
	   FDNC E 0 ACS_ExecuteAlways(913,0,100,8,0)//increase health on higher difficulties//A_JumpIf(ACS_ExecuteWithResult(522,0,0,0)==1,"Mutate")
       FDNC EFG 10 Bright A_Look
       Goto Spawn +3
   See:
       FDNC E 8 Bright
       FDNC F 6 Bright
       FDNC G 5 Bright
       FDNC F 8 Bright
       FDNC E 6 Bright
       FDNC G 7 Bright A_FiredRocks
       FDNC HI 5 Bright
       FDNC J 5 Bright A_UnSetInvulnerable
   Chase:
	   FDNC A 0 A_UnsetInvulnerable
       FDNC ABC 5 Bright A_FireDChase
       Loop
   Pain:
	FDNC A 0 A_UnsetInvulnerable
       FDNC D 6 Bright A_Pain
       Goto Chase
   Missile:
       FDNC K 3 Bright A_FaceTarget
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNC K 5 Bright A_CustomMissile("FireDemonCommanderMissile",32)
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNC K 5 Bright A_CustomMissile("FireDemonCommanderMissile",32)
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNC K 5 Bright A_CustomMissile("FireDemonCommanderMissile",32)
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNC K 5 Bright A_CustomMissile("FireDemonCommanderMissile",32)
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNC K 5 Bright A_CustomMissile("FireDemonCommanderMissile",32)
	   TNT1 A 0 A_FaceTarget
       TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNC K 5 Bright A_CustomMissile("FireDemonCommanderMissile",32)
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNC K 5 Bright A_CustomMissile("FireDemonCommanderMissile",32)
       Goto Chase
   Crash:
		FDNC M 5 A_FaceTarget
       FDNC N 5 A_NoBlocking
	   TNT1 A 0 A_SpawnItemEx("FireDemonCommanderSplotch1",0,0,0,Random(1,2),Random(1,2),Random(3,5),Random(1,360))
       FDNC O 5 A_SpawnItemEx("FireDemonCommanderSplotch2",0,0,0,Random(1,2),Random(1,2),Random(3,5),Random(1,360))
       Stop
   XDeath:
	   FDNC M 0 ACS_ExecuteAlways(914,0,25)
       FDNC M 5 A_FaceTarget
       FDNC N 5 A_NoBlocking
	   TNT1 A 0 A_SpawnItemEx("FireDemonCommanderSplotch1",0,0,0,Random(1,2),Random(1,2),Random(3,5),Random(1,360))
       FDNC O 5 A_SpawnItemEx("FireDemonCommanderSplotch2",0,0,0,Random(1,2),Random(1,2),Random(3,5),Random(1,360))
       Stop
   Death:
	   FDNC M 0 ACS_ExecuteAlways(914,0,25)
       FDNC D 4 Bright A_FaceTarget
       FDNC L 4 Bright A_Scream
       FDNC L 4 Bright A_NoBlocking
       FDNC L 200 Bright
       Stop
   Ice:
		"----" D 0 ACS_ExecuteAlways(914,0, 25)
       "----" D 5 A_GenericFreezeDeath
       "----" D 1 A_FreezeDeathChunks
       Wait
   }
}

Actor FireDemonCommanderMissile
{
  Health 1000
  ReactionTime 8
  Speed 15
  Radius 10
  Height 6
  Mass 5
  Damage (Random(1,8)+(ACS_ExecuteWithResult(912,1,0,0)/3))
  DamageType "Fire"
  Projectile
  +FLOORCLIP
  RenderStyle Add
  DeathSound "FireDemonMissileHit"
  States
  {
  Spawn:
    FDCB A 1 Bright A_CustomMissile("FireDemonCommanderTrail1",0,0,Random(-200,200),50,Random(-200,200))
	FDCB A 1 Bright A_CustomMissile("FireDemonCommanderTrail2",0,0,0,0)
      Loop
  Death:
    FDCB BCDE 5 Bright
    Stop
  }
}

ACTOR FireDemonCommanderTrail1
{   
   Radius 2
   Height 2
   Speed 1
   ReactionTime 60
   PROJECTILE
   RENDERSTYLE ADD
   Alpha 0.75
   +CLIENTSIDEONLY
   +NOGRAVITY
   +DOOMBOUNCE
   +EXPLODEONWATER
   -CANBOUNCEWATER
   -SOLID
   +DONTSPLASH
   +NOINTERACTION
   States
   {
   Spawn:
      FCSP AB 3 BRIGHT A_FadeOut(0.1)
      loop
   Death:
      FCSP CDE 3 BRIGHT
      Stop 
   }
}

ACTOR FireDemonCommanderTrail2
{   
   Radius 2
   Height 2
   Speed 0
   Scale 1.0
   PROJECTILE
   RENDERSTYLE ADD
   +CLIENTSIDEONLY
   +NOINTERACTION
   ALPHA 0.67
   States
   {
   Spawn:
      NULL A 3 Bright
      FCFX ABCDE 3 BRIGHT
      Stop 
   }
}

Actor FireDemonCommanderSplotch1
{
   Health 1000
   ReactionTime 8
   Radius 3
   Height 16
   Mass 100
   +DROPOFF
   +CORPSE
   +NOTELEPORT
   +FLOORCLIP
   States
   {
   Spawn:
       FDNC P 3
       FDNC P 6 A_QueueCorpse
       FDNC Y -1
       Stop
   }
}

Actor FireDemonCommanderSplotch2 : FireDemonCommanderSplotch1
{
   States
   {
   Spawn:
       FDNC Q 3
       FDNC Q 6 A_QueueCorpse
       FDNC Z -1
       Stop
   }
}

Actor FireDemonQueen : FireDemon
{
   Health 800
   ReactionTime 8
   PainChance 1
   Speed 13
   Radius 20
   Height 68
   Mass 75
   Damage 1
   Monster
   +DROPOFF
   +NOGRAVITY
   +FLOAT
   +FLOORCLIP
   +INVULNERABLE
   +TELESTOMP
   +NEVERRESPAWN
   Species "Afrit"
   SeeSound "FireDemonSpawn"
   PainSound "FireDemonPain"
   DeathSound "FireDemonDeath"
   ActiveSound "FireDemonActive"
   dropitem "artipurpleflask" 64
   dropitem "artiredflask" 64
   dropitem "ArtiAquaFlask" 64
   dropItem "ArtiBlackFlask" 64
   DropItem "ArtiWhiteFlash" 64
   DropItem "ArtiYellowFlask" 64
   Dropitem "ArtiOrangeFlask" 64
   Dropitem "newArtiBoostMana" 64
   DropItem "ForceCube" 64
   Obituary "%o tasted an Afrit Queen's fire."
   DamageFactor "Deathblow", 0
   States
   {
   Spawn:
		FDNQ X 0 Bright
		FDNQ X 0 ACS_ExecuteAlways(913,0,800,50,0)//increase health on higher difficulties//A_JumpIf(ACS_ExecuteWithResult(522,0,0,0)==1,"Mutate")
       FDNQ X 5 Bright
	   FDNQ E 0 ACS_ExecuteAlways(913,0,800,50,0)//increase health on higher difficulties//A_JumpIf(ACS_ExecuteWithResult(522,0,0,0)==1,"Mutate")
       FDNQ EFG 10 Bright A_Look
       Goto Spawn +3
   See:
       FDNQ E 8 Bright
       FDNQ F 6 Bright
       FDNQ G 5 Bright
       FDNQ F 8 Bright
       FDNQ E 6 Bright
       FDNQ G 7 Bright A_FiredRocks
       FDNQ HI 5 Bright
       FDNQ J 5 Bright A_UnSetInvulnerable
   Chase:
	FDNQ A 0 A_UnsetInvulnerable
       FDNQ ABC 5 Bright A_FireDChase
       Loop
   Pain:
	FDNQ A 0 A_UnsetInvulnerable
       FDNQ D 6 Bright A_Pain
       Goto Chase
   Missile:
       TNT1 A 0 A_Jump(48,28)
       FDNQ K 3 Bright A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNQ K 4 Bright A_CustomMissile("FireDemonQueenMissile",32)
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNQ K 4 Bright A_CustomMissile("FireDemonQueenMissile",32)
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNQ K 4 Bright A_CustomMissile("FireDemonQueenMissile",32)
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNQ K 4 Bright A_CustomMissile("FireDemonQueenMissile",32)
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNQ K 4 Bright A_CustomMissile("FireDemonQueenMissile",32)
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
	   FDNQ K 4 Bright A_CustomMissile("FireDemonQueenMissile",32)
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNQ K 4 Bright A_CustomMissile("FireDemonQueenMissile",32)
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
	   FDNQ K 4 Bright A_CustomMissile("FireDemonQueenMissile",32)
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNQ K 4 Bright A_CustomMissile("FireDemonQueenMissile",32)
       Goto Chase
	   TNT1 A 0 Thing_Stop(0)
	   TNT1 A 0 A_KillChildren
       TNT1 A 0 A_UnSetShootable
       FDNQ AAAAAAAAA 1 Bright A_FadeOut(0.10)
       FDNQ A 1 Bright A_SetTranslucent(0.0)
       TNT1 A 0 A_SpawnItemEx("FireDemonQueenClone",-50,100,0,0,0,0,0,16)
       TNT1 A 0 A_SpawnItemEx("FireDemonQueenClone",50,-100,0,0,0,0,0,16)
       TNT1 A 0 A_SpawnItemEx("FireDemonQueenClone",100,100,0,0,0,0,0,16)
       TNT1 A 0 A_SpawnItemEx("FireDemonQueenClone",-100,-50,0,0,0,0,0,16)
       FDNQ AAAAAAAAAA 1 Bright A_FadeIn(0.10)
       TNT1 A 0 A_SetShootable
       Goto Chase
   Crash:
   XDeath:
		FDNQ M 5 A_FaceTarget
       FDNQ N 5 A_NoBlocking
	   TNT1 A 0 A_SpawnItemEx("FireDemonQueenSplotch1",0,0,0,Random(1,2),Random(1,2),Random(3,5),Random(1,360))
       FDNQ O 5 A_SpawnItemEx("FireDemonQueenSplotch2",0,0,0,Random(1,2),Random(1,2),Random(3,5),Random(1,360))
       Stop
	   TNT1 A 0 A_KillChildren
	   FDNQ D 0 Bright ACS_ExecuteAlways(914,0, 500)
       FDNQ M 5 A_FaceTarget
       FDNQ N 5 A_NoBlocking
	   TNT1 A 0 A_SpawnItemEx("FireDemonQueenSplotch1",0,0,0,Random(1,2),Random(1,2),Random(3,5),Random(1,360))
       FDNQ O 5 A_SpawnItemEx("FireDemonQueenSplotch2",0,0,0,Random(1,2),Random(1,2),Random(3,5),Random(1,360))
       Stop
   Death:
	   TNT1 A 0 A_KillChildren
	   FDNQ D 0 Bright ACS_ExecuteAlways(914,0, 500)
       FDNQ D 4 Bright A_FaceTarget
       FDNQ L 4 Bright A_Scream
       FDNQ L 4 Bright A_NoBlocking
       FDNQ L 200 Bright
       Stop
   Ice:
       "----" A 0 A_KillChildren
	   "----" A 0 ACS_ExecuteAlways(914,0, 500)
       "----" A 5 A_GenericFreezeDeath
       "----" A 1 A_FreezeDeathChunks
       Wait
   }
}

actor FireDemonQueenClone: FireDemonQueen
{
   Health 1
   +NOBLOOD
   -COUNTKILL
   -TELESTOMP
   -INVULNERABLE
   RenderStyle Translucent
   Alpha 0.0
   States
   {
   Spawn:
       FDNQ AAAAAAA 1 Bright A_FadeIn(0.10)
       Goto Chase
   Missile:
       FDNQ K 3 Bright A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNQ K 5 Bright A_CustomMissile("FireDemonQueenMissile",32)
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNQ K 5 Bright A_CustomMissile("FireDemonQueenMissile",32)
	   TNT1 A 0 A_FaceTarget
	   TNT1 A 0 A_PlaySound("FireDemonAttack")
       FDNQ K 5 Bright A_CustomMissile("FireDemonQueenMissile",32)
	   Goto Chase
   Crash:
   XDeath:
   Death:
       FDNQ A 1 Bright A_FadeOut(0.10)
	   Loop
   }
}

Actor FireDemonQueenMissile
{
  Health 1000
  ReactionTime 8
  Speed 15
  Radius 10
  Height 6
  Mass 5
  Damage (Random(1,8)+(ACS_ExecuteWithResult(912,1,0,0)/3))
  DamageType "Fire"
  Projectile
  +FLOORCLIP
  RenderStyle Add
  DeathSound "FireDemonMissileHit"
  States
  {
  Spawn:
    FDQB A 1 Bright A_CustomMissile("FireDemonQueenTrail1",0,0,Random(-200,200),50,Random(-200,200))
	FDQB A 1 Bright A_CustomMissile("FireDemonQueenTrail2",0,0,0,0)
      Loop
  Death:
    FDQB BCDE 5 Bright
    Stop
  }
}

ACTOR FireDemonQueenTrail1
{   
   Radius 2
   Height 2
   Speed 1
   ReactionTime 60
   PROJECTILE
   RENDERSTYLE ADD
   Alpha 0.75
   +CLIENTSIDEONLY
   +NOGRAVITY
   +DOOMBOUNCE
   +EXPLODEONWATER
   -CANBOUNCEWATER
   -SOLID
   +DONTSPLASH
   +NOINTERACTION
   States
   {
   Spawn:
      FQSP AB 3 BRIGHT A_FadeOut(0.1)
      loop
   Death:
      FQSP CDE 3 BRIGHT
      Stop 
   }
}

ACTOR FireDemonQueenTrail2
{   
   Radius 2
   Height 2
   Speed 0
   Scale 1.0
   PROJECTILE
   RENDERSTYLE ADD
   +CLIENTSIDEONLY
   +NOINTERACTION
   ALPHA 0.67
   States
   {
   Spawn:
      NULL A 3 Bright
      FQFX ABCDE 3 BRIGHT
      Stop 
   }
}

Actor FireDemonQueenSplotch1
{
   Health 1000
   ReactionTime 8
   Radius 3
   Height 16
   Mass 100
   +DROPOFF
   +CORPSE
   +NOTELEPORT
   +FLOORCLIP
   States
   {
   Spawn:
       FDNQ P 3
       FDNQ P 6 A_QueueCorpse
       FDMN Y -1
       Stop
   }
}

Actor FireDemonQueenSplotch2 : FireDemonQueenSplotch1
{
   States
   {
   Spawn:
       FDNQ Q 3
       FDNQ Q 6 A_QueueCorpse
       FDMN Z -1
       Stop
   }
}

Actor Demon1SpotZ : RandomSpawner replaces Demon1
{
	Game Hexen
	SpawnID 3
	DropItem "NewDemon1" 255 170
	DropItem "Demon3" 255 85
}

Actor Demon2SpotZ : RandomSpawner replaces Demon2
{
	DropItem "NewDemon2" 255 170
	DropItem "Demon4" 255 85
}

Actor NewDemon1 : Demon1 //Replaces Demon1
{
speed 12
Species "ChaosSerpent"
PainChance "Convert", 255
DamageFactor ChaosSerpentFire, 0
+TELESTOMP
dropitem "ReagentTan" 32
meleerange 82
States
{
Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,70),"Feared")
	Goto Pain
  Feared:
	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(914,0,40)
	TNT1 A 0 ACS_ExecuteAlways(560,0,0,0,0)
	goto See
	Spawn:
		DEMN A 0
   	 	DEMN A 0 ACS_ExecuteAlways(913,0,250,10,0)//increase health on higher difficulties//A_JumpIf(ACS_ExecuteWithResult(535,0,0,0)==1,"Mutate")
    	DEMN AA 10 A_Look
    	Loop
	Idle:
		DEMN AA 10 A_Look
    	Loop
	Melee:
		DEMN E 6 A_FaceTarget
		DEMN F 8 A_FaceTarget
		DEMN G 6 A_CustomMeleeAttack((Random(1, 8)*2)+(ACS_ExecuteWithResult(912,3,0,0)/2))
		Goto See
	Death:
		DMN1 A 0 ACS_ExecuteAlways(914,0,40)
		DEMN H 0 A_SpawnItemEx("GIBBER")
		DEMN HI 6
		DEMN J 6 A_Scream
		DEMN K 6 A_NoBlocking
		DEMN L 6 A_QueueCorpse
		DEMN MNO 6
		DEMN P -1
		Stop
	XDeath:
	DEMN A 0 ACS_ExecuteAlways(914,0,40)
		DEMN H 6 A_SpawnItemEx("GIBBER")
		DEMN I 0 A_SpawnItemEx("Demon1Chunk1", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625),
                           1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 90)
    DEMN I 0 A_SpawnItemEx("Demon1Chunk2", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625),
                           1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 270)
    DEMN I 0 A_SpawnItemEx("Demon1Chunk3", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625),
                           1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 270)
    DEMN I 0 A_SpawnItemEx("Demon1Chunk4", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625),
                           1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 270)
    DEMN I 6 A_SpawnItemEx("Demon1Chunk5", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625),
                           1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 270)
    Goto Death+4

	Ice:
	"----" A 0 ACS_ExecuteAlways(914,0,40)
	"----" E 5 A_GenericFreezeDeath
	"----" E 1 A_FreezeDeathChunks
	Wait
	Raise:
	DEMN PONMLKJIH 6
	DEMN H 0 A_Pain
	Goto See
}
}

ACTOR NewDemon1Mash : NewDemon1 replaces Demon1Mash
{
  Game Hexen
  SpawnID 100
  +NOBLOOD
  +NOICEDEATH
  RenderStyle Translucent
  Alpha 0.4
}

Actor NewDemon1FX1 : Demon1FX1 replaces Demon1FX1
{
	Damage ((random(1,8)*5)+(ACS_ExecuteWithResult(912,3,0,0)))
	States
	{
	Spawn:
    DMFX AABBCC 2 Bright A_spawnitemEx("Demon1FX1Trail")
    Loop
	}
}

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


Actor Demon3 : Demon1
{
  Health 250
  Painchance 50
  Speed 13
  Radius 32
  Height 64
  Mass 220
  Monster
  +TELESTOMP
  +FLOORCLIP
  meleerange 82
  dropitem "ReagentRed" 32
  DamageFactor ChaosSerpentFire, 0
  Species "ChaosSerpent"
  BloodColor "Orange"
  SeeSound "DemonSight"
  AttackSound "DemonAttack"
  PainChance "Convert", 255
  PainSound "DemonPain"
  DeathSound "DemonDeath"
  ActiveSound "DemonActive"
  Obituary "%o was blasted by a Magma Serpent."
  HitObituary "%o was swallowed by a Magma Serpent."
  States
  {
  Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,70),"Feared")
	Goto Pain
  Feared:
	TNT1 A 0 A_Changeflag("Frightened", 1)
	Goto Pain
  Spawn:
	RDMN A 0
   	RDMN A 0 ACS_ExecuteAlways(913,0,250,10,0)//increase health on higher difficulties//A_JumpIf(ACS_ExecuteWithResult(535,0,0,0)==1,"Mutate")
    RDMN AA 10 A_Look
    Loop
  Pain.Convert:
	TNT1 A 0 A_JumpIfInTargetInventory("Visions",Random(0,9),"ConvertMe")
	goto Pain
	ConvertMe:
	TNT1 A 0 ACS_ExecuteAlways(914,0,55)
	TNT1 A 0 ACS_ExecuteAlways(560,0,0,0,0)
	goto See
  Idle:
	RDMN AA 10 A_Look
    Loop
  See:
    RDMN ABCD 4 A_Chase
    Loop
  Pain:
    RDMN E 4
    RDMN E 4 A_Pain
    Goto See
  Melee:
    RDMN E 6 A_FaceTarget
    RDMN F 8 A_FaceTarget
    RDMN G 6 A_CustomMeleeAttack((Random(1, 8)*2)+(ACS_ExecuteWithResult(912,3,0,0)/2))
    Goto See
  Missile:
    RDMN E 5 A_FaceTarget
    RDMN F 6 A_FaceTarget
    RDMN G 5 A_CustomMissile("Demon3FX",62,0,0,0)
    Goto See
  Death:
	RDMN A 0 ACS_ExecuteAlways(914,0,55)
    RDMN H 6 A_SpawnItemEx("GIBBERORANGE")
	RDMN I 6
    RDMN J 6 A_Scream
    RDMN K 6 A_NoBlocking
    RDMN L 6  A_QueueCorpse
    RDMN MNO 6
    RDMN P -1
    Stop
  XDeath:
	RDMN A 0 ACS_ExecuteAlways(914,0,55)
    RDMN H 6 A_SpawnItemEx("GIBBERORANGE")
    TNT1 A 0 A_SpawnItemEx("Demon3Chunk1", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625),1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 90)
    TNT1 A 0 A_SpawnItemEx("Demon3Chunk2", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625),1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 270)
    TNT1 A 0 A_SpawnItemEx("Demon3Chunk3", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625),1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 270)
    TNT1 A 0 A_SpawnItemEx("Demon3Chunk4", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625),1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 270)
    RDMN I 6 A_SpawnItemEx("Demon3Chunk5", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625),1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 270)
    Goto Death+3
  Ice:
	"----" A 0 ACS_ExecuteAlways(914,0,55)
    "----" E 5 A_GenericFreezeDeath
    "----" E 1 A_FreezeDeathChunks
    Wait
  }
}

Actor Demon3Chunk1 : DemonChunk
{
  States
  {
  Spawn:
    RDMA A 4
    RDMA A 10 A_QueueCorpse
    RDMA A 20
    Wait
  Death:
    RDMA A -1
    Stop
  }
}

Actor Demon3Chunk2 : DemonChunk
{
  States
  {
  Spawn:
    RDMB A 4
    RDMB A 10 A_QueueCorpse
    RDMB A 20
    Wait
  Death:
    RDMB A -1
    Stop
  }
}

Actor Demon3Chunk3 : DemonChunk
{
  States
  {
  Spawn:
    RDMC A 4
    RDMC A 10 A_QueueCorpse
    RDMC A 20
    Wait
  Death:
    RDMC A -1
    Stop
  }
}

Actor Demon3Chunk4 : DemonChunk
{
  States
  {
  Spawn:
    RDMD A 4
    RDMD A 10 A_QueueCorpse
    RDMD A 20
    Wait
  Death:
    RDMD A -1
    Stop
  }
}

Actor Demon3Chunk5 : DemonChunk
{
  States
  {
  Spawn:
    RDME A 4
    RDME A 10 A_QueueCorpse
    RDME A 20
    Wait
  Death:
    RDME A -1
    Stop
  }
}

Actor Demon3FX
{
  Speed 15
  Radius 10
  Height 6
  Damage ((random(1,8)*5)+(ACS_ExecuteWithResult(912,3,0,0)))
  DamageType Fire
  Projectile
  +SPAWNSOUNDSOURCE
  RenderStyle Add
  SeeSound "DemonMissileFire"
  DeathSound "DemonMissileExplode"
  States
  {
  Spawn:
	RDFX AABBCC 2 Bright A_spawnitemEx("Demon3FX1Trail")
    Loop
  Death:
  	TNT1 AA 0 A_CustomMissile("HrVolcanoTBlast",0,0,random(0,359),CMF_TRACKOWNER,random(0,60))
	TNT1 AA 0 A_CustomMissile("HrVolcanoTBlast",0,0,random(0,359),CMF_TRACKOWNER,random(0,60))
  	TNT1 AA 0 A_CustomMissile("HrVolcanoTBlast",0,0,random(0,359),CMF_TRACKOWNER,random(0,60))
    XPL1 A 4 BRIGHT A_CustomMissile("HrVolcanoTBlast",0,0,random(0,359),CMF_TRACKOWNER,random(0,60))
    XPL1 B 4 BRIGHT //A_SpawnItemEx("RedDemonFXExplosion")
    XPL1 CDEF 4 BRIGHT
    Stop
  }
}

ACTOR Demon3FX1Trail
{
    Radius 1
    Height 1
	Gravity 0
	Speed 1
	Scale 1.1
    +NOBLOCKMAP
    +NOTELEPORT
    +DONTSPLASH
	+MISSILE
	+CLIENTSIDEONLY
	+FORCEXYBILLBOARD
	+NOINTERACTION
	Renderstyle Add
    States
    {
    Spawn:
        FBL1 CDEFG 4
        Stop
    }
}

ACTOR HrVolcanoTBlast
{
  Radius 8
  Height 6
  Speed 20
  Damage (random(1,8)+(ACS_ExecuteWithResult(912,1,0,0)/2))
  Gravity 0.825
  +NOBLOCKMAP
  +MISSILE
  +DROPOFF
  +NOTELEPORT
  Damagetype "Fire"
  Renderstyle Add
  States
  {
  Spawn:
    VTFB AB 4 BRIGHT
    Loop
  Death:
    SFFI CBABCDE 4 BRIGHT
    Stop
  }
}

Actor RedDemonFXExplosion
{
  DamageType ChaosSerpentFire
  +NODAMAGETHRUST
  States
  {
  Spawn:
  	TNT1 A 0 A_Explode(32,52,0)
  Death:
    TNT1 A 0
  	Stop
  }
}

Actor NewDemon2 : Demon2
{
DamageFactor ChaosSerpentFire, 0
PainChance "Convert", 255
Species "ChaosSerpent"
+TELESTOMP
meleerange 82
dropitem "ReagentTan" 32
States
{
Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,70),"Feared")
	Goto Pain
  Feared:
	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(914,0,40)
	TNT1 A 0 ACS_ExecuteAlways(560,0,0,0,0)
	goto See
	Spawn:
		DEM2 A 0
   	 	DEM2 A 0 ACS_ExecuteAlways(913,0,250,10,0)//increase health on higher difficulties//A_JumpIf(ACS_ExecuteWithResult(536,0,0,0)==1,"Mutate")
		//Idle
    	DEM2 AA 10 A_Look
    	Loop
	Idle:
		DEM2 AA 10 A_Look
    	Loop
	Melee:
		DEM2 E 6 A_FaceTarget
		DEM2 F 8 A_FaceTarget
		DEM2 G 6 A_CustomMeleeAttack((Random(1, 8)*2)+(ACS_ExecuteWithResult(912,3,0,0)/2))
		Goto See
	Death:
		DMN2 T 0 ACS_ExecuteAlways(914,0,40)
		DMN2 T 6 A_SpawnItemEx("GIBBER")
		DMN2 U 6 A_Scream
		DMN2 V 6 A_NoBlocking
		DMN2 W 6 A_QueueCorpse
		DMN2 XY 6
		DMN2 Y -1
		Stop
	XDeath:
	DEM2 A 0 ACS_ExecuteAlways(914,0,40)
	DEM2 H 6 A_SpawnItemEx("GIBBER")
	DEM2 I 0 A_CustomMissile("Demon2Chunk1",2,0,Random(0,360),2)
	DEM2 I 0 A_CustomMissile("Demon2Chunk2",2,0,Random(0,360),2)
	DEM2 I 0 A_CustomMissile("Demon2Chunk3",2,0,Random(0,360),2)
	DEM2 I 0 A_CustomMissile("Demon2Chunk4",2,0,Random(0,360),2)
	DEM2 I 0 A_CustomMissile("Demon2Chunk5",2,0,Random(0,360),2)
	DEM2 I 6
	DEM2 J 6 A_Scream
	DEM2 K 6 A_NoBlocking
	DEM2 L 6 A_QueueCorpse
	DEM2 MNO 6
	DEM2 P -1
	Stop
	Death:
	DEM2 A 0 ACS_ExecuteAlways(914,0,40)
	DEM2 H 0 A_SpawnItemEx("GIBBER")
    DEM2 HI 6
    DEM2 J 6 A_Scream
    DEM2 K 6 A_NoBlocking
    DEM2 L 6 A_QueueCorpse
    DEM2 MNO 6
    DEM2 P -1
    Stop
  XDeath:
  DEM2 A 0 ACS_ExecuteAlways(914,0,40)
    DEM2 H 6 A_SpawnItemEx("GIBBER")
    DEM2 I 0 A_SpawnItemEx("Demon2Chunk1", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625),
                           1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 90)
    DEM2 I 0 A_SpawnItemEx("Demon2Chunk2", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625),
                           1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 270)
    DEM2 I 0 A_SpawnItemEx("Demon2Chunk3", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625),
                           1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 270)
    DEM2 I 0 A_SpawnItemEx("Demon2Chunk4", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625),
                           1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 270)
    DEM2 I 6 A_SpawnItemEx("Demon2Chunk5", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625),
                           1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 270)
    Goto Death+4
	Ice:
	"----" A 0 ACS_ExecuteAlways(914,0,70)
	"----" E 5 A_GenericFreezeDeath
	"----" E 1 A_FreezeDeathChunks
	Wait
	Raise:
	DEM2 PONMLKJIH 6
	DEM2 H 0 A_Pain
	Goto See
}
}

ACTOR NewDemon2Mash : NewDemon2 replaces Demon2Mash
{
  Game Hexen
  SpawnID 101
  +NOBLOOD
  +NOICEDEATH
  RenderStyle Translucent
  Alpha 0.4
}

Actor Demon4 : Demon2
{
  Health 250
  Painchance 50
  Speed 13
  Radius 32
  Height 64
  Mass 220
  Monster
  +TELESTOMP
  +FLOORCLIP
  meleerange 82
  BloodColor 00 80 00
  dropitem "ReagentGreen" 32
  SeeSound "DemonSight"
  AttackSound "DemonAttack"
  PainSound "DemonPain"
  PainChance "Convert", 255
  DeathSound "DemonDeath"
  ActiveSound "DemonActive"
  Species "ChaosSerpent"
  Obituary "%o was envenomed by a Serpent."
  States
  {
  Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,70),"Feared")
	Goto Pain
  Feared:
	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(914,0,55)
	TNT1 A 0 ACS_ExecuteAlways(560,0,0,0,0)
	goto See
  Spawn:
	DEM4 A 0
   	DEM4 A 0 ACS_ExecuteAlways(913,0,250,10,0)//increase health on higher difficulties//A_JumpIf(ACS_ExecuteWithResult(535,0,0,0)==1,"Mutate")
    DEM4 AA 10 A_Look
    Loop
  Idle:
	DEM4 AA 10 A_Look
    Loop
  See:
    DEM4 ABCD 4 A_Chase
    Loop
  Pain:
    DEM4 E 4
    DEM4 E 4 A_Pain
    Goto See
  Melee:
	DEM4 E 6 A_FaceTarget
	DEM4 F 8 A_FaceTarget
	DEM4 G 6 A_CustomMeleeAttack((Random(1, 8)*2)+(ACS_ExecuteWithResult(912,3,0,0)/2))
	Goto See
  Missile:
    DEM4 E 5 A_FaceTarget
    DEM4 F 6 A_FaceTarget
    DEM4 G 5 A_CustomMissile("Demon4FX", 62, 0)
    Goto See
  Death:
	DEM4 A 0 ACS_ExecuteAlways(914,0,55)
	DEM4 H 0 A_SpawnItemEx("GREENGIBBERS")
    DEM4 HI 6
    DEM4 J 6 A_Scream
    DEM4 K 6 A_NoBlocking
    DEM4 L 6 A_QueueCorpse
    DEM4 MNO 6
    DEM4 P -1
    Stop
  XDeath:
	DEM4 A 0 ACS_ExecuteAlways(914,0,55)
    DEM4 H 6 A_SpawnItemEx("GREENGIBBERS")
    TNT1 A 0 A_SpawnItemEx("Demon4Chunk1", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625), 1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 90)
    TNT1 A 0 A_SpawnItemEx("Demon4Chunk2", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625), 1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 270)
    TNT1 A 0 A_SpawnItemEx("Demon4Chunk3", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625), 1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 270)
    TNT1 A 0 A_SpawnItemEx("Demon4Chunk4", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625), 1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 270)
    DEM4 I 6 A_SpawnItemEx("Demon4Chunk5", 0,0,45, 1+(random[DemonChunks](0,255)*0.015625), 1+(random[DemonChunks](0,255)*0.015625), ChunkFlags, 270)
    Goto Death+4
  Ice:
	"----" E 0 ACS_ExecuteAlways(914,0,55)
    "----" E 5 A_GenericFreezeDeath
    "----" E 1 A_FreezeDeathChunks
    Wait
  }
}

Actor Demon4Chunk1 : DemonChunk
{
  States
  {
  Spawn:
    BDMA A 4
    BDMA A 10 A_QueueCorpse
    BDMA A 20
    Wait
  Death:
    BDMA A -1
    Stop
  }
}

Actor Demon4Chunk2 : DemonChunk
{
  States
  {
  Spawn:
    BDMB A 4
    BDMB A 10 A_QueueCorpse
    BDMB A 20
    Wait
  Death:
    BDMB A -1
    Stop
  }
}

Actor Demon4Chunk3 : DemonChunk
{
  States
  {
  Spawn:
    BDMC A 4
    BDMC A 10 A_QueueCorpse
    BDMC A 20
    Wait
  Death:
    BDMC A -1
    Stop
  }
}

Actor Demon4Chunk4 : DemonChunk
{
  States
  {
  Spawn:
    BDMD A 4
    BDMD A 10 A_QueueCorpse
    BDMD A 20
    Wait
  Death:
    BDMD A -1
    Stop
  }
}

Actor Demon4Chunk5 : DemonChunk
{
  States
  {
  Spawn:
    BDME A 4
    BDME A 10 A_QueueCorpse
    BDME A 20
    Wait
  Death:
    BDME A -1
    Stop
  }
}

Actor Demon4FX
{
  Speed 15
  Radius 10
  Height 6
  Damage ((random(1,8)*5)+(ACS_ExecuteWithResult(912,3,0,0)))
  PoisonDamage 60
  DamageType Fire
  Projectile
  +SPAWNSOUNDSOURCE
  RenderStyle Add
  Alpha 0.99
  SeeSound "DemonMissileFire"
  DeathSound "DemonMissileExplode"
  States
  {
  Spawn:
    D4FX AABB 2 Bright A_SpawnItemEx("BlackDemonTrail", 0, 0,
                                0, 0, 0, 0, 0, 0)
    Loop
  Death:
	TNT1 AA 0 A_CustomMissile("PoisonVolcanoTBlast",0,0,random(0,359),CMF_TRACKOWNER,random(0,60))
	TNT1 AA 0 A_CustomMissile("PoisonVolcanoTBlast",0,0,random(0,359),CMF_TRACKOWNER,random(0,60))
  	TNT1 AA 0 A_CustomMissile("PoisonVolcanoTBlast",0,0,random(0,359),CMF_TRACKOWNER,random(0,60))
    D4FX C 4 BRIGHT A_CustomMissile("PoisonVolcanoTBlast",0,0,random(0,359),CMF_TRACKOWNER,random(0,60))
    D4FX DEFGH 4 BRIGHT
    Stop
  }
}

ACTOR BlackDemonTrail
{
  Radius 6
  Height 8
  Speed 10
  +NOBLOCKMAP
  +NOGRAVITY
  +MISSILE
  +NOTELEPORT
  +DONTSPLASH
  +CLIENTSIDEONLY
  +NOINTERACTION
  RenderStyle Add
  States
  {
  Spawn:
    D4TR DEFGH 4
    Stop
  }
}

Actor PoisonVolcanoTBlast
{
  Radius 8
  Height 6
  Speed 20
  Damage (random(1,8)+(ACS_ExecuteWithResult(912,1,0,0)/2))
  Gravity 0.825
  PoisonDamage 5
  DamageType Fire
  Obituary "%o was envenomed by a Serpent."
  +NOBLOCKMAP
  +MISSILE
  +DROPOFF
  +NOTELEPORT
  Renderstyle Add
  States
  {
  Spawn:
    BPBL AB 4 BRIGHT
    Loop
  Death:
    BPBL EDCDEFG 4 BRIGHT
    Stop
  }
}

/*Actor NewDemon1Fx1 : Demon1FX1 replaces Demon1FX1
{
	states
	{
  Spawn:
    DMFX ABC 4 Bright A_SpawnItemEx("Demon1FX1Trail")
    Loop
}
}

Actor Demon1FX1Trail
{
	Radius 10
  Height 6
  Projectile
	Renderstyle Add
	States
	{
	Spawn:
    DMFX E 3 Bright
    DMFX FGH 3 Bright
    Stop
  }
}*/


Actor NewDemon2Fx1 : Demon2FX1 replaces Demon2FX1
{
	PoisonDamage 75
	Damage ((random(1,8)*5)+(ACS_ExecuteWithResult(912,3,0,0)))
}

Actor NewIceGuy : IceGuy Replaces IceGuy
{
PainChance "Convert", 255
PainChance 0
+TELESTOMP
dropitem "ReagentBlue" 64
States
{
Spawn:
	ICEY A 0
	ICEY A 0 ACS_ExecuteAlways(913,0,120,20,0)//increase health on higher difficulties//A_JumpIf(ACS_ExecuteWithResult(536,0,0,0)==1,"Mutate")
    ICEY A 10 A_IceGuyLook
    Loop
Idle:
	ICEY A 10 A_IceGuyLook
    Loop
Pain.Convert:
	TNT1 A 0 A_JumpIfInTargetInventory("Visions",Random(0,6),"ConvertMe")
	goto See
	ConvertMe:
	TNT1 A 0 ACS_ExecuteAlways(914,0,35)
	TNT1 A 0 ACS_ExecuteAlways(560,0,0,0,0)
	goto See
	Death:
	ICEY A 0 ACS_ExecuteAlways(914,0,35)
	ICEY A 1 A_IceGuyDie
	Stop
}
}

Actor NewIceGuyFX : IceGuyFX replaces IceGuyFX
{
	Damage (random(1,8)+(ACS_ExecuteWithResult(912,1,0,0)))
	States
	{
	Death:
    ICPR D 4 Bright
	ICPR E 0 Bright A_CustomMissile("IceGuyFX2", 0, 0, 360, 6, 3)
	ICPR E 0 Bright A_CustomMissile("IceGuyFX2", 0, 0, 315, 6, 3)
	ICPR E 0 Bright A_CustomMissile("IceGuyFX2", 0, 0, 270, 6, 3)
	ICPR E 0 Bright A_CustomMissile("IceGuyFX2", 0, 0, 235, 6, 3)
	ICPR E 0 Bright A_CustomMissile("IceGuyFX2", 0, 0, 180, 6, 3)
	ICPR E 0 Bright A_CustomMissile("IceGuyFX2", 0, 0, 135, 6, 3)
	ICPR E 0 Bright A_CustomMissile("IceGuyFX2", 0, 0, 90, 6, 3)
	ICPR E 0 Bright A_CustomMissile("IceGuyFX2", 0, 0, 45, 6, 3)
    ICPR E 4 Bright A_CustomMissile("IceGuyFX2", 0, 0, 0, 6, 3)
    ICPR FG 4 Bright
    ICPR H 3 Bright
    Stop
	}
}

Actor NewIceGuyFX2 : IceGuyFX2 replaces IceGuyFX2
{
	Damage (random(1,4)+(ACS_ExecuteWithResult(912,1,0,0)/2))
}


ACTOR NewMinotaur
{
  Radius 28
  Height 100
  Speed 16
  Damage 7
  Monster
  +FLOORCLIP
  +DONTMORPH
  +NODROPOFF
  SeeSound "minotaur/sight"
  AttackSound "minotaur/attack1"
  PainSound "minotaur/pain"
  DeathSound "minotaur/death"
  ActiveSound "minotaur/active"
  health 500
  painchance 0
  meleerange 164
  mass 4000
  //+NOICEDEATH
  +QUICKTORETALIATE
  +MISSILEMORE
  +DONTMORPH
  Obituary "%o was burnt to a crisp by the Maulotaur."
  HitObituary "%o was crushed by the Maulotaur."
  states
  {
  Spawn:
	NMTR A 0
	NMTR A 0 ACS_ExecuteAlways(913,0,500,25,0)//increase health on higher difficulties//A_JumpIf(ACS_ExecuteWithResult(536,0,0,0)==1,"Mutate")
    NMTR AB 10 A_Look
    Loop
	Idle:
  NMTR AB 10 A_Look
    Loop
  Melee:
    NMTR U 0 A_UnSetInvulnerable
	NMTR U 0 A_TakeInventory("Hammercheck", 1)
    NMTR V 10 A_FaceTarget
    NMTR W 7 A_FaceTarget
    NMTR X 12 A_CustomMeleeAttack ((random(1,8)*7)+(ACS_ExecuteWithResult(912,6,0,0)), "minotaur/melee")
    Goto See
  Missile:
    NMTR U 0 A_UnSetInvulnerable
    NMTR V 0 A_Jump(51, 2)
    NMTR V 0 A_JumpIfCloser(800, "Hammer")
	NMTR V 0 A_TakeInventory("Hammercheck", 1)
  	NMTR V 0 A_Jump(104, 2)
    NMTR V 0 A_JumpIfCloser(2000, "Charge")
    NMTR V 10
    NMTR Y 4 A_FaceTarget
	NMTR Z 0 A_CustomMissile("MinotaurFX1", 40, 0, 0)
	NMTR Z 0 A_CustomMissile("MinotaurFX1", 40, 0, 2.8125)
	NMTR Z 0 A_CustomMissile("MinotaurFX1", 40, 0, -2.8125)
	NMTR Z 0 A_CustomMissile("MinotaurFX1", 40, 0, 5.625)
	NMTR Z 0 A_CustomMissile("MinotaurFX1", 40, 0, -5.625)
    NMTR Z 9
    Goto See
  Hammer:
    NMTR U 0 A_UnSetInvulnerable
  	NMTR V 0 A_JumpIfInventory("Hammercheck", 1, "Missile")
    NMTR V 10 A_FaceTarget
    NMTR W 7 A_FaceTarget
	NMTR W 0 A_PlaySound("minotaur/attack3", CHAN_VOICE)
	NMTR X 0 A_PlaySound("minotaur/attack1", CHAN_WEAPON)
    NMTR X 12 A_CustomMissile("MinotaurFX2", 0, 0, 0)
	NMTR V 0 A_Jump(192, "HammerLoop")
    Goto See
  HammerLoop:
    NMTR X 12 A_GiveInventory("Hammercheck", 1)
    Goto Hammer
  Charge:
	NMTR U 0 A_SetInvulnerable
    NMTR U 0 A_FaceTarget
    NMTR U 0 A_SkullAttack(13)
	NMTR U 0 A_SpawnItemEx("MinoPuff",0,0,0,0,0,2)
	NMTR U 0 A_FaceTarget
	NMTR U 2
	NMTR U 0 A_JumpIf(z - floorz >= 15, "ChargeStop")
    goto Charge+2
   ChargeStop:
    SPOS A 0 A_Stop
    goto See
  See:
    NMTR A 0 A_UnSetInvulnerable
	//NMTR A 0 A_PlaySound("gibbage/xbstep")
    NMTR AB 5 A_Chase
	//NMTR C 0 A_PlaySound("gibbage/xbstep")
	NMTR CD 5 A_Chase
    Loop
  Death:
  NMTR A 0 ACS_ExecuteAlways(914,0,400)
    NMTR F 1 //A_SpawnItemEx("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
    NMTR F 1 //A_SpawnItemEx("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
    NMTR F 1 //A_SpawnItemEx("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
    NMTR F 1 // A_SpawnItemEx("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
    NMTR F 1 //A_SpawnItemEx("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
    NMTR F 1 //A_SpawnItemEx("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
    NMTR F 1 //A_SpawnItemEx("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
    NMTR F 1 //A_SpawnItemEx("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
    NMTR F 1 //A_SpawnItemEx("Kaboom", 0, 0,0,random(-9,9),random(-9,9),random(5,9), 48, 128)
    NMTR G 5
    NMTR H 6 A_Scream
    NMTR I 5
    NMTR J 6
    NMTR K 5
    NMTR L 6
    NMTR M 5 A_NoBlocking
    NMTR N 6
    NMTR O 5
    NMTR P 6
    NMTR Q 5
    NMTR R 6
    NMTR S 5
    NMTR T -1 A_BossDeath
    Stop
  Ice:
	"----" A 0 ACS_ExecuteAlways(914,0,400)
	"----" E 5 A_GenericFreezeDeath
	"----" E 1 A_FreezeDeathChunks
	Wait
  }
}

ACTOR MinoPuff : PhoenixPuff
{
  +NOBLOCKMAP
  +NOGRAVITY
  +NOTELEPORT
  +CANNOTPUSH
  RenderStyle Translucent
  Alpha 0.4
    SeeSound ""
  DeathSound ""
  States
  {
  Spawn:
    FX04 BCDEF 4
    Stop
  }
}

ACTOR HammerCheck : Inventory
{
inventory.maxamount 1
}

Actor CentaurSpotZ : RandomSpawner replaces Centaur
{
	Game Hexen
	SpawnID 1
	DropItem "NewCentaur"
	DropItem "ImpWarrior"
	DropItem "NewClink"
}

Actor NewCentaur : Centaur// Replaces Centaur
{
speed 10
PainChance "Convert", 255
Species "Centaur"
+TELESTOMP
-DEFLECT
dropitem "ArtiEmptyFlask" 64
  dropitem "ArtiMaroonFlask" 16
  dropitem "ReagentRed" 64
  Dropitem "Armour2" 8
meleerange 60
States
{
Spawn:
	CENT A 0
	CENT A 0 ACS_ExecuteAlways(913,0,200,10,0)//increase health on higher difficulties
    CENT AB 10 A_Look
    Loop
Idle:
	CENT AB 10 A_Look
    Loop
	Melee:
    CENT H 5 A_FaceTarget
    CENT I 4 A_FaceTarget
    CENT J 7 A_CustomMeleeAttack(random(3,9)+(ACS_ExecuteWithResult(912,2,0,0)))
    Goto See
Pain.Convert:
	TNT1 A 0 A_JumpIfInTargetInventory("Visions",Random(0,5),"ConvertMe")
	goto Pain
	ConvertMe:
	TNT1 A 0 ACS_ExecuteAlways(914,0,40)
	TNT1 A 0 ACS_ExecuteAlways(560,0,0,0,0)
	goto See
  See:
	CENT ABCD 5 A_Chase
    Loop
  Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,60),"Feared")
	Goto Pain
  Feared:
	TNT1 A 0 A_Changeflag("Frightened", 1)
	Goto Pain
  Pain:
    CENT G 9 A_Pain
    CENT G 3 A_SetReflectiveInvulnerable
    CENT EEE 15 A_CentaurDefend
    CENT E 1 A_UnsetReflectiveInvulnerable
    Goto See
	Death:
	CENT A 0 ACS_ExecuteAlways(914,0,40)
	CENT K 4
	CENT L 4 A_Scream
	CENT MN 4
	CENT O 4 A_NoBlocking
	CENT PQ 4
	CENT R 4 A_QueueCorpse
	CENT S 4
	CENT T -1
	Stop
	XDeath:
	CENT A 0 ACS_ExecuteAlways(914,0,40)
	CTXD A 0 A_SpawnItemEx("GIBBER")
	CTXD B 4 A_NoBlocking
	CTXD C 0 A_SpawnItemEx("CentaurSword", 0, 0, 45, 1 + random[CentaurDrop](-128,127)*0.03125,
                           1 + random[CentaurDrop](-128,127)*0.03125, 8 + random[CentaurDrop](0,255)*0.015625, 270)
    CTXD C 4 A_SpawnItemEx("CentaurShield", 0, 0, 45, 1 + random[CentaurDrop](-128,127)*0.03125,
                           1 + random[CentaurDrop](-128,127)*0.03125, 8 + random[CentaurDrop](0,255)*0.015625, 90)

	CTXD D 3 A_Scream
	CTXD E 4 A_QueueCorpse
	CTXD F 3
	CTXD G 4
	CTXD H 3
	CTXD I 4
	CTXD J 3
	CTXD K -1
	Stop
	Ice:
	"----" A 0 ACS_ExecuteAlways(914,0,40)
	"----" G 5 A_GenericFreezeDeath
	"----" G 1 A_FreezeDeathChunks
	Wait
	Raise:
	CENT TSRQPONMLK 4
	CENT K 0 A_Pain
	Goto See
}
}

ACTOR NewCentaurMash : NewCentaur replaces CentaurMash
{
  Game Hexen
  SpawnID 103
  +NOBLOOD
  +NOICEDEATH
  RenderStyle Translucent
  Alpha 0.4
}

Actor ImpWarrior
{
    Health 180
    Radius 20
    Height 56
	Scale 1.15
    Speed 8
    PainChance 128
    MONSTER
    +FLOORCLIP
	+TELESTOMP
	Meleerange 52
	PainChance "Convert", 255
	Species "Centaur"
    SeeSound "orc/sight"
    PainSound "orc/pain"
    DeathSound "orc/death"
    ActiveSound "orc/active"
	dropitem "ArtiEmptyFlask" 64
	dropitem "ArtiBlackFlask" 8
	dropitem "ReagentRed" 64
	DropItem "Armour7" 8
	//AttackSound "implord/macehit"
    Obituary "%o couldn't run from the imp warrior's fireball."
    HitObituary "%o was beaten to death by an imp warrior."
    States
    {
	Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,60),"Feared")
	Goto Pain
  Feared:
	TNT1 A 0 A_Changeflag("Frightened", 1)
	Goto Pain
    Spawn:
		WARI A 0
	WARI A 0 ACS_ExecuteAlways(913,0,180,11,0)//increase health on higher difficulties
        WARI AB 10 A_Look
        Loop
	Idle:
		WARI A 0 A_UnSetInvulnerable
		WARI AB 10 A_Look
        Loop
    See:
		WARI A 0 A_UnSetInvulnerable
        WARI AABBCCDD 3 A_Chase
        Loop
    Melee:
        WARI E 6 A_FaceTarget
        TNT1 A 0 A_PlaySound("implord/maceswing")
        WARI F 4 A_FaceTarget
        WARI G 5 A_CustomMeleeAttack(random(1,8)+(ACS_ExecuteWithResult(912,2,0,0)), "implord/macehit", "none")
        Goto See
    Missile:
		WARI G 0 A_Jump(38, 1)
		Goto See
        WARI GF 8 A_FaceTarget
        TNT1 A 0 A_Jump(128,2)
        WARI E 8 A_CustomMissile("FamiliarSpawner", 36, 0, -30)
        Goto See
        WARI E 8 A_CustomMissile("FamiliarSpawner", 36, 0, 30)
        Goto See
    Pain:
        WARI H 8 A_Pain
	    WARI I 1
        TNT1 A 0 A_SetInvulnerable
	    WARI IIIIII 4 A_FaceTarget
        WARI IIII 4 A_FaceTarget
        TNT1 A 0 A_UnSetInvulnerable
		Goto See
	Pain.Convert:
	TNT1 A 0 A_JumpIfInTargetInventory("Visions",Random(0,6),"ConvertMe")
	goto Pain
	ConvertMe:
	TNT1 A 0 ACS_ExecuteAlways(914,0,40)
	TNT1 A 0 ACS_ExecuteAlways(560,0,0,0,0)
	goto See
    Death:
		TNT1 A 0 ACS_ExecuteAlways(914,0,40)
        TNT1 A 0 A_FaceTarget
        TNT1 A 0 A_SpawnItemEx("WarlordMace", 0, 0, 32, 4, 0, 0, -90, 128)
        WARI R 8 A_SpawnItemEx("WarlordShield", 0, 0, 32, 5, 0, 0, 90, 128)
        WARI S 8 A_Scream
        WARI T 6
	    WARI U 6 A_Fall
        WARI V -1
        Stop
	Ice:
		"----" A 0 ACS_ExecuteAlways(914,0,40)
		"----" H 5 A_GenericFreezeDeath
		"----" H 1 A_FreezeDeathChunks
		Wait
    }
}

Actor NewClink
{
  Health 150
  Radius 20
  Height 56
  Mass 135
  Speed 14
  Painchance 32
  Monster
  +NOBLOOD
  +FLOORCLIP
  Species "Centaur"
  +DONTHURTSPECIES
  +QUICKTORETALIATE
  DropItem "ForceCube" 8
  SeeSound "clink/sight"
  AttackSound "clink/attack"
  PainSound "clink/pain"
  DeathSound "clink/death"
  ActiveSound "clink/active"
  Damage (random(3,9)+(ACS_ExecuteWithResult(912,2,0,0)))
  +NOTARGET
  +NOINFIGHTING
  Obituary "$OB_CLINK" // "%o was slashed by a sabreclaw."
  MeleeRange 52
  States
  {
  Spawn:
	CLNK A 0
	CLNK A 0 ACS_ExecuteAlways(913,0,150,11,0)//increase health on higher difficulties
    CLNK AB 10 A_Look
    Loop
  Idle:
    CLNK AB 10 A_Look
    Loop
  See:
	CLNK A 0 A_UnSetInvulnerable
    CLNK A 3 A_Chase
	CLNK B 3 A_Chase
	CLNK C 3 A_Chase
	CLNK D 3 A_Chase
    Loop
  Melee:
	CLNK A 0 A_UnSetInvulnerable
    CLNK E 5 A_FaceTarget
    CLNK F 4 A_FaceTarget
    CLNK G 7 A_CustomMeleeAttack(random(3,9)+(ACS_ExecuteWithResult(912,2,0,0)), "clink/attack", "clink/attack", "melee", 1)
    Goto See
  Missile:
	CLNK A 0 A_UnSetInvulnerable
    CLNK A 0 A_CheckFloor(2)
    CLNK A 0 A_Jump(256, "See")
    CLNK A 1 A_JumpIfCloser(300, "ChargeAttack")
    Goto See
  ChargeAttack:
    CLNK A 3 A_FaceTarget
	CLNK A 0 A_SetInvulnerable
    CLNK A 0 A_SkullAttack(22)
    CLNK A 20
	CLNK A 0 A_UnSetInvulnerable
    CLNK A 0 A_Gravity
    CLNK A 0 A_Stop
    Goto See
  Pain:
	CLNK A 0 A_UnSetInvulnerable
    CLNK H 3
    CLNK H 3 A_Pain
    Goto See
  Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,60),"Feared")
	Goto Pain
  Feared:
	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(914,0,40)
	TNT1 A 0 ACS_ExecuteAlways(560,0,0,0,0)
	goto See
  Death:
	CLNK I 0 ACS_ExecuteAlways(914,0,40)
    CLNK I 6 A_Scream
	CLNK J 6
    CLNK K 5
    CLNK L 5 A_NoBlocking
    CLNK MN 5
    CLNK O -1
    Stop
  Ice:
	"----" A 0 ACS_ExecuteAlways(914,0,40)
	"----" G 5 A_GenericFreezeDeath
	"----" G 1 A_FreezeDeathChunks
	Wait
	Raise:
		CLNK ONMLKJI 5
		Goto See
  }
}

Actor CentaurLeaderSpotZ : RandomSpawner replaces CentaurLeader
{
	Game Hexen
	SpawnID 2
	DropItem "NewCentaurLeader"
	DropItem "ImpWarlord"
	Dropitem "Razreblade"
}

Actor ImpWarlord
{
    Health 220
    Radius 20
    Height 56
	Scale 1.15
    Speed 8
    PainChance 128
    MONSTER
    +FLOORCLIP
	+TELESTOMP
	Meleerange 52
	PainChance "Convert", 255
	Species "Centaur"
    SeeSound "orc/sight"
    PainSound "orc/pain"
    DeathSound "orc/death"
    ActiveSound "orc/active"
	dropitem "ArtiEmptyFlask" 64
	dropitem "ArtiBlackFlask" 8
	dropitem "ReagentRed" 64
	Dropitem "ReagentGreen" 64
	DropItem "Armour7" 8
	DropItem "ForceCube" 8
    Obituary "%o couldn't run from the imp warlord's fireball."
    HitObituary "%o was beaten to death by an imp warlord."
    States
    {
	Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,60),"Feared")
	Goto Pain
  Feared:
	TNT1 A 0 A_Changeflag("Frightened", 1)
	Goto Pain
    Spawn:
		WARI A 0
	WARI A 0 ACS_ExecuteAlways(913,0,220,11,0)//increase health on higher difficulties
        WARI AB 10 A_Look
        Loop
	Idle:
		WARI A 0 A_UnSetInvulnerable
		WARI AB 10 A_Look
        Loop
    See:
		WARI A 0 A_UnSetInvulnerable
        WARI AABBCCDD 3 A_Chase
        Loop
    Melee:
        WARI E 6 A_FaceTarget
        TNT1 A 0 A_PlaySound("implord/maceswing")
        WARI F 4 A_FaceTarget
        WARI G 5 A_CustomMeleeAttack(random(1,8)+(ACS_ExecuteWithResult(912,2,0,0)), "implord/macehit", "none")
        Goto See
    Missile:
        TNT1 A 0 A_Jump(38,23)  //20% chance: jump to familiar drop
        TNT1 A 0 A_Jump(77,2)   //30% chance: jump to heat seekers
        TNT1 A 0 A_Jump(128,11) //50% chance: jump to green fireballs
        Goto Missile+28         //Otherwise : jump to red fireball
        TNT1 A 0 A_SetInvulnerable
        WARI I 6 A_FaceTarget
        TNT1 A 0 A_PlaySound("implord/shieldshot")
        WARI J 6 bright A_FaceTarget
        TNT1 A 0 A_Jump(128,4)
        TNT1 A 0 A_CustomMissile("YellowSkullSeeker", 36, 0, -45)
        WARI K 6 bright A_CustomMissile("YellowSkullSeeker", 36, 0, 45)
        TNT1 A 0 A_UnSetInvulnerable
        Goto See
        WARI K 6 bright A_CustomMissile("YellowSkullSeeker", 36, 0, 0)
        TNT1 A 0 A_UnSetInvulnerable
        Goto See
        WARI L 7 A_FaceTarget
        TNT1 A 0 A_PlaySound("implord/maceswing")
        WARI M 5 A_FaceTarget
        //TNT1 A 0 A_PlayWeaponSound("imp/attack")
        TNT1 A 0 A_Jump(128,3)
		TNT1 A 0 A_PlaySound("implord/poisonballfire")
        TNT1 A 0 A_CustomMissile("GreenPoisonBall", 44, 0, -8, 1)
        TNT1 A 0 A_CustomMissile("GreenPoisonBall", 28, 0, 8, 1)
		TNT1 A 0 A_CustomMissile("GreenPoisonBall", 36, 0, 0, 1)
        TNT1 A 0 A_CustomMissile("GreenPoisonBall", 40, 0, -4, 1)
        WARI N 6 A_CustomMissile("GreenPoisonBall", 32, 0, 4, 1)
        Goto See
        WARI GF 8 A_FaceTarget
        TNT1 A 0 A_Jump(128,2)
        WARI E 8 A_CustomMissile("FamiliarSpawner", 36, 0, -30)
        Goto See
        WARI E 8 A_CustomMissile("FamiliarSpawner", 36, 0, 30)
        Goto See
        TNT1 A 0 A_Jump(128,5)
        WARI O 7 A_FaceTarget
        TNT1 A 0 A_PlaySound("implord/maceswing")
        WARI P 5 A_FaceTarget
        WARI Q 6 A_CustomMissile("RedSkullBall", 36, 0, 0)
        WARI O 7 A_FaceTarget
        TNT1 A 0 A_PlaySound("implord/maceswing")
	    WARI P 5 A_FaceTarget
        WARI Q 6 A_CustomMissile("RedSkullBall", 36, 0, 0)
        Goto See
    Pain:
        WARI H 8 A_Pain
	    WARI I 1
        TNT1 A 0 A_SetInvulnerable
	    WARI IIIIII 4 A_FaceTarget
        WARI IIII 4 A_FaceTarget
        TNT1 A 0 A_UnSetInvulnerable
		Goto See
	Pain.Convert:
	TNT1 A 0 A_JumpIfInTargetInventory("Visions",Random(0,6),"ConvertMe")
	goto Pain
	ConvertMe:
	TNT1 A 0 ACS_ExecuteAlways(914,0,40)
	TNT1 A 0 ACS_ExecuteAlways(560,0,0,0,0)
	goto See
    Death:
		TNT1 A 0 ACS_ExecuteAlways(914,0,40)
        TNT1 A 0 A_FaceTarget
        TNT1 A 0 A_SpawnItemEx("WarlordMace", 0, 0, 32, 4, 0, 0, -90, 128)
        WARI R 8 A_SpawnItemEx("WarlordShield", 0, 0, 32, 5, 0, 0, 90, 128)
        WARI S 8 A_Scream
        WARI T 6
	    WARI U 6 A_Fall
        WARI V -1
        Stop
	Ice:
		"----" A 0 ACS_ExecuteAlways(914,0,40)
		"----" H 5 A_GenericFreezeDeath
		"----" H 1 A_FreezeDeathChunks
		Wait
    }
}

Actor YellowSkullSeeker
{
    Radius 8
    Height 6
    Speed 9
    Damage ((random(1,8)*2)+(ACS_ExecuteWithResult(912,1,0,0)))
    +SEEKERMISSILE
    PROJECTILE
    RenderStyle Add
    Scale 0.67
    Alpha 0.67
    DeathSound "implord/shieldshothit"
    Decal RevenantScorch
    States
    {
    Spawn:
        WLP2 ABCD 3 Bright A_SeekerMissile (5,10)
        Loop
    Death:
        WLP2 EFG 4 Bright
        Stop
    }
}

Actor GreenPoisonBall
{
    Radius 8
    Height 6
    Speed 10
    Damage (random(1,8)+(ACS_ExecuteWithResult(912,1,0,0)/2))
    PROJECTILE
    RenderStyle Add
	PoisonDamage 15
    Alpha 0.67
    DeathSound "impwar/poison"
    States
    {
    Spawn:
        WLP1 ABCD 3
        Loop
    Death:
        WLP1 EFGH 4
        Stop
    }
}

Actor FamiliarSpawner
{
     +MISSILE
     +DOOMBOUNCE
     +BOUNCEONACTORS
     +BLOODLESSIMPACT
     +PAINLESS
     Speed 8
     DeathSound "implord/familiarspawn"
     States
     {
     Spawn:
          WLP3 ABCD 4
          Loop
     Death:
          WLP3 E 4
          WLP3 F 6
          TNT1 A 0 A_Jump(85,3)
          WLP3 G 8 A_SpawnItemEx("SummonedBatFamiliar",0,0,32,0,0,0,0,SXF_SETMASTER)
          WLP3 H 350
          Stop
          WLP3 G 8 A_SpawnItemEx("DragonFamiliar",0,0,32,0,0,0,0,SXF_SETMASTER)
          WLP3 H 350
          Stop
     }
}

Actor RedSkullBall
{
    Radius 8
    Height 6
    Speed 15
    Damage ((random(1,8)*4)+(ACS_ExecuteWithResult(912,2,0,0)))
    PROJECTILE
    RenderStyle Add
    Alpha 0.67
    SeeSound "impwar/skull"
    Decal PlasmaScorchLower
    States
    {
    Spawn:
		WLP4 A 1 Bright
		WLP4 A 5 Bright A_PlaySound("impwar/skull")
        WLP4 BCB 5 Bright
        Goto Spawn+1
    Death:
        WLP4 DEFG 5 Bright
        Stop
    }
}

Actor WarlordMace
{
    +DOOMBOUNCE
    Speed 4
    States
    {
    Spawn:
        WLI2 ABCDEF 5
        WLI2 G -1
        Stop
    }
}

Actor WarlordShield
{
    +DOOMBOUNCE
    Speed 5
    States
    {
    Spawn:
        WLI1 ABCDEF 5
        WLI1 G -1
        Stop
    }
}

Actor SummonedBatFamiliar
{
    Health 10
    Radius 12
    Height 24
    Speed 14
    PainChance 200
    MONSTER
    +NOGRAVITY
    +FLOAT
    +NEVERRESPAWN
    SeeSound "batfam/idle"
    PainSound "batfam/pain"
    DeathSound "batfam/death"
    ActiveSound "batfam/idle"
    HitObituary "%o was scratched by a bat familiar"
    States
    {
	Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,60),"Feared")
	Goto Pain
  Feared:
	TNT1 A 0 A_Changeflag("Frightened", 1)
	Goto Pain
    Spawn:
		BFAM A 0
		BFAM A 0 ACS_ExecuteAlways(913,0,10,1,0)//increase health on higher difficulties
        BFAM ABCB 3 A_Look
        Loop
	Idle:
		BFAM ABCB 3 A_Look
        Loop
    See:
        BFAM ABCB 3 A_Chase
        Loop
    Melee:
        BFAM A 3 A_FaceTarget
        BFAM B 3 A_CustomMeleeAttack(random(1,8)+(ACS_ExecuteWithResult(912,1,0,0)/2),"batfam/idle")
        BFAM CB 3 A_FaceTarget
        Goto See
    Pain:
        BFAM A 2
        BFAM A 2 A_Pain
        Goto See
    Death:
        TNT1 A 0 A_Die
        TNT1 A 0 A_NoBlocking
        BFAM D 5 A_Scream
        BFAM E 5
        BFAM FDEF 5
        Goto Death+5
    Crash:
        TNT1 A 0 A_SetFloorClip
        BFAM G 6 A_PlaySound("batfam/crash")
        BFAM H 7
        BFAM I 8
        BFAM J -1
        Stop
    }
}

Actor DragonFamiliar
{
    Health 25
    Radius 16
    Height 32
    Speed 10
    PainChance 200
    MaxTargetRange 78
    MONSTER
    +NOGRAVITY
    +FLOAT
    +STRIFEDAMAGE
    +NEVERRESPAWN
    SeeSound "dragonfam/see"
    PainSound "dragonfam/pain"
    DeathSound "dragonfam/death"
    ActiveSound "dragonfam/idle"
    Obituary "%o was cooked by a dragon familiar."
    States
    {
	Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,60),"Feared")
	Goto Pain
  Feared:
	TNT1 A 0 A_Changeflag("Frightened", 1)
	Goto Pain
    Spawn:
		DFAM A 0
		DFAM A 0 ACS_ExecuteAlways(913,0,25,2,0)//increase health on higher difficulties
        DFAM ABCD 10 A_Look
        Loop
	Idle:
		DFAM ABCD 10 A_Look
        Loop
    See:
        DFAM AABBCCDD 3 A_Chase
        Loop
    Missile:
        TNT1 A 0 A_JumpIfCloser(270,2)
	    Goto See
		TNT1 A 0 A_Jump(48,"See")
	    Goto Missile+3
	    TNT1 A 0 A_PlaySound("dragonfam/attack")
	    TNT1 A 0 A_JumpIfCloser(270,1)
	    Goto See
        DFAM E 2 Bright A_CPosRefire
        TNT1 A 0 A_CustomMissile("MiniFirePuffNoDamage", 12, 0, 0)
	    TNT1 A 0 A_JumpIfCloser(270,1)
	    Goto See
        DFAM E 2 Bright A_CPosRefire
        TNT1 A 0 A_CustomMissile("MiniFirePuff", 12, 0, Random(1,2))
	    TNT1 A 0 A_JumpIfCloser(270,1)
	    Goto See
        DFAM E 2 Bright A_CPosRefire
        TNT1 A 0 A_CustomMissile("MiniFirePuff", 12, 0, Random(-1,-2))
        Goto Missile+1
    Pain:
        DFAM F 2
        DFAM F 2 A_Pain
        Goto See
    Death:
        TNT1 A 0 A_Die
        DFAM G 8 A_NoBlocking
        DFAM H 8 A_Scream
        DFAM I 6 A_SetFloorClip
        DFAM JKL 6
        DFAM M -1
        Stop
    }
}

Actor MiniFirePuff
{
    Radius 6
    Height 10
    Speed 7
    Damage (random(1,4)+(ACS_ExecuteWithResult(912,1,0,0))/2)
    PROJECTILE
	Damagetype Fire
    RenderStyle Add
    Alpha 0.67
    States
    {
    Spawn:
        DFFP ABCDEFGH 2 Bright
    Death:
        DFFP IJKLMNOPQR 2 Bright
        Stop
    }
}

Actor MiniFirePuffNoDamage : MiniFirePuff
{
    Damage 0
}

Actor NewCentaurLeader : CentaurLeader
{
Species "Centaur"
PainChance "Convert", 255
+TELESTOMP
-DEFLECT
meleerange 74
dropitem "ArtiEmptyFlask" 32
  dropitem "ArtiBlueFlask" 32  
  dropitem "ReagentRed" 64
  DropItem "Armour2" 8
States
{
Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,70),"Feared")
	Goto Pain
  Feared:
	TNT1 A 0 A_Changeflag("Frightened", 1)
	Goto Pain
Spawn:
	CENT A 0
	CENT A 0 ACS_ExecuteAlways(913,0,250,13,0)//increase health on higher difficulties
	//Idle
    CENT AB 10 A_Look
    Loop
Idle:
	CENT AB 10 A_Look
    Loop
	Pain:
	CENT G 9 A_Pain
	CENT G 3 A_SetReflectiveInvulnerable
	CENT G 0 A_Jump(128,5)
	CENT E 10 A_FaceTarget
	CENT F 8 Bright A_CustomMissile("CentaurFX", 45, 0, 0, CMF_AIMOFFSET)
	CENT E 6 A_FaceTarget
	CENT E 0 A_Jump(256,4)
	CENT EEE 15 A_CentaurDefend
	CENT E 1 A_UnsetReflectiveInvulnerable
	Goto See
Pain.Convert:
	TNT1 A 0 A_JumpIfInTargetInventory("Visions",Random(0,9),"ConvertMe")
	goto Pain
	ConvertMe:
	TNT1 A 0 ACS_ExecuteAlways(914,0,55)
	TNT1 A 0 ACS_ExecuteAlways(560,0,0,0,0)
	goto See
See:
	CENT ABCD 5 A_Chase
    Loop
	Melee:
    CENT H 5 A_FaceTarget
    CENT I 4 A_FaceTarget
    CENT J 7 A_CustomMeleeAttack(random(3,9)+(ACS_ExecuteWithResult(912,2,0,0)))
    Goto See
  Flee:
    CENT ABCD 5 A_ChangeFlag("FRIGHTENED", 1)
	goto See
	Death:
	CENT A 0 ACS_ExecuteAlways(914,0,55)
	CENT K 4
	CENT L 4 A_Scream
	CENT MN 4
	CENT O 4 A_NoBlocking
	CENT PQ 4
	CENT R 4 A_QueueCorpse
	CENT S 4
	CENT T -1
	Stop
	XDeath:
	CENT A 0 ACS_ExecuteAlways(914,0,55)
	CTXD A 0 A_SpawnItemEx("GIBBER")
	CTXD B 4 A_NoBlocking
	CTXD C 0 A_SpawnItemEx("CentaurSword", 0, 0, 45, 1 + random[CentaurDrop](-128,127)*0.03125,
                           1 + random[CentaurDrop](-128,127)*0.03125, 8 + random[CentaurDrop](0,255)*0.015625, 270)
    CTXD C 4 A_SpawnItemEx("CentaurShield", 0, 0, 45, 1 + random[CentaurDrop](-128,127)*0.03125,
                           1 + random[CentaurDrop](-128,127)*0.03125, 8 + random[CentaurDrop](0,255)*0.015625, 90)
	CTXD D 3 A_Scream
	CTXD E 4 A_QueueCorpse
	CTXD F 3
	CTXD G 4
	CTXD H 3
	CTXD I 4
	CTXD J 3
	CTXD K -1
	Stop
	Ice:
	"----" A 0 ACS_ExecuteAlways(914,0,55)
	"----" G 5 A_GenericFreezeDeath
	"----" G 1 A_FreezeDeathChunks
	Wait
}
}

Actor NewCentaurFX : CentaurFX replaces CentaurFX
{
	Radius 6
	Damage ((random(1,8)*4)+(ACS_ExecuteWithResult(912,2,0,0)))
	Height 8
	States
	{
	Spawn:
      CTFX A 1 Bright A_SpawnItemEx("CentaurTrailFX",  -(MomX/1.2), -(MomY/1.2), (MomZ/1.2*-1), (MomX/1.2), (MomY/1.2), (MomZ/1.2), 0, 138)
      Loop
	}
}

Actor CentaurTrailFX
{
	Radius 6
	Height 8
	Projectile
	RenderStyle Add
	Alpha 0.5
	+PAINLESS
	+CLIENTSIDEONLY
	+NOINTERACTION
	States
	{
	Spawn:
	CTFX A 0 Bright
	CTFX A 1 Bright A_FadeOut(0.05)
	Loop
	}
}

Actor RazreBlade
{
  Health 200
  Radius 20
  Height 56
  Mass 135
  Speed 14
  Painchance 32
  Monster
  +NOBLOOD
  +FLOORCLIP
  Species "Centaur"
  +DONTHURTSPECIES
  +QUICKTORETALIATE
  SeeSound "clink/sight"
  AttackSound "clink/attack"
  PainSound "clink/pain"
  DeathSound "clink/death"
  ActiveSound "clink/active"
  Damage (random(3,9)+(ACS_ExecuteWithResult(912,2,0,0)))
  +NOTARGET
  +NOINFIGHTING
  Obituary "%o was slashed by a razreblade."
  MeleeRange 52
  States
  {
  Spawn:
	CLNK A 0
	CLNK A 0 ACS_ExecuteAlways(913,0,200,13,0)//increase health on higher difficulties
    CLNK AB 10 A_Look
    Loop
  Idle:
    CLNK AB 10 A_Look
    Loop
  See:
	CLNK A 0 A_UnSetInvulnerable
    CLNK A 3 A_Chase
	CLNK B 3 A_Chase
	CLNK C 3 A_Chase
	CLNK D 3 A_Chase
    Loop
  Melee:
	CLNK A 0 A_UnSetInvulnerable
    CLNK E 5 A_FaceTarget
    CLNK F 4 A_FaceTarget
    CLNK G 7 A_CustomMeleeAttack(random(3,9)+(ACS_ExecuteWithResult(912,2,0,0)), "clink/attack", "clink/attack", "melee", 1)
    Goto See
  Missile:
	CLNK A 0 A_UnSetInvulnerable
	CLNK A 0 A_Jump(128, "AxeMissile")
    CLNK A 0 A_CheckFloor(2)
    CLNK A 0 A_Jump(256, "See")
    CLNK A 1 A_JumpIfCloser(300, "ChargeAttack")
    Goto See
  Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,75),"Feared")
	Goto Pain
  Feared:
	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(914,0,55)
	TNT1 A 0 ACS_ExecuteAlways(560,0,0,0,0)
	goto See
  AxeMissile:
	CLNK E 5 A_FaceTarget
	CLNK F 5 A_FaceTarget
	CLNK G 5 A_CustomMissile("ClinkAxe",30,0,0)
	Goto See
  ChargeAttack:
    CLNK A 3 A_FaceTarget
	CLNK A 0 A_SetInvulnerable
    CLNK A 0 A_SkullAttack(22)
    CLNK A 20
	CLNK A 0 A_UnSetInvulnerable
    CLNK A 0 A_Gravity
    CLNK A 0 A_Stop
    Goto See
  Pain:
	CLNK A 0 A_UnSetInvulnerable
    CLNK H 3
    CLNK H 3 A_Pain
    Goto See
  Death:
	CLNK I 0 ACS_ExecuteAlways(914,0,55)
    CLNK I 6 A_Scream
	CLNK J 6
    CLNK K 5
    CLNK L 5 A_NoBlocking
    CLNK MN 5
    CLNK O -1
    Stop
  Ice:
	"----" A 0 ACS_ExecuteAlways(914,0,55)
	"----" G 5 A_GenericFreezeDeath
	"----" G 1 A_FreezeDeathChunks
	Wait
  }
}

ACTOR ClinkAxe
{
  Radius 10
  Height 8
  Speed 25
  Damage ((random(1,8)*2)+(ACS_ExecuteWithResult(912,2,0,0)))
  Projectile
  -ACTIVATEIMPACT
  -ACTIVATEPCROSS
  Renderstyle Add
  Scale 0.6
  DeathSound "hknight/hit"
  States
  {
  Spawn:
    CLAX A 3 Bright A_PlaySound("hknight/axewhoosh")
    CLAX BC 3 Bright
    Loop
  Death:
    CLAX DEF 6 Bright
    Stop
  }
}

Actor SerpentSpotZ : RandomSpawner replaces Serpent
{
	Game Hexen
	SpawnID 6
	DropItem "NewSerpent" 255 160
	DropItem "IceStalker" 255 86
}

Actor NewSerpent : Serpent
{
+TELESTOMP
//meleerange 72
Dropitem "ReagentGreen" 64
States
{
Spawn:
SSPT H 0
	SSPT H 0 ACS_ExecuteAlways(913,0,90,7,0)//increase health on higher difficulties
	SSPT H 10 A_Look
    Loop
Idle:
	SSPT H 10 A_Look
    Loop
Idle:
SSPT H 10 A_Look
    Loop
	MeleeAttack:
    SSPT N 5 A_CustomMeleeAttack((random(1,8)*5)+(ACS_ExecuteWithResult(912,3,0,0)))
    Goto Dive
	Death:
	SSPT A 0 ACS_ExecuteAlways(914,0,30)
	SSPT O 4
	SSPT P 4 A_Scream
	SSPT Q 4 A_NoBlocking
	SSPT RSTUVWXYZ 4
	Stop
	XDeath:
	SSPT A 0 ACS_ExecuteAlways(914,0,30)
	SSXD A 4
	SSXD B 0 A_CustomMissile("SerpentHead",45,0,0,2)
	SSXD B 4
	SSXD C 4 A_NoBlocking
	SSXD DE 4
	SSXD FG 3
	SSXD H 0 A_CustomMissile("SerpentGib1",6,0,0,2)
	SSXD H 0 A_CustomMissile("SerpentGib2",6,0,0,2)
	SSXD H 0 A_CustomMissile("SerpentGib3",6,0,0,2)
	SSXD H 3
	Stop
	Ice:
	"----" A 0 ACS_ExecuteAlways(914,0,30)
	"----" L 5 A_GenericFreezeDeath
	"----" L 1 A_FreezeDeathChunks
	Wait
}
}

ACTOR iceStalker : serpent
{
	Health 120
	Speed 10
	Monster
	//MeleeRange 72
	damagetype ice
	-SHOOTABLE
	+NOBLOOD
	+CANTLEAVEFLOORPIC +NONSHOOTABLE
	+STAYMORPHED +DONTBLAST +NOTELEOTHER
	+INVISIBLE
	+NOICEDEATH
	Dropitem "ReagentBlue" 64
        Obituary "%o caught a chill from an ice stalker."
        HitObituary "%o caught a chill from an ice stalker."
	States
	{
	Spawn:
		ISPT H 0
		ISPT H 0 ACS_ExecuteAlways(913,0,120,12,0)
		ISPT H 10 A_Look
		Loop
	Idle:
		ISPT H 10 A_Look
		Loop
	See:
		ISPT HH 1 A_Chase("Melee", "None", CHF_NIGHTMAREFAST|CHF_NOPLAYACTIVE)
		ISPT H 2 A_SerpentHumpDecide
		Loop
	Pain:
		ISPT L 5
		ISPT L 5 A_Pain
	Dive:
		ISDV ABC 4
		ISDV D 4 A_UnSetShootable
		ISDV E 3 A_PlaySoundEx("SerpentActive", "Body")
		ISDV F 3
		ISDV GH 4
		ISDV I 3
		ISDV J 3 A_SerpentHide
		Goto See
	Melee:
		ISPT A 1 A_UnHideThing
		ISPT A 1 A_PlaySoundEx("SerpentBirth", "Voice")
		ISPT B 3 A_SetShootable
		ISPT C 3
		ISPT D 4 A_SerpentCheckForAttack
		Goto Dive
	Death:
		ISPT A 0 ACS_ExecuteAlways(914,0,55)
		ISPT [ 1 A_IceGuyDie
		Stop
	XDeath:
		ISPT A 0 ACS_ExecuteAlways(914,0,55)
		ISPT [ 1 A_IceGuyDie
		Stop
	Ice:
		STOP
	Walk:
		ISPT IJI 5 A_Chase("Attack", "None", CHF_NIGHTMAREFAST)
		ISPT J 5 A_SerpentCheckForAttack
		Goto Dive
	Hump:
		ISPT H 3 A_SerpentUnHide
		ISPT EFGEF 3 A_SerpentRaiseHump
		ISPT GEF 3
		ISPT GEFGE 3 A_SerpentLowerHump
		ISPT F 3 A_SerpentHide
		Goto See
	Attack:
		ISPT K 6 A_FaceTarget
		ISPT L 5 A_SerpentChooseAttack
		Goto MeleeAttack
	MeleeAttack:
		ISPT N 5 A_CustomMeleeAttack((random(1,8)*5)+(ACS_ExecuteWithResult(912,3,0,0)))
		Goto Dive
	}
}

Actor SerpentLeaderSpotZ : RandomSpawner replaces SerpentLeader
{
	Game Hexen
	SpawnID 7
	DropItem "NewSerpentLeader" 255 160
	DropItem "IceStalkerLeader" 255 86
}

Actor NewSerpentLeader : SerpentLeader
{
+TELESTOMP
//meleerange 72
Dropitem "ReagentGreen" 64
States
{
Spawn:
	SSPT H 0
	SSPT H 0 ACS_ExecuteAlways(913,0,90,9,0)//increase health on higher difficulties
	SSPT H 10 A_Look
    Loop
Idle:
    SSPT H 10 A_Look
    Loop
Idle:
	SSPT H 10 A_Look
    Loop
	MeleeAttack:
    SSPT N 5 A_CustomMeleeAttack((random(1,8)*5)+(ACS_ExecuteWithResult(912,3,0,0)))
    Goto Dive
	Death:
	SSPT A 0 ACS_ExecuteAlways(914,0,50)
	SSPT O 4
	SSPT P 4 A_Scream
	SSPT Q 4 A_NoBlocking
	SSPT RSTUVWXYZ 4
	Stop
	XDeath:
	SSPT A 0 ACS_ExecuteAlways(914,0,50)
	SSXD A 4
	SSXD B 0 A_CustomMissile("SerpentHead",45,0,0,2)
	SSXD B 4
	SSXD C 4 A_NoBlocking
	SSXD DE 4
	SSXD FG 3
	SSXD H 0 A_CustomMissile("SerpentGib1",6,0,0,2)
	SSXD H 0 A_CustomMissile("SerpentGib2",6,0,0,2)
	SSXD H 0 A_CustomMissile("SerpentGib3",6,0,0,2)
	SSXD H 3
	Stop
	Ice:
	"----" A 0 ACS_ExecuteAlways(914,0,50)
	"----" L 5 A_GenericFreezeDeath
	"----" L 1 A_FreezeDeathChunks
	Wait
}
}

//Ice Stalker created by Ben2k9/Virtue

ACTOR iceStalkerLeader : serpent
{
	Health 120
	Speed 10
	Monster
	Meleerange 72
	damagetype ice
	-SHOOTABLE
	+NOBLOOD
	+CANTLEAVEFLOORPIC +NONSHOOTABLE
	+STAYMORPHED +DONTBLAST +NOTELEOTHER
	+INVISIBLE
	+NOICEDEATH
	Dropitem "ReagentBlue" 64
        Obituary "%o caught a chill from an ice stalker."
        HitObituary "%o caught a chill from an ice stalker."
	States
	{
	Spawn:
		ISPT H 0
		ISPT H 0 ACS_ExecuteAlways(913,0,120,13,0)
		ISPT H 10 A_Look
		Loop
	Idle:
		ISPT H 10 A_Look
		Loop
	See:
		ISPT HH 1 A_Chase("Melee", "None", CHF_NIGHTMAREFAST|CHF_NOPLAYACTIVE)
		ISPT H 2 A_SerpentHumpDecide
		Loop
	Pain:
		ISPT L 5
		ISPT L 5 A_Pain
	Dive:
		ISDV ABC 4
		ISDV D 4 A_UnSetShootable
		ISDV E 3 A_PlaySoundEx("SerpentActive", "Body")
		ISDV F 3
		ISDV GH 4
		ISDV I 3
		ISDV J 3 A_SerpentHide
		Goto See
	Melee:
		ISPT A 1 A_UnHideThing
		ISPT A 1 A_PlaySoundEx("SerpentBirth", "Voice")
		ISPT B 3 A_SetShootable
		ISPT C 3
		ISPT D 4 A_SerpentCheckForAttack
		Goto Dive
	Missile:
		ISPT N 0 A_CustomMissile("iceguyFX", 32, 0)
		ISPT N 5 A_CustomMissile("iceguyFX", 32, 0)
		Goto Dive
	Death:
		ISPT A 0 ACS_ExecuteAlways(914,0,60)
		ISPT [ 1 A_IceGuyDie
		Stop
	XDeath:
		ISPT A 0 ACS_ExecuteAlways(914,0,60)
		ISPT [ 1 A_IceGuyDie
		Stop
	Ice:
		STOP
	Walk:
		ISPT IJI 5 A_Chase("Attack", "None", CHF_NIGHTMAREFAST)
		ISPT J 5 A_SerpentCheckForAttack
		Goto Dive
	Hump:
		ISPT H 3 A_SerpentUnHide
		ISPT EFGEF 3 A_SerpentRaiseHump
		ISPT GEF 3
		ISPT GEFGE 3 A_SerpentLowerHump
		ISPT F 3 A_SerpentHide
		Goto See
	Attack:
		ISPT K 6 A_FaceTarget
		ISPT L 5 A_SerpentChooseAttack
		Goto MeleeAttack
	MeleeAttack:
		ISPT N 5 A_CustomMeleeAttack((random(1,8)*5)+(ACS_ExecuteWithResult(912,3,0,0)))
		Goto Dive
	}
}


Actor NewSerpentFX : SerpentFX replaces SerpentFX
{
	PoisonDamage 40
	Damage ((random(1,8)*4)+(ACS_ExecuteWithResult(912,2,0,0)))
	States
	{
	Spawn:
    SSFX A 0
    SSFX A 0 Bright A_PlaySoundEx("SerpentFXContinuous", "Body", 1)
    SSFX AAABBBAAABBB 1 Bright A_SpawnItemEx("CStaffTrail",0,0,0,0,0,0,0,8)
    Goto Spawn+1
	}
}

Actor NewHeresiarch : Heresiarch Replaces Heresiarch
{
Health 50000
+TELESTOMP
+NEVERRESPAWN
PainChance 0
Damagefactor "PoisonCloud", 0.25
DamageFactor "Deathblow", 0
DropItem "NewArtiBoostMana"
DropItem "NewArtiSuperHealth"
States
{
	Spawn:
	SORC A 0
    SORC A 0 ACS_ExecuteAlways(913,0,50000,0,0)
    SORC A 5 A_SorcSpinBalls
  Idle:
    SORC A 10 A_Look
    Wait
	Death:
	SORC A 0 ACS_ExecuteAlways(914,0,20000)
	SORC H 5
	SORC I 5 A_FaceTarget
	SORC J 5 A_Scream
	SORC KLMNOPQRST 5
	SORC U 5 A_NoBlocking
	SORC VWXY 5
	SORC Z -1
	Stop
}
}
ACTOR NewClericBoss : ClericBoss Replaces ClericBoss
{
  Health 8000
  +TELESTOMP
  +NEVERRESPAWN
  +NOTARGET
  PainChance 0
  DropItem "Armour2"
  DropItem "NewArtiSuperHealth"
  DamageFactor "Deathblow", 0
  Damagefactor "PoisonCloud", 0.25
  States
  {
	Spawn:
    CLER A 0
    CLER A 3 ACS_ExecuteAlways(913,0,8000,0,0)
	CLER A 5 A_Look
    Loop
  Idle:
    CLER A 5 A_Look
    Loop
  Death:
    CLER I 6
    CLER K 6 A_Scream
    CLER LL 6
	CLER A 0 ACS_ExecuteAlways(914,0,1000)
    CLER M 6 A_NoBlocking
    CLER NOP 6
    CLER Q -1
    Stop
  XDeath:
	CLER R 0 A_SpawnItemEx("GIBBER")
    CLER R 5 A_Scream
    CLER S 5
	CLER A 0 ACS_ExecuteAlways(914,0,1000)
    CLER T 5 A_NoBlocking
    CLER UVWXYZ 5
    CLER "[" -1
    Stop
  Ice:
    "----" A 0 ACS_ExecuteAlways(914,0,1000)
	"----" "\" 5 A_GenericFreezeDeath
    "----" "\" 1 A_FreezeDeathChunks
    Wait
  Burn:
    CLER C 5 Bright A_PlaySound("PlayerClericBurnDeath")
    FDTH D 4 Bright
    FDTH G 5 Bright
    FDTH H 4 Bright A_Scream
    FDTH I 5 Bright
    FDTH J 4 Bright
    FDTH K 5 Bright
    FDTH L 4 Bright
    FDTH M 5 Bright
    FDTH N 4 Bright
    FDTH O 5 Bright
    FDTH P 4 Bright
    FDTH Q 5 Bright ACS_ExecuteAlways(914,0,1000)
    FDTH R 4 Bright
    FDTH S 5 Bright A_NoBlocking
    FDTH T 4 Bright
    FDTH U 5 Bright
    FDTH V 4 Bright
    Stop
  }
}
ACTOR NewFighterBoss : FighterBoss Replaces FighterBoss
{
  Health 8000
+TELESTOMP
PainChance 0
DropItem "Armour1"
DropItem "Armour3"
DropItem "Armour5"
+NEVERRESPAWN
+NOTARGET
DamageFactor "Deathblow", 0
Damagefactor "PoisonCloud", 0.25
  States
  {
  Spawn:
    PLAY A 0
    PLAY A 3 ACS_ExecuteAlways(913,0,8000,0,0)
    PLAY A 5 A_Look
    Loop
  Idle:
	PLAY A 5 A_Look
    Loop
  Melee:
  Missile:
    PLAY E 8 A_FaceTarget
	PLAY F 0 A_PlaySound("FighterSwordFire")
	PLAY F 0 A_CustomMissile("BossFSwordMissile", 32, 11.25)
	PLAY F 0 A_CustomMissile("BossFSwordMissile", 32, 5.625)
	PLAY F 0 A_CustomMissile("BossFSwordMissile", 32, -11.25)
	PLAY F 0 A_CustomMissile("BossFSwordMissile", 32, -5.625)
    PLAY F 8 A_CustomMissile("BossFSwordMissile", 32, 0)
    Goto See
  Death:
    PLAY H 6
	PLAY A 0 ACS_ExecuteAlways(914,0,1000)
    PLAY I 6 A_Scream
    PLAY JK 6
    PLAY L 6 A_NoBlocking
    PLAY M 6
    PLAY N -1
    Stop
  XDeath:
	PLAY O 0 A_SpawnItemEx("GIBBER")
    PLAY A 0 ACS_ExecuteAlways(914,0,1000)
    PLAY O 5 A_Scream
    PLAY P 5 A_SkullPop
    PLAY R 5 A_NoBlocking
    PLAY STUV 5
    PLAY W -1
    Stop
  Ice:
  "----" A 0 ACS_ExecuteAlways(914,0,1000)
    "----" X 5 A_GenericFreezeDeath
    "----" X 1 A_FreezeDeathChunks
    Wait
  Burn:
    FDTH A 5 Bright A_PlaySound("PlayerFighterBurnDeath")
    FDTH B 4 Bright
	PLAY A 0 ACS_ExecuteAlways(914,0,1000)
    FDTH G 5 Bright
    FDTH H 4 Bright A_Scream
    FDTH I 5 Bright
    FDTH J 4 Bright
    FDTH K 5 Bright
    FDTH L 4 Bright
    FDTH M 5 Bright
    FDTH N 4 Bright
    FDTH O 5 Bright
    FDTH P 4 Bright
    FDTH Q 5 Bright
    FDTH R 4 Bright
    FDTH S 5 Bright A_NoBlocking
    FDTH T 4 Bright
    FDTH U 5 Bright
    FDTH V 4 Bright
    Stop
  }
}

Actor BossFSwordMissile : FSwordMissile
{
	Damage (random(1,8)*8+(acs_executewithresult(556))-10+5*(acs_executewithresult(599,16)))
	States
	{
	Spawn:
    FSFX ABC 3 Bright A_CustomMissile("FSwordFireTrail",0,0,0,6)
    Loop
	Death:
    FSFX D 3 Bright
    FSFX E 2 Bright A_FSwordFlames
    FSFX F 3 Bright A_Explode(64+acs_executewithresult(556)-10+5*(acs_executewithresult(599,16)), 128, 0)
    FSFX G 2 Bright
    FSFX H 3 Bright
    FSFX I 2 Bright
    FSFX J 3 Bright
    FSFX KLM 2 Bright
    Stop
	}
}

ACTOR NewMageBoss : MageBoss replaces MageBoss
{
  Health 8000
	+TELESTOMP
	PainChance 0
	DropItem "Armour4"
	DropItem "NewArtiBoostMana"
	+NEVERRESPAWN
	DamageFactor "Deathblow", 0
	+NOTARGET
	Damagefactor "PoisonCloud", 0.25
  States
  {
  Spawn:
    MAGE A 0
    MAGE A 3 ACS_ExecuteAlways(913,0,8000,0,0)
    MAGE A 5 A_Look
    Loop
  Idle:
	MAGE A 5 A_Look
    Loop
  Melee:
  Missile:
    MAGE E 8 A_FaceTarget
	MAGE F 0 A_CustomMissile("BossMageStaffFX2", 40, -5)
	MAGE F 0 A_CustomMissile("BossMageStaffFX2", 40, 5)
    MAGE F 8 Bright A_CustomMissile("BossMageStaffFX2", 40, 0)
    Goto See
  Death:
    MAGE A 0 ACS_ExecuteAlways(914,0,1000)
    MAGE H 6
    MAGE I 6 A_Scream
    MAGE JK 6
    MAGE L 6 A_NoBlocking
    MAGE M 6
    MAGE N -1
    Stop
  XDeath:
	MAGE O 0 A_SpawnItemEx("GIBBER")
    MAGE O 5 A_Scream
	MAGE A 0 ACS_ExecuteAlways(914,0,1000)
    MAGE P 5
    MAGE R 5 A_NoBlocking
    MAGE S 5
    MAGE T 5
    MAGE U 5
    MAGE V 5
    MAGE W 5
    MAGE X -1
    Stop
  Ice:
	"----" A 0 ACS_ExecuteAlways(914,0,1000)
    "----" Y 5 A_GenericFreezeDeath
    "----" Y 1 A_FreezeDeathChunks
    Wait
  Burn:
    FDTH E 5 Bright A_PlaySound("PlayerMageBurnDeath")
    FDTH F 4 Bright
	MAGE A 0 ACS_ExecuteAlways(914,0,1000)
    FDTH G 5 Bright
    FDTH H 4 Bright A_Scream
    FDTH I 5 Bright
    FDTH J 4 Bright
    FDTH K 5 Bright
    FDTH L 4 Bright
    FDTH M 5 Bright
    FDTH N 4 Bright
    FDTH O 5 Bright
    FDTH P 4 Bright
    FDTH Q 5 Bright
    FDTH R 4 Bright
    FDTH S 5 Bright A_NoBlocking
    FDTH T 4 Bright
    FDTH U 5 Bright
    FDTH V 4 Bright
    Stop
  }
}

Actor BossMageStaffFX2 : MageStaffFX2
{
Damage (Random(1,8)*4+ACS_ExecuteWithResult(556)-10)
States
  {
  Spawn:
	MSP2 A 0 Bright A_CustomMissile("BloodscourgeFXSpawner",0,0,0,4)
    MSP2 A 1 Bright A_MStaffTrack
	MSP2 A 0 Bright A_CustomMissile("BloodscourgeFXSpawner",0,0,0,4)
    MSP2 A 1 Bright
	MSP2 B 0 Bright A_CustomMissile("BloodscourgeFXSpawner",0,0,0,4)
    MSP2 B 1 Bright A_MStaffTrack
	MSP2 B 0 Bright A_CustomMissile("BloodscourgeFXSpawner",0,0,0,4)
    MSP2 B 1 Bright
	MSP2 C 0 Bright A_CustomMissile("BloodscourgeFXSpawner",0,0,0,4)
    MSP2 C 1 Bright A_MStaffTrack
	MSP2 C 0 Bright A_CustomMissile("BloodscourgeFXSpawner",0,0,0,4)
    MSP2 C 1 Bright
	MSP2 D 0 Bright A_CustomMissile("BloodscourgeFXSpawner",0,0,0,4)
    MSP2 D 1 Bright A_MStaffTrack
	MSP2 D 0 Bright A_CustomMissile("BloodscourgeFXSpawner",0,0,0,4)
    MSP2 D 1 Bright
    Loop
  Death:
	MSP2 E 0 Bright A_ChangeFlag("NODAMAGETHRUST", 1)
    MSP2 E 4 Bright A_SetTranslucent(1,1)
    MSP2 F 5 Bright A_Explode(80+(4*ACS_ExecuteWithResult(556))-40, 192, 0)
    MSP2 GH 5 Bright
    MSP2 I 4 Bright
    Stop
}
}

Actor WraithSpotZ : RandomSpawner replaces Wraith
{
	Game Hexen
	SpawnID 8
	DropItem "NewWraith" 255 150
	DropItem "Ghostie" 255 53
	DropItem "PoisonWraith" 255 53
}

Actor WraithBuredSpotZ : RandomSpawner replaces WraithBuried
{
	Game Hexen
	SpawnID 9
	DropItem "NewWraithBuried" 255 150
	DropItem "GhostieBuried" 255 53
	DropItem "PoisonWraithBuried" 255 53
}

Actor NewWraithFX1 : WraithFX1 replaces WraithFX1
{
	Renderstyle Add
	Damage ((random(1,8)*5)+(ACS_ExecuteWithResult(912,3,0,0)))
}

/*Actor NewWraith : Wraith// Replaces Wraith
{
	Renderstyle Add
	Species "Wraith"
	dropitem "ArtiWhiteFlask" 8
	dropitem "ArtiBlackFlask" 8
	Dropitem "Armour1" 16
	+TELESTOMP
States
{
	Spawn:
	WRTH A 0
	WRTH A 0 ACS_ExecuteAlways(913,0,135,15,0)
    WRTH A 10
    WRTH B 5 A_WraithInit
    Goto Look
	Look:
	WRTH A 0
	WRTH A 0 ACS_ExecuteAlways(913,0,135,15,0)
    WRTH AB 15 A_Look
    Loop
	Idle:
	WRTH AB 15 A_Look
    Loop
	Death:
	WRTH A 0 ACS_ExecuteAlways(914,0,60)
	WRTH I 4
	WRTH J 4 A_Scream
	WRTH KL 4
	WRTH M 4 A_NoBlocking
	WRTH N 4 A_QueueCorpse
	WRTH O 4
	WRTH PQ 5
	WRTH R -1
	Stop
	XDeath:
	WRT2 A 0
	WRT2 A 0 ACS_ExecuteAlways(914,0,60)
	WRT2 A 5
	WRT2 B 5 A_Scream
	WRT2 CD 5
	WRT2 E 5 A_NoBlocking
	WRT2 F 5 A_QueueCorpse
	WRT2 G 5
	WRT2 H -1
	Stop
	Ice:
	"----" A 0 ACS_ExecuteAlways(914,0,60)
	"----" H 5 A_GenericFreezeDeath
	"----" H 1 A_FreezeDeathChunks
	Wait
}
}*/

Actor NewWraith : WraithBuried
{
  Health 150
  PainChance 25
  Speed 11
  Height 55
  Mass 75
  Damage 10
  Monster
  +NOGRAVITY
  +DROPOFF
  +FLOAT
  +FLOORCLIP
  +TELESTOMP
  +SHOOTABLE
  +SOLID
  -DONTMORPH
  -DONTBLAST
  -SPECIALFLOORCLIP
  -STAYMORPHED
  -INVISIBLE
  SeeSound "WraithSight"
  AttackSound "WraithAttack"
  PainSound "WraithPain"
  DeathSound "WraithDeath"
  ActiveSound "WraithActive"
  dropitem "ArtiGreenFlask" 32
  Dropitem "GreenReagent" 64
  dropitem "ArtiWhiteFlask" 8
	dropitem "ArtiBlackFlask" 8
	Dropitem "Armour1" 16
	Species "Wraith"
  HitObituary "%o had %p life stolen by a Poison Reiver."
  Obituary "%o was poisoned by a Poison Reiver."
  Renderstyle Add
  States
  {
  Spawn:
    WRTH A 0
    WRTH A 10 ACS_ExecuteAlways(913,0,150,15,0)
    WRTH B 5 A_WraithInit
    Goto Look
  Look:
	WRTH A 0 ACS_ExecuteAlways(913,0,150,15,0)
    WRTH AB 15 A_Look
    Loop
  Idle:
    WRTH AB 15 A_Look
	Loop
  See:
    WRTH ABCD 4 A_WraithChase
    Loop
  Pain:
    WRTH A 2
    WRTH H 6 A_Pain
    Goto See
  Death:
	WRTH A 0 ACS_ExecuteAlways(914,0,60)
	WRTH I 4
	WRTH J 4 A_Scream
	WRTH KL 4
	WRTH M 4 A_NoBlocking
	WRTH N 4 A_QueueCorpse
	WRTH O 4
	WRTH PQ 5
	WRTH R -1
	Stop
  XDeath:
	WRT2 A 0
	WRT2 A 0 ACS_ExecuteAlways(914,0,60)
	WRT2 A 5
	WRT2 B 5 A_Scream
	WRT2 CD 5
	WRT2 E 5 A_NoBlocking
	WRT2 F 5 A_QueueCorpse
	WRT2 G 5
	WRT2 H -1
	Stop
  Ice:
	"----" A 0 ACS_ExecuteAlways(914,0,60)
	"----" H 5 A_GenericFreezeDeath
	"----" H 1 A_FreezeDeathChunks
	Wait
  }
}

Actor NewWraithBuried : NewWraith
{
  Height 68
  -SHOOTABLE
  -SOLID
  +DONTMORPH
  +DONTBLAST
  +SPECIALFLOORCLIP
  +STAYMORPHED
  +INVISIBLE
  PainChance 0
  States
  {
  Spawn:
	WRTH A 0
    WRTH A 0 ACS_ExecuteAlways(913,0,150,15,0)
    Goto Super::Look
  See:
    WRTH A 2 A_WraithRaiseInit
    WRTH A 2 A_WraithRaise
    WRTH A 2 A_FaceTarget
    WRTH BB 2 A_WraithRaise
    Goto See+1
  Chase:
    Goto Super::See
  }
}

Actor PoisonWraith : WraithBuried
{
  Health 150
  PainChance 25
  Speed 11
  Height 55
  Mass 75
  Damage 10
  BloodColor "33 99 33"
  Monster
  +NOGRAVITY
  +DROPOFF
  +FLOAT
  +FLOORCLIP
  +TELESTOMP
  +SHOOTABLE
  +SOLID
  -DONTMORPH
  -DONTBLAST
  -SPECIALFLOORCLIP
  -STAYMORPHED
  -INVISIBLE
  Species "Wraith"
  SeeSound "WraithSight"
  AttackSound "WraithAttack"
  PainSound "WraithPain"
  DeathSound "WraithDeath"
  ActiveSound "WraithActive"
  dropitem "ArtiGreenFlask" 32
  Dropitem "GreenReagent" 64
  HitObituary "%o had %p life stolen by a Poison Reiver."
  Obituary "%o was poisoned by a Poison Reiver."
  Renderstyle Add
  States
  {
  Spawn:
    PWTH A 0
    PWTH A 10 ACS_ExecuteAlways(913,0,150,15,0)
    PWTH B 5 A_WraithInit
    Goto Look
  Look:
	PWTH A 0 ACS_ExecuteAlways(913,0,150,15,0)
    PWTH AB 15 A_Look
    Loop
  Idle:
    PWTH AB 15 A_Look
	Loop
  See:
    PWTH ABCD 4 A_WraithChase
    Loop
  Pain:
    PWTH A 2
    PWTH H 6 A_Pain
    Goto See
  Melee:
    PWTH E 6 A_FaceTarget
	TNT1 A 0 A_Jump(256,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
	TNT1 AAAAAAAAAAAAAA 0 A_SpawnItemEx("PoisonWraithFX3",Random(-4,4),Random(-4,4),1,0,0,0,0)
    PWTH F 6
    PWTH G 6 A_WraithMelee
    Goto See
  Missile:
    PWTH E 6 A_FaceTarget
    PWTH F 6
    PWTH G 6 A_CustomMissile("PoisonWraithFX1", 32, 0)
    Goto See
  Death:
    PWTH I 4 ACS_ExecuteAlways(914,0,70)
    PWTH J 4 A_Scream
    PWTH KL 4
    PWTH M 4 A_NoBlocking
    PWTH N 4 A_QueueCorpse
    PWTH O 4
    PWTH PQ 5
    PWTH R -1
    Stop
  XDeath:
    PWT2 A 5 ACS_ExecuteAlways(914,0,70)
    PWT2 B 5 A_Scream
    PWT2 CD 5
    PWT2 E 5 A_NoBlocking
    PWT2 F 5 A_QueueCorpse
    PWT2 G 5
    PWT2 H -1
    Stop
  Ice:
    "----" A 0 ACS_ExecuteAlways(914,0,70)
    "----" I 5 A_FreezeDeath
    "----" I 1 A_FreezeDeathChunks
    Wait
  }
}

Actor PoisonWraithBuried : PoisonWraith
{
  Height 68
  -SHOOTABLE
  -SOLID
  +DONTMORPH
  +DONTBLAST
  +SPECIALFLOORCLIP
  +STAYMORPHED
  +INVISIBLE
  PainChance 0
  States
  {
  Spawn:
	PWTH A 0
    PWTH A 0 ACS_ExecuteAlways(913,0,150,15,0)
    Goto Super::Look
  See:
    PWTH A 2 A_WraithRaiseInit
    PWTH A 2 A_WraithRaise
    PWTH A 2 A_FaceTarget
    PWTH BB 2 A_WraithRaise
    Goto See+1
  Chase:
    Goto Super::See
  }
}

Actor PoisonWraithFX1
{
  Speed 14
  Radius 10
  Height 6
  Mass 5
  Damage ((random(1,8)*5)+(ACS_ExecuteWithResult(912,3,0,0)))
  PoisonDamage 20
  DamageType "Fire"
  Projectile
  +FLOORCLIP
  SeeSound "WraithMissileFire"
  DeathSound "WraithMissileExplode"
  Renderstyle Add
  States
  {
  Spawn:
    PWRB A 3 Bright
    TNT1 A 0 A_SpawnItemEx("PoisonWraithFX2",0,0,1,Random(1.0,1.5),Random(1.0,1.5),0,Random(0,90))
    PWRB B 3 Bright A_SpawnItemEx("PoisonWraithFX2",0,0,1,Random(1.0,1.5),Random(1.0,1.5),0,Random(270,0))
    PWRB C 3 Bright
    Loop
  Death:
    PWRB D 4 Bright
    TNT1 A 0 A_SpawnItemEx("PoisonWraithFX2",0,0,1,Random(1.0,1.5),Random(1.0,1.5),0,Random(0,90))
    PWRB E 4 Bright A_SpawnItemEx("PoisonWraithFX2",0,0,1,Random(1.0,1.5),Random(1.0,1.5),0,Random(270,0))
    PWRB F 4 Bright
    TNT1 A 0 A_SpawnItemEx("PoisonWraithFX2",0,0,1,Random(1.0,1.5),Random(1.0,1.5),0,Random(0,90))
    WRBL G 3 Bright A_SpawnItemEx("PoisonWraithFX2",0,0,1,Random(1.0,1.5),Random(1.0,1.5),0,Random(270,0))
    TNT1 A 0 A_SpawnItemEx("PoisonWraithFX2",0,0,1,Random(1.0,1.5),Random(1.0,1.5),0,Random(0,90))
    WRBL H 3 Bright A_SpawnItemEx("PoisonWraithFX2",0,0,1,Random(1.0,1.5),Random(1.0,1.5),0,Random(270,0))
    WRBL I 3 Bright
    Stop
  }
}

Actor PoisonWraithFX2
{
  Radius 2
  Height 5
  Mass 5
  +NOBLOCKMAP
  +DROPOFF
  +FLOORCLIP
  +NOTELEPORT
  States
  {
  Spawn:
    PWRB JKLMNOP 4 Bright
    Stop
  }
}

Actor PoisonWraithFX3
{
  Radius 2
  Height 5
  Mass 5
  +NOBLOCKMAP
  +DROPOFF
  +MISSILE
  +FLOORCLIP
  +NOTELEPORT
  DeathSound "Drip"
  States
  {
  Spawn:
    PWRB QRS 4 Bright
    Loop
  Death:
    PWRB S 4 Bright
    Stop
  }
}

Actor Ghostie : WraithBuried
{
  Health 250
  PainChance 25
  Speed 11
  Height 55
  Mass 75
  Damage 10
  BloodColor "white"
  Monster
  +NOGRAVITY
  +DROPOFF
  +FLOAT
  +FLOORCLIP
  +TELESTOMP
  +SHOOTABLE
  +SOLID
  -DONTMORPH
  -DONTBLAST
  -SPECIALFLOORCLIP
  -STAYMORPHED
  -INVISIBLE
  Species "Wraith"
  SeeSound "WraithSight"
  AttackSound "WraithAttack"
  PainSound "WraithPain"
  DeathSound "WraithDeath"
  ActiveSound "WraithActive"
  HitObituary "%o had %p life stolen by a Wraith."
  Obituary "%o was drained by a Wraith."
  DamageType ManaDrain
  Renderstyle Add
  DropItem "ArtiWhiteFlask" 16
  States
  {
  Spawn:
    GOST A 0
    GOST A 10 ACS_ExecuteAlways(913,0,250,20,0)
    GOST B 5 A_WraithInit
    Goto Look
  Idle:
    GOST AB 15 A_Look
	Loop
  Look:
	GOST A 0 ACS_ExecuteAlways(913,0,250,20,0)
    GOST AB 15 A_Look
    Loop
  See:
    GOST ABCD 4 A_WraithChase
    Loop
  Pain:
    GOST A 2
    GOST H 6 A_Pain
    Goto See
  Melee:
	Stop
  Missile:
    GOST E 6 A_FaceTarget
    GOST F 6
	GOST G 0 A_CustomMissile("WVSpell1", 32, 0)
	GOST G 0 A_CustomMissile("WVSpell2", 32, 0)
	GOST G 0 A_CustomMissile("WVSpell3", 32, 0)
    GOST G 6 A_CustomMissile("WVSpell4", 32, 0)
    Goto See
  Death:
    GOST I 4 ACS_ExecuteAlways(914,0,70)
    GOST J 4 A_Scream
    GOST KL 4
    GOST M 4 A_NoBlocking
    GOST N 4 A_QueueCorpse
    GOST O 4
    GOST PQ 5
    GOST R -1
    Stop
  XDeath:
    GOS2 A 5 ACS_ExecuteAlways(914,0,70)
    GOS2 B 5 A_Scream
    GOS2 CD 5
    GOS2 E 5 A_NoBlocking
    GOS2 F 5 A_QueueCorpse
    GOS2 G 5
    GOS2 H -1
    Stop
  Ice:
    "----" A 0 ACS_ExecuteAlways(914,0,70)
    "----" I 5 A_FreezeDeath
    "----" I 1 A_FreezeDeathChunks
    Wait
  }
}

Actor GhostieBuried : Ghostie
{
  Height 68
  -SHOOTABLE
  -SOLID
  +DONTMORPH
  +DONTBLAST
  +SPECIALFLOORCLIP
  +STAYMORPHED
  +INVISIBLE
  PainChance 0
  States
  {
  Spawn:
	GOST A 0
    GOST A 0 ACS_ExecuteAlways(913,0,250,20,0)
    Goto Super::Look
  See:
    GOST A 2 A_WraithRaiseInit
    GOST A 2 A_WraithRaise
    GOST A 2 A_FaceTarget
    GOST BB 2 A_WraithRaise
    Goto See+1
  Chase:
    Goto Super::See
  }
}

ACTOR WVSpell1
{
    Speed 20
    Damagetype "ManaDrain"
	Damage (random(1,8)+(ACS_ExecuteWithResult(912,1,0,0)))
    Scale 0.35
    Radius 6
    Height 12
    RenderStyle Add
    Alpha 0.75
    PROJECTILE
    //+SEEKERMISSILE
    +EXTREMEDEATH
    +DONTREFLECT
    SeeSound "whiteballbsee"
    DeathSound "whiteballbdeth"
    States
    {
    Spawn:
	PSMM A 1 Bright A_SeekerMissile(25,10)
	TNT1 A 0 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	PSMM A 1 Bright A_SeekerMissile(25,10)
	TNT1 A 0 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	PSMM A 1 Bright A_SeekerMissile(25,10)
	TNT1 A 0 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	PSMM A 1 Bright A_SeekerMissile(25,10)
	TNT1 A 0 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	PSMM B 1 Bright A_SeekerMissile(25,10)
	TNT1 A 0 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	PSMM B 1 Bright A_SeekerMissile(25,10)
	TNT1 A 0 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	PSMM B 1 Bright A_SeekerMissile(25,10)
	TNT1 A 0 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	PSMM B 1 Bright A_SeekerMissile(25,10)
	TNT1 A 0 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	PSMM C 1 Bright A_SeekerMissile(25,10)
	TNT1 A 0 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	PSMM C 1 Bright A_SeekerMissile(25,10)
	TNT1 A 0 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	PSMM C 1 Bright A_SeekerMissile(25,10)
	TNT1 A 0 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	PSMM D 1 Bright A_SeekerMissile(25,10)
	TNT1 A 0 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	PSMM D 1 Bright A_SeekerMissile(25,10)
	TNT1 A 0 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	PSMM E 1 Bright A_SeekerMissile(25,10)
	TNT1 A 0 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	PSMM E 1 Bright A_SeekerMissile(25,10)
	TNT1 A 0 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	PSMM F 1 Bright A_SeekerMissile(25,10)
	TNT1 A 0 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	PSMM F 1 Bright A_SeekerMissile(25,10)
	TNT1 A 0 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	Goto Spawn+33
    Death:
	PSMM GGHHIIJJKKLLMM 2 Bright A_FadeOut(0.05)
	Stop
    }
}

ACTOR WVSpell2 : WVSpell1
{
    States
    {
    Spawn:
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM A 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM A 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM A 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM A 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM B 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM B 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM B 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM B 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM C 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM C 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM C 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM C 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM D 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM D 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM E 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM E 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM F 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM F 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM D 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM D 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM E 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM E 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	Goto Spawn+48
    }
}

ACTOR WVSpell3 : WVSpell1
{
    States
    {
    Spawn:
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM A 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM A 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM A 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM A 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM B 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM B 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM B 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM B 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM C 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM C 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM C 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM C 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM D 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM D 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM E 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM E 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM F 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM F 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	Goto Spawn+36
    }
}

ACTOR WVSpell4 : WVSpell1
{
    States
    {
    Spawn:
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM A 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM A 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM A 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM A 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM B 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM B 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM B 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM B 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM C 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM C 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM C 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM C 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM D 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM D 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM E 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM E 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM F 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM F 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM D 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM D 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM E 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM E 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM F 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM F 1 Bright
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM D 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM D 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM E 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM E 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM F 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	TNT1 A 0 A_SeekerMissile(25,10)
	PSMM F 1 Bright A_BishopMissileWeave
	TNT1 A 0 A_CustomMissile("SLM2Trail",0,0,0)
	Goto Spawn+72
    }
}

ACTOR SLM2Trail
{
    PROJECTILE
    +NOCLIP
    Damage 0
    RenderStyle Add
    Alpha 0.45
    Scale 0.9
    States
    {
    Spawn:
	TNT1 A 2
	PUF2 BDFHJLNPRTVXZ 1
	PUF3 B 1 A_FadeOut(0.2)
	Wait
    }
}

Actor BishopSpotZ : RandomSpawner Replaces Bishop
{
	DropItem "NewBishop" 255 99
	DropItem "Priest" 255 66
	DropItem "Disciple" 255 49
	DropItem "Vampire" 255 41
}

Actor NewBishop : Bishop// Replaces Bishop
{
Species "Bishop"
PainChance "Convert", 255
dropitem "ArtiOrangeFlask" 32
DropItem "Armour4" 8
  dropitem "ReagentGreen" 64
+TELESTOMP
States
{
Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,75),"Feared")
	Goto Pain
  Feared:
	TNT1 A 0 A_Changeflag("Frightened", 1)
	Goto Pain
	Spawn:
	BISH A 0
	BISH A 0 ACS_ExecuteAlways(913,0,130,11,0)//increase health on higher difficulties
	//Idle
    BISH A 10 A_Look
    Loop
Idle:
	BISH A 10 A_Look
    Loop
Pain.Convert:
	TNT1 A 0 A_JumpIfInTargetInventory("Visions",Random(0,30),"ConvertMe")
	goto Pain
	ConvertMe:
	TNT1 A 0 ACS_ExecuteAlways(914,0,65)
	TNT1 A 0 ACS_ExecuteAlways(560,0,0,0,0)
	goto See
	Death:
	BISH A 0 ACS_ExecuteAlways(914,0,65)
	BISH G 6
	BISH H 6 A_Scream
	BISH I 5 A_NoBlocking
	BISH J 5 A_Explode
	BISH K 5
	BISH LM 4
	BISH N 4 A_CustomMissile("BishopPuff",40,0,0,2)
	BISH O 4 A_QueueCorpse
	BISH P -1
	Stop
	Ice:
	"----" A 0 ACS_ExecuteAlways(914,0,65)
	"----" C 5 A_GenericFreezeDeath
	"----" C 1 A_FreezeDeathChunks
	Wait
}
}

Actor NewBishopFX : BishopFX replaces BishopFX
{
	Damage (random(1,4)+(ACS_ExecuteWithResult(912,1,0,0)/2))
}

//Acolyte

Actor Priest : Bishop// replaces Bishop
{
  Health 130
  Radius 22
  Height 65
  Speed 10
  PainChance 110
  Species "Bishop"
  Monster
  +FLOAT
  +NOTARGET
  +NOGRAVITY
  +NOBLOOD
  +TELESTOMP
  +DONTOVERLAP
  +NOTARGETSWITCH
  +TELESTOMP
  SeeSound "BishopSight"
  AttackSound "BishopAttack"
  PainSound "BishopPain"
  DeathSound "BishopDeath"
  ActiveSound "BishopActiveSounds"
  Obituary "%o succumbed to a Acolyte's dark power."
  dropitem "ArtiOrangeFlask" 32
  dropitem "ReagentRed" 64
  DropItem "Armour8" 16
  States
   {
   Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,75),"Feared")
	Goto Pain
  Feared:
	TNT1 A 0 A_Changeflag("Frightened", 1)
	Goto Pain
   Spawn:
	ACOL A 0
	ACOL A 0 A_GiveInventory("FriendlyInDisguise")
	ACOL A 0 ACS_ExecuteAlways(913,0,130,11,0)//increase health on higher difficulties
       ACOL A 10 A_Look
       Loop
   Idle:
		ACOL A 10 A_Look
       Loop
   See:
		ACOL A 0 A_ChangeFlag ("Friendly", 1)
       ACOL A 2 A_Chase
	   ACOL A 2 A_BishopChase
       ACOL A 2
       ACOL B 2 A_BishopChase
       ACOL B 2 A_Chase
       ACOL B 2 A_BishopChase
	   ACOL A 1 A_BishopDecide
	   Loop
   Blur:
	   ACOL A 2 A_BishopDoBlur
	   ACOL AAA 4 A_SpawnItem("AcolyteBlur")
	   TNT1 A 0 A_Jump(256,1,2,3)
	   ACOL AA 4 A_SpawnItem("AcolyteBlur")
	   TNT1 A 0 Thing_Stop(0)
	   TNT1 A 0 A_SpawnItem("AcolyteBlur")
	   //TNT1 A 0 A_Jump(97,"Missile")
	   Goto See
   Missile:
	   ACOL A 3 A_FaceTarget
	   ACOL DE 3 A_FaceTarget
	   ACOL F 3 A_PlaySound("BishopAttack")
	   TNT1 A 0 A_Jump(256,2,4,6,8)
	   ACOL F 5 A_CustomMissile("AcolyteFX",32)
	   ACOL F 0 Acs_ExecuteAlways(607,0,Acs_executewithresult(912,4,0,0))
	   ACOL F 5 A_CustomMissile("AcolyteFX",32)
	   ACOL F 0 Acs_ExecuteAlways(607,0,Acs_executewithresult(912,4,0,0))
	   ACOL F 5 A_CustomMissile("AcolyteFX",32)
	   ACOL F 0 Acs_ExecuteAlways(607,0,Acs_executewithresult(912,4,0,0))
	   ACOL F 5 A_CustomMissile("AcolyteFX",32)
	   ACOL F 0 Acs_ExecuteAlways(607,0,Acs_executewithresult(912,4,0,0))
	   ACOL F 5 A_CustomMissile("AcolyteFX",32)
	   ACOL F 0 Acs_ExecuteAlways(607,0,Acs_executewithresult(912,4,0,0))
	   ACOL F 5 A_CustomMissile("AcolyteFX",32)
	   ACOL F 0 Acs_ExecuteAlways(607,0,Acs_executewithresult(912,4,0,0))
	   ACOL F 5 A_CustomMissile("AcolyteFX",32)
	   ACOL F 0 Acs_ExecuteAlways(607,0,Acs_executewithresult(912,4,0,0))
	   ACOL F 5 A_CustomMissile("AcolyteFX",32)
	   ACOL F 0 Acs_ExecuteAlways(607,0,Acs_executewithresult(912,4,0,0))
	   ACOL F 0 A_ClearTarget
       Goto See
   Pain:
       ACOL C 6 A_Pain
	   TNT1 A 0 A_Jump(64,"Blur")
	   ACOL C 6 A_SpawnItemEx("AcolytePainBlur",Random(-10,10),Random(-10,10),Random(-10,10))
	   TNT1 A 0 A_Jump(64,"Blur")
	   ACOL C 6 A_SpawnItemEx("AcolytePainBlur",Random(-10,10),Random(-10,10),Random(-10,10))
	   TNT1 A 0 A_Jump(64,"Blur")
	   ACOL C 6 A_SpawnItemEX("AcolytePainBlur",Random(-10,10),Random(-10,10),Random(-10,10))
       Goto See
   Death:
       ACOL G 6 Bright ACS_ExecuteAlways(914,0,65)
	   ACOL H 6 Bright A_Scream
       ACOL I 5 Bright A_NoBlocking
       ACOL J 5 Bright A_Explode(random[BishopBoom](25,40))
       ACOL K 5 Bright
       ACOL LM 4 Bright
       ACOL N 4 A_SpawnItemEx("BishopPuff", 0,0,40, 0,0,0.5)
       ACOL O 4 A_QueueCorpse
       ACOL P -1
       Stop
	   Ice:
		"----" C 0 Bright ACS_ExecuteAlways(914,0,65)
		"----" C 5 A_GenericFreezeDeath
    "----" C 1 A_FreezeDeathChunks
    Wait

   //Ice:
	   //BISH X 5 A_FreezeDeath
       //BISH X 1 A_FreezeDeathChunks
       //Wait
   }
}



Actor AcolytePainBlur
{
  +NOBLOCKMAP
  +NOGRAVITY
  RenderStyle Translucent
  Alpha 0.6
  States
  {
  Spawn:
    ACOL C 8
    Stop
  }
}

Actor AcolyteBlur
{
  +NOBLOCKMAP
  +NOGRAVITY
  RenderStyle Translucent
  Alpha 0.6
  States
  {
  Spawn:
    ACOL A 16
    ACOL A 8 A_SetTranslucent(0.4)
    Stop
  }
}

Actor AcolyteFX
{
   Radius 10
   Height 6
   Speed 10
   Damagetype "AcolyteHealing"
   Projectile
   +SEEKERMISSILE
   +FOILINVUL
   +NODAMAGETHRUST
   +PAINLESS
   RenderStyle Add
   Alpha 0.67
   DeathSound "BishopMissileExplode"
   States
   {
   Spawn:
      CFX1 AB 1 Bright A_BishopMissileWeave
	  TNT1 A 0 A_SeekerMissile(1,3)
	  CFX1 AB 1 Bright A_BishopMissileWeave
      TNT1 A 0 A_SeekerMissile(1,3)
      loop
   Death:
      CFX1 CDEF 4 Bright
	  CFX1 GH 3 Bright
      stop
   }
}

ACTOR Vampire : Bishop
{
Health 220
PainChance 170
SeeSound "vampire/see"
DeathSound "vampire/death"
PainSound "vampire/pain"
MONSTER
+DONTHURTSPECIES
+TELESTOMP
dropitem "ArtiOrangeFlask" 32
  dropitem "ArtiBlackFlask" 8
PainChance "Convert", 255
Species "Bishop"
Obituary "A Vampire drained all of %o's life."
States
   {
   Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,75),"Feared")
	Goto Pain
  Feared:
	TNT1 A 0 A_Changeflag("Frightened", 1)
	Goto Pain
   Spawn:
		VAM1 A 0
		VAM1 A 0 ACS_ExecuteAlways(913,0,220,15,0)//increase health on higher difficulties
       VAM1 AB 10 A_Look
       Loop
	   Pain.Convert:
	TNT1 A 0 A_JumpIfInTargetInventory("Visions",Random(0,30),"ConvertMe")
	goto Pain
	ConvertMe:
	TNT1 A 0 ACS_ExecuteAlways(914,0,70)
	TNT1 A 0 ACS_ExecuteAlways(560,0,0,0,0)
	goto See
	Idle:
		VAM1 AB 10 A_Look
       Loop
   See:
       VAM1 A 2 A_Chase
	   VAM1 A 2 A_BishopChase
       VAM1 A 2
       VAM1 B 2 A_BishopChase
       VAM1 B 2 A_Chase
       VAM1 B 2 A_BishopChase
	   VAM1 A 1 A_BishopDecide
	   Loop
   Blur:
	   VAM1 A 2 A_BishopDoBlur
	   VAM1 AAA 4 A_SpawnItem("VampireBlur")
	   TNT1 A 0 A_Jump(256,1,2,3)
	   VAM1 AA 4 A_SpawnItem("VampireBlur")
	   TNT1 A 0 Thing_Stop(0)
	   TNT1 A 0 A_SpawnItem("VampireBlur")
	   TNT1 A 0 A_Jump(97,"Missile")
	   Goto See
   Missile:
	   TNT1 A 0 A_JumpIfCloser(64,1)
	   Goto Missile+5
	   VAM1 ADE 3 Bright A_FaceTarget
	   VAM1 F 3 Bright A_BishopAttack
	   Goto See
	   VAM1 X 1 Bright A_Jump(96,26)
       VAM1 X 8 Bright A_FaceTarget
	   TNT1 AAAAAAAAAAAAAA 0 A_SpawnItemEx("VampCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
	   TNT1 AAAAAAAAA 0 A_CustomMissile("BatAttack",Random(8,64),Random(-32,32),Random(20,-20),1)
	   VAM1 Y 8 Bright A_CustomMissile("BatAttack",Random(8,64),Random(-32,32),Random(20,-20),1)
       Goto See
       VAM1 E 8 Bright A_FaceTarget
	   TNT1 AAAAAAAAAAAAAA 0 A_SpawnDebris("NashGore_FlyingBlood",1)
       VAM1 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 1 Bright A_CustomMissile("VampireRoundBeam",32,0,0,1)
       Goto See
   Pain:
       VAM1 C 6 A_Pain
	   TNT1 A 0 A_Jump(64,"Blur")
	   VAM1 C 6 A_SpawnItemEx("VampirePainBlur",Random(-10,10),Random(-10,10),Random(-10,10))
	   TNT1 A 0 A_Jump(64,"Blur")
	   VAM1 C 6 A_SpawnItemEx("VampirePainBlur",Random(-10,10),Random(-10,10),Random(-10,10))
	   TNT1 A 0 A_Jump(64,"Blur")
	   VAM1 C 6 A_SpawnItemEX("VampirePainBlur",Random(-10,10),Random(-10,10),Random(-10,10))
       Goto See
   Death:
       VAM1 G 1 Bright ACS_ExecuteAlways(914,0,70)
       VAM1 G 8 Bright A_Scream
       VAM1 H 5 Bright
       VAM1 I 5 Bright A_NoBlocking
	   TNT1 AAAAAAAAAAAAAA 0 A_SpawnItemEx("VampCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
	   TNT1 A 0 A_Jump(128,3)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),1)
	   TNT1 A 0 A_Jump(256,2)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),-1)
	   TNT1 A 0 A_Jump(128,3)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),1)
	   TNT1 A 0 A_Jump(256,2)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),-1)
	   TNT1 A 0 A_Jump(128,3)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),1)
	   TNT1 A 0 A_Jump(256,2)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),-1)
	   TNT1 A 0 A_Jump(128,3)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),1)
	   TNT1 A 0 A_Jump(256,2)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),-1)
	   TNT1 A 0 A_Jump(128,3)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),1)
	   TNT1 A 0 A_Jump(256,2)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),-1)
	   TNT1 A 0 A_Jump(128,3)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),1)
	   TNT1 A 0 A_Jump(256,2)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),-1)
	   TNT1 A 0 A_Jump(128,3)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),1)
	   TNT1 A 0 A_Jump(256,2)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),-1)
	   TNT1 A 0 A_Jump(128,3)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),1)
	   TNT1 A 0 A_Jump(256,2)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),-1)
	   TNT1 A 0 A_Jump(128,3)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),1)
	   TNT1 A 0 A_Jump(256,2)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),-1)
	   TNT1 A 0 A_Jump(128,3)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),1)
	   TNT1 A 0 A_Jump(256,2)
	   TNT1 A 0 A_SpawnItemEx("BatAttackSafe", 0, 0, 30, random(-8, 8), random(-8, 8),-1)
       VAM1 J 5 Bright
       VAM1 KLM 5 Bright
       VAM1 N 5
       VAM1 O 5
       VAM1 P -1
       Stop
	Ice:
		"----" C 0 ACS_ExecuteAlways(914,0,70)
		"----" C 5 A_GenericFreezeDeath
		"----" C 1 A_FreezeDeathChunks
		Wait
   Raise:
       VAM1 PONMLKJIHG 5
       Goto See
   }
}

Actor VampirePainBlur
{
  +NOBLOCKMAP
  +NOGRAVITY
  +CLIENTSIDEONLY
  RenderStyle Translucent
  Alpha 0.6
  States
  {
  Spawn:
    VAM1 C 8
    Stop
  }
}

Actor VampireBlur
{
  +NOBLOCKMAP
  +NOGRAVITY
  +CLIENTSIDEONLY
  RenderStyle Translucent
  Alpha 0.6
  States
  {
  Spawn:
    VAM1 A 16
    VAM1 A 8 A_SetTranslucent(0.4)
    Stop
  }
}


ACTOR VampireRoundBeam
{
   Radius 2
   Height 4
   Speed 10
   Damage (1+(ACS_ExecuteWithResult(912,1,0,0)/3))
   Scale 0.50
   PROJECTILE
   +FLOATBOB
   Renderstyle Add
   +SeekerMissile
   States
   {
   Spawn:
      VAM2 A 0 Bright A_PlaySound("vampire/beam")
	  VAM2 A 0 Bright A_PlaySound("vampire/beam")
	  VAM2 A 0 Bright A_PlaySound("vampire/beam")
	  VAM2 A 0 Bright A_PlaySound("vampire/beam")
	  VAM2 A 0 Bright A_PlaySound("vampire/beam")
      VAM2 A 1 Bright A_CStaffMissileSlither
      VAM2 A 0 Bright A_SpawnItemEx("VampireRoundBeamTrail", 0, 0, 0, 0, 0, 0, 0, 128)
      VAM2 A 1 Bright A_CStaffMissileSlither
      VAM2 A 0 Bright A_SpawnItemEx("VampireRoundBeamTrail", 0, 0, 0, 0, 0, 0, 0, 128)
      VAM2 A 1 Bright A_CStaffMissileSlither
      VAM2 A 0 Bright A_SpawnItemEx("VampireRoundBeamTrail", 0, 0, 0, 0, 0, 0, 0, 128)
      VAM2 A 1 Bright A_CStaffMissileSlither
      VAM2 A 0 Bright A_SpawnItemEx("VampireRoundBeamTrail", 0, 0, 0, 0, 0, 0, 0, 128)
      VAM2 A 0 Bright A_SeekerMissile(5,5)
      loop
   Death:
      VAM2 CDEFGH 3 Bright
      stop
   }
}

ACTOR VampireRoundBeamTrail
{
   Radius 8
   Height 16
   RENDERSTYLE ADD
   ALPHA 0.67
   Scale 0.50
   PROJECTILE
   +Clientsideonly
   +FLOATBOB
   SeeSound "monster/acosht"
   DeathSound "monster/acohit"
   States
   {
   Spawn:
      VAM2 A 2 Bright
      VAM2 A 2 Bright
      VAM2 A 2 Bright
      VAM2 A 2 Bright
      VAM2 A 0 Bright
      goto death
   Death:
      VAM2 A 1 Bright A_SetTranslucent(0.60)
	  VAM2 A 1 Bright A_SetTranslucent(0.50)
	  VAM2 A 1 Bright A_SetTranslucent(0.40)
	  VAM2 A 1 Bright A_SetTranslucent(0.30)
	  VAM2 A 1 Bright A_SetTranslucent(0.20)
	  VAM2 A 1 Bright A_SetTranslucent(0.10)
	  VAM2 A 1 Bright A_SetTranslucent(0.00)
      stop
   }
}


actor VampireBloodBoom
{
 game Doom
 scale 0.75
 health 1
 radius 8
 height 1
 mass 1
 +CORPSE
 +Clientsideonly
 +NOTELEPORT
 +NOBLOCKMAP
 states
 {
 Spawn:
  TNT1 A 0
  VAB1 A 1 A_SpawnItemEx("VampireBloodTrail",0,0,0,1,0,0,0,128)
  VAB1 A 1
  VAB1 A 1 A_SpawnItemEx("VampireBloodTrail",0,0,0,1,0,0,0,128)
  VAB1 A 1
  VAB1 B 1 A_SpawnItemEx("VampireBloodTrail",0,0,0,1,0,0,0,128)
  VAB1 B 1
  VAB1 B 1 A_SpawnItemEx("VampireBloodTrail",0,0,0,1,0,0,0,128)
  VAB1 B 1
  VAB1 C 1 A_SpawnItemEx("VampireBloodTrail",0,0,0,1,0,0,0,128)
  VAB1 C 1
  VAB1 C 1 A_SpawnItemEx("VampireBloodTrail",0,0,0,1,0,0,0,128)
  VAB1 C 1
  VAB1 D 1 A_SpawnItemEx("VampireBloodTrail",0,0,0,1,0,0,0,128)
  VAB1 D 1
  VAB1 D 1 A_SpawnItemEx("VampireBloodTrail",0,0,0,1,0,0,0,128)
  VAB1 D 1
  loop
 Crash:
  TNT1 A 1 A_SpawnItemEx("VampireBloodSpot",0,0,0,1,0,0,0,128)
  stop
 }
}

actor VampireBloodSpot
{
 game Doom
 radius 12
 height 2
 mass 1
 +NOTELEPORT
 -NOBLOCKMAP
 +Clientsideonly
 states
 {
 Spawn:
  TNT1 A 0
  TNT1 A 0 A_PlaySound("vampireblood")
  TNT1 A 0 A_Jump(64,4)
  TNT1 A 0 A_Jump(128,4)
  TNT1 A 0 A_Jump(192,4)
  TNT1 A 0 A_Jump(255,4)
  VAB3 A 750
  stop
  VAB3 B 750
  stop
  VAB3 C 750
  stop
  VAB3 D 750
  stop
 }
}

actor VampireBloodTrail
{
 game Doom
 scale 0.70
 mass 1
 +LOWGRAVITY
 +NOTELEPORT
 +NOBLOCKMAP
 +Clientsideonly
 states
 {
  Spawn:
  VAB2 A 4
  VAB2 B 4
  VAB2 C 4
  VAB2 D 4
  stop
 }
}

ACTOR BatAttack
{
  Radius 8
  Height 16
  Speed 12
  Damage (random(1,8)+(ACS_ExecuteWithResult(912,1,0,0)))
  PROJECTILE
  +Randomize
  +NoGravity
  //+Float
  seesound "vampire/bats"
  states
  {
  Spawn:
    VAM4 ABCABCABCABC 3 BRIGHT A_SpawnItemEx("BatTrail")
	VAM4 ABCABCABCABC 3 BRIGHT A_SpawnItemEx("BatTrail")
	VAM4 ABCABCABCABC 3 BRIGHT A_SpawnItemEx("BatTrail")
	VAM4 ABCABCABCABC 3 BRIGHT A_SpawnItemEx("BatTrail")
	VAM4 ABCABCABCABC 3 BRIGHT A_SpawnItemEx("BatTrail")
    Goto death
  Death:
    TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
    VAM4 A 2 A_SetTranslucent(0.9)
	TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
	VAM4 B 2 A_SetTranslucent(0.8)
	TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
	VAM4 C 2 A_SetTranslucent(0.7)
	TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
	VAM4 A 2 A_SetTranslucent(0.6)
	TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
	VAM4 B 2 A_SetTranslucent(0.5)
	TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
	VAM4 C 2 A_SetTranslucent(0.4)
	TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
	VAM4 A 2 A_SetTranslucent(0.3)
	TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
	VAM4 B 2 A_SetTranslucent(0.2)
	TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
	VAM4 C 2 A_SetTranslucent(0.1)
	TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
    Stop
  }
}

ACTOR BatTrail
{
  Radius 8
  Height 16
  RenderStyle Add
  Alpha 0.8
  Scale 0.3
  PROJECTILE
  +Randomize
  +Clientsideonly
  +NoGravity
  +Float
  states
  {
  Spawn:
    VAM5 ABCDEFGHI 3 BRIGHT
    Goto death
  Death:
	VAM5 I 1
    Stop
  }
}

Actor VampCloudSpawner
{
  radius 0
  height 0
  +NOGRAVITY
  +NOBLOCKMAP
  +NOLIFTDROP
  +NOTARGET
  +DONTSQUASH
  +NOTELEOTHER
  +NONSHOOTABLE
  +Clientsideonly
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 1 A_SpawnItemEx("VampCloud", 0, 0, 0, random(-2, 2), random(-2, 2), random(-1, 1))
    Stop
  }
}

Actor VampCloud
{
  renderstyle translucent
  alpha 0.9
  Scale 0.5
  radius 0
  height 0
  +NOGRAVITY
  +NOBLOCKMAP
  +NOLIFTDROP
  +NOTARGET
  +DONTSQUASH
  +NOTELEOTHER
  +NONSHOOTABLE
  +Clientsideonly
  States
  {
  Spawn:
    VAM6 A 0
    VAM6 A 0 A_Jump(128, 6)
    VAM6 ABCDE 3 A_FadeOut(0.05)
    Goto Spawn+1
    VAM6 F 0 A_Jump(128, 6)
    VAM6 FGHIJ 3 A_FadeOut(0.05)
    Goto Spawn+7
    VAM6 KLMNO 3 A_FadeOut(0.05)
    Goto Spawn+12
  }
}

Actor BatCloudSpawner
{
  radius 0
  height 0
  +NOGRAVITY
  +NOBLOCKMAP
  +NOLIFTDROP
  +NOTARGET
  +DONTSQUASH
  +NOTELEOTHER
  +NONSHOOTABLE
  +Clientsideonly
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 1 A_SpawnItemEx("BatCloud", 0, 0, 0, random(-2, 2), random(-2, 2), random(-1, 1))
    Stop
  }
}

Actor BatCloud
{
  renderstyle translucent
  alpha 0.9
  Scale 0.2
  radius 0
  height 0
  +NOGRAVITY
  +NOBLOCKMAP
  +NOLIFTDROP
  +NOTARGET
  +DONTSQUASH
  +NOTELEOTHER
  +Clientsideonly
  +NONSHOOTABLE
  States
  {
  Spawn:
    VAM6 A 0
    VAM6 A 0 A_Jump(128, 6)
    VAM6 ABCDE 3 A_FadeOut(0.10)
    Goto Spawn+1
    VAM6 F 0 A_Jump(128, 6)
    VAM6 FGHIJ 3 A_FadeOut(0.10)
    Goto Spawn+7
    VAM6 KLMNO 3 A_FadeOut(0.10)
    Goto Spawn+12
  }
}

ACTOR BatAttackSafe
{
  Radius 8
  Height 16
  Speed 15
  Damage 0
  PROJECTILE
  +Randomize
  +NoGravity
  +Float
  seesound "vampire/bats"
  states
  {
  Spawn:
    VAM4 ABCABCABCABC 3 BRIGHT A_SpawnItemEx("BatTrail")
	VAM4 ABCABCABCABC 3 BRIGHT A_SpawnItemEx("BatTrail")
	VAM4 ABCABCABCABC 3 BRIGHT A_SpawnItemEx("BatTrail")
	VAM4 ABCABCABCABC 3 BRIGHT A_SpawnItemEx("BatTrail")
	VAM4 ABCABCABCABC 3 BRIGHT A_SpawnItemEx("BatTrail")
    Goto death
  Death:
    TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
    VAM4 A 2 A_SetTranslucent(0.9)
	TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
	VAM4 B 2 A_SetTranslucent(0.8)
	TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
	VAM4 C 2 A_SetTranslucent(0.7)
	TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
	VAM4 A 2 A_SetTranslucent(0.6)
	TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
	VAM4 B 2 A_SetTranslucent(0.5)
	TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
	VAM4 C 2 A_SetTranslucent(0.4)
	TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
	VAM4 A 2 A_SetTranslucent(0.3)
	TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
	VAM4 B 2 A_SetTranslucent(0.2)
	TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
	VAM4 C 2 A_SetTranslucent(0.1)
	TNT1 A 0 A_SpawnItemEx("BatCloudSpawner", 0, 0, 30, 0, 0, 0, 0, 128)
    Stop
  }
}

Actor Disciple : Bishop
{
  Health 170
  Radius 22
  Height 65
  Speed 10
  PainChance 110
  Monster
  +FLOAT
  +NOGRAVITY
  +NOBLOOD
  +TELESTOMP
  +DONTOVERLAP
  +NOTARGETSWITCH
  Species "Bishop"
  SeeSound "BishopSight"
  AttackSound "BishopAttack"
  PainSound "BishopPain"
  DeathSound "BishopDeath"
  ActiveSound "BishopActiveSounds"
  dropitem "ArtiOrangeFlask" 32
  dropitem "ArtiPurpleFlask" 8
  Obituary"%o succumbed to a Disciple's dark power."
  States
  {
  Pain.Morale:
	TNT1 A 0 A_JumpIfInTargetInventory("WarCry",Random(0,75),"Feared")
	Goto Pain
  Feared:
	TNT1 A 0 A_Changeflag("Frightened", 1)
	Goto Pain
  Spawn:
		HDIS A 0
		HDIS A 0 ACS_ExecuteAlways(913,0,170,20,0)//increase health on higher difficulties
       HDIS A 10 A_Look
       Loop
  Idle:
		HDIS A 10 A_Look
       Loop
  See:
       HDIS A 2 A_Chase
	   HDIS A 2 A_BishopChase
       HDIS A 2
       HDIS B 2 A_BishopChase
       HDIS B 2 A_Chase
       HDIS B 2 A_BishopChase
	   HDIS A 1 A_BishopDecide
	   Loop
  Blur:
	   HDIS A 2 A_BishopDoBlur
	   HDIS AAA 4 A_SpawnItem("DiscipleBlur")
	   TNT1 A 0 A_Jump(256,1,2,3)
	   HDIS AA 4 A_SpawnItem("DiscipleBlur")
	   TNT1 A 0 Thing_Stop(0)
	   TNT1 A 0 A_SpawnItem("DiscipleBlur")
	   TNT1 A 0 A_Jump(97,"Missile")
	   Goto See
  Missile:
	   HDIS A 3 A_FaceTarget
	   HDIS DE 3 A_FaceTarget
	   TNT1 A 0 A_JumpIfCloser(64,1)
	   Goto Missile+5
	   HDIS F 3 A_BishopAttack
	   Goto See
	   HDIS F 3 A_PlaySound("BishopAttack")
	   TNT1 A 0 A_Jump(256,1,4,7,10)
	   TNT1 A 0 A_CustomMissile("DiscipleSpreadFX",32,0,-60,1)
	   TNT1 A 0 A_CustomMissile("DiscipleSpreadFX",32,0,60,1)
	   HDIS F 5 A_CustomMissile("DiscipleFX",32)
	   TNT1 A 0 A_CustomMissile("DiscipleSpreadFX",32,0,-60,1)
	   TNT1 A 0 A_CustomMissile("DiscipleSpreadFX",32,0,60,1)
	   HDIS F 5 A_CustomMissile("DiscipleFX",32)
	   TNT1 A 0 A_CustomMissile("DiscipleSpreadFX",32,0,-60,1)
	   TNT1 A 0 A_CustomMissile("DiscipleSpreadFX",32,0,60,1)
	   HDIS F 5 A_CustomMissile("DiscipleFX",32)
	   TNT1 A 0 A_CustomMissile("DiscipleSpreadFX",32,0,-60,1)
	   TNT1 A 0 A_CustomMissile("DiscipleSpreadFX",32,0,60,1)
	   HDIS F 5 A_CustomMissile("DiscipleFX",32)
	   TNT1 A 0 A_CustomMissile("DiscipleSpreadFX",32,0,-60,1)
	   TNT1 A 0 A_CustomMissile("DiscipleSpreadFX",32,0,60,1)
	   HDIS F 5 A_CustomMissile("DiscipleFX",32)
	   TNT1 A 0 A_CustomMissile("DiscipleSpreadFX",32,0,-60,1)
	   TNT1 A 0 A_CustomMissile("DiscipleSpreadFX",32,0,60,1)
	   HDIS F 5 A_CustomMissile("DiscipleFX",32)
	   TNT1 A 0 A_CustomMissile("DiscipleSpreadFX",32,0,-60,1)
	   TNT1 A 0 A_CustomMissile("DiscipleSpreadFX",32,0,60,1)
	   HDIS F 5 A_CustomMissile("DiscipleFX",32)
	   TNT1 A 0 A_CustomMissile("DiscipleSpreadFX",32,0,-60,1)
	   TNT1 A 0 A_CustomMissile("DiscipleSpreadFX",32,0,60,1)
	   HDIS F 5 A_CustomMissile("DiscipleFX",32)
       Goto See
  Pain:
       HDIS C 6 A_Pain
	   TNT1 A 0 A_Jump(64,"Blur")
	   HDIS C 6 A_SpawnItemEx("DisciplePainBlur",Random(-10,10),Random(-10,10),Random(-10,10))
	   TNT1 A 0 A_Jump(64,"Blur")
	   HDIS C 6 A_SpawnItemEx("DisciplePainBlur",Random(-10,10),Random(-10,10),Random(-10,10))
	   TNT1 A 0 A_Jump(64,"Blur")
	   HDIS C 6 A_SpawnItemEX("DisciplePainBlur",Random(-10,10),Random(-10,10),Random(-10,10))
       Goto See
  Death:
       HDIS G 6 ACS_ExecuteAlways(914,0,70)
	   HDIS H 6 Bright A_Scream
       HDIS I 5 Bright A_NoBlocking
       HDIS J 5 Bright A_Explode(random[BishopBoom](25,40))
       HDIS K 5 Bright
       HDIS LM 4 Bright
       HDIS N 4 A_SpawnItemEx("BishopPuff", 0,0,40, 0,0,0.5)
       HDIS O 4 A_QueueCorpse
       HDIS P -1
       Stop
  Ice:
		"----" C 0 ACS_ExecuteAlways(914,0,70)
	   "----" C 5 A_GenericFreezeDeath
       "----" C 1 A_FreezeDeathChunks
       Wait
   }
}

Actor DisciplePainBlur
{
  +NOBLOCKMAP
  +NOGRAVITY
  RenderStyle Translucent
  Alpha 0.6
  States
  {
  Spawn:
    HDIS C 8
    Stop
  }
}

Actor DiscipleBlur
{
  +NOBLOCKMAP
  +NOGRAVITY
  RenderStyle Translucent
  Alpha 0.6
  States
  {
  Spawn:
    HDIS A 16
    HDIS A 8 A_SetTranslucent(0.4)
    Stop
  }
}

Actor DiscipleFX
{
   Radius 10
   Height 6
   Speed 10
   Damage (random(1,2)+(ACS_ExecuteWithResult(912,1,0,0)/2))
   Projectile
   +SEEKERMISSILE
   -ACTIVATEIMPACT
   -ACTIVATEPCROSS
   +STRIFEDAMAGE
   RenderStyle Add
   DeathSound "BishopMissileExplode"
   States
   {
   Spawn:
      HDFX ABAB 1 Bright A_BishopMissileWeave
      TNT1 A 0 A_SeekerMissile(1,3)
      loop
   Death:
      HDFX CDEF 4 Bright
	  HDFX GH 3 Bright
      stop
   }
}

Actor DiscipleSpreadFX : DiscipleFX
{
   States
   {
   Spawn:
      HDFX A 1 Bright A_BishopMissileWeave
	  TNT1 A 0 A_SeekerMissile(1,9)
	  HDFX B 1 Bright A_BishopMissileWeave
      TNT1 A 0 A_SeekerMissile(1,9)
	  HDFX A 1 Bright A_BishopMissileWeave
	  TNT1 A 0 A_SeekerMissile(1,9)
	  HDFX B 1 Bright A_BishopMissileWeave
      TNT1 A 0 A_SeekerMissile(1,9)
	  HDFX A 1 Bright A_BishopMissileWeave
	  TNT1 A 0 A_SeekerMissile(1,9)
	  HDFX B 1 Bright A_BishopMissileWeave
      TNT1 A 0 A_SeekerMissile(1,9)
	  HDFX A 1 Bright A_BishopMissileWeave
	  TNT1 A 0 A_SeekerMissile(1,9)
	  HDFX B 1 Bright A_BishopMissileWeave
      TNT1 A 0 A_SeekerMissile(1,9)
      HDFX ABAB 1 Bright A_BishopMissileWeave
      TNT1 A 0 A_SeekerMissile(1,3)
      Goto Spawn+16
   Death:
      HDFX CDEF 4 Bright
	  HDFX GH 3 Bright
      stop
   }
}

ACTOR NewDragon : Dragon Replaces Dragon
{
Health 6400
+TELESTOMP
DamageFactor "Deathblow", 0
+NOTARGET
Damagefactor "PoisonCloud", 0.25
  States
  {
  Spawn:
	DRAG D 0
	DRAG D 0 ACS_ExecuteAlways(913,0,6400,0,0)
	DRAG D 10 A_Look
    Loop
  Idle:
    DRAG D 10 A_Look
    Loop
  Crash:
    DRAG A 0 ACS_ExecuteAlways(914,0,750)
    DRAG KL 5
    DRAG M -1
    Stop
  }
}

Actor NewDragonFireBall : DragonFireBall replaces DragonFireball
{
	Damage ((random(1,8)*6)+(ACS_ExecuteWithResult(912,2,0,0)))
}

Actor NewDragonExplosion : DragonExplosion replaces DragonExplosion
{
	States
	{
	Spawn:
     CFCF Q 1 Bright
     CFCF Q 4 Bright A_UnHideThing
     CFCF R 3 Bright A_Scream
     CFCF S 4 Bright
     CFCF T 3 Bright A_Explode(80+(ACS_ExecuteWithResult(912,2,0,0)), 128, 0)
     CFCF U 4 Bright
     CFCF V 3 Bright
     CFCF W 4 Bright
     CFCF X 3 Bright
     CFCF Y 4 Bright
     CFCF Z 3 Bright
     Stop
  }
}

Actor DarkPatriarch : Bishop
{
  Health 1500
  Radius 22
  Height 65
  Speed 10
  PainChance 30
  Monster
  +FLOAT
  +NOGRAVITY
  +NOBLOOD
  +TELESTOMP
  +DONTOVERLAP
  +NOTARGETSWITCH
  Species "Bishop"
  SeeSound "BishopSight"
  AttackSound "BishopAttack"
  PainSound "BishopPain"
  DeathSound "BishopDeath"
  ActiveSound "BishopActiveSounds"
  dropitem "ArtiOrangeFlask" 32
  dropitem "ArtiPurpleFlask" 8
  Obituary "%o succumbed to a Disciple's dark power."
  States
  {
  Spawn:
		DPTR A 0
		DPTR A 0 ACS_ExecuteAlways(913,0,1350,150,0)//increase health on higher difficulties
       DPTR A 10 A_Look
       Loop
  Idle:
		DPTR A 10 A_Look
       Loop
  See:
       DPTR A 2 A_Chase
	   DPTR A 2 A_BishopChase
       DPTR A 2
       DPTR B 2 A_BishopChase
       DPTR B 2 A_Chase
       DPTR B 2 A_BishopChase
	   DPTR A 1 A_BishopDecide
	   Loop
  Blur:
	   DPTR A 0 A_UnsetShootable
	   DPTR A 1 A_SetTranslucent(0.9, 0)
	   DPTR A 1 A_SetTranslucent(0.8, 0)
	   DPTR A 1 A_SetTranslucent(0.7, 0)
	   DPTR A 1 A_SetTranslucent(0.6, 0)
	   DPTR A 1 A_SetTranslucent(0.5, 0)
	   DPTR A 1 A_SetTranslucent(0.4, 0)
	   DPTR A 1 A_SetTranslucent(0.3, 0)
	   DPTR A 1 A_SetTranslucent(0.2, 0)
	   DPTR A 1 A_SetTranslucent(0.1, 0)
	   DPTR A 1 A_SetTranslucent(0.0, 0)
	   DPTR AAAAAAAAAAAAAAAAAAA 0 A_Wander
	   DPTR AAAAAAAAAAAAAAAAAAA 0 A_Wander
	   DPTR AAAAAAAAAAAAAAAAAAA 0 A_Wander
	   TNT1 A 0 Thing_Stop(0)
	   DPTR A 1 A_SetTranslucent(0.1, 0)
	   DPTR A 1 A_SetTranslucent(0.2, 0)
	   DPTR A 1 A_SetTranslucent(0.3, 0)
	   DPTR A 1 A_SetTranslucent(0.4, 0)
	   DPTR A 1 A_SetTranslucent(0.5, 0)
	   DPTR A 1 A_SetTranslucent(0.6, 0)
	   DPTR A 1 A_SetTranslucent(0.7, 0)
	   DPTR A 1 A_SetTranslucent(0.8, 0)
	   DPTR A 1 A_SetTranslucent(0.9, 0)
	   DPTR A 1 A_SetTranslucent(1.0, 0)
	   DPTR A 0 A_setShootable
	   TNT1 A 0 A_Jump(97,"Missile")
	   Goto See
  Missile:
	   DPTR A 3 A_FaceTarget
	   DPTR DE 3 A_FaceTarget
	   DPTR F 3 A_PlaySound("BishopAttack")
	   DPTR F 5 A_CustomMissile("DarkPatriarchFX1",32)
	   DPTR F 5 A_CustomMissile("DarkPatriarchFX1",32)
	   DPTR F 5 A_CustomMissile("DarkPatriarchFX1",32)
	   DPTR F 5 A_CustomMissile("DarkPatriarchFX1",32)
	   DPTR F 5 A_CustomMissile("DarkPatriarchFX1",32)
	   DPTR F 5 A_CustomMissile("DarkPatriarchFX1",32)
	   DPTR F 5 A_CustomMissile("DarkPatriarchFX1",32)
	   DPTR F 5 A_CustomMissile("DarkPatriarchFX1",32)
       Goto See
  Pain:
       DPTR C 6 A_Pain
	   TNT1 A 0 A_Jump(64,"Blur")
	   DPTR C 6 A_SpawnItemEx("DisciplePainBlur",Random(-10,10),Random(-10,10),Random(-10,10))
	   TNT1 A 0 A_Jump(64,"Blur")
	   DPTR C 6 A_SpawnItemEx("DisciplePainBlur",Random(-10,10),Random(-10,10),Random(-10,10))
	   TNT1 A 0 A_Jump(64,"Blur")
	   DPTR C 6 A_SpawnItemEX("DisciplePainBlur",Random(-10,10),Random(-10,10),Random(-10,10))
       Goto See
  Death:
       DPTR G 6 ACS_ExecuteAlways(914,0,70)
	   DPTR H 6 Bright A_Scream
       DPTR I 5 Bright A_NoBlocking
       DPTR J 5 Bright A_Explode(random[BishopBoom](25,40))
       DPTR K 5 Bright
       DPTR LM 4 Bright
       DPTR N 4 A_SpawnItemEx("BishopPuff", 0,0,40, 0,0,0.5)
       DPTR O 4 A_QueueCorpse
       DPTR P -1
       Stop
  Ice:
		"----" C 0 ACS_ExecuteAlways(914,0,70)
	   "----" C 5 A_GenericFreezeDeath
       "----" C 1 A_FreezeDeathChunks
       Wait
   }
}

ACTOR DarkPatriarchFX1
{
  Radius 12
  Height 8
  Speed 22
  Damage (random(1,4)+(ACS_ExecuteWithResult(912,1,0,0)/2))
  Projectile
  RenderStyle Add
  SeeSound "weapons/hornrodpowshoot"
  DeathSound "weapons/hornrodpowhit"
  Obituary "$OB_MPPSKULLROD"
  States
  {
  Spawn:
	PFX1 C 0
	PFX1 C 0 Bright A_GiveToTarget("PatriarchRainCheck")
    PFX1 C 3 Bright
    PFX1 D 3 Bright A_SeekerMissile(10, 30)
    PFX1 E 3 Bright
    PFX1 F 3 Bright A_SeekerMissile(10, 30)
    Goto Spawn+2
  Death:
    PFX1 H 5 Bright
    PFX1 I 5 Bright
    PFX1 J 4 Bright
    PFX1 KLM 3 Bright
  DeathRain:
	TNT1 A 0 A_TakeFromTarget("PatriarchRainCheck")
	TNT1 A 0 A_JumpIfInTargetInventory("PatriarchRainCheck", 1, "DeathGone")
	TNT1 A 0 A_JumpIfInventory("PatriarchRainCount", 140, "DeathGone")
    TNT1 A 0 A_SpawnItemEx("PatriarchRainSpawner",0,0,9999,0,0,0,0,SXF_NOCHECKPOSITION)
	TNT1 A 1 A_GiveInventory("PatriarchRainCount", 1)
    Loop
  DeathGone:
	TNT1 A 1 //A_TakeFromTarget("PatriarchRainCheck")
	Stop
  }
}

Actor PatriarchRainCheck : Inventory
{
	Inventory.MaxAmount 1
}

Actor PatriarchRainCount : Inventory
{
	Inventory.MaxAmount 140
}

actor PatriarchRainSpawner
{
+SKYEXPLODE
PROJECTILE
-SOLID
+NOGRAVITY
+CEILINGHUGGER
radius 1
height 8
speed 0
States
{
Spawn:
Death:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("PatriarchRain",random(-64,64),random(-64,64),-2,random(-1,1),random(-1,1),-20)
Stop
}
}

ACTOR PatriarchRain
{
  Radius 5
  Height 8
  Speed 0
  Damage (random(1,2)+(ACS_ExecuteWithResult(912,1,0,0)/2))
  Mass 5
  Projectile
  -ACTIVATEPCROSS
  -ACTIVATEIMPACT
  RenderStyle Add
  Obituary "$OB_MPPSKULLROD"
  States
  {
  Spawn:
    PFX3 A -1 Bright
    Loop
  Death:
    PFX3 B 4 Bright
    PFX3 CDEF 4 Bright
    Stop
  }
}