Actor EnragedLegendaryQuadShotgunZombie : EnragedLegendaryLieutenant
{
//Creator: Eshkere_Jason
//Origin: Nexus Infinity
//Sprite: ELGQ
//Title: "Enraged Legendary Quad Shotgun Zombie"
  Health 1650 //2250
  Speed 12
  PainChance 20
  +BRIGHT
  BloodColor "Red"
  DropItem "LegendaryBossLifeEssence" 256
  DropItem "LegendaryBossArmorBonusMax" 256
  DropItem "EnragedLegendaryShell" 256 8
  DropItem "EnragedLegendaryShellBox" 160
  DropItem "EnragedLegendaryPowerShard" 30 1
  DropItem "EnragedLegendaryArmor" 92 1
  DropItem "LegAmmoSphere" 95 1
  DropItem "HandGrenadeAmmo" 237 2
  DropItem "MineAmmo" 242 2
  DropItem "Backpack" 202 1
  DropItem "Armorplate" 212 1
  DropItem "Portablemedkit" 217 1
  DropItem "StimKit" 222 3
  DropItem "HealthFlask" 227 5
  DropItem "LegendaryQuadShotgun" 224 1
  DropItem "LegendaryRune" 57 1
  DropItem "EnragedLegendaryAmmoSphere", 128
  DropItem "EnragedLegTimeFreezeSphere", 128 
  AttackSound ""
  SeeSound "Elegzom/sight"
  PainSound "Elegzom/pain"
  DeathSound "Elegzom/death"
  ActiveSound "Elegzom/active"
  Obituary "%o's body wasn't able to be identified after being shot by a Enraged Legendary Quad Shotgun Zombie."
  var int user_reload;
  Tag "\c[m6]Enraged\c- \c[z3]Legendary Quad-Shotgun Zombie\c-"
  States
  {
  Spawn:
	ELGQ A 10 A_Look
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	Loop
  Idle:
	TNT1 A 0 A_SetShootable
	TNT1 A 0 A_SetTranslucent(1)
	TNT1 A 0 A_ChangeFlag("NOPAIN",0)
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	ELGQ AA 3 A_Wander
	TNT1 A 0 A_Look
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	ELGQ BB 3 A_Wander
	TNT1 A 0 A_Look
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	ELGQ CC 3 A_Wander
	TNT1 A 0 A_Look
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	ELGQ DD 3 A_Wander
	TNT1 A 0 A_Look
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	Loop
  See:
	TNT1 A 0 A_SetShootable
	TNT1 A 0 A_SetTranslucent(1)
	TNT1 A 0 A_ChangeFlag("NOPAIN",0)
    TNT1 A 0 A_JumpIf(user_music == 1,3)
    TNT1 A 0 ACS_NamedExecuteAlways("InfinityMusic",0,6777,307)
	TNT1 A 0 A_SetUserVar("user_music",1)
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	ELGQ AA 3 A_Chase
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	ELGQ BB 3 A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	ELGQ CC 3 A_Chase
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	ELGQ DD 3 A_Chase
	TNT1 A 0 A_Jump(80,"Mine","Rush")
	TNT1 A 0 A_Jump(64,"Dodge")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	Loop
  Rush:
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("ELegQuadSGZombieGhostA",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	ELGQ A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("ELegQuadSGZombieGhostA",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	ELGQ A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("ELegQuadSGZombieGhostA",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	ELGQ B 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("ELegQuadSGZombieGhostA",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	ELGQ B 1 A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("ELegQuadSGZombieGhostC",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	ELGQ C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("ELegQuadSGZombieGhostC",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	ELGQ C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("ELegQuadSGZombieGhostD",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	ELGQ D 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("ELegQuadSGZombieGhostD",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	ELGQ D 1 A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Jump(84,"See")
	TNT1 A 0 A_Jump(64,"Dodge")
	Loop
  Strafing:
	TNT1 A 0
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	ELGQ AA 3 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	ELGQ BB 3 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	ELGQ CC 3 A_GiveInventory("LegZombieStrafingg",1)	
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	ELGQ DD 3 A_GiveInventory("LegZombieStrafingg",1)
	Goto See
  Dodge:
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	ELGQ A 1 A_FaceTarget
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	ELGQ E 0 ThrustThingZ(0,20,0,0)
	ELGQ A 0 A_Jump(256,"DodgeRight","DodgeLeft")
  DodgeLeft:
	ELGQ E 0 ThrustThing(angle*256/360+192, 15, 0, 0)
	Goto See
  DodgeRight:
	ELGQ E 0 ThrustThing(angle*256/360+64, 15, 0, 0)
	Goto See
  Mine:
	ELGQ C 1 Bright
    ELGQ C 12 Bright A_CustomMissile("ELACThrownMine",32,0,0,2,15)
	ELGQ E 12 Bright
    ELGQ C 3 Bright
	Goto See
  Missile:
	TNT1 A 0 A_SetShootable
	TNT1 A 0 A_SetTranslucent(1)
	TNT1 A 0 A_ChangeFlag("NOPAIN",0)
	TNT1 A 0 A_JumpIf(user_reload == 2,"Reload")
	TNT1 A 0 A_Jump(40,"Grenade")
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_JumpIfCloser(400,"Quad")
  Normal:
	ELGQ EE 5 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_PlaySound("LegendaryQuadShotgun/DualFire",CHAN_WEAPON)
	TNT1 AAAAAAAA 0 A_CustomMissile("LegendaryRedTracer",Random(28,34),0,Random(6,-6),0)
	TNT1 A 0 A_SetUserVar(user_reload,1)
	ELGQ F 5 A_CustomBulletAttack(30,20,24,Random(20,28),"EnragedBulletPuff")
	ELGQ EE 4 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_JumpIf(user_reload == 2,"Reload")
	TNT1 A 0 A_PlaySound("LegendaryQuadShotgun/DualFire",CHAN_WEAPON)
	TNT1 AAAAAAAA 0 A_CustomMissile("LegendaryRedTracer",Random(28,34),0,Random(6,-6),0)
	TNT1 A 0 A_SetUserVar(user_reload,2)
	ELGQ F 5 A_CustomBulletAttack(30,20,24,Random(20,28),"EnragedBulletPuff")
	ELGQ EE 5 A_GiveInventory("LegZombieStrafingg",1)
	Goto Reload
  Quad:
	TNT1 A 0 A_JumpIf(user_reload == 1,"Normal")
	TNT1 A 0 A_FaceTarget(45)
	ELGQ E 5 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_FaceTarget(45)
	ELGQ E 5 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_FaceTarget(45)
	ELGQ E 5 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_PlaySound("Coachgun/Fire1",CHAN_WEAPON)
	TNT1 AAAAAAAA 0 A_CustomMissile("PlayerDragonTracerBad",Random(28,34),0,Random(6,-6),0)
	TNT1 AAAAAAAAAAAAAAAA 0 A_CustomMissile("LegendaryRedTracer",Random(28,34),0,Random(6,-6),0)
	TNT1 A 0 A_SetUserVar(user_reload,4)
	ELGQ F 5 A_CustomBulletAttack(30,20,48,Random(20,28),"EnragedBulletPuff") //oh...
	ELGQ EEE 5 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_Jump(64,"Grenade")
	Goto Reload
  Grenade:
	TNT1 A 0 A_PlaySound("weapons/hgrenadepin",0,1.0,0)
	ELGQ CE 4 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("weapons/hgrenadethrow",0,1.0,0)
	ELGQ E 1 Bright A_CustomMissile("ELACGrenade",32,0,0,2,4)
	TNT1 A 0 A_JumpIf(user_reload == 2,"Reload")
	Goto Dodge
  Reload:
	ELGQ E 3 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafingg",1)
	ELGQ A 6 A_PlaySound("LegendaryQuadShotgun/Open")
	TNT1 A 0 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_SpawnItemEx("RedShellCasing",-8,6,36,Random(2,6),0,random(1,3),random(-80,-90),128)
	ELGQ B 1 A_SpawnItemEx("RedShellCasing",-10,6,36,Random(2,6),0,random(1,3),random(-80,-90),128)
	ELGQ B 6 A_PlaySound("LegendaryQuadShotgun/Load")
	TNT1 A 0 A_SpawnItemEx("RedShellCasing",-8,6,36,Random(2,6),0,random(1,3),random(-80,-90),128)
	ELGQ B 1 A_SpawnItemEx("RedShellCasing",-10,6,36,Random(2,6),0,random(1,3),random(-80,-90),128)
	ELGQ B 6 A_PlaySound("LegendaryQuadShotgun/Load")
	TNT1 A 0 A_SetUserVar(user_reload,0)
	TNT1 A 0 A_GiveInventory("LegZombieStrafingg",1)
	ELGQ C 6 A_PlaySound("LegendaryQuadShotgun/Close")
	TNT1 A 0 A_GiveInventory("LegZombieStrafingg",1)
	ELGQ D 6
	Goto See
  Pain:
	TNT1 A 0 A_ChangeFlag("NOPAIN",1)
	TNT1 A 0 A_Jump(10,"Protection")
	TNT1 A 0 A_Jump(20,"Dodge")
	ELGQ G 3
	ELGQ G 3 A_Pain
	TNT1 A 0 A_Jump(192,"Missile")
	Goto See
  Protection:
	TNT1 A 0 A_JumpIf(user_protection >= 4,"Pain")
	TNT1 A 0 A_JumpIf(user_protected == 1,"Pain")
	TNT1 A 0 A_PlaySound("legendary/defense")
	TNT1 A 0 A_FaceTarget
	ELGQ E 2 ACS_NamedExecuteAlways("LegendaryProtection",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	Goto See	
  Death:
//	TNT1 A 0 A_Jump(36,"LegendarySoul")
	ELGQ H 6 A_Scream
	ELGQ I 6 A_ChangeFlag("BRIGHT",0)
	ELGQ J 6 A_Fall
	ELGQ K 6 A_SpawnItem("BodyCrash",0,0,0,0)
	ELGQ L 5
	ELGQ M 5
	ELGQ N -1
	Stop
  LegendarySoul:
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	ELGQ H 6
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	ELGQ I 6 A_Scream
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegSSGGuyGib",0,0,12,frandom(0.1,1.0),frandom(0.1,1.0),frandom(0.1,1.0),random(0,360),SXF_CLIENTSIDE)
	ELGQ J 6 A_Fall
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	ELGQ K 6 A_SpawnItem("BodyCrash",0,0,0,0)			
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	ELGQ L 6
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	ELGQ L 5
	ELGQ M 5
    ELGQ N 140
	TNT1 A 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	ELGQ NNNNNNNNNNNNNNNNN 2 A_GiveInventory("ELegSoulEventSmokeSpawner",1)
	ELGQ NNNNNNNNNNNNNNNNN 2 A_GiveInventory("ELegSoulEventSmokeSpawner",1)
	ELGQ NNNNNNNNNNNNNNNNN 2 A_GiveInventory("ELegSoulEventSmokeSpawner",1)
	TNT1 A 0 A_ChangeFlag("BRIGHT",0)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION,0)
	TNT1 A 0 A_SpawnItemEx("EnragedLegendarySoul",0,0,16,0,0,0,0,SXF_NOCHECKPOSITION,0)
	ELGQ N 525
	ELGQ N 5 A_FadeOut(0.1,1)
	Wait
  XDeath:
	TNT1 A 0 A_ChangeFlag("BRIGHT",0)
	TNT1 A 0 A_Jump(36,"LegendarySoul")
	ELGQ H 6 A_Scream
	ELGQ I 6 A_ChangeFlag("BRIGHT",0)
	ELGQ J 6 A_Fall
	ELGQ K 6 A_SpawnItem("BodyCrash",0,0,0,0)
	ELGQ L 5
	ELGQ M 5
	ELGQ N -1
	Stop
	}
}

ACTOR ELegQuadSGZombieGhostA
{
  Alpha 0.7
  Renderstyle Translucent
  +NOTIMEFREEZE
  +NOINTERACTION
  +CLIENTSIDEONLY
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "Toaster")
	TNT1 A 1 Bright
	Goto Fade
  Fade:
	ELGQ A 2 A_FadeOut(0.1,1)
	Goto Spawn+3
  Toaster:
	TNT1 A 1 Bright
	Stop
	}
}

ACTOR ELegQuadSGZombieGhostB : ELegQuadSGZombieGhostA
{   
States
	{
	Fade:
	ELGQ B 2 A_FadeOut(0.1,1)
	Loop
    }
}

ACTOR EELegQuadSGZombieGhostC : ELegQuadSGZombieGhostA
{   
States
	{
	Fade:
	ELGQ C 2 A_FadeOut(0.1,1)
	Loop
    }
}

ACTOR ELegQuadSGZombieGhostD : ELegQuadSGZombieGhostA
{   
States
	{
	Fade:
	ELGQ D 2 A_FadeOut(0.1,1)
	Loop
    }
}

ACTOR ELegQuadSGZombieGhostE : ELegQuadSGZombieGhostA
{   
States
	{
	Fade:
	ELGQ E 2 A_FadeOut(0.1,1)
	Loop
	}
}