ACTOR EnragedLegendaryLeader
{
//Creator: Eshkere_Jason
//Origin: Divine Infinity
//Sprite: ELGE
//Title: "Enraged Legendary Leader"
Health 2250
Mass 400
Radius 20
Height 56
Speed 15
MaxStepHeight 64
PainChance 30
Reactiontime 25
Monster
DamageFactor 0.65
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
DropItem "PortableMedCell", 150, 1
DropItem "StimKit", 180, 2
DropItem "ClipBox", 180
DropItem "HealthFlask", 200, 6
DropItem "EnragedLegendaryArmor" 80 1
DropItem "LegAmmoSphere" 85 1
DropItem "ArmorPlate", 160
DropItem "HandGrenadeAmmo", 120, 1
DropItem "MineAmmo", 90, 1
DropItem "AmmoPack", 160, 1
DropItem "ShieldSphere", 64, 1
DropItem "MarineMedicBeacon", 15, 1
DropItem "MarineDispensersBeacon", 15, 1
DropItem "EnragedLegendarySphere", 80, 1
SeeSound "PNZombie/See"
ActiveSound "PNZombie/Act"
PainSound "PNZombie/Pain"
DeathSound "PNZombie/Die"
Obituary "A Enraged Legendary Elite Zombie Leader showed %o how to act like a leader."
Tag "\c[m6]Enraged\c- \c[z3]Legendary Elite Zombie Leader\c-"
+BRIGHT
-FORCERADIUSDMG
-NORADIUSDMG
var int user_music;
var int user_protection;
var int user_protected;
States
{
  Spawn:
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
    ELGE A 10 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,6728)
	TNT1 A 0 A_SetUserVar("user_music",1)
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_JumpIfInventory("SnipeOn",1,"SnipeSee")
	ELGE AAAABBBB 1 A_Chase
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("FootStep2",0,0,5,0,0,-20)
	ELGE CCCCDDDD 1 A_Chase
	TNT1 A 0 HealThing(random(1,2))
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("FootStep2",0,0,5,0,0,-20)
	Loop
  SnipeSee:
	ELGE AAAA 1 A_Chase("","SnipeFire")
	TNT1 A 0 A_FastChase
	TNT1 A 0 A_JumpIfCloser(192,"StopSnipe")
	ELGE AAAA 1 A_Chase("","SnipeFire")
	TNT1 A 0 A_JumpIfCloser(192,"StopSnipe")
	ELGE BBBB 1 A_Chase("","SnipeFire")
	TNT1 A 0 A_Jump(20,"Heal")
	TNT1 A 0 A_JumpIfCloser(192,"StopSnipe")
	ELGE BBBB 1 A_Chase("","SnipeFire")
	TNT1 A 0 A_SpawnItemEx("FootStep2",0,0,5,0,0,-20)
	TNT1 A 0 A_JumpIfCloser(192,"StopSnipe")
	ELGE CCCC 1 A_Chase("","SnipeFire")
	TNT1 A 0 A_Jump(20,"Heal")
	TNT1 A 0 A_JumpIfCloser(192,"StopSnipe")
	ELGE CCCC 1 A_Chase("","SnipeFire")
	TNT1 A 0 A_FastChase
	TNT1 A 0 A_JumpIfCloser(192,"StopSnipe")
	ELGE DDDD 1 A_Chase("","SnipeFire")
	TNT1 A 0 A_JumpIfCloser(192,"StopSnipe")
	TNT1 A 0 A_FastChase
	ELGE DDDD 1 A_Chase("","SnipeFire")
	TNT1 A 0 A_SpawnItemEx("FootStep2",0,0,5,0,0,-20)
	Loop
  Missile:
	TNT1 A 0
	TNT1 A 0 HealThing(1)
	TNT1 A 0 A_Jump(25,"Rage")
	TNT1 A 0 A_Jump(60,"Heal")
	TNT1 A 0 A_JumpIfCloser(128,"SpreadFire")
	ELGE EEEEEEEEEE 1 A_FaceTarget(45)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	ELGE F 2 A_CustomMissile("LegSentientExplosiveTracer",34,9,frandom(-2.0,2.0),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_JumpIfInventory("LowHealthCheck",1,"MissileEnd")
	TNT1 A 0 A_Jump(16,"MabySee")
	TNT1 A 0 A_Jump(35,"Grenade")
	TNT1 A 0 A_Jump(20,"ActiveEnragedLegendaryLeaderBeacon")
	ELGE E 2 A_SpidRefire
	Goto Missile 
  MissileEnd:
	ELGE E 2 A_FaceTarget
	TNT1 AAA 0 A_FastChase
	Goto See
  ActiveEnragedLegendaryLeaderBeacon:
	ELGE P 0 A_SpawnItem("ActiveEnragedLegendaryLeaderBeacon")
	Goto See
  Rage:
	ELGE EEEEEEEEEE 1 A_FaceTarget(45)
	ELGE E 3 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	ELGE F 1 A_CustomMissile("LegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	ELGE E 2 A_FaceTarget
	TNT1 A 0 A_Jump(50,"Heal")
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	ELGE F 1 A_CustomMissile("LegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	ELGE E 2 A_FaceTarget
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	ELGE F 1 A_CustomMissile("LegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	ELGE E 2 A_FaceTarget
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	ELGE F 1 A_CustomMissile("LegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	ELGE E 2 A_FaceTarget
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	ELGE F 1 A_CustomMissile("LegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	ELGE E 2 A_FaceTarget
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	ELGE F 1 A_CustomMissile("LegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	ELGE E 2 A_FaceTarget
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_Jump(40,"Heal")
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	ELGE F 1 A_CustomMissile("LegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	ELGE E 2 A_FaceTarget
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	ELGE F 1 A_CustomMissile("LegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	ELGE E 2 A_FaceTarget
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	ELGE F 1 A_CustomMissile("LegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	ELGE E 2 A_FaceTarget
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_Jump(40,"Heal")
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	ELGE F 1 A_CustomMissile("LegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	ELGE E 2 A_FaceTarget
	TNT1 A 0 A_FastChase
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	ELGE F 1 A_CustomMissile("LegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	ELGE E 2 A_FaceTarget
	TNT1 A 0 A_FastChase
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	ELGE F 1 A_CustomMissile("LegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	ELGE E 2 A_FaceTarget
	TNT1 A 0 A_FastChase
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	ELGE F 1 A_CustomMissile("LegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	ELGE E 2 A_FaceTarget
	TNT1 A 0 A_FastChase
	TNT1 A 0 A_Jump(40,"Heal")
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	ELGE F 1 A_CustomMissile("LegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	ELGE E 2 A_FaceTarget
	TNT1 A 0 A_FastChase
	TNT1 A 0 A_Jump(40,"Heal")
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	ELGE F 1 A_CustomMissile("LegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	ELGE E 2 A_FaceTarget
	TNT1 A 0 A_FastChase
	GoTo See
  Grenade:
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("weapons/hgrenadepin",0,1.0,0)
	ELGE CE 4 A_FaceTarget
	TNT1 A 0 A_PlaySound("weapons/hgrenadethrow",0,1.0,0)
	ELGE E 1 A_CustomMissile("eLieutenantGrenade",32,0,0,2,4)
	Goto See
  SpreadFire:
	TNT1 A 0
	TNT1 A 0 A_FastChase
	ELGE EEEEEEEEEE 1 A_FaceTarget
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	TNT1 A 0 A_CustomMissile("LegSentientExplosiveTracer",34,9,random(-8,8),CMF_OFFSETPITCH,frandom(-4.0,4.0))
	TNT1 A 0 A_CustomMissile("LegSentientExplosiveTracer",34,9,random(-8,8),CMF_OFFSETPITCH,frandom(-4.0,4.0))
	TNT1 A 0 A_CustomMissile("LegSentientExplosiveTracer",34,9,random(-8,8),CMF_OFFSETPITCH,frandom(-4.0,4.0))
	TNT1 A 0 A_CustomMissile("LegSentientExplosiveTracer",34,9,random(-8,8),CMF_OFFSETPITCH,frandom(-4.0,4.0))
	ELGE F 3 A_CustomMissile("LegSentientExplosiveTracer",random(32,36),random(8,10),random(-8,8),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-4.0,4.0))
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_JumpIfInventory("LowHealthCheck",1,"SpreadFireEnd")
	TNT1 A 0 A_Jump(16,"MabySee")
	ELGE E 3 A_SpidRefire
	TNT1 A 0 A_Jump(30,"Heal")
	Goto Missile
  SpreadFireEnd:
	ELGE E 5 A_FaceTarget
	Goto See
  MabySee:
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_JumpIfInventory("LowHealthCheck",1,"See")
	TNT1 A 0 A_JumpIfCloser(384,"See")
	Goto StartSnipe
  SnipeFire:
	TNT1 A 0 A_ChangeFlag(NOPAIN,1)
	TNT1 A 0 A_Jump(64,2)
	ELGE E 2 A_FaceTarget
	TNT1 A 0 A_Jump(64,2)
	ELGE E 2 A_FaceTarget
	TNT1 A 0 A_Jump(64,2)
	ELGE E 2 A_FaceTarget
	ELGE E 2 A_FaceTarget
	ELGE F 3 A_PlaySound("PulseNail/fire")
	TNT1 A 0 A_CustomMissile("LegSentientExplosiveTracer",34,9,0)
	TNT1 AA 0 A_CustomMissile("LegSentientExplosiveTracer",34,9,0,CMF_TRACKOWNER)
	TNT1 A 0 A_FaceTarget
	ELGE E 4 A_SpidRefire
	TNT1 A 0 A_ChangeFlag(NOPAIN,0)
	TNT1 A 0 A_Jump(40,"Heal")
	Goto SnipeFire
  Pain:
	TNT1 A 0
	TNT1 A 0 A_JumpIfHealthLower((ACS_NamedExecuteWithResult("Hem_SpawnHealth")*0.25),"PainShield")
	TNT1 A 0 A_Jump(64,"NoPainShield")
  PainShield:
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("ZombieShieldSphere",1)
  NoPainShield:
	ELGE G 3
	ELGE G 3 A_Pain
	TNT1 A 0 A_JumpIfInventory("LowHealthCheck",1,3)
	TNT1 A 0 A_JumpIfHealthLower((ACS_NamedExecuteWithResult("Hem_SpawnHealth")*0.25),"LowHealth")
	TNT1 A 0 A_JumpIfInventory("SnipeOn",1,"SnipePain")
	TNT1 A 0 A_Jump(20,"Heal")
	Goto See
  Pain.Mine:
	ELGE A 1 A_Recoil(-16)
	TNT1 A 0 ThrustThingZ(0,11,0,0)
	ELGE A 4
	GoTo See
  Heal:
	ELGE A 5
	TNT1 A 0 A_Jump(40,"Heal2")
	TNT1 A 0 A_Jump(15,"Heal3")
	TNT1 A 0 HealThing(10)
	TNT1 A 0 A_PlaySound("pickups/flask",0,1.0,0)
	TNT1 A 0 A_JumpIf(Health >= 140,"UnFright")
	GoTo See
  Heal2:
	TNT1 A 0
	TNT1 A 0 HealThing(25)
	TNT1 A 0 A_PlaySound("pickups/pstimpack",0,1.0,0)
	TNT1 A 0 A_JumpIf(Health >= 140,"UnFright")
	GoTo See
  Heal3:
	TNT1 A 0
	TNT1 A 0 HealThing(45)
	TNT1 A 0 A_PlaySound("pmed/use",0,1.0,0)
	TNT1 A 0 A_JumpIf(Health >= 140,"UnFright")
	GoTo See
  SnipePain:
	TNT1 A 0
	TNT1 A 0 A_Jump(128,"StopSnipe")
  StartSnipe:
	TNT1 A 0 A_GiveInventory("SnipeOn",1)
	TNT1 A 0 A_ChangeFlag(MISSILEMORE,1)
	TNT1 A 0 A_ChangeFlag(MissileEvenMore,1)
	TNT1 A 0 A_ChangeFlag(NOFEAR,0)
	TNT1 A 0 A_ChangeFlag(FRIGHTENED,1)
	Goto SnipeSee
  StopSnipe:
	TNT1 A 0 A_TakeInventory("SnipeOn",1)
	TNT1 A 0 A_ChangeFlag(MISSILEMORE,0)
	TNT1 A 0 A_ChangeFlag(MissileEvenMore,0)
	TNT1 A 0 A_ChangeFlag(NOFEAR,1)
	TNT1 A 0 A_ChangeFlag(FRIGHTENED,0)
  LowHealth:
	TNT1 A 0 A_GiveInventory("LowHealthCheck",1)
	TNT1 A 0 A_ChangeFlag(NOFEAR,0)
	TNT1 A 0 A_ChangeFlag(FRIGHTENED,1)
	Goto See
  UnFright:
	TNT1 A 0 A_TakeInventory("LowHealthCheck",1)
	TNT1 A 0 A_ChangeFlag(NOFEAR,1)
	TNT1 A 0 A_ChangeFlag(FRIGHTENED,0)
	Goto See
  Death:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("TrueLegMode") == 0,3)
	TNT1 A 0 A_JumpIfInTargetInventory("TrueLegendaryRuneItem",1,"TrueLeg")
	TNT1 A 0 A_JumpIfInTargetInventory("TrueLegendaryRuneItem2",1,"TrueLeg")
    TNT1 A 0 A_Jump(40,"TrueLeg")
  Death2:
	ELGE H 5
	TNT1 A 0 A_Jump(30,"LegendarySoul")
	ELGE I 5 A_Scream
	ELGE J 5 A_Fall
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(298) == 1, "AlwaysDrop")
	TNT1 A 0 A_SpawnItemEx("ExplosiveRifle",0,0,8,random(0,8),random(0,8),2,random(0,360),0,224)
	Stop
  AlwaysDrop:
	TNT1 A 0 A_SpawnItemEx("ExplosiveRifle",0,0,8,random(0,8),random(0,8),2,random(0,360),0,0)
	Stop
  EndDrop:
    TNT1 A 0 A_ChangeFlag(BRIGHT,0)
	ELGE KLM 5
	TNT1 A 0 A_SpawnItem("BodyCrash",0,0,0,0)
	TNT1 A 0 A_Jump(64,3)
	TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("SignetAvaliableTokensCheck") == 2,2)
	TNT1 A 0 A_JumpIfInTargetInventory("SignetActiveToken",1,"SignetResurrect")
	ELGE N 63000 CanRaise
	Stop
  LegendarySoul:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	ELGE I 5 A_Scream
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
    ELGE J 5 A_Fall
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_ChangeFlag(BRIGHT,0)
    ELGE K 5 A_SpawnItem("BodyCrash",0,0,0,0)
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
    ELGE LM 5 
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
    ELGE N 140
	TNT1 A 0 A_ChangeFlag(BRIGHT,1)
	ELGE N 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	ELGE NNNNNNNNNNNNNNNNN 2 A_GiveInventory("ELegSoulEventSmokeSpawner",1)
	ELGE NNNNNNNNNNNNNNNNN 2 A_GiveInventory("ELegSoulEventSmokeSpawner",1)
	ELGE NNNNNNNNNNNNNNNNN 2 A_GiveInventory("ELegSoulEventSmokeSpawner",1)
	TNT1 A 0 A_SpawnItemEx("EnragedLegendarySoul",0,0,16,0,0,0,0,32)
	TNT1 A 0 A_ChangeFlag(BRIGHT,0)
	ELGE N -1
	Stop
  XDeath:
  	ELGE H 5
	TNT1 A 0 A_Jump(30,"LegendarySoul")
	ELGE I 5 A_Scream
	ELGE J 5 A_Fall
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(298) == 1, "AlwaysDrop")
	TNT1 A 0 A_SpawnItemEx("ExplosiveRifle",0,0,8,random(0,8),random(0,8),2,random(0,360),0,224)
	Stop
  XAlwaysDrop:
	TNT1 A 0 A_SpawnItemEx("ExplosiveRifle",0,0,8,random(0,8),random(0,8),2,random(0,360),0,0)
	Goto XEndDrop
  XEndDrop:
    TNT1 A 0 A_ChangeFlag(BRIGHT,0)
	ELGE RSTU 5
	ELGE V 63000 CanRaise
	Stop
	}
}