ACTOR NoMusicEnragedLegendaryZombie
{
Health 850 //Nerf Health for balance
Radius 20
Height 56
Speed 35
Mass 100
PainChance 25
PainChance "ZombieDemonTech", 0
BloodColor "Red"
DropItem "LegendaryBossLifeEssence" 256
DropItem "LegendaryBossArmorBonusMax" 256
DropItem "LegendaryBossLifeEssence" 128
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.65
DamageFactor "PlayerDBFG10K2", 0.65
DamageFactor "DBFG2", 0.65
DamageFactor "PlayerDBFG2", 0.65
DamageFactor "PlayerDTRG", 0.5
DamageFactor "CerChainguns", 0.0
DamageFactor 0.65
DamageFactor "Legendary", 0.0
DamageFactor "LegendaryPlayer", 0.0
DamageFactor "LACGrenade", 0.0
MONSTER
SeeSound "Elegzom/sight"
PainSound "Elegzom/pain"
DeathSound "Elegzom/death"
ActiveSound "Elegzom/active"
Obituary "%o was vaporized by an Enraged Legendary Zombie's overheated plasma."
Tag "\c[m6]Enraged\c- \c[z3]Legendary Zombie Summoning\c-"
+NOTIMEFREEZE
+NOFEAR
+BOSS
+BOSSDEATH
+FLOORCLIP
+MISSILEMORE
+MISSILEEVENMORE
+QUICKTORETALIATE
+NOICEDEATH
+NODROPOFF
+DONTGIB
+NOTARGET
+NOKILLSCRIPTS
+BRIGHT
var int user_protection;
var int user_protected;
var int user_missile;
States
{
  Spawn:
    TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
    IPOS A 10 A_Look
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	IPO2 A 10 A_Look
    Loop
  See:
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
    IPOS A 0 A_JumpIfTargetInLOS("Strafing")
    IPOS AA 3 A_Chase
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	IPOS BB 3 A_Chase
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItem("FootStep")
	IPOS A 0 A_JumpIfTargetInLOS("Strafing")
	IPOS CC 3 A_Chase
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	IPOS DD 3 A_Chase
	IPOS A 0 A_Jump(80,"Rush")
    TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItem("FootStep")
    Loop
  Rush:
    IPOS A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItem("FootStep")
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("FLegZombieGhostAA")
	IPOS A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("FLegZombieGhostAA")
	IPOS A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("FLegendaryZombieGhostBB")
	IPOS B 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("FLegendaryZombieGhostBB")
	IPOS B 1 A_Chase
	TNT1 A 0 A_SpawnItem("FootStep")
    TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("FLegZombieGhostCC")
	IPOS C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("FLegZombieGhostCC")
	IPOS C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("FLegendaryZombieGhostDD")
	IPOS D 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("FLegendaryZombieGhostDD")
	IPOS D 1 A_Chase
	TNT1 A 0 A_SpawnItem("FootStep")
	TNT1 A 0 A_Jump(84,"See")
	Loop
  Strafing:
	TNT1 A 0 A_SpawnItem("FootStep")
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	IPOS AA 3 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	IPOS BB 3 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_SpawnItem("FootStep")
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    IPOS CC 3 A_GiveInventory("LegZombieStrafingg",1)	
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	IPOS DD 3 A_GiveInventory("LegZombieStrafingg",1)
	Goto See
  Pause:
	TNT1 A 0 A_SetUserVar(user_missile,0)
	IPOS E 0 A_PlaySound("weapons/demontechsteam")
	IPOS EEEEE 3 A_GiveInventory("LegZombieStrafingg",1)
	Goto See	
  Missile:
	IPOS EEEE 3 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_Jump(20,"FRapid")
	IPOS E 3 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 AA 0 A_CustomMissile("RLegendaryProjectile",32,0,Frandom(-1,1),0)
	IPOS F 3 A_PlaySoundEx("weapons/DemonTechRifle","Weapon")
	TNT1 A 0 A_Jump(24,"Pause")
	TNT1 A 0 A_SpidRefire
    TNT1 A 0 A_PlayWeaponSound("BlueDTRFire")
	Goto Missile+4	
  FRapid:
	TNT1 A 0 A_PlaySound("ELegCommando/Star",0,1,0,ATTN_NONE)
    IPOS EEEEEEEE 3 A_GiveInventory("LegZombieStrafingg",1)
  FRapidLoop:
    TNT1 A 0 A_JumpIf(user_missile == 20,"Pause")
    IPOS E 1 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 AA 0 A_CustomMissile("RLegendaryProjectile",32,0,Frandom(-1,1),0)
	IPOS F 3 A_PlaySoundEx("weapons/DemonTechRifle","Weapon")
	TNT1 A 0 A_PlayWeaponSound("BlueDTRFire")
	TNT1 A 0 A_SetUserVar("user_missile",user_missile+1)
	Loop
  Pain:
	TNT1 A 0 A_Jump(10,"FProtection")
  Pain2:
	TNT1 A 0 A_Jump(192,"FPainMissile")
    IPOS G 3 A_GiveInventory("LegZombieStrafingg",1)
    TNT1 A 0 A_Pain
	IPOS G 3 A_GiveInventory("LegZombieStrafingg",1)
    Goto See
  FPainMissile: 
	IPOS G 3 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_Pain
	IPOS G 3 A_GiveInventory("LegZombieStrafingg",1)
	Goto Missile	
  FProtection:
	TNT1 A 0 A_JumpIf(user_protection >= 3,"Pain2")
	TNT1 A 0 A_JumpIf(user_protected == 1,"Pain2")
	TNT1 A 0 A_PlaySound("legendary/defense")
	TNT1 A 0 A_FaceTarget
	IPOS E 2 ACS_NamedExecuteAlways("EnragedLegendaryProtection")
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	Goto See	
  Death:
    TNT1 A 0 A_ChangeFlag("BRIGHT",0)
    TNT1 A 0 A_StopSound(6)
    TNT1 A 0 A_Jump(36,"LegendarySoul")
	IPOS H 5 A_Scream
    IPOS I 5 A_NoBlocking
    IPOS J 5 A_SpawnItem("BodyCrash")
    IPOS K 5 
    IPOS L -1 
	Stop
  LegendarySoul:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	IPOS H 5 A_Scream
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
    IPOS I 5 A_Fall
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
    IPOS J 5 A_SpawnItem("BodyCrash")
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
    IPOS KLL 5 A_SpawnItem("EnragedHellionSmokeSpawner")
	IPOS L 140
	IPOS N 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	IPOS LLLLLLLLLLLLLLLLL 2 Bright A_SpawnItem("ELegSoulEventSmokeSpawner",1)
	IPOS LLLLLLLLLLLLLLLLL 2 Bright A_SpawnItem("ELegSoulEventSmokeSpawner",1)
	IPOS LLLLLLLLLLLLLLLLL 2 Bright A_SpawnItem("ELegSoulEventSmokeSpawner",1)
	TNT1 A 0 A_SpawnItemEx("EnragedLegendarySoul",0,0,16,0,0,0,0,32)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	IPOS L -1
	Stop	
  XDeath:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_SpawnItemEx("EnragedGibbedGenerator")
    IPOS P 3 A_XScream
    IPOS Q 3 A_NoBlocking
    IPOS RSTUV 3 
    IPOS W -1 
    Stop
    }
}

ACTOR FLegZombieGhostAA : LegZombieGhostA
{
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "NULL")
  Fade:
    TNT1 A 1
    IPOS A 2 A_FadeOut(0.10)
    Goto Fade+1
  Toaster:
    TNT1 A 0
    Stop
    }
}

ACTOR FLegendaryZombieGhostBB : LegZombieGhostAA
{   
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "NULL")
  Fade:
    TNT1 A 1
    IPOS B 2 A_FadeOut(0.10)
    Goto Fade+1
    }
}

ACTOR FLegZombieGhostCC : LegZombieGhostAA
{   
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "NULL")
  Fade:
    TNT1 A 1
    IPOS C 2 A_FadeOut(0.10)
    Goto Fade+1
    }
}

ACTOR FLegendaryZombieGhostDD : LegZombieGhostAA
{   
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "NULL")
  Fade:
    TNT1 A 1
    IPOS D 2 A_FadeOut(0.10)
    Goto Fade+1
    }
}

ACTOR FLegendaryZombieGhostEE : LegZombieGhostAA
{   
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "NULL")
  Fade:
    TNT1 A 1
    IPOS E 2 A_FadeOut(0.10)
    Goto Fade+1
    }
}

ACTOR FLegendaryZombieGhostFF : LegZombieGhostAA
{   
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "NULL")
  Fade:
    TNT1 A 1
    IPOS F 2 A_FadeOut(0.10)
    Goto Fade+1
    }
}

Actor FLegZombieStrafingg : LegZombieStrafing
{
  States
  {
  Pickup:
    NULL A 1 
	NULL A 1 A_SpawnItem("EnragedHellionSmokeSpawner")
	NULL A 1 A_Jump(188,2)
	NULL A 1 A_GiveInventory("LegZombieJumping",1)
	NULL A 1 A_JumpIf(velx != 0 || vely != 0,2)
	NULL A 1 A_Jump(256,2)
	NULL A 1 A_Jump(235,5)
	NULL A 1 A_JumpIfInventory("LegZombieStrafeSens",1,3)
	NULL A 1 A_GiveInventory("LegZombieStrafeSens",1)
	NULL A 1 A_Jump(256,2)	
	NULL A 1 A_TakeInventory("LegZombieStrafeSens",1)
	NULL A 1 A_JumpIfInventory("LegZombieStrafeSens",1,3)
	NULL A 1 ThrustThing(angle*256/360+38.7,3,0,0)
	NULL A 1 A_Jump(256,2)	
	NULL A 1 ThrustThing(angle*256/360+38.7,-3,0,0)
    NULL A 1 A_FaceTarget
	NULL A 1 A_Jump(24,2)
	NULL A 1 A_JumpIfCloser(300,2)
	NULL A 1 A_Recoil(-1)
    Stop
	NULL A 1 A_Recoil(1)
    Stop	
  }
}

Actor FLegZombieJumpingg : LegZombieStrafingg
{
  +NOTIMEFREEZE
  States
  {
  Pickup:
    NULL A 1 
    NULL A 1 A_CheckFloor(1)
    Stop
	NULL A 1 A_Jump(242,2)
	NULL A 1 ThrustThingZ(0,25,0,1)
    Stop
	NULL A 1
    Stop
  }
}