ACTOR LegendaryMinigunner
{
Monster
Health 1500
Radius 16
Height 56
Mass 100
Speed 15
PainChance 20
DamageFactor "Legendary1", 0.0
DamageFactor 0.5
DamageFactor "PlasmaBall", 20
DamageFactor "Legendary", 0.0
DamageFactor "LegendaryPlayer", 0.0
DamageFactor "PDTBFG", 0.25
DamageFactor "PDTBFGTracer", 0.25
DamageFactor "PlayerDevBall", 0.125
DamageFactor "PlayerDevBall2", 0.125
DamageFactor "PlayerDTBFGRailgunSlug", 0.75
DamageFactor "PlayerDevTracer", 0.125
DamageFactor "DBFG10K2", 0.1
DamageFactor "PlayerDBFG10K2", 0.1
DamageFactor "DBFG2", 0.1
DamageFactor "PlayerDBFG2", 0.1
DropItem "EnragedLegendarySphere" 70
DropItem "LegendaryPowerSphere" 85 1
DropItem "EnrLegGreaterDemonicEnergy" 200
DropItem "EnrLegDemonicEnergy" 250
DropItem "LegendaryBossLifeEssence" 256
DropItem "LegendaryBossArmorBonusMax" 256
DropItem "LegendaryBossLifeEssence" 128
DropItem "LegendaryBossArmorBonusMax" 128
DropItem "LegendaryArmor" 128
DropItem "LegendaryRune" 128
DropItem "LegendaryMinigun" 128
DamageType "Legendary"
Species "Legendary"
SeeSound "LUCOMM/Sight"
ActiveSound "LUCOMM/Active"
PainSound "UCHAIN/Pain"
DeathSound "CCHAIN/Death"
BloodColor "Blue"
HitObituary "%o was made into a feast for a Legendary Minigunner."
Obituary "%o was deep impaled by a Legendary Minigunner."
Tag "\c[z3]Legendary Minigunner\c-"
+NOTIMEFREEZE
+NOFEAR
+BOSS
+BOSSDEATH
+FLOORCLIP
+MISSILEMORE
+MISSILEEVENMORE
+QUICKTORETALIATE
+NOICEDEATH
+NODROPOFF
+DONTGIB
+NOTARGET
+BRIGHT
+MISSILEMORE
+QUICKTORETALIATE
var int user_music;
var int user_missile;
  States
  {
  Spawn:
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner")
    LMGZ A 10 A_Look
	LMGZ Z 10 A_Look
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner")
    Loop
  See:
	TNT1 A 0 A_JumpIf(user_music == 1,3)
	TNT1 A 0 ACS_NamedExecuteAlways("StartMonsterMusic",0,6754)
	TNT1 A 0 A_SetUserVar("user_music",1)
    TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner")
    LMGZ AABB 3 A_Chase
    TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    LMGZ CCDD 3 A_Chase
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner")
    TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    Loop
  Rush:
    LMGZ A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItem("FootStep")
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("LegendaryMinigunnerGhostAA")
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner")
	LMGZ A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryMinigunnerGhostAA")
	LMGZ A 1 A_Chase
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("LegendaryMinigunnerGhostBB")
	LMGZ B 1 A_Chase
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("LegendaryMinigunnerGhostBB")
	LMGZ B 1 A_Chase
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItem("FootStep")
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("LegendaryMinigunnerGhostCC")
	LMGZ C 1 A_Chase
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("LegendaryMinigunnerGhostCC")
	LMGZ C 1 A_Chase
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("LegendaryMinigunnerGhostDD")
	LMGZ D 1 A_Chase
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("LegendaryMinigunnerGhostDD")
	LMGZ D 1 A_Chase
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner")
	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)
	LMGZ AA 3 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LMGZ BB 3 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_SpawnItem("FootStep")
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    LMGZ CC 3 A_GiveInventory("LegZombieStrafingg",1)	
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LMGZ DD 3 A_GiveInventory("LegZombieStrafingg",1)
	Goto See
  Pause:
	LMGZ E 0 A_PlaySound("LUCOMM/Active")
	LMGZ EEEEE 3 A_GiveInventory("LegZombieStrafingg",1)
	Goto See
  Teleport:
	TNT1 A 0 A_JumpIfTargetInLOS("Missile")
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegendaryMinigunnerGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LMGZ A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryMinigunnerGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LMGZ A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryMinigunnerGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LMGZ B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryMinigunnerGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LMGZ B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegendaryMinigunnerGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LMGZ C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryMinigunnerGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LMGZ C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryMinigunnerGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LMGZ D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryMinigunnerGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LMGZ D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_Jump(84,"See")
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	Loop
  Missile:
  TNT1 A 0 A_SpawnItemEx("LHellionSmokeSpawner")
	LMGZ E 1 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("sentient/fire")
	LMGZ F 2 Bright A_CustomMissile("LegUCommandoExplosiveTracer",32,0,random(-5,5))
	TNT1 A 0 A_FaceTarget
	LMGZ EE 1 Bright A_GiveInventory("LCommandoStrafing",1)	
	TNT1 A 0 A_PlaySound("sentient/fire")
	LMGZ F 1 Bright A_CustomMissile("LegUCommandoExplosiveTracer",32,0,random(-5,5))
	TNT1 A 0 A_FaceTarget
	LMGZ EE 1 Bright A_GiveInventory("LCommandoStrafing",1)	
	TNT1 A 0 A_PlaySound("sentient/fire")
	LMGZ F 2 Bright A_CustomMissile("LegUCommandoExplosiveTracer",32,0,random(-5,5))
	TNT1 A 0 A_SpawnItemEx("LHellionSmokeSpawner")
	TNT1 A 0 A_FaceTarget
	LMGZ EE 1 Bright A_GiveInventory("LCommandoStrafing",1)	
	TNT1 A 0 A_PlaySound("sentient/fire")
	LMGZ F 1 Bright A_CustomMissile("LegUCommandoExplosiveTracer",32,0,random(-5,5))
	TNT1 A 0 A_SpawnItemEx("LHellionSmokeSpawner")
	TNT1 A 0 A_FaceTarget
	LMGZ EE 1 Bright A_GiveInventory("LCommandoStrafing",1)	
	TNT1 A 0 A_PlaySound("sentient/fire")
	LMGZ F 1 Bright A_CustomMissile("LegUCommandoExplosiveTracer",32,0,random(-5,5))
	TNT1 A 0 A_FaceTarget
	LMGZ EE 1 Bright A_GiveInventory("LCommandoStrafing",1)	
	TNT1 A 0 A_PlaySound("sentient/fire")
	LMGZ F 1 Bright A_CustomMissile("LegUCommandoExplosiveTracer",32,0,random(-5,5))
	TNT1 A 0 A_FaceTarget
	LMGZ EE 1 Bright A_GiveInventory("LCommandoStrafing",1)	
	TNT1 A 0 A_PlaySound("sentient/fire")
	LMGZ F 1 Bright A_CustomMissile("LegUCommandoExplosiveTracer",32,0,random(-5,5))
	TNT1 A 0 A_FaceTarget
	LMGZ EE 1 Bright A_GiveInventory("LCommandoStrafing",1)	
	TNT1 A 0 A_SpawnItemEx("LHellionSmokeSpawner")
	TNT1 A 0 A_PlaySound("sentient/fire")
	LMGZ F 1 Bright A_CustomMissile("LegUCommandoExplosiveTracer",32,0,random(-5,5))
	TNT1 A 0 A_FaceTarget
	LMGZ EE 1 Bright A_GiveInventory("LCommandoStrafing",1)	
	TNT1 A 0 A_PlaySound("sentient/fire")
	LMGZ F 1 Bright A_CustomMissile("LegUCommandoExplosiveTracer",32,0,random(-5,5))
	TNT1 A 0 A_Jump(80, "Teleport")
	TNT1 A 0 A_Jump(80, "Pause")
	Loop
  Pain:
    LMGZ G 6 A_Pain
    Goto See
  Death:
    TNT1 A 0 A_StopSoundEx("Voice")
    LMGZ H 5
    LMGZ I 5 A_Scream 
    LMGZ J 5 A_Fall
    LMGZ K 5 A_SpawnItem("BodyCrash",0,0,0,0)
    LMGZ LM 5
    LMGZ N -1
    Stop
  XDeath:
    LMGZ O 3 
    LMGZ P 3 A_XScream
    LMGZ Q 3 A_SpawnItemEx("GibbedGenerator",0,0,0,0,0,0,0,128,0)
    LMGZ R 3 A_Fall 
    LMGZ STUV 3
	LMGZ W -1
    Stop
	}
}

ACTOR LegendaryMinigunnerGhostAA
{
Scale 1.1
Radius 20
Height 56
Speed 0
Alpha 0.7
PROJECTILE
RENDERSTYLE Translucent
+NOTIMEFREEZE
+NOINTERACTION
+CLIENTSIDEONLY
+NONETID
States
{
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "NULL")
	TNT1 A 1
	Goto Fade
  Fade:
	LMGZ A 2 A_FadeOut(0.1,1)
	Loop
  Toaster:
	TNT1 A 1
	Stop
	}
}

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

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

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

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

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


Actor LegZombieGhost : LegZombieStrafing
{
  States
  {
  Pickup:
    NULL A 1 
	NULL A 1 A_SpawnItem("LHellionSmokeSpawner")
	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 LegZombieJumpingg : 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
  }
}

ACTOR LegendaryMinigunnerGhost
{
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")
    LMGZ A 2 A_FadeOut(0.10)
    Wait
    }
}
