actor UndeadPriest
{
//Creator: "pdxbla's "VDP-MonsterRandomizer" & ElAnexo
//Origin: Realm667
//Sprite: UNDP
//Title: "Undead Priest"
MONSTER
health 666
gibhealth 60
radius 20
height 56
mass 125
speed 13
painchance 45
DropItem "Demon Tech Shotgun" 55
DropItem "Demon Tech Shotgun" 30
DropItem "NemesisHealthBonusMax", 256, 32
DropItem "NemesisArmorBonus32", 256
DropItem "NemesisHealthBonusMax", 100, 32
DropItem "NemesisArmorBonus32", 80
DropItem "NemesisArmor", 5
DropItem "ShieldSphere", 40, 1
DropItem "SphereOfPower" 70
DropItem "ArmorPlate", 190
DropItem "BackPack", 56
DropItem "NewShell", 255, 4
DropItem "NewShellBox", 128
DropItem "HealthFlask", 55
DropItem "ArmorCharge", 55
DropItem "AmmoPack", 40
Species "ZombieDeud"
decal BulletChip
obituary "%o was bagged by an undead priest."
painsound "UndeadPriest/Pain"
deathsound "UndeadPriest/Die"
seesound "jitterskull/spawn"
DamageFactor 0.75
DamageFactor "UndeadPriest", 0
Tag "\c[black]Undead\c- \c[Red]Priest\c-"
+FLOORCLIP
+SEEINVISIBLE
+MISSILEMORE
var int user_attack;
states
{
  Spawn:
    UNDP A 10 A_Look
    loop
  See:
    UNDP A 0 A_Jump (32, "Run")
    UNDP AABBCCDD 3 A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    loop
  Run:
    UNDP A 0 A_Jump (24, "See")
    UNDP AABBCCDD 2 A_Chase
    loop
  Missile:
    TNT1 A 0
    TNT1 A 0 A_SetUserVar("user_attack",1)
    UNDP E 14 A_FaceTarget
	UNDP F 0 A_PlaySoundEx ("UndeadPriest/Shoot","SoundSlot6")
	TNT1 AAAA 0 A_CustomMissile("RedDemonTechTracer",Random(38,50),0,Random(6,-6),0)
    UNDP F 5 bright A_CustomBulletAttack(7, 7, 5, Random(6,12), "UndeadPriestDemonShotgunPuff")
    UNDP E 2 A_SentinelRefire
    UNDP E 10 A_FaceTarget
	UNDP F 0 A_PlaySoundEx ("UndeadPriest/Shoot2","SoundSlot7")
	TNT1 AAAA 0 A_CustomMissile("RedDemonTechTracer",Random(38,50),0,Random(6,-6),0)
    UNDP F 5 bright A_CustomBulletAttack(7, 7, 5, Random(6,12), "UndeadPriestDemonShotgunPuff")
    UNDP E 10
    goto See
 MissileEnd:
    TNT1 A 0
	TNT1 A 0 A_SetUserVar("user_attack",0)
	TNT1 A 0 A_PlaySound("HeavyChaingun/Down",CHAN_WEAPON,1.0,0)
	Goto See
  Pain:
	TNT1 A 0
	TNT1 A 0 A_JumpIfHealthLower((ACS_NamedExecuteWithResult("Hem_SpawnHealth")*0.80),"PainShield")
	TNT1 A 0 A_Jump(96,"NoPainShield")
  PainShield:
	TNT1 A 0 A_GiveInventory("ZombieShieldSphere",1)
  NoPainShield:
	TNT1 A 0 A_JumpIf(user_attack > 0,"WeapodDown")
	UNDP G 6 A_Pain
	Goto See
  WeapodDown:
	TNT1 A 0
	TNT1 A 0 A_SetUserVar("user_attack",0)
	TNT1 A 0 A_PlaySound("HeavyChaingun/Down",CHAN_WEAPON,1.0,0)
	UNDP G 6 A_Pain
	Goto See
  Death:
    UNDP H 6
    UNDP I 6 A_Scream
    UNDP JK 6
    UNDP L 6 A_NoBlocking
    UNDP M 6
    UNDP N -1
    Stop
  XDeath:
    UNDP O 5 A_XScream
    UNDP P 5 A_SpawnItemEx("GibbedGenerator",0,0,0,0,0,0,0,128,0)
    UNDP R 5 A_NoBlocking
    UNDP STUVW 5
    UNDP X -1
    Stop
  Raise:
    TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("VileHealEffect",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
    UNDP NMLKJIH 6
    goto See
  }
}

Actor UndeadPriestDemonShotgunPuff : DemonShotgunPuff
{
Species "ZombieDeud"
DamageType "UndeadPriest"
+ALLOWPARTICLES
-ExtremeDeath
States
{
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("RedParticleSpawner",0,0,0,0,0,0,0,128)
	TNT1 AAA 0 A_CustomMissile("RedDTKaboom2",0,0,random(0,360),2,random(0,360))
	TNT1 A 0 A_CustomMissile("SmokeFX4",0,0,random(0,360),2,random(0,360))
	BFOG A 3 Bright //A_Explode(25,8)
	BFOG BCDEF 3 Bright
	Stop
	}
}

Actor UndeadPriestShotgun : UndeadPriest
{
Health 50
DropItem "Shotgun"
}