ACTOR EnragedLegendaryPyroZombie
{
//Creator: Eshkere_Jason
//Origin: Divine Infinity
//Sprite: ELGP
//Title: "Enraged Legendary Pyro Zombie"
Obituary "%o went brunt into a bluish crisp by a \c[m6]Enraged\c- \c[z3]Legendary Pyro\c-."
Health 1500
Radius 20
Height 56
Mass 100
Speed 12
FastSpeed 14
PainChance 20
BloodColor "Red"
MONSTER
DropItem "LegendaryBossLifeEssence" 256
DropItem "LegendaryBossArmorBonusMax" 256
DropItem "Enraged Legendary Assault Shotgun" 65
DropItem "LegendaryShell" 128 4
DropItem "LegendaryShellBox" 80
DropItem "HandGrenadeAmmo" 235 2
DropItem "MineAmmo" 235 2
DropItem "Armorplate" 205 1
DropItem "Portablemedkit" 210 1
DropItem "Backpack" 198 1
DropItem "Gas" 250
DropItem "BigGas" 200
DropItem "LegAmmoSphere" 102 1
DropItem "EnragedLegendaryArmor" 105 1
DropItem "Welder" 150 1
DropItem "LegendaryRune" 29 1
DropItem "LegendaryPowerShard" 42 1
DropItem "EnragedLegendaryPowerShard" 15 1
DropItem "Enraged Legendary Plasmatic Rifle" 256
DamageFactor 0.5
DamageFactor "PDTBFG", 0.20
DamageFactor "PDTBFGTracer", 0.20
DamageFactor "PlayerDevBall", 0.120
DamageFactor "PlayerDevBall2", 0.120
DamageFactor "PlayerDTBFGRailgunSlug", 0.120
DamageFactor "PlayerDevTracer", 0.120
DamageFactor "Legendary", 0.0
DamageFactor "LegendaryPlayer", 0.3
DamageFactor "LegendaryGuru", 0.0
DamageFactor "LegendaryGuruPlayer", 0.3
DamageFactor "LACGrenade", 0.0
DamageFactor "LegendaryZombie", 0.0
DamageFactor "GeneralTracer", 0.0
DamageFactor "DBFG10K2", 0.35
DamageFactor "PlayerDBFG10K2", 0.35
DamageFactor "DBFG2", 0.35
DamageFactor "PlayerDBFG2", 0.35
DamageFactor "PlayerDTRG", 0.5
DamageFactor "Cyber10K", 0.0
DamageFactor "SoapOpera", 0.0 
DamageFactor "Fire", 0.0
DamageFactor "Ice", 0.25
SeeSound "lgeneral/sight"
PainSound "lgeneral/pain"
DeathSound "lgeneral/death"
ActiveSound "lgeneral/active"
Tag "\c[m6]Enraged\c- \c[z3]Legendary Pyro Zombie\c-"
+NOTIMEFREEZE
+BOSS
+BOSSDEATH
+FLOORCLIP
+MISSILEMORE
+MISSILEEVENMORE
+QUICKTORETALIATE
+NOICEDEATH
+NODROPOFF
+DONTGIB
+NOTARGET
+NORADIUSDMG
+FORCERADIUSDMG
+NOFEAR
+BRIGHT
var int user_music;
var int user_arson;
var int user_protection;
var int user_protected;
states
{
  Spawn:
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
    ELGP A 10 A_Look
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	ELGP X 10 A_Look
    Loop
  See:
	TNT1 A 0 A_JumpIf(user_music == 1,3)
	TNT1 A 0 ACS_NamedExecuteAlways("InfinityMusic",0,6816,313)
	TNT1 A 0 A_SetUserVar("user_music",1)
    ELGP A 0 A_JumpIfTargetInLOS("Strafing")
    ELGP AABB 3 A_Chase
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	ELGP A 0 A_Jump(30,"Rush","Arson")
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
    TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	ELGP A 0 A_JumpIfTargetInLOS("Strafing")
	ELGP CCDD 3 A_Chase
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	ELGP A 0 A_Jump(80,"Rush","Arson")
    TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
    Loop
  Rush:
    ELGP A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("EnragedLegPyroGhost",0,0,0,0,0,0,0,128)
	ELGP A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("EnragedLegPyroGhost",0,0,0,0,0,0,0,128)
	ELGP A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("EnragedLegPyroGhostB",0,0,0,0,0,0,0,128)
	ELGP B 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("EnragedLegPyroGhostB",0,0,0,0,0,0,0,128)
	ELGP B 1 A_Chase
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
    TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("EnragedLegPyroGhostC",0,0,0,0,0,0,0,128)
	ELGP C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("EnragedLegPyroGhostC",0,0,0,0,0,0,0,128)
	ELGP C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("EnragedLegPyroGhostD",0,0,0,0,0,0,0,128)
	ELGP D 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("EnragedLegPyroGhostD",0,0,0,0,0,0,0,128)
	ELGP D 1 A_Chase
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
	TNT1 A 0 A_Jump(84,"See")
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	Loop
  Strafing:
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	ELGP AA 3 A_GiveInventory("LegZombieStrafing2",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	ELGP BB 3 A_GiveInventory("LegZombieStrafing2",1)
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    ELGP CC 3 A_GiveInventory("LegZombieStrafing2",1)	
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	ELGP DD 3 A_GiveInventory("LegZombieStrafing2",1)
	Goto See
  Pause:
	ELGP EEEEE 3 A_GiveInventory("LegZombieStrafing2",1)
	Goto See	
  Arson:
    TNT1 A 0 A_JumpIf(user_arson == 0,"Rush")
    ELGP EEE 3
    ELGP C 0 A_JumpIfTargetInLos("Missile")
    LASG C 0 A_JumpIfCloser(300,"Missile")
	TNT1 AAAA 0 A_CustomMissile("LegendaryFlamethrowerShot",36,0,random(-6,6),CMF_TRACKOWNER)
    ELGP F 15
	Goto See
  Missile:
    TNT1 A 0 A_SetShootable
    TNT1 A 0 A_UnsetInvulnerable
    TNT1 A 0 A_SetTranslucent(1)
	TNT1 A 0 A_SetUserVar("user_arson",1)
	TNT1 A 0 A_JumpIfCloser(500,"MissileClose")
	TNT1 A 0 A_Jump(72,"Napalm")
	Goto Normal
  MissileClose:
    TNT1 A 0 A_Jump(88,"Normal","Normal","Napalm","Flamethrower")
  Flamethrower:
	ELGP EF 5 A_FaceTarget
	TNT1 A 0 A_PlaySound("magma/firebreath")
	TNT1 A 0 A_FaceTarget
	ELGP FFF 2 A_CustomMissile("ELegFiendFlameBreath",32,0,Random(6,-6))
	TNT1 A 0 A_FaceTarget
    ELGP FFF 2 A_CustomMissile("ELegFiendFlameBreath",32,0,Random(6,-6))
	TNT1 A 0 A_FaceTarget
    ELGP FFF 2 A_CustomMissile("ELegFiendFlameBreath",32,0,Random(6,-6))
	TNT1 A 0 A_FaceTarget		
	ELGP FFF 2 A_CustomMissile("ELegFiendFlameBreath",32,0,Random(6,-6))
    ELGP E 5
	Goto See
  Close:
	TNT1 A 0 A_CheckRange(500,"Normal")
	ELGP EEEE 3 A_GiveInventory("LegZombieStrafing2",1)
	ELGP FF 1 A_GiveInventory("LegZombieStrafing2",1)
	TNT1 A 0 A_PlaySound("Weapons/PyroSGShot")
	TNT1 AAAA 0 A_CustomMissile("LegendaryFlamethrowerShot",36,0,random(-6,6),CMF_TRACKOWNER)
	ELGP EEEE 3 A_GiveInventory("LegZombieStrafing2",1)
	ELGP FF 1 A_GiveInventory("LegZombieStrafing2",1)
	TNT1 A 0 A_PlaySound("Weapons/PyroSGShot")
	TNT1 AAAA 0 A_CustomMissile("LegendaryFlamethrowerShot",36,0,random(-6,6),CMF_TRACKOWNER)
	TNT1 A 0 A_Jump(24,"Pause")
	TNT1 A 0 A_SpidRefire
	Loop
  Normal:
    TNT1 A 0 A_SetShootable
    TNT1 A 0 A_UnsetInvulnerable
    TNT1 A 0 A_SetTranslucent(1)
	ELGP EEE 3 A_GiveInventory("LegZombieStrafing2",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing2",1)
	TNT1 AAAAA 0 A_CustomMissile("ILegendaryBall",32,0,random(-6,6),0)
	ELGP F 5 A_PlaySoundEx("Weapons/PyroSGShot","Weapon")
	TNT1 A 0 A_Jump(24,"Pause")
	TNT1 A 0 A_JumpIfCloser(500,"Close")
	TNT1 A 0 A_SpidRefire
	Goto Normal+5
  Napalm:
	ELGP EEEE 3 A_GiveInventory("LegZombieStrafing2",1)
	ELGP FF 1 A_GiveInventory("LegZombieStrafing2",1)
	TNT1 A 0 A_CustomMissile("ELegBehComet",32,0,0)
	ELGP EEEE 3 A_GiveInventory("LegZombieStrafing2",1)
	ELGP FF 1 A_GiveInventory("LegZombieStrafing2",1)
	TNT1 A 0 A_CustomMissile("ELegBehComet",32,0,0)
	ELGP EEEE 3 A_GiveInventory("LegZombieStrafing2",1)
	ELGP FF 1 A_GiveInventory("LegZombieStrafing2",1)
	TNT1 A 0 A_CustomMissile("ELegBehComet",32,0,0)
	ELGP EEEE 3 A_GiveInventory("LegZombieStrafing2",1)
	ELGP FF 1 A_GiveInventory("LegZombieStrafing2",1)
	TNT1 A 0 A_CustomMissile("ELegBehComet",32,0,0)
	//TNT1 A 0 A_Jump(24,"Pause")
	//TNT1 A 0 A_SpidRefire
	Goto See
  Pain:
	TNT1 A 0 A_Jump(30,"Protection")
	TNT1 A 0 A_Jump(192,"PainMissile")
	ELGP G 3
	ELGP G 3 A_Pain
	Goto See
  PainMissile:
	ELGP G 3
	ELGP G 3 A_Pain
	TNT1 A 0 A_Jump(64,"Arson")
	Goto Missile	
  Protection:
	TNT1 A 0 A_JumpIf(user_protection >= 3,"Pain")
	TNT1 A 0 A_JumpIf(user_protected == 1,"Pain")
	TNT1 A 0 A_PlaySound("legendary/defense")
	TNT1 A 0 A_FaceTarget
	ELGP E 2 ACS_NamedExecuteAlways("LegendaryProtection",0,0,0,0)
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	Goto See
  XDeath:
  Death:
    ELGP G 0 A_Scream
	ELGP HHHIHIHIHIHHIHIHIHIHIHIIHIHIHIIHIHI 2 A_SpawnItemEx("EKaboomLN",random(-32,32),random(-40,40),random(16,48),random(-4,4),random(-4,4),random(0,4),0,SXF_TRANSFERPOINTERS)
	TNT1 AA 0 A_SpawnItemEx("EnragedGibbedGenerator",0,0,0,0,0,0,0,128)	
	TNT1 A 0 A_SpawnItem("EnragedDeathBallMedium")
	ELGP JJJKKK 2 A_CustomMissile ("EKaboomLN", Random(10,50), 0, random(0,360), 2, random(0,360))
	TNT1 AA 0 A_SpawnItemEx("EnragedGibbedGenerator",0,0,0,0,0,0,0,128)
    TNT1 AAAA 0 A_CustomMissile("LegendarySmokeFX", Random(30,60), 0, random(0,360), 2, random(0,360))	
    ELGP L 4 A_NoBlocking
    ELGP MNO 3
	TNT1 A 0 A_BossDeath
	ELGP P 2 A_ChangeFlag("BRIGHT",0)
    ELGP P -1 A_KillMaster
    Stop
  }
}

Actor INFEnragedLegendaryPyroZombie : EnragedLegendaryPyroZombie
{
Tag "\c[m6]Enraged\c- \c[z3]Legendary Pyro Zombie\c-"
States
{
  Spawn:
    TNT1 A 0 A_Jump(110,"Remove")
    TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("RuneTier1SpawnCheck") == 2,1)
	Goto Remove
  Idle:
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
    ELGP A 10 A_Look
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	ELGP X 10 A_Look
	Loop
  Remove:
	TNT1 A 1
	TNT1 A 0 A_SpawnItemEx("Chaingunner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
	TNT1 A 0 A_ChangeFlag("COUNTKILL", FALSE)
	TNT1 A 0
	Stop
	}
}

ACTOR EnragedLegPyroGhost
{
Scale 1.1
Radius 20
Height 56
Speed 0
Alpha 0.7
PROJECTILE
RENDERSTYLE Translucent
+CLIENTSIDEONLY
+NOINTERACTION
+NOTIMEFREEZE
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 1 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
    ELGP A 2 A_FadeOut(0.10)
    Wait
	}
}

ACTOR EnragedLegPyroGhostB : EnragedLegPyroGhost
{   
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 1 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
    ELGP B 2 A_FadeOut(0.10)
    Wait
    }
}

ACTOR EnragedLegPyroGhostC : EnragedLegPyroGhost
{   
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 1 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
    ELGP C 2 A_FadeOut(0.10)
    Wait
    }
}

ACTOR EnragedLegPyroGhostD : EnragedLegPyroGhost
{   
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 1 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
    ELGP D 2 A_FadeOut(0.10)
    Wait
    }
}