ACTOR NewEnragedLegendaryGhoul : EnragedLegendaryZombie replaces EnragedLegendaryGhoul
{
//Creator: Eshkere_Jason
//Origin: Divine Infinity
//Sprite: ELGH
//Title: "EnragedLegendaryGhoul"
Health 1450 
Radius 16
Height 56
Mass 550
Speed 24
PainChance 15
Monster
MeleeDamage 25
DamageFactor 0.45
DamageFactor "BombBreath", 0.0
DamageFactor "FiendFire", 0.0
DamageFactor "DTFiendEx", 0.0
DamageFactor "PlasmaBall", 20
DamageFactor "Legendary1", 0.0
DamageFactor "LegendaryPlayer", 0.0
DamageFactor "Legendary", 0.0
DamageFactor "LegendaryGuru", 0.0
DamageFactor "LegendaryGuruPlayer", 0.3
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 "EnragedLegendaryArmor" 70
DropItem "LegendaryPowerSphere" 85 1
DropItem "EnrLegGreaterDemonicEnergy" 200
DropItem "EnrLegDemonicEnergy" 250
DropItem "LegendaryBossLifeEssence" 256
DropItem "LegendaryBossArmorBonusMax" 256
DropItem "LegendaryBossLifeEssence" 128
DropItem "LegendaryBossArmorBonusMax" 128
DropItem "Enraged Legendary Plasmatic Rifle" 76
DropItem "LegendaryRune" 128
DropItem "EnragedLegendaryAmmoSphere", 128
DropItem "EnragedLegTimeFreezeSphere", 128 
Species "Imps"
SeeSound "monster/vulsit"
PainSound "monster/vulpai"
DeathSound "monster/vulhit"
ActiveSound "monster/vulact"
BloodColor "Red"
MeleeSound "imp/melee"
HitObituary "%o was made into a feast for a Enraged Legendary Ghoul."
Obituary "%o was deep impaled by a Enraged Legendary Ghoul."
Tag "\c[m6]Enraged\c- \c[z3]Legendary Ghoul\c-"
+NOTIMEFREEZE
+NOFEAR
+BOSS
+BOSSDEATH
+FLOORCLIP
+MISSILEMORE
+MISSILEEVENMORE
+QUICKTORETALIATE
+NOICEDEATH
+NODROPOFF
+DONTGIB
+NOTARGET
+BRIGHT
var int user_music;
var int user_protection;
var int user_protected;
var int user_missile;
var int user_delay;
var int user_ragewait;
var int user_ragecount;
States
{
  Spawn:
    TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
    ELGH A 10 A_Look
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	ELGH A 10 A_Look
    Loop
  See:
	TNT1 A 0 A_JumpIf(user_music == 1,3)
	TNT1 A 0 ACS_NamedExecuteAlways("InfinityMusic",0,6819,452)
	TNT1 A 0 A_SetUserVar("user_music",1)
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
    ELGH A 0 A_JumpIfTargetInLOS("Strafing")
    ELGH AA 3 A_Chase
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	ELGH BB 3 A_Chase
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItem("FootStep")
	ELGH A 0 A_JumpIfTargetInLOS("Strafing")
	ELGH CC 3 A_Chase
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	ELGH DD 3 A_Chase
	ELGH A 0 A_Jump(80,"Rush")
    TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItem("FootStep")
    Loop
  Rush:
    ELGH A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItem("FootStep")
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("LegZombieGhostAA")
	ELGH A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegZombieGhostAA")
	ELGH A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryZombieGhostBB")
	ELGH B 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryZombieGhostBB")
	ELGH B 1 A_Chase
	TNT1 A 0 A_SpawnItem("FootStep")
    TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("LegZombieGhostCC")
	ELGH C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegZombieGhostCC")
	ELGH C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryZombieGhostDD")
	ELGH D 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryZombieGhostDD")
	ELGH 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)
	ELGH AA 3 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	ELGH BB 3 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_SpawnItem("FootStep")
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    ELGH CC 3 A_GiveInventory("LegZombieStrafingg",1)	
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	ELGH DD 3 A_GiveInventory("LegZombieStrafingg",1)
	Goto See
  Pause:
	TNT1 A 0 A_SetUserVar(user_missile,0)
	ELGH E 0 A_PlaySound("legimp/fiyabetch")
	ELGH EEEEE 3 A_GiveInventory("LegZombieStrafingg",1)
	Goto See
  Melee:
    ELGH EF 6 A_FaceTarget
    ELGH F 5 A_MeleeAttack
	Goto See
  Missile:
	ELGH EEEE 3 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_Jump(120,"Rapid","Super","Seeker","Normal","Fake","SoulAttack")
	TNT1 A 0 A_Jump(67,"Laser","Detonate","ETormLostSoul","Rage")
	ELGH E 3 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 AA 0 A_CustomMissile("Ghoulshot",32,0,Frandom(-1,1),0)
	ELGH F 3 A_PlaySoundEx("Kakuhou/Use","Weapon")
	TNT1 A 0 A_Jump(24,"Pause")
	TNT1 A 0 A_SpidRefire
    TNT1 A 0 A_PlayWeaponSound("BlueDTRFire")
	Goto Missile+4	
  Rapid:
	TNT1 A 0 A_PlaySound("monster/vulpai",0,1,0,ATTN_NONE)
    ELGH EEEEEEEE 3 A_GiveInventory("LegZombieStrafingg",1)
  RapidLoop:
    TNT1 A 0 A_JumpIf(user_missile == 20,"Pause")
    ELGH E 1 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 AA 0 A_CustomMissile("ILegendaryBall",32,0,Frandom(-1,1),0)
	ELGH F 3 A_PlaySoundEx("legimp/chargingsound","Weapon")
	TNT1 A 0 A_PlayWeaponSound("legimp/fiyabetch")
	TNT1 A 0 A_SetUserVar("user_missile",user_missile+1)
	Loop
   Normal:
    ELGH EF 8 A_FaceTarget
	ELGH F 1 A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	TNT1 A 0 A_CustomMissile("ILegendaryBall", 28, 0, 0)
	TNT1 A 0 A_CustomMissile("ILegendaryBall", 28, 0, -5)
	TNT1 A 0 A_CustomMissile("ILegendaryBall", 28, 0, 5)
	TNT1 A 0 A_CustomMissile("ILegendaryBall", 28, 0, -10)
	TNT1 A 0 A_CustomMissile("ILegendaryBall", 28, 0, 10)
	TNT1 A 0 A_CustomMissile("ILegendaryBall", 28, 0, -15)
	TNT1 A 0 A_CustomMissile("ILegendaryBall", 28, 0, 15)
	TNT1 A 0 A_CustomMissile("ILegendaryBall", 28, 0, -20)
	TNT1 A 0 A_CustomMissile("ILegendaryBall", 28, 0, 20)
	TNT1 A 0 A_Jump(88,"Seeker")
	Goto See
  Seeker:
	ELGH EF 10 A_FaceTarget
  SeekerLoop:
    TNT1 A 0 A_JumpIf(user_missile >= 6,"Detox")
	TNT1 A 0 A_PlaySound("imp/attack")
	ELGH F 6 A_CustomMissile("ILegImpSeekBall",32,20,0)
    ELGH F 2 A_FaceTarget
	TNT1 A 0 A_SetUserVar(user_missile,user_missile+1)
	Loop
  Super:
	TNT1 A 0 A_JumpIfCloser(200,"Normal")
	TNT1 A 0 A_PlaySound ("legimp/chargingsound")
	TNT1 A 0 A_SetInvulnerable
  SuperLoop1:
    TNT1 A 0 A_JumpIf(user_missile >= 5,"SuperLoop2")
	ELGH E 0 A_FaceTarget
	ELGH EEEEE 2 A_SpawnItem("ILegImpLineSpawner")
    TNT1 A 0 A_SetUserVar(user_missile,user_missile+1)
	Loop
  SuperLoop2:
	TNT1 A 0 A_JumpIf(user_missile >= 10,"SuperFire")
	ELGH E 0 A_FaceTarget
	ELGH FFFFF 2 A_SpawnItem("ILegImpLineSpawner")
    TNT1 A 0 A_SetUserVar(user_missile,user_missile+1)
	Loop
  SuperFire:
    TNT1 A 0 A_SetUserVar(user_missile,0)
    TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	ELGH F 0 A_CustomMissile ("LegendaryImpRedBall",28,0,-5)
	ELGH F 0 A_CustomMissile ("LegendaryImpRedBall",28,0,5)
	TNT1 A 0 A_playSound ("legimp/fiyabetch")
	TNT1 A 0 A_UnsetInvulnerable
	Goto See
  Laser:
    ELGH E 0 A_SetInvulnerable
	ELGH E 0 A_FaceTarget
	TNT1 A 0 Radius_Quake(8,51,0,20,0)
	TNT1 A 0 A_PlaySound("legbanished/pain",CHAN_AUTO,1.0,False,ATTN_NONE)
  LaserReadyLoop:
    TNT1 A 0 A_JumpIf(user_delay >= 4,"LaserChargeLoop")
	ELGH EEE 0 A_SpawnItem("ELRedeBSmokeSpawner")
    ELGH F 3 A_FaceTarget
	TNT1 A 0 A_SetUserVar(user_delay,user_delay+1)
	Loop
  LaserChargeLoop:
    TNT1 A 0 A_JumpIf(user_delay >= 21,"LaserFire")
    ELGH FF 3 A_FaceTarget
	ELGH FFFF 0 A_SpawnItem("ELRedeBSmokeSpawner")
    TNT1 A 0 A_SetUserVar(user_delay,user_delay+1)
	Loop
  LaserFire:
    TNT1 A 0 A_SetUserVar(user_delay,0)
	ELGH F 0 A_UnSetInvulnerable
	TNT1 A 0 A_PlaySound("legbanished/see",CHAN_AUTO,1.0,False,ATTN_NONE)
	ELGH G 0 A_FaceTarget
	ELGH GGGG 4 A_CustomMissile("ELegBanishedLaserBeam",43)
	ELGH G 0 A_FaceTarget
	ELGH GGGG 4 A_CustomMissile("ELegBanishedLaserBeam",43)
	ELGH G 0 A_FaceTarget
	ELGH GGGG 4 A_CustomMissile("ELegBanishedLaserBeam",43)
	ELGH G 0 A_FaceTarget
	ELGH GGGG 4 A_CustomMissile("ELegBanishedLaserBeam",43)
	TNT1 A 0 A_Jump(48,"Normal")
	TNT1 A 0 A_Jump(148,"Teleport")
	Goto See
  SoulAttack:
    ELGH EEEFF 4 A_FaceTarget
	TNT1 A 0 A_Jump(96,"HuskSpawn")
  SoulAttackLoop:
    TNT1 A 0 A_JumpIf(user_delay == 15,"Rage")
    ELGH GG 3 A_CustomMissile("ETormLostSoul",43)
	ELGH F 2 A_FaceTarget
	TNT1 A 0 A_SetUserVar(user_delay,user_delay+1)
	Loop
  Teleport:
    ELGH A 1 A_UnSetShootable
	ELGH AAAA 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	ELGH AAAAAAAAAA 1  A_FadeOut(0.1,0)
	ELGH A 2 
	ELGH AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
	ELGH AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
    ELGH A 1 A_PlayWeaponSound("boss/teleport")
	ELGH AAAA 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	ELGH AAAAAAAAAA 1 A_FadeIn(0.1)
    ELGH A 1 A_SetShootable
    Goto See
  Fake:
    ELGH EEEEEEE 2 A_FadeOut(0.1)
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
	PLAY AABBCCDDA 2 A_FadeIn(0.1)
  FakeLoop:
    PLAY AABB 2 A_GiveInventory("ApparitionStrafing")
	TNT1 A 0 A_Jump(128,"FakeLookRight")
	TNT1 A 0 A_SetAngle(angle+Random(1,3))
	TNT1 A 0 A_Jump(128,"FakeAttack")
	PLAY CCDD 2 A_GiveInventory("ApparitionStrafing")
	TNT1 A 0 A_Jump(10,"FakeBreak")
	Loop
  FakeLookRight:
    TNT1 A 0 A_SetAngle(angle+Random(-1,-3))
	PLAY CCDD 2 A_GiveInventory("ApparitionStrafing")
	TNT1 A 0 A_Jump(10,"FakeBreak")
	Goto FakeLoop
  FakeAttack:
    PLAY EE 1
    PLAY F 3 A_CustomMissile("ELegSoulBigBall",43)
	Goto FakeLoop
  FakeBreak:
	TNT1 A 0 A_PlaySoundEx("exile/voidend","Voice")
	TNT1 AAAA 0 A_SpawnItem("EnragedHellionSmokeSpawner")
    TNT1 AAAA 0 A_SpawnItemEx("LAWarpSmoke",Random(-24,24),Random(-24,24),Random(12,40),Random(-8,8),Random(-8,8),Random(2,7))
	Goto Normal
  Rage:	
    ELGH E 1 A_JumpIfCloser(1800,1)
    Goto Normal
    ELGH E 1 A_PlaySound("LegFiend/Active")
	ELGH E 0 A_SetInvulnerable
	ELGH E 1 A_FaceTarget
  RageWait:
    TNT1 A 0 A_JumpIf(user_ragewait >= 14,"RageGo")
	TNT1 A 0 A_SetUserVar("user_ragewait",user_ragewait+1)
    ELGH F 0 A_JumpIfTargetInLos(2)
	ELGH F 0 A_Jump(256,2)
	ELGH F 0 A_FaceTarget
	ELGH F 2 A_SpawnItem("ELFiendFlameSpawner")
	Loop
  RageGo:
	TNT1 A 0 A_Jump(96,"Rage2")
    TNT1 A 0 A_SetUserVar("user_ragewait",0) 
	TNT1 A 0 A_SetUserVar("user_ragecount",user_ragecount+1)
	ELGH F 0 A_UnSetInvulnerable
	TNT1 A 0 ThrustThingZ(0,30,0,1)
    TNT1 A 0 A_ChangeFlag(SLIDESONWALLS,1)
	TNT1 A 0 A_ChangeFlag(NOPAIN,1)
	ELGH F 9
	ELGH F 0 A_JumpIfTargetInLos(2)
	ELGH E 0 A_Jump(256,2)
	ELGH E 0 A_FaceTarget
	ELGH E 3
	TNT1 A 0 ThrustThingZ(0,25,0,1)
    ELGH E 2 A_Recoil(-110)
	TNT1 A 0 A_PlaySound("LegFiend/Melee")
  RageLoop:
    TNT1 A 0 A_JumpIf(user_ragewait >= 20,"RageEnd")
	TNT1 A 0 A_SetUserVar("user_ragewait",user_ragewait+1)
	ELGH E 0 A_SpawnItemEx("ELGHGhost",0,0,0,0,0,0,0,128)
	ELGH E 0 A_SpawnItem("ELFiendFlameSpawner")
	ELGH E 0 A_CustomMissile("BigELFLunge",18,0,0,CMF_AIMDIRECTION)
	ELGH E 2 A_FaceTarget
	Loop
  RageEnd:
    TNT1 A 0 A_SetUserVar("user_ragewait",0)
	TNT1 A 0 A_ChangeFlag(SLIDESONWALLS,0)
	TNT1 A 0 A_ChangeFlag(NOPAIN,0)
	TNT1 A 0 A_JumpIf(user_ragecount >= 3,"See")
	TNT1 A 0 A_Jump(148,"RageGo")
	TNT1 A 0 A_SetUserVar("user_ragecount",0)
	Goto See
  Rage2:	
    TNT1 A 0 A_JumpIf(user_ragecount >= 2,"RageGo")
    TNT1 A 0 A_SetUserVar("user_ragewait",0) 
	ELGH E 0 A_FaceTarget
	TNT1 A 0 A_SpawnItemEx("ELGHLungeGhost")
	ELGH E 20
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_SpawnItemEx("ELGHLungeGhost")
	ELGH F 20 
	TNT1 A 0 A_SetUserVar("user_ragecount",user_ragecount+1)
	Goto RageGo
  Detox:
    TNT1 A 0 A_SetUserVar(user_missile,0)
	Goto See
  Pause:
	TNT1 A 0 A_SetUserVar(user_missile,0)
	ELGH E 0 A_PlaySound("weapons/demontechsteam")
	ELGH EEEEE 3 A_GiveInventory("LegZombieStrafingg",1)
	Goto See	
  Pain:
	TNT1 A 0 A_Jump(100,"Protection")
  Pain2:
	TNT1 A 0 A_Jump(192,"PainMissile")
    ELGH G 3 A_GiveInventory("LegZombieStrafingg",1)
    TNT1 A 0 A_Pain
	ELGH G 3 A_GiveInventory("LegZombieStrafingg",1)
    Goto See
  PainMissile: 
	ELGH G 3 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_Pain
	ELGH G 3 A_GiveInventory("LegZombieStrafingg",1)
	Goto Missile	
  Protection:
	TNT1 A 0 A_JumpIf(user_protection >= 10,"Pain2")
	TNT1 A 0 A_JumpIf(user_protected == 4,"Pain2")
	TNT1 A 0 A_PlaySound("legendary/defense")
	TNT1 A 0 A_FaceTarget
	ELGH E 2 ACS_NamedExecuteAlways("EnragedLegendaryProtection")
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	Goto See
   XDeath:
   Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_ChangeFlag("BRIGHT",0)
	ELGH I 8 A_SpawnItemEx("EnragedGibbedGenerator")
    ELGH J 8 A_Scream
    ELGH K 6
    ELGH L 6 A_NoBlocking
    ELGH M 1
    ELGH N -1
	Stop
	}
}

Actor ELGHGhost
{
Scale 1.2
RENDERSTYLE Translucent
Alpha 0.75
+NOGRAVITY
+CLIENTSIDEONLY
+DONTSPLASH
+NOINTERACTION
+NOCLIP
+NOTIMEFREEZE
States
{
Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
    ELGH A 2 A_FadeOut(0.09)
    Wait	
    }
}

Actor ELGHLungeGhost : ELGHGhost
{
Monster


Mass 550
Alpha 0.6
-COUNTKILL
-NOINTERACTION
-NOGRAVITY
-NOCLIP
+THRUSPECIES
var int user_ragewait;
States
{
  Spawn:
	ELGH E 1
	TNT1 A 0 ThrustThingZ(0,35,0,1)
    TNT1 A 0 A_ChangeFlag(SLIDESONWALLS,1)
	ELGH E 9 Bright
	ELGH F 0 A_FaceTarget
	ELGH F 3 Bright
	TNT1 A 0 ThrustThingZ(0,25,0,1)
    ELGH F 2 A_Recoil(-100)
	TNT1 A 0 A_PlaySound("LegFiend/Melee")
  RageLoop:
    TNT1 A 0 A_JumpIf(user_ragewait >= 10,"Death")
	TNT1 A 0 A_SetUserVar("user_ragewait",user_ragewait+1)
	ELGH E 0 A_SpawnItem("ELFiendFlameSpawner")
	ELGH E 0 A_CustomMissile("BigELGHGhostLunge",18,0,0,CMF_AIMDIRECTION)
	ELGH E 2 Bright A_FaceTarget
	Loop
  Death:
	ELGH GGGGG 2 A_FadeOut(0.1)
	Stop
	}
}

ACTOR BigELGHGhostLunge : BigLFLunge
{
Damage 10
Speed 0
Species "Imps"
+EXTREMEDEATH
+FORCERADIUSDMG
+NOTIMEFREEZE
States
{
  Spawn:
	TNT1 A 2
	TNT1 A 1 A_Explode(8,64)
	Stop
  Death:
	TNT1 A 2
	TNT1 A 1 A_Explode(8,64)
	Stop
	}
}