ACTOR EnragedLegendaryAdmiral : LegendaryZombie
{ //unused for now
//Creator: Eshkere_Jason
//Origin: Nexus Infinity
//Sprite: ELAD
//Title: "Legendary Admiral"
Obituary "%o was sentenced to death by a Enraged Legendary Former Admiral."
Health 3000
Mass 600
Speed 21
Painchance 20
BloodColor "Red"
Seesound "FormerAdmiral/Sight"
Painsound "FormerAdmiral/Pain"
Deathsound "FormerAdmiral/Death"
Activesound "FormerAdmiral/Active"
DropItem "PortableMedkit" 200
DropItem "EnragedLegendaryArmor" 87 1
DropItem "LegendaryRune" 70 1
DropItem "LegAmmoSphere" 90 1
DropItem "ArmorPlate" 200
DropItem "HandGrenadeAmmo" 225 1
DropItem "MineAmmo" 125 1
DropItem "AmmoPack" 125
DropItem "BulletMag" 256 10
DropItem "BulletBox" 128
//DropItem "Explosive Minigun" 200 1
DropItem "EnragedLegendaryMinigun" 200 1
DropItem "Enraged Legendary Plasmatic Cannon" 156 1
DropItem "Beacon" 128 1
//DropItem "FriendlyLegendaryBeaconSpecOps" 256 1
DropItem "LegendaryBeaconLow" 128 1
DropItem "LegendaryBeaconMid" 64 1
DamageFactor 0.50
DamageFactor "PDTBFG", 0.15
DamageFactor "PDTBFGTracer", 0.15
DamageFactor "PlayerDevBall", 0.100
DamageFactor "PlayerDevBall2", 0.100
DamageFactor "PlayerDTBFGRailgunSlug", 0.100
DamageFactor "PlayerDevTracer", 0.100
DamageFactor "Legendary", 0.0
DamageFactor "LegendaryPlayer", 0.2
DamageFactor "LegendaryGuru", 0.0
DamageFactor "LegendaryGuruPlayer", 0.2
DamageFactor "LACGrenade", 0.0
DamageFactor "LegendaryZombie", 0.0
DamageFactor "GeneralTracer", 0.0
DamageFactor "DBFG10K2", 0.50
DamageFactor "PlayerDBFG10K2", 0.50
DamageFactor "DBFG2", 0.50
DamageFactor "PlayerDBFG2", 0.50
DamageFactor "PlayerDTRG", 0.5
Scale 1.25
Species "SpecOps"
Tag "\c[m6]Enraged\c- \c[z3]Legendary Admiral\c-"
States
{
  Spawn:
    TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	ELAD A 10 Bright A_Look
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	Loop
  See:
	TNT1 A 0 A_JumpIf(user_music == 1,3)
	TNT1 A 0 ACS_NamedExecuteAlways("StartMonsterMusic",0,6771)
	TNT1 A 0 A_SetUserVar("user_music",1)
	TNT1 A 0 A_StopSound(7)
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	ELAD AABB 3 Bright A_Chase
	TNT1 A 0 A_SpawnItem("LegendaryFootStep")
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	ELAD CCDD 3 Bright A_Chase
	TNT1 A 0 A_Jump(80,"Rush")
	TNT1 A 0 A_SpawnItem("LegendaryFootStep")
	Loop
  Rush:
	ELAD 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("LegAdmiralGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	ELAD A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegAdmiralGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	ELAD A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegAdmiralGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	ELAD B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegAdmiralGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	ELAD B 1 Bright 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("LegAdmiralGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	ELAD C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegAdmiralGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	ELAD C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegAdmiralGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	ELAD D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegAdmiralGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	ELAD D 1 Bright 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_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)
	ELAD AA 3 Bright A_GiveInventory("LegZombieStrafing2",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	ELAD BB 3 Bright A_GiveInventory("LegZombieStrafing2",1)
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	ELAD CC 3 Bright A_GiveInventory("LegZombieStrafing2",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	ELAD DD 3 Bright A_GiveInventory("LegZombieStrafing2",1)
	Goto See
  Missile:
	TNT1 A 0 A_Jump(150,"Rockets","HomingRockets","Cannon","CannonBall")
	TNT1 A 0 A_Jump(70,"Beacon")
	TNT1 A 0 A_Jump(200,"Chaingun")
    TNT1 A 0 A_Playsound("FormerAdmiral/Attack")
  Chaingun:
	ELAD HKHKH 2 A_GiveInventory("LegendaryAdmiralStrafing",1)
	TNT1 A 0 A_JumpIfTargetinLOS("ContinueShooting")
	ELAD H 2 A_GiveInventory("LegendaryAdmiralStrafing",1)
	TNT1 A 0 A_JumpIfTargetinLOS("ContinueShooting")
	ELAD K 2 A_GiveInventory("LegendaryAdmiralStrafing",1)
	TNT1 A 0 A_JumpIfTargetinLOS("ContinueShooting")
	TNT1 A 0 A_MonsterRefire(200,"See")
	Goto Chaingun+7
  ContinueShooting:
	TNT1 A 0 A_GiveInventory("LegendaryAdmiralStrafing",1)
	TNT1 A 0 A_PlaySound("sentient/fire")
	ELAD F 4 Bright A_CustomMissile("ELegRifleCasing",Random(30,34),0,Random(5,-5),0)
	TNT1 A 0 A_GiveInventory("LegendaryAdmiralStrafing",1)
	TNT1 A 0 A_PlaySound("sentient/fire")
	ELAD E 4 Bright A_CustomMissile("ELegRifleCasing",Random(30,34),0,Random(5,-5),0)
	TNT1 A 0 A_Jump(24,"Missile","Pause")
	TNT1 A 0 A_MonsterRefire(150,"See")
	Loop
  Pause:
	ELAD HKHKH 3 Bright A_GiveInventory("LegZombieStrafing2",1)
	Goto See
  Rockets:
	TNT1 A 0 A_GiveInventory("LegendaryAdmiralStrafing",1)
	ELAD HJ 4 Bright A_FaceTarget
	ELAD I 2 Bright A_CustomMissile("EnragedRocket",40,16,0,0)
	ELAD HJ 4 Bright A_FaceTarget
	ELAD I 2 Bright A_CustomMissile("EnragedRocket",40,16,Random(2,-2),0)
	ELAD HJ 4 Bright A_FaceTarget
	ELAD I 2 Bright A_CustomMissile("EnragedRocket",40,16,Random(4,-4),0)
	ELAD HJ 4 Bright A_FaceTarget
	ELAD I 2 Bright A_CustomMissile("EnragedRocket",40,16,Random(6,-6),0)
	ELAD H 2 A_CPosRefire
	Goto See
  HomingRockets:
    TNT1 A 0 A_Playsound("FormerAdmiral/Attack")
	ELAD HJ 4 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory("LegendaryAdmiralStrafing",1)
	ELAD I 2 Bright A_CustomMissile("EnragedRocket",40,16,0,0)
	ELAD HJ 4 Bright A_FaceTarget
	ELAD I 2 Bright A_CustomMissile("EnragedRocket",40,16,0,0)
	ELAD HJ 4 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory("LegendaryAdmiralStrafing",1)
	ELAD I 2 Bright A_CustomMissile("EnragedRocket",40,16,0,0)
	ELAD HJ 4 Bright A_FaceTarget
	ELAD I 2 Bright A_CustomMissile("EnragedRocket",40,16,0,0)
	Goto See
  Cannon:
	ELAD EEEE 3 Bright A_GiveInventory("LegZombieStrafing2",1)
	ELAD E 3 Bright A_GiveInventory("LegZombieStrafing2",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing2",1)
	TNT1 A 0 A_CustomMissile("ELegRevBall",40,16,0,0)
	ELAD F 3 Bright A_PlaySoundEx("legendarycannon/fire","Weapon")
	TNT1 A 0 A_Jump(32,"Pause")
	TNT1 A 0 A_SpidRefire
	Goto Cannon+3
  CannonBall:
	ELAD EEE 5 Bright A_GiveInventory("LegZombieStrafing2",1)
	TNT1 A 0 A_PlaySound("LegCannon/Fire",1)
	ELAD F 5 Bright A_CustomMissile("ELegDoomguyCannonBall",32,16,0,0)
	ELAD EEE 5 Bright A_GiveInventory("LegZombieStrafing2",1)
	TNT1 A 0 A_PlaySound("LegCannon/Fire",1)
	ELAD F 5 Bright A_CustomMissile("ELegDoomguyCannonBall",32,16,0,0)
	ELAD EEE 5 Bright A_GiveInventory("LegZombieStrafing2",1)
	TNT1 A 0 A_PlaySound("LegCannon/Fire",1)
	ELAD F 5 Bright A_CustomMissile("ELegDoomguyCannonBall",32,16,0,0)
	Goto See
  Beacon:
	ELAD H 20 A_SpawnItem("ActiveEnragedLegendaryFormerBeacon")
	Goto See
  Pain:
	TNT1 A 0 A_Jump(20,"Protection")
	ELAD G 3 Bright
	ELAD G 3 Bright A_Pain
	TNT1 A 0 A_Jump(192,"Missile")
	Goto See
  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
	ELAD E 2 Bright ACS_NamedExecuteAlways("LegendaryProtection",0,0,0,0)
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	Goto See
 Death:
	TNT1 A 0
	TNT1 A 0 A_JumpIfInTargetInventory("TrueLegendaryRuneItem",1,"LegendarySoul")
	TNT1 A 0 A_JumpIfInTargetInventory("TrueLegendaryRuneItem2",1,"LegendarySoul")
    //TNT1 A 0 A_Jump(40,"LegendarySoul")
  Death2:
    //TNT1 A 0 A_Jump(32,"LegendarySoul")
	ELAD G 4   
	TNT1 A 0 A_Scream    
	LPOX ABCDE 7 
	TNT1 A 0 A_NoBlocking
	TNT1 A 0 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
	LPOX FFGG 4 BRIGHT A_CustomMissile("LegendaryKaboom3", Random(10,50), 0, random(0,360), 2, random(0,360))
	LPOX H 6 BRIGHT
	LPOX I -1
	Stop
	}
}
	/*
  LegendarySoul:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPOX I 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPOX I 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPOX I 5 A_SpawnItem("BodyCrash",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPOX I 5 
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPOX I 140
	LPOX I 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LPOX IIIIIIIIIIIIIIIII 2 Bright A_GiveInventory("ELegSoulEventSmokeSpawner",1)
	LPOX IIIIIIIIIIIIIIIII 2 Bright A_GiveInventory("ELegSoulEventSmokeSpawner",1)
	LPOX IIIIIIIIIIIIIIIII 2 Bright A_GiveInventory("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)
	LPOX I -1
	Stop
	}
}
*/

Actor INFEnragedLegendaryAdmiral : EnragedLegendaryAdmiral
{
Tag "\c[m6]Enraged\c- \c[z3]Legendary Admiral\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)
	ELAD A 10 Bright A_Look
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	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 ActiveLegendaryFormerBeacon
{
-SOLID
-SHOOTABLE
States
{
  Spawn:
    ENLB A 105
    ENLB A 0 A_SpawnItemEx("TeleportFog")
    ENLB A 0 A_SpawnItemEx ("LegendarySpecOpsMachinegunner", 0, 0, 8, 0, 0, 0, 0, 1)
    ENLB A 105
    ENLB A 0 A_SpawnItemEx("TeleportFog")
    ENLB A 0 A_SpawnItemEx ("LegendarySpecOpsMachinegunner", 0, 0, 8, 0, 0, 0, 0, 1)
    ENLB A 105
    ENLB A 0 A_SpawnItemEx("TeleportFog")
    ENLB A 0 A_SpawnItemEx ("LegendarySpecOpsMachinegunner", 0, 0, 8, 0, 0, 0, 0, 1)
    ENLB A 105
    goto Death
  Death:
    TNT1 A 1 A_SpawnItemEx("TeleportFog")
    stop
	}
}

Actor LegendaryAdmiralStrafing : CustomInventory
{
-COUNTITEM
+NOTIMEFREEZE
+INVENTORY.QUIET
+INVENTORY.UNDROPPABLE
+INVENTORY.ALWAYSPICKUP
+INVENTORY.AUTOACTIVATE
Inventory.Amount 1
Inventory.MaxAmount 0
States
  {
  Pickup:
	NULL A 1 
	NULL A 1 A_SpawnItemEx("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 EnragedLegendarySpecOpsMachinegunner : LegendaryZombie
{
Health 1000
Speed 16
PainChance 25
DamageFactor "LegendaryZombie", 0.0
DamageFactor "PDTBFG", 0.20
DamageFactor "PDTBFGTracer", 0.20
DamageFactor "PlayerDevBall", 0.65
DamageFactor "PlayerDevBall2", 0.65
DamageFactor "PlayerDTBFGRailgunSlug", 0.65
DamageFactor "PlayerDevTracer", 0.65
DamageFactor "Legendary", 0.0
DamageFactor "LegendaryPlayer", 0.2
DamageFactor "LegendaryGuru", 0.0
DamageFactor "LegendaryGuruPlayer", 0.2
DamageFactor "DBFG10K2", 0.50
DamageFactor "PlayerDBFG10K2", 0.50
DamageFactor "DBFG2", 0.50
DamageFactor "PlayerDBFG2", 0.50
DamageFactor "PlayerDTRG", 0.5
DamageFactor "CerChainguns", 0.0
DamageFactor 0.50
Species "SpecOps"
SeeSound "SpecOpsZombie/Sight"
ActiveSound "SpecOpsZombie/Active"
PainSound "SpecOpsZombie/Pain"
DeathSound "SpecOpsZombie/Death"
Obituary "%o was gunned down by a Legendary Spec Ops Zombie."
DropItem "LegendaryBossLifeEssence" 256
DropItem "LegendaryBossArmorBonusMax" 256
DropItem "LegendaryBossLifeEssence" 128
DropItem "LegendaryBossArmorBonusMax" 128
Tag "\c[m6]Enraged\c- \c[z3]Legendary Spec Ops Machinegunner\c-"
+NOKILLSCRIPTS
-BOSS
-BOSSDEATH
States
{
  Spawn:
    ELD0 A 10 Bright A_Look
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
    Loop
  See:
	TNT1 A 0 A_JumpIfTargetInLOS("See2")
	ELD0 ABCD 4 A_Chase
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	Loop
  See2:
    ELD0 A 0 A_TakeInventory("ZSpecOpAggressive", 1)
    ELD0 A 0 A_TakeInventory("ZSpecOpSnipe", 1)
    ELD0 A 0 A_TakeInventory("ZSpecOpWander", 1)
    ELD0 A 0 A_TakeInventory("ZSpecOpCreep", 1)
    ELD0 A 0 A_TakeInventory("ZSpecOpFlee", 1)
    ELD0 A 0 A_ChangeFlag("MissileMore", 0)
    ELD0 A 0 A_ChangeFlag("MissileEvenMore", 0)
    ELD0 A 0 A_ChangeFlag("AvoidMelee", 0)
    ELD0 A 0 A_ChangeFlag("Frightened", 0)
    ELD0 A 0 A_GiveInventory("ZSpecOpsMSitRep", 1)
    ELD0 A 0 A_JumpIfInventory("ZSpecOpAggressive", 1, "AggressiveSwitch")
    ELD0 A 0 A_JumpIfInventory("ZSpecOpSnipe", 1, "SnipeSwitch")
    ELD0 A 0 A_JumpIfInventory("ZSpecOpWander", 1, "WanderSwitch")
    ELD0 A 0 A_JumpIfInventory("ZSpecOpCreep", 1, "CreepSwitch")
    ELD0 A 0 A_JumpIfInventory("ZSpecOpFlee", 1, "FleeSwitch")
  AggressiveSwitch:
    ELD0 A 0 A_ChangeFlag("MissileMore", 1)
    ELD0 A 0 A_ChangeFlag("MissileEvenMore", 1)
    Goto AggressiveSee
  AggressiveSee:
    ELD0 A 3 A_Chase("", "AggressiveMissile")
    ELD0 A 0 A_JumpIfHealthLower(50, "See")
    ELD0 A 0 A_Jump(32, 2)
    ELD0 A 0 A_JumpIfCloser(768, 1)
    Goto See
    ELD0 A 3 A_Chase("", "AggressiveMissile")
    ELD0 A 0 A_JumpIfHealthLower(50, "See")
    ELD0 A 0 A_Jump(32, 2)
    ELD0 A 0 A_JumpIfCloser(768, 1)
    Goto See
    ELD0 B 3 A_Chase("", "AggressiveMissile")
    ELD0 B 0 A_JumpIfHealthLower(50, "See")
    ELD0 B 0 A_Jump(32, 2)
    ELD0 B 0 A_JumpIfCloser(768, 1)
    Goto See
    ELD0 B 3 A_Chase("", "AggressiveMissile")
    TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    ELD0 B 0 A_JumpIfHealthLower(50, "See")
    ELD0 B 0 A_Jump(32, 2)
    ELD0 B 0 A_JumpIfCloser(768, 1)
    Goto See
    ELD0 C 3 A_Chase("", "AggressiveMissile")
    ELD0 C 0 A_JumpIfHealthLower(50, "See")
    ELD0 C 0 A_Jump(32, 2)
    ELD0 C 0 A_JumpIfCloser(768, 1)
    Goto See
    ELD0 C 3 A_Chase("", "AggressiveMissile")
    ELD0 C 0 A_JumpIfHealthLower(50, "See")
    ELD0 C 0 A_Jump(32, 2)
    ELD0 C 0 A_JumpIfCloser(768, 1)
    Goto See
    ELD0 D 3 A_Chase("", "AggressiveMissile")
    ELD0 D 0 A_JumpIfHealthLower(50, "See")
    ELD0 D 0 A_Jump(32, 2)
    ELD0 D 0 A_JumpIfCloser(768, 1)
    Goto See
    ELD0 D 3 A_Chase("", "AggressiveMissile")
    TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    ELD0 D 0 A_JumpIfHealthLower(50, "See")
    ELD0 D 0 A_Jump(32, 2)
    ELD0 D 0 A_JumpIfCloser(768, 1)
    Goto See
    ELD0 A 0
    Loop
  Missile:
  AggressiveMissile:
    ELD0 EEE 2 A_FaceTarget
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_CustomMissile("ELegRifleCasing",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    ELD0 F 0 A_PlayWeaponSound("SpecOpsZombie/Machinegun")
    ELD0 F 1 Bright A_CustomBulletAttack(11,8,1,Random(1,5)*3,"LegModdedBulletPuff")
    ELD0 E 2 A_FaceTarget
	TNT1 A 0 A_CustomMissile("ELegRifleCasing",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    ELD0 F 0 A_PlayWeaponSound("SpecOpsZombie/Machinegun")
    ELD0 F 1 Bright A_CustomBulletAttack(11,8,1,Random(1,5)*3,"LegModdedBulletPuff")
    ELD0 E 2 A_FaceTarget
	TNT1 A 0 A_CustomMissile("ELegRifleCasing",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    ELD0 F 0 A_PlayWeaponSound("SpecOpsZombie/Machinegun")
    ELD0 F 1 Bright A_CustomBulletAttack(11,8,1,Random(1,5)*3,"LegModdedBulletPuff")
    ELD0 E 2 A_FaceTarget
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
    ELD0 F 0 A_Jump(32, "AggressiveSee")
    ELD0 F 0 A_Jump(192, 2)
    ELD0 F 0 A_MonsterRefire(40, "AggressiveSee")
    ELD0 F 0
    Goto AggressiveMissile+3
  SnipeSwitch:
    ELD0 A 0 A_ChangeFlag("MissileMore", 1)
    ELD0 A 0 A_ChangeFlag("MissileEvenMore", 1)
    Goto SnipeSee
  SnipeSee:
    ELD0 E 0 A_Chase("", "SnipeMissile", 17)
    ELD0 EEEE 2 A_FaceTarget
    ELD0 E 0 A_JumpIfCloser(384, "See")
    ELD0 E 0 A_CheckSight("SnipeIdle")
    Loop
  SnipeIdle:
    ELD0 E 0 A_ClearTarget
    ELD0 E 1 A_LookEx(10, 0, 0, 0, 360, "SnipeSee")
    Goto SnipeIdle+1
  SnipeMissile:
    ELD0 E 0 A_Jump(128, 2)
    ELD0 E 1 A_FaceTarget
    ELD0 E 0 A_Jump(128, 2)
    ELD0 E 1 A_FaceTarget
    ELD0 E 0 A_Jump(128, 2)
    ELD0 E 1 A_FaceTarget
    ELD0 E 0 A_Jump(128, 2)
    ELD0 E 1 A_FaceTarget
    ELD0 E 0 A_Jump(128, 2)
    ELD0 E 1 A_FaceTarget
    ELD0 E 0 A_Jump(128, 2)
    ELD0 E 1 A_FaceTarget
    ELD0 E 0 A_Jump(128, 2)
    ELD0 E 1 A_FaceTarget
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_CustomMissile("ELegRifleCasing",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    ELD0 F 0 A_PlayWeaponSound("SpecOpsZombie/Machinegun")
    ELD0 F 1 Bright A_CustomBulletAttack(6,4,1,Random(1,5)*3,"LegModdedBulletPuff")
    ELD0 E 1 A_FaceTarget
    ELD0 E 0 A_Jump(192, "SnipeSee")
    ELD0 E 0 A_MonsterRefire(40, "SnipeSee")
    Loop
  WanderSwitch:
    ELD0 A 0 A_ClearTarget
    Goto WanderSee
  WanderSee:
    ELD0 A 2 A_Wander
    ELD0 A 0 A_LookEx(10, 0, 0, 0, 360, "See")
    ELD0 A 2 A_Wander
    ELD0 A 0 A_LookEx(10, 0, 0, 0, 360, "See")
    ELD0 B 2 A_Wander
    ELD0 A 0 A_LookEx(10, 0, 0, 0, 360, "See")
    ELD0 B 2 A_Wander
    TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    ELD0 A 0 A_LookEx(10, 0, 0, 0, 360, "See")
    ELD0 C 2 A_Wander
    ELD0 A 0 A_LookEx(10, 0, 0, 0, 360, "See")
    ELD0 C 2 A_Wander
    ELD0 A 0 A_LookEx(10, 0, 0, 0, 360, "See")
    ELD0 D 2 A_Wander
    ELD0 A 0 A_LookEx(10, 0, 0, 0, 360, "See")
    ELD0 D 2 A_Wander
    TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    ELD0 A 0 A_LookEx(10, 0, 0, 0, 360, "See")
    Loop
  CreepSwitch:
    ELD0 A 0 A_ChangeFlag("MissileMore", 1)
    ELD0 A 0 A_ChangeFlag("AvoidMelee", 1)
    Goto CreepSee
  CreepSee:
    ELD0 A 0 A_CheckSight("CreepCheck")
    ELD0 A 0 A_JumpIfHealthLower(50, "See")
    ELD0 AABB 3 A_Chase("", "CreepMissile", 2)
    TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	ELD0 CCDD 3 A_Chase("", "CreepMissile", 2)
    TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    Loop
  CreepCheck:
    ELD0 A 0 A_Jump(32, "See")
    Goto CreepSee+1
  CreepMissile:
    ELD0 EEE 2 A_FaceTarget
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_CustomMissile("ELegRifleCasing",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    ELD0 F 0 A_PlayWeaponSound("SpecOpsZombie/Machinegun")
    ELD0 F 1 Bright A_CustomBulletAttack(11,8,1,Random(1,5)*3,"LegModdedBulletPuff")
    ELD0 E 2 A_FaceTarget
	TNT1 A 0 A_CustomMissile("ELegRifleCasing",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    ELD0 F 0 A_PlayWeaponSound("SpecOpsZombie/Machinegun")
    ELD0 F 1 Bright A_CustomBulletAttack(11,8,1,Random(1,5)*3,"LegModdedBulletPuff")
    ELD0 E 2 A_FaceTarget
	TNT1 A 0 A_CustomMissile("ELegRifleCasing",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    ELD0 F 0 A_PlayWeaponSound("SpecOpsZombie/Machinegun")
    ELD0 F 1 Bright A_CustomBulletAttack(11,8,1,Random(1,5)*3,"LegModdedBulletPuff")
    ELD0 E 2 A_FaceTarget
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
    ELD0 F 0 A_Jump(32, "CreepSee")
    ELD0 F 0 A_MonsterRefire(40, "CreepSee")
    Goto CreepMissile+4
  FleeSwitch:
    ELD0 A 0 A_ChangeFlag("Frightened", 1)
    Goto FleeSee
  FleeSee:
    ELD0 AABB 2 A_Chase("", "FleeMissile")
    TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	ELD0 CCDD 2 A_Chase("", "FleeMissile")
    TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    ELD0 A 0 A_JumpIfCloser(768, 1)
    Goto See
    SPE2 A 0
    Loop
  FleeMissile:
    ELD0 EE 2 A_FaceTarget
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_CustomMissile("ELegRifleCasing",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    ELD0 F 0 A_PlayWeaponSound("SpecOpsZombie/Machinegun")
    ELD0 F 1 Bright A_CustomBulletAttack(11,8,1,Random(1,5)*3,"LegModdedBulletPuff")
    ELD0 E 2 A_FaceTarget
	TNT1 A 0 A_CustomMissile("ELegRifleCasing",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    ELD0 F 0 A_PlayWeaponSound("SpecOpsZombie/Machinegun")
    ELD0 F 1 Bright A_CustomBulletAttack(11,8,1,Random(1,5)*3,"LegModdedBulletPuff")
    ELD0 E 2 A_FaceTarget
	TNT1 A 0 A_CustomMissile("ELegRifleCasing",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    ELD0 F 0 A_PlayWeaponSound("SpecOpsZombie/Machinegun")
    ELD0 F 1 Bright A_CustomBulletAttack(11,8,1,Random(1,5)*3,"LegModdedBulletPuff")
    ELD0 E 2 A_FaceTarget
	TNT1 A 0 A_CustomMissile("ELegRifleCasing",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    ELD0 F 0 A_PlayWeaponSound("SpecOpsZombie/Machinegun")
    ELD0 F 1 Bright A_CustomBulletAttack(11,8,1,Random(1,5)*3,"LegModdedBulletPuff")
    ELD0 E 2 A_FaceTarget
	TNT1 A 0 A_CustomMissile("ELegRifleCasing",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    ELD0 F 0 A_PlayWeaponSound("SpecOpsZombie/Machinegun")
    ELD0 F 1 Bright A_CustomBulletAttack(11,8,1,Random(1,5)*3,"LegModdedBulletPuff")
    ELD0 E 2 A_FaceTarget
	TNT1 A 0 A_CustomMissile("ELegRifleCasing",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    ELD0 F 0 A_PlayWeaponSound("SpecOpsZombie/Machinegun")
    ELD0 F 1 Bright A_CustomBulletAttack(11,8,1,Random(1,5)*3,"LegModdedBulletPuff")
    ELD0 E 2 A_FaceTarget
	TNT1 A 0 A_CustomMissile("ELegRifleCasing",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    ELD0 F 0 A_PlayWeaponSound("SpecOpsZombie/Machinegun")
    ELD0 F 1 Bright A_CustomBulletAttack(11,8,1,Random(1,5)*3)
    ELD0 E 2 A_FaceTarget
	TNT1 A 0 A_CustomMissile("ELegRifleCasing",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    ELD0 F 0 A_PlayWeaponSound("SpecOpsZombie/Machinegun")
    ELD0 F 1 Bright A_CustomBulletAttack(11,8,1,Random(1,5)*3,"LegModdedBulletPuff")
    ELD0 E 2 A_FaceTarget
	TNT1 A 0 A_CustomMissile("ELegRifleCasing",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    ELD0 F 0 A_PlayWeaponSound("SpecOpsZombie/Machinegun")
    ELD0 F 1 Bright A_CustomBulletAttack(11,8,1,Random(1,5)*3,"LegModdedBulletPuff")
    ELD0 E 2 A_FaceTarget
	TNT1 A 0 A_CustomMissile("ELegRifleCasing",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    ELD0 F 0 A_PlayWeaponSound("SpecOpsZombie/Machinegun")
    ELD0 F 1 Bright A_CustomBulletAttack(11,8,1,Random(1,5)*3,"LegModdedBulletPuff")
    ELD0 E 2 A_FaceTarget
	TNT1 A 0 A_CustomMissile("ELegRifleCasing",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    ELD0 F 0 A_PlayWeaponSound("SpecOpsZombie/Machinegun")
    ELD0 F 1 Bright A_CustomBulletAttack(11,8,1,Random(1,5)*3,"LegModdedBulletPuff")
    ELD0 E 2 A_FaceTarget
	TNT1 A 0 A_CustomMissile("ELegRifleCasing",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    ELD0 F 0 A_PlayWeaponSound("SpecOpsZombie/Machinegun")
    ELD0 F 1 Bright A_CustomBulletAttack(11,8,1,Random(1,5)*3,"LegModdedBulletPuff")
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
    ELD0 E 2 A_FaceTarget
    Goto FleeSee
  Pain:
    ELD0 G 4
    ELD0 G 4 A_Pain
    ELD0 G 0 A_Jump(96, "See")
    Goto WhatPainState
  WhatPainState:
    ELD0 G 0 A_JumpIfInventory("ZSpecOpAggressive", 1, "AggressiveSee")
    ELD0 G 0 A_JumpIfInventory("ZSpecOpSnipe", 1, "SnipeSee")
    ELD0 G 0 A_JumpIfInventory("ZSpecOpWander", 1, "WanderSee")
    ELD0 G 0 A_JumpIfInventory("ZSpecOpCreep", 1, "CreepSee")
    ELD0 G 0 A_JumpIfInventory("ZSpecOpFlee", 1, "FleeSee")
    Goto AggressiveSee
  Death:
    ELD0 H 5
    ELD0 I 5 A_Scream
    ELD0 J 5
    ELD0 K 5 A_NoBlocking
    ELD0 L -1
	Stop
  XDeath:
	ELD0 O 3 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    ELD0 P 3 A_XScream
    ELD0 R 3 A_Fall
    ELD0 STUV 3 
    ELD0 W -1 
    Stop
	}
}