ACTOR FLegendaryTest : CustomInventory
{
+INVBAR
+INVENTORY.AUTOACTIVATE
+INVENTORY.BIGPOWERUP
+INVENTORY.NEVERRESPAWN
Inventory.MaxAmount 8
Inventory.InterHubAmount 8
Inventory.Icon "B3ACZ0"
Inventory.PickupSound "Beacon/Pickup"
Inventory.PickupMessage "Marine Beacon"
Tag "Beacon - Single Marine"
Scale 0.8
States
{
  Spawn:
	B3AC A -1
    Stop
  Use:
	TNT1 A 1 A_SpawnItemEx("FriendlyGeneralRoasterock",30,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0,tid-2)
	Stop
	}
}

ACTOR FriendlyRedHeart : PatriarchOrbitCube1
{
Scale 0.8
Height 4
Radius 2
//RenderStyle "Translucent"
-CLIENTSIDEONLY
+NOTIMEFREEZE
+FORCEXYBILLBOARD
+NOBLOCKMAP
States
{
  Spawn:
	TNT1 AA 0
  Looping:
    FMRK A 1
	TNT1 A 0 A_Warp(AAPTR_MASTER,0,0,tid+20,0,WARPF_ABSOLUTEANGLE|WARPF_NOCHECKPOSITION|WARPF_INTERPOLATE,"Looping")
    FMRK A 1
	TNT1 A 0 A_Warp(AAPTR_MASTER,0,0,tid+20,0,WARPF_ABSOLUTEANGLE|WARPF_NOCHECKPOSITION|WARPF_INTERPOLATE,"Looping")
    FMRK A 1
	TNT1 A 0 A_Warp(AAPTR_MASTER,0,0,tid+20,0,WARPF_ABSOLUTEANGLE|WARPF_NOCHECKPOSITION|WARPF_INTERPOLATE,"Looping")
    FMRK A 1
	TNT1 A 0 A_Warp(AAPTR_MASTER,0,0,tid+20,0,WARPF_ABSOLUTEANGLE|WARPF_NOCHECKPOSITION|WARPF_INTERPOLATE,"Looping")
  Fade:
    FMRK AAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_FadeOut(0.05,0)
	Stop
	}
}

ACTOR SignetFriendlyMessage : Crusaderbuff
{
Inventory.Amount 5
Inventory.MaxAmount 5
States 
{
  Pickup:
	TNT1 A 1
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	stop
	}
}

Actor FLegendaryEffectSpawnerT1
{
Renderstyle Add
//+NOINTERACTION
+NOTIMEFREEZE
+CLIENTSIDEONLY
var int user_delay;
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
	TNT1 AA 0 A_SpawnItemEx("LegArmorSpark",random(-12,12),random(-12,12),random(15,40),frandom(-0.4,0.4),frandom(-0.4,0.4),frandom(0,3),0,0,64)
	TNT1 A 1 A_SpawnItemEx("InvulnSphereParticle",Random(-12,12),Random(-12,12),Random(30,50),Random(-2,2),Random(-2,2),Random(-2,2),Random(-20,20),128)
	Stop
	}
}

Actor MonsterPatroling : AIStrafing
{
  States
  {
  Pickup:
    NULL A 1
    NULL A 1 NoiseAlert(0,0)
	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("StrafeSens",1,3)
	NULL A 1 A_GiveInventory("StrafeSens",1)
	NULL A 1 A_Jump(256,2)
	NULL A 1 A_TakeInventory("StrafeSens",1)
	NULL A 1 A_JumpIfInventory("StrafeSens",1,3)
	NULL A 1 //ThrustThing(angle*256/360+38.7,4,0,0)
	NULL A 1 A_Jump(256,2)
	NULL A 1 //ThrustThing(angle*256/360+38.7,-4,0,0)
	NULL A 1 A_Jump(200,2)
    NULL A 1 A_SetAngle(random(0,359))
	NULL A 1 A_Jump(90,2)
	NULL A 1 //A_Recoil(-1)
    Stop
	NULL A 1 //A_Recoil(1)
    Stop
  }
}

ACTOR FriendlyLegendaryZombie : UACBaseMarine //SOULS NEED +1 IN TID
{ 
Health 1000
Speed 10
BloodColor "Blue"
DamageFactor 0.75
RadiusDamageFactor 0.55
DamageFactor "PlayerNemesisPlasma", 0.0
DamageFactor "VileFires", 0.0
DropItem "LegendaryArmor" 85 1
DropItem "LegAmmoSphere" 88 1
DropItem "LegendaryPowerShard" 35 1
DropItem "HandGrenadeAmmo" 235 2
DropItem "MineAmmo" 235 2
DropItem "Backpack" 198 1
DropItem "Armorplate" 205 1
DropItem "Portablemedkit" 210 1
DropItem "LDemonAmmoBox" 200 
DropItem "LDemonAmmo" 250 
DropItem "LegendaryRune" 30 1
DropItem "Legendary Plasmatic Rifle" 155 1
SeeSound "legzom/sight"
PainSound "legzom/pain"
DeathSound "legzom/death"
ActiveSound "legzom/active"
Obituary "%o was killed by a Friendly Legendary Zombie."
Tag "\c[z3]Friendly Legendary Zombie\c-"
+NOICEDEATH
States
{
  Spawn:
    LPOS A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	LPOS A 10 Bright A_Look
	Goto Idle
  Idle:
	LPOS A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	LPOS A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Look
	LPOS AABB 3 Bright A_GiveInventory("AIPatroling",1)
	LPOS C 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Look
    LPOS CCDD 3 Bright A_GiveInventory("AIPatroling",1)
	Loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  See:
    TNT1 A 0 A_PlaySound("legzom/sight",CHAN_VOICE)
  SeeLoop:
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	LPOS AABB 3 Bright A_Chase
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Jump(16,"GiveUp")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	LPOS CCDD 3 Bright A_Chase
	TNT1 A 0 A_Jump(80,"Rush")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	Loop
  GiveUp:
	LPOS A 10 Bright A_ClearTarget
	Goto Idle
  Rush:
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegZombieGhostA",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LPOS A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegZombieGhostA",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LPOS A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryZombieGhostB",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LPOS B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryZombieGhostB",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LPOS B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_SpawnItemEx("LegZombieGhostC",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LPOS C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegZombieGhostC",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LPOS C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryZombieGhostD",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LPOS D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryZombieGhostD",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LPOS D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Jump(84,"SeeLoop")
	Loop
  Strafing:
	LPOS A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LPOS A 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LPOS A 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LPOS B 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LPOS B 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	LPOS C 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    LPOS C 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    LPOS C 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    LPOS D 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    LPOS D 3 Bright A_GiveInventory("AIStrafing",1)
	Goto SeeLoop
  Pause:
	TNT1 A 0 A_PlaySound("weapons/demontechsteam")
	LPOS EEEEE 3 Bright A_GiveInventory("LegZombieStrafing",1)
	Goto SeeLoop  
  Missile:
	TNT1 A 0 A_SetShootable
	TNT1 A 0 A_UnsetInvulnerable
	TNT1 A 0 A_SetTranslucent(1)
	LPOS EEE 2 Bright A_GiveInventory("LegZombieStrafing",1)
  MissileLoop:
	LPOS E 4 Bright A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_CustomMissile("FLegendaryProjectile",32,0,random(-2,2),0)
	LPOS F 4 Bright A_PlaySoundEx("weapons/DemonTechRifle","Weapon")
	TNT1 A 0 A_Jump(24,"Pause")
	TNT1 A 0 A_MonsterRefire(40,"SeeLoop")
	TNT1 A 0 A_PlayWeaponSound("BlueDTRFire")
	Goto MissileLoop
  Pain:
	TNT1 A 0 A_Jump(30,"Strafing")
	LPOS G 3 Bright A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_Pain
	LPOS G 3 Bright A_GiveInventory("LegZombieStrafing",1)
	Goto SeeLoop
  Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPOS H 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPOS I 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPOS J 5 A_SpawnItem("BodyCrash",0,0,0,0)
    LPOS K 5 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPOS L 140 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPOS L 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LPOS LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LPOS LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LPOS LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid+1)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	LPOS L -1
	Stop
  XDeath:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	LPOS O 3 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    LPOS P 3 A_XScream
    LPOS R 3 A_Fall
    LPOS STUV 3 
    LPOS W -1 
    Stop
  }
}

Actor FriendlyLegendaryZombie2 : FriendlyLegendaryZombie
{
Tag "\c[z3]Friendly Legendary Zombie\c-"
States
{
  Spawn:
    LPOS A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	LPOS A 10 Bright A_Look
	Goto Idle
  Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_RemoveChildren(1)
	LPOS H 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPOS I 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPOS J 5 A_SpawnItem("BodyCrash",0,0,0,0)
    LPOS K 5 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPOS L 140 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPOS L 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LPOS LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LPOS LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LPOS LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	LPOS L -1
	Stop
  XDeath:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	LPOS O 3 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    LPOS P 3 A_XScream
    LPOS R 3 A_Fall
    LPOS STUV 3 
    LPOS W -1 
    Stop
	}
}

ACTOR FLegendaryProjectile : LegendaryProjectile
{
Species "Player"
DamageType "FriendlyMonster"
States
{
   Death:
      TNT1 A 0
      TNT1 A 0 Bright A_SpawnItemEx("LegendaryBlueParticleSpawner", 0, 0, 0, 0, 0, 0, 0, 128)
      TNT1 AAA 0 A_CustomMissile("LegendarySmokeFX4", 0, 0, random(0,360), 2, random(0,360))
      TNT1 A 0 Bright A_SpawnItemEx("LegendaryADemonTechEx",0,0,0,0,0,0,0,128,0)
      TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 0, "DeathSFX")
      Goto Toaster
   DeathSFX:
      TNT1 A 0 Bright A_SpawnItemEx("LegendaryBlueParticleSpawner", 0, 0, 0, 0, 0, 0, 0, 128)
      TNT1 AAA 0 A_CustomMissile("BlueKaboom7", 0, 0, random(0,360), 2, random(0,360))
      TNT1 AAA 0 A_CustomMissile("LegendarySmokeFX4", 0, 0, random(0,360), 2, random(0,360))
      TNT1 A 0 Bright A_SpawnItemEx("LegendaryADemonTechEx",0,0,0,0,0,0,0,128,0)
   Toaster:
      TNT1 A 1 Bright A_Explode(20,64)
      Stop
      }
}

ACTOR FriendlyLegendarySoul : UACBaseMarine
{ 
Health 750
Speed 15
Radius 16
Height 56
Scale 1.2
Damage 25
DamageType "FriendlyMonster"
BloodColor "Blue"
DamageFactor 0.75
RadiusDamageFactor 0.50
DropItem "LegendarySphere" 80 1
DropItem "LegendaryPowerSphere" 75 1
DropItem "LDemonAmmoBox" 120
DropItem "LDemonAmmo" 240
DropItem "BossLifeEssence" 256
DropItem "BossArmorBonusMax" 256
DropItem "Legendary Plasmatic Rifle" 8 1
SeeSound "legsoul/see"
PainSound "legsoul/pain"
DeathSound "legsoul/death"
ActiveSound "legsoul/idle"
AttackSound "legsoul/attack"
Obituary "%o was killed by a friendly Legendary Soul"
Tag "\c[z3]Friendly Legendary Soul\c-"
+FLOAT
+NOGRAVITY
+LOOKALLAROUND
+NOICEDEATH
var int user_ragewait;
var int user_delay;
var int user_timer;
States
{
  Spawn:
    LSOL A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
    LSOL A 10 Bright A_Look
    Goto Idle
  Idle:
    TNT1 A 0 A_SetUserVar(user_woke,0) //Only for monsters
  IdleLoop:
	LSOL A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,0,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK|LOF_NOSEESOUND)
	LSOL AAAAAA 2 Bright A_Wander
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK|LOF_NOSEESOUND)
	LSOL AAAAAA 2 Bright A_Wander
	Loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  See:
    TNT1 A 0 A_JumpIf(user_woke == 1,3)
    TNT1 A 0 A_PlaySound("legsoul/see",CHAN_VOICE)
    TNT1 A 0 A_SetUserVar(user_woke,1)
  SeeLoop:
	TNT1 A 0 A_ChangeFlag(NOPAIN,0)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,0,0,0)
	TNT1 A 0 A_Jump(20,"GiveUp")
	LSOL A 0 A_UnSetInvulnerable
    LSOL AAA 2 Bright A_Chase
	TNT1 A 0 A_Jump(68,"Avoid","Rush")
    Loop
  GiveUp:
	LSOL A 10 Bright A_ClearTarget
	Goto Idle
  Rush:
    TNT1 A 0
	LSOL AA 0 A_Chase
    LSOL A 1 Bright A_SpawnItemEx("LegendarySoulGhost")
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,0,0,0)
	TNT1 A 0 A_Jump(12,"SeeLoop")	
    Loop
  Avoid:
	LSOL B 0
	LSOL B 0 A_SetAngle(angle+random(0,359))
	LSOL B 0 A_Recoil(-50)
	LSOL B 0 A_FaceTarget
	LSOL BBBBBBBBBBBBB 1 Bright A_SpawnItemEx("LegendarySoulGhost2")
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,0,0,0)
	TNT1 A 0 A_Jump(127,"SeeLoop")
	LSOL B 1 Bright A_Stop
    Goto Avoid
  Missile:
    TNT1 A 0 A_SetTranslucent(1)
    TNT1 A 0 A_Jump(48,"Super")
	TNT1 A 0 A_Jump(32,"Rage")
	TNT1 A 0 A_Jump(127,"Proj")
  Normal:
	LSOL B 10 Bright A_FaceTarget
	LSOL B 2 Bright A_SkullAttack(50)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LSOL B 2 Bright A_MonsterRefire(40,"SeeLoop")
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LSOL B 2 Bright A_MonsterRefire(40,"SeeLoop")
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_JumpIf(velx != 0 || vely != 0,2)
	TNT1 A 0 A_Jump(188,"SeeLoop")
	TNT1 A 0 A_Jump(16,"SeeLoop")
	LSOL B 2 Bright A_MonsterRefire(40,"SeeLoop")
	Goto Normal+1	
  Proj:
   	LSOL BBB 3 Bright A_FaceTarget
	LSOL B 0 A_FaceTarget
	LSOL B 4 Bright A_CustomMissile("FLegSoulBall",20,0,random(-3,3))
	LSOL B 0 A_FaceTarget
	LSOL B 4 Bright A_CustomMissile("FLegSoulBall",20,0,random(-3,3))
	LSOL B 0 A_FaceTarget
	LSOL B 4 Bright A_CustomMissile("FLegSoulBall",20,0,random(-3,3))
	LSOL B 0 A_FaceTarget
	LSOL B 4 Bright A_CustomMissile("FLegSoulBall",20,0,random(-3,3))
	LSOL B 0 A_FaceTarget
	LSOL B 4 Bright A_CustomMissile("FLegSoulBall",20,0,random(-3,3))
	LSOL B 0 A_FaceTarget
	LSOL B 4 Bright A_CustomMissile("FLegSoulBall",20,0,random(-3,3))
	Goto SeeLoop
  Rage:	
    LSOL B 1 Bright A_JumpIfCloser(1500,1)
    Goto Normal
    LSOL B 1 Bright A_PlaySound("legsoul/see")
	LSOL B 0 A_SetInvulnerable
	LSOL B 1 Bright A_FaceTarget
  RageWait:
    TNT1 A 0 A_JumpIf(user_ragewait >= 28,"RageGo")
	TNT1 A 0 A_SetUserVar("user_ragewait",user_ragewait+1)
    LSOL B 0 A_JumpIfTargetInLos(2)
	LSOL B 0 A_Jump(256,2)
	LSOL B 0 A_FaceTarget
	LSOL B 2 Bright A_SpawnItem("LFiendFlameSpawner",0,0,0,0)
	Loop
  RageGo:
    TNT1 A 0 A_SetUserVar("user_ragewait",0) 
	LSOL G 0 A_UnSetInvulnerable
	TNT1 A 0 A_ChangeFlag(NOPAIN,1)
	TNT1 A 0 A_CustomMissile("FLegSoulCharge",18,0,0,CMF_AIMDIRECTION)
	TNT1 A 0 A_SpawnItemEx("LegendarySoulGhost2")
	TNT1 A 0 A_SpawnItem("LFiendFlameSpawner",0,0,0,0)
	LSOL B 2 Bright A_SkullAttack(75)
	TNT1 A 0 A_CustomMissile("FLegSoulCharge",18,0,0,CMF_AIMDIRECTION)
	TNT1 A 0 A_SpawnItemEx("LegendarySoulGhost2")
	TNT1 A 0 A_SpawnItem("LFiendFlameSpawner",0,0,0,0)
	LSOL B 2 Bright A_MonsterRefire(40,"SeeLoop")
	TNT1 A 0 A_CustomMissile("FLegSoulCharge",18,0,0,CMF_AIMDIRECTION)
	TNT1 A 0 A_SpawnItemEx("LegendarySoulGhost2")
	TNT1 A 0 A_SpawnItem("LFiendFlameSpawner",0,0,0,0)
	LSOL B 2 Bright A_MonsterRefire(40,"SeeLoop")
	TNT1 A 0 A_CustomMissile("FLegSoulCharge",18,0,0,CMF_AIMDIRECTION)
	TNT1 A 0 A_SpawnItemEx("LegendarySoulGhost2")
	TNT1 A 0 A_SpawnItem("LFiendFlameSpawner",0,0,0,0)
	LSOL B 2 Bright A_MonsterRefire(40,"SeeLoop")
	Goto RageGo+3
  Super:
  	TNT1 A 0 Bright A_PlaySound("legsoul/see")
	TNT1 A 0 A_SetInvulnerable
	TNT1 A 0 A_FaceTarget
	LSOL BBBBB 2 Bright A_SpawnItem("LSoulFlameSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	LSOL BBBBB 2 Bright A_SpawnItem("LSoulFlameSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	LSOL BBBBB 2 Bright A_SpawnItem("LSoulFlameSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	LSOL BBBBB 2 Bright A_SpawnItem("LSoulFlameSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	LSOL BBBBB 2 Bright A_SpawnItem("LSoulFlameSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	LSOL BBBBB 2 Bright A_SpawnItem("LSoulFlameSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	LSOL BBBBB 2 Bright A_SpawnItem("LSoulFlameSpawner",0,0,0,0)
	LSOL B 4 Bright A_CustomMissile("FLegSoulBigBall",20,0,0)
	LSOL B 4 A_UnSetInvulnerable
    Goto SeeLoop
  Pain:
    TNT1 A 0
	TNT1 A 0 A_KillChildren
    TNT1 A 0 A_Jump(8,"Super")	
  	TNT1 A 0 A_Jump(21,"See")	
	TNT1 A 0 A_Jump(128,"PainMissile")
    LSOL C 2 Bright
    LSOL C 2 Bright A_Pain
    Goto SeeLoop
  PainMissile: 
    LSOL C 2 Bright
    LSOL C 2 Bright A_Pain
    Goto Missile
  Death:
  XDeath:
    TNT1 A 0
    TNT1 A 0 A_SetTranslucent(0.75,1)
	LSOL F 0 A_Scream
	TNT1 A 0 A_RemoveChildren(1)
    LSOL FFFFGGGG 2 Bright A_SpawnItemEx("BlueKaboom",random(-32,32),random(-40,40),random(16,48),random(-4,4),random(-4,4),random(0,4),0,SXF_TRANSFERPOINTERS)
	TNT1 AA 0 A_SpawnItemEx("SoulPart1",0,0,Random(10,20),Random(8,-8),Random(8,-8),Random(6,8))
	TNT1 A 0 A_SpawnItemEx("SoulPart2",0,0,Random(10,20),Random(8,-8),Random(8,-8),Random(6,8))
	TNT1 AA 0 A_SpawnItemEx("SoulPart3",0,0,Random(10,20),Random(8,-8),Random(8,-8),Random(6,8))
    LSOL H 4 Bright
    TNT1 AA 0 A_SpawnItemEx("BlueParticleSpawner", 0, 0, 0, 0, 0, 0, 0, 128) 
	TNT1 AAAA 0 A_CustomMissile("SmokeFX2", 0, 0, random(0,360), 2, random(0,360))
    LSOL I 4 Bright A_NoBlocking
    LSOL JK 4 Bright
    Stop
  }
}

ACTOR FLegSoulBall : LegSoulBall
{
Damage 16
Species "Player"
DamageType "FriendlyMonster"
+MTHRUSPECIES
States
{
  Spawn:
    TNT1 A 0 A_SpawnItemEx("BFGTrailParticleBlue",Random(-12,12),Random(-12,12),Random(-12,12),Random(-2,2),Random(-2,2),Random(-2,2),Random(-20,20),128)
	LSA1 AB 3 Bright
	TNT1 A 0 A_SpawnItemEx("BFGTrailParticleBlue",Random(-12,12),Random(-12,12),Random(-12,12),Random(-2,2),Random(-2,2),Random(-2,2),Random(-20,20),128)
	LSA1 CD 3 Bright
    Loop
  Death:
    TNT1 A 0
    TNT1 A 0 A_SpawnItemEx("BlueParticleSpawner", 0, 0, 0, 0, 0, 0, 0, 128)
	TNT1 AAA 0 A_CustomMissile("Kaboom6", 0, 0, random(0,360), 2, random(0,360))
	TNT1 AAA 0 A_CustomMissile("SmokeFX4", 0, 0, random(0,360), 2, random(0,360))
    LSA1 EFGHIJ 3 Bright
    LSA1 K 1
    Stop
  }
}

Actor FLegSoulBigBall : LegSoulBigBall
{
Damage 55
Species "Player"
DamageType "FriendlyMonster"
+MTHRUSPECIES
States
{
  Spawn:
	LSA2 ABCD 2 Bright A_SpawnItemEx("LegSoulBigBallTrail",0,0,2,0,0,0,0,128,0)
	Loop
  Death:
  
  	TNT1 A 0 A_SpawnItemEx("BFGShockwaveGold", 0, 0, 0, 0, 0, 0, 0, 128)
    TNT1 AAAAAA 0 A_CustomMissile("KaboomGold", 0, 0, random(0,360), 2, random(0,360))
    TNT1 AAA 0 A_SpawnItemEx("LegendaryGoldParticleSpawner", 0, 0, 0, 0, 0, 0, 0, 128)
	TNT1 A 0 A_Explode(735,300,0)
	LSA2 EFG 4 Bright
	Stop
 }
}

ACTOR FLegSoulCharge : LegSoulCharge
{
Damagetype "FriendlyMonster"
States
{
Spawn:
TNT1 A 2
TNT1 A 1 A_Explode(120,412,0)
Stop
Death:
TNT1 A 2
TNT1 A 1 A_Explode(120,412,0)
Stop
}
}

ACTOR FriendlyLegendaryImp : UACBaseMarine
{ 
Health 1000
Speed 8
Radius 20
Height 56
MeleeDamage 15
BloodColor "Blue"
PainChance 50
DamageFactor 0.75
RadiusDamageFactor 0.50
DropItem "LegendaryBossLifeEssence" 256
DropItem "LegendaryBossArmorBonusMax" 256
DropItem "Legendary Plasmatic Rifle" 30 1
DropItem "LegendarySphere" 90 1
DropItem "LegendaryPowerSphere" 85 1
DropItem "LegGreaterDemonicEnergy" 200
DropItem "LegDemonicEnergy" 250
SeeSound "legimp/sight"
PainSound "legimp/pain"
DeathSound "legimp/death"
ActiveSound "legimp/active"
MeleeSound "imp/melee"
Obituary "%o was killed by a friendly Legendary Imp"
Tag "\c[z3]Friendly Legendary Imp\c-"
+FLOAT
+NOGRAVITY
+LOOKALLAROUND
+NOICEDEATH
States
{
  Spawn:
    LEGN A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	LEGN A 10 Bright A_Look
    Goto Idle
  Idle:
    TNT1 A 0 A_SetuserVar(user_woke,0)
  IdleLoop:
	LEGN A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK|LOF_NOSEESOUND)
	LEGN AABB 3 Bright A_Wander
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK|LOF_NOSEESOUND)
	LEGN CCDD 3 Bright A_Wander
	TNT1 A 0 A_Jump(30,"Teleport")
	TNT1 A 0 A_Jump(62,"RushIdle")
	TNT1 A 0 A_Jump(50,"AirDodge")
	Loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  See:
    TNT1 A 0 A_JumpIf(user_woke == 1,3)
    TNT1 A 0 A_PlaySound("legimp/sight",CHAN_VOICE)
    TNT1 A 0 A_SetuserVar(user_woke,1)
  SeeLoop:
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Jump(20,"GiveUp")
    LEGN AABBCCDD 3 Bright A_Chase
	TNT1 A 0 A_Jump(30,"Teleport")
	TNT1 A 0 A_Jump(62,"Rush")
	TNT1 A 0 A_Jump(50,"AirDodge")
	Loop
  GiveUp:
    TNT1 A 0 A_ClearTarget
	LEGN ABCD 3 Bright
	Goto Idle
  AirDodge:
	LEGN A 0 A_Jump(255,"Right","Left","Back","BackLeftRange","BackRightRange")
	Goto See
  Right:
	LEGN A 0 ThrustThing(angle*256/360+64,30,0,0)
	LEGN A 5 Bright
	LEGN A 0 A_JumpIf(user_woke == 0, "Idle")
	Goto See
  Left:
	LEGN A 0 ThrustThing(angle*256/360+192,30,0,0)
	LEGN A 5 Bright
	LEGN A 0 A_JumpIf(user_woke == 0, "Idle")
	Goto See
  Back:
	LEGN A 0 ThrustThing(angle*256/360+128,30,0,0)
	LEGN A 5 Bright
	LEGN A 0 A_JumpIf(user_woke == 0, "Idle")
	Goto See
  BackLeftRange:
	ELGN A 0 ThrustThing(angle*256/360+random(133,187),30,0,0)
	LEGN A 5 Bright
	LEGN A 0 A_JumpIf(user_woke == 0, "Idle")
	Goto See
  BackRightRange:
	LEGN A 0 ThrustThing(angle*256/360+random(69,123),30,0,0)
	LEGN A 5 Bright
	LEGN A 0 A_JumpIf(user_woke == 0, "Idle")
	Goto See
  Rush:
	TNT1 A 0 A_SpawnItemEx("LegendaryImpGhost")	
	LEGN A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryImpGhost")	
	LEGN A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryImpGhost")	
	LEGN A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryImpGhost")	
	LEGN A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryImpGhost")	
	LEGN A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryImpGhost")	
	LEGN A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryImpGhost")	
	LEGN A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryImpGhost")	
	LEGN A 1 Bright A_Chase
	TNT1 A 0 A_Jump(84,"See")
	Loop
  RushIdle:
	TNT1 A 0 A_SpawnItemEx("LegendaryImpGhost")	
	LEGN A 1 Bright A_Wander
	TNT1 A 0 A_SpawnItemEx("LegendaryImpGhost")	
	LEGN A 1 Bright A_Wander
	TNT1 A 0 A_SpawnItemEx("LegendaryImpGhost")	
	LEGN A 1 Bright A_Wander
	TNT1 A 0 A_SpawnItemEx("LegendaryImpGhost")	
	LEGN A 1 Bright A_Wander
	TNT1 A 0 A_SpawnItemEx("LegendaryImpGhost")	
	LEGN A 1 Bright A_Wander
	TNT1 A 0 A_SpawnItemEx("LegendaryImpGhost")	
	LEGN A 1 Bright A_Wander
	TNT1 A 0 A_SpawnItemEx("LegendaryImpGhost")	
	LEGN A 1 Bright A_Wander
	TNT1 A 0 A_SpawnItemEx("LegendaryImpGhost")	
	LEGN A 1 Bright A_Wander
	TNT1 A 0 A_Jump(84,"idle")
	Loop
  Teleport:
    LEGN A 1 Bright A_UnSetShootable
	LEGN AAAA 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	LEGN AAAAAAAAAA 1  A_FadeOut(0.1,0)
	LEGN A 2 
	LEGN AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
	LEGN AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
    LEGN A 1 A_PlayWeaponSound("boss/teleport")
	LEGN AAAA 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	LEGN AAAAAAAAAA 1 A_FadeIn(0.1)
    LEGN A 1 Bright A_SetShootable
	LEGN A 0 A_JumpIf(user_woke == 0, "Idle")
    Goto See
  Melee:
    LEGN EF 6 Bright A_FaceTarget
    LEGN F 5 Bright A_MeleeAttack
	Goto See
  Missile:
    TNT1 A 0 A_SetShootable
    TNT1 A 0 A_UnsetInvulnerable
    TNT1 A 0 A_SetTranslucent(1)
    TNT1 A 0 A_Jump(32,"Super")
    TNT1 A 0 A_Jump(64,"Seeker")
  Normal:
    LEGN EF 8 Bright A_FaceTarget
	LEGM F 1 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	TNT1 A 0 A_CustomMissile("FLegendaryBall", 28, 0, 0)
	TNT1 A 0 A_CustomMissile("FLegendaryBall", 28, 0, -5)
	TNT1 A 0 A_CustomMissile("FLegendaryBall", 28, 0, 5)
	TNT1 A 0 A_CustomMissile("FLegendaryBall", 28, 0, -10)
	TNT1 A 0 A_CustomMissile("FLegendaryBall", 28, 0, 10)
	TNT1 A 0 A_Jump(88,"Seeker")
	Goto See
  Seeker:
	LEGN EF 10 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	LEGM F 6 Bright A_CustomMissile("FLegImpSeekBall",32,20,0)
    LEGM F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	LEGM F 6 Bright A_CustomMissile("FLegImpSeekBall",32,20,0)
    LEGM F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	LEGM F 6 Bright A_CustomMissile("FLegImpSeekBall",32,20,0)
	LEGM F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	LEGM F 6 Bright A_CustomMissile("FLegImpSeekBall",32,20,0)
    LEGM F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	LEGM F 6 Bright A_CustomMissile("FLegImpSeekBall",32,20,0)
    LEGM F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	LEGM F 6 Bright A_CustomMissile("FLegImpSeekBall",32,20,0)
	Goto See
  Super:
	TNT1 A 0 A_JumpIfCloser(200,"Normal")
	TNT1 A 0 A_PlaySound ("legimp/chargingsound")
	TNT1 A 0 A_SetInvulnerable
	LEGN E 0 A_FaceTarget
	LEGN EEEEE 2 Bright A_SpawnItem("LegImpLineSpawner",0,0,0,0)
	LEGN E 0 A_FaceTarget
	LEGN EEEEE 2 Bright A_SpawnItem("LegImpLineSpawner",0,0,0,0)
	LEGN E 0 A_FaceTarget
	LEGN EEEEE 2 Bright A_SpawnItem("LegImpLineSpawner",0,0,0,0)
	LEGN E 0 A_FaceTarget
	LEGN EEEEE 2 Bright A_SpawnItem("LegImpLineSpawner",0,0,0,0)
	LEGN E 0 A_FaceTarget
	LEGN EEEEE 2 Bright A_SpawnItem("LegImpLineSpawner",0,0,0,0)
	LEGN F 0 A_FaceTarget
	LEGN FFFFF 2 Bright A_SpawnItem("LegImpLineSpawner",0,0,0,0)
	LEGN F 0 A_FaceTarget
	LEGN FFFFF 2 Bright A_SpawnItem("LegImpLineSpawner",0,0,0,0)
	LEGN F 0 A_FaceTarget
	LEGN FFFFF 2 Bright A_SpawnItem("LegImpLineSpawner",0,0,0,0)
	LEGN F 0 A_FaceTarget
	LEGN FFFFF 2 Bright A_SpawnItem("LegImpLineSpawner",0,0,0,0)
	LEGN F 0 A_FaceTarget
	LEGN FFFFF 2 Bright A_SpawnItem("LegImpLineSpawner",0,0,0,0)
	LEGM F 6 Bright A_CustomMissile ("FLegendaryImpBlueBall2",28,0,0)
	TNT1 A 0 A_playSound ("legimp/fiyabetch")
	TNT1 A 0 A_UnsetInvulnerable
	Goto See
  Pain:
    TNT1 A 0 A_Jump(50,"Teleport")
    LEGN H 2 Bright
	LEGN H 2 Bright A_Pain
	Goto See
  Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	LEGN I 8
    LEGN J 8 A_Scream
    LEGN K 6
    LEGN L 6 A_NoBlocking
    LEGN M 1
    LEGN N -1
	Stop
  XDeath:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	LEGN O 4 A_SpawnItemEx("LegBlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
	LEGN P 4 A_XScream
	LEGN Q 4 A_NoBlocking
	LEGN RSTU 4
	LEGN V -1
	Stop
  }
}

Actor FriendlyLegendaryImp2 : FriendlyLegendaryImp
{
Tag "\c[z3]Friendly Legendary Imp\c-"
States
{
  Spawn:
    LEGN A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	LEGN A 10 Bright A_Look
    Goto Idle
  Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	LEGN I 8
    LEGN J 8 A_Scream
    LEGN K 6
    LEGN L 6 A_NoBlocking
    LEGN M 1
    LEGN N -1
	Stop
  XDeath:
	TNT1 A 0 A_StopSound(6)
	LEGN O 4 A_SpawnItemEx("LegBlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
	LEGN P 4 A_XScream
	LEGN Q 4 A_NoBlocking
	LEGN RSTU 4
	LEGN V -1
	Stop
	}
}

Actor FLegendaryBall : LegendaryBall { Species "Player" DamageType "FriendlyMonster" +MTHRUSPECIES }

Actor FLegImpSeekBall : LegImpSeekBall { Species "Player" DamageType "FriendlyMonster" +MTHRUSPECIES }


Actor FLegendaryImpBlueBall2 : LegendaryImpBlueBall2
{
Species "Player"
DamageType "FriendlyMonster"
+MTHRUSPECIES
States
{
  Spawn:
	TNT1 A 0 NoDelay A_PlaySound("legball/fly",6,1.0,1)
	Goto Fly
  Fly:
	LIBB A 3 Bright A_CustomMissile("FLegBallAttack2",random(-1,1),random(-2,2),0,CMF_AIMDIRECTION|CMF_TRACKOWNER)
	TNT1 A 0 A_SpawnItemEx("BlueBallTrailA")
	TNT1 A 0 A_SpawnItemEx("BlueBallTrailB")
	TNT1 A 0 A_SpawnItemEx("BlueBallTrailC")
	LIBB B 3 Bright A_CustomMissile("FLegBallAttack2",random(-1,1),random(-2,2),0,CMF_AIMDIRECTION|CMF_TRACKOWNER)
	TNT1 A 0 A_SpawnItemEx("BlueBallTrailA")
	TNT1 A 0 A_SpawnItemEx("BlueBallTrailB")
	TNT1 A 0 A_SpawnItemEx("BlueBallTrailC")
	LIBB C 3 Bright A_CustomMissile("FLegBallAttack2",random(-1,1),random(-2,2),0,CMF_AIMDIRECTION|CMF_TRACKOWNER)
	TNT1 A 0 A_SpawnItemEx("BlueBallTrailA")
	TNT1 A 0 A_SpawnItemEx("BlueBallTrailB")
	TNT1 A 0 A_SpawnItemEx("BlueBallTrailC")
	LIBB D 3 Bright A_CustomMissile("FLegBallAttack2",random(-1,1),random(-2,2),0,CMF_AIMDIRECTION|CMF_TRACKOWNER)
	TNT1 A 0 A_SpawnItemEx("BlueBallTrailA")
	TNT1 A 0 A_SpawnItemEx("BlueBallTrailB")
	TNT1 A 0 A_SpawnItemEx("BlueBallTrailC")
	Loop
  Death:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_Explode(158,138,0)
	TNT1 A 0 Radius_Quake(20,12,0,12,0)
	LIBE ABCDEFG 4
	Stop
	}
}

Actor FLegBallAttack2 : LegBallAttack2
{
Species "Player"
DamageType "FriendlyMonster"
+MTHRUSPECIES
States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_CopyFriendliness(AAPTR_TARGET)
	TNT1 A 0 A_RearrangePointers(AAPTR_NULL, AAPTR_TARGET, AAPTR_NULL)
	TNT1 AAAAA 1 A_LookEx(LOF_NOSOUNDCHECK|LOF_NOSEESOUND,0,1250,0,360,"Attack")
	Goto Death
  Attack:
	TNT1 A 0
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_RearrangePointers(AAPTR_MASTER, AAPTR_MASTER, AAPTR_NULL)
	TNT1 A 1 A_CustomRailgun(5,0,None,"Blue",RGF_SILENT|RGF_FULLBRIGHT,0,12,"FLegendaryImpPuff",0,0,0,0,10,0,"Leg10kRailParticle")
	Goto Death
	}
}

Actor FLegendaryImpPuff : LegendaryImpPuff { Species "Player" DamageType "FriendlyMonster" }

ACTOR FriendlyLegendaryPhaseImp : UACBaseMarine
{ 
Health 1000
Scale 1.1
Speed 15
Radius 20
Height 56
MeleeDamage 15
BloodColor "Blue"
PainChance 50
DamageFactor 0.75
RadiusDamageFactor 0.50
DropItem "LegendaryBossLifeEssence" 256
DropItem "LegendaryBossArmorBonusMax" 256
DropItem "Legendary Plasmatic Rifle" 30 1
DropItem "LegendarySphere" 90 1
DropItem "LegendaryPowerSphere" 85 1
DropItem "LegGreaterDemonicEnergy" 200
DropItem "LegDemonicEnergy" 250
SeeSound "LPhaseImp/sight"
PainSound "LPhaseImp/pain"
DeathSound "LPhaseImp/death"
ActiveSound "LPhaseImp/active"
MeleeSound "imp/melee"
Obituary "%o was killed by a friendly Legendary Phase Imp"
Tag "\c[z3]Friendly Legendary Phase Imp\c-"
+LOOKALLAROUND
+NOICEDEATH
States
{
  Spawn:
    LPHA A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	LPHA A 10 Bright A_Look
    Goto Idle
  Idle:
    TNT1 A 0 A_SetuserVar(user_woke,0)
	LPHA A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK|LOF_NOSEESOUND)
    TNT1 A 0 A_Jump(46,"RushIdle")
	LPHA AABB 3 Bright A_Wander
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK|LOF_NOSEESOUND)
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	LPHA CCDD 3 Bright A_Wander
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
    TNT1 A 0 A_Jump(46,"PhaseIdle")	
	Loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  See:
    TNT1 A 0 A_JumpIf(user_woke == 1,3)
    TNT1 A 0 A_PlaySound("LPhaseImp/sight",CHAN_VOICE)
    TNT1 A 0 A_SetuserVar(user_woke,1)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Jump(20,"GiveUp")
	TNT1 A 0 A_Jump(46,"Rush","Evade")
    LPHA AABB 3 Bright A_Chase
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	LPHA CCDD 3 Bright A_Chase
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
    TNT1 A 0 A_Jump(46,"Phase")	
	Loop
  GiveUp:
    TNT1 A 0 A_ClearTarget
	LPHA A 10 Bright
	Goto Idle
  Rush:
	LPHA A 1 A_Chase
	LPHA A 0 A_Chase
	LPHA A 1 A_Chase
	LPHA A 0 A_Chase
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	LPHA B 1 A_Chase
	LPHA A 0 A_Chase
	LPHA B 1 A_Chase
	LPHA A 0 A_Chase
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	LPHA C 1 A_Chase
	LPHA A 0 A_Chase
	LPHA C 1 A_Chase
	LPHA A 0 A_Chase
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	LPHA D 1 A_Chase
	LPHA A 0 A_Chase
	LPHA D 1 A_Chase
	LPHA A 0 A_Chase
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	LPHA A 1 A_Chase
	LPHA A 0 A_Chase
	LPHA A 1 A_Chase
	LPHA A 0 A_Chase
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	LPHA B 1 A_Chase
	LPHA A 0 A_Chase
	LPHA B 1 A_Chase
	LPHA A 0 A_Chase
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	LPHA C 1 A_Chase
	LPHA A 0 A_Chase
	LPHA C 1 A_Chase
	LPHA A 0 A_Chase
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	LPHA D 1 A_Chase
	LPHA A 0 A_Chase
	LPHA D 1 A_Chase
	LPHA A 0 A_Chase
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	TNT1 A 0 A_Jump(48,"See")
	Loop
  RushIdle:
	LPHA A 1 A_Wander
	LPHA A 0 A_Wander
	LPHA A 1 A_Wander
	LPHA A 0 A_Wander
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	LPHA B 1 A_Wander
	LPHA A 0 A_Wander
	LPHA B 1 A_Wander
	LPHA A 0 A_Wander
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	LPHA C 1 A_Wander
	LPHA A 0 A_Wander
	LPHA C 1 A_Wander
	LPHA A 0 A_Wander
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	LPHA D 1 A_Wander
	LPHA A 0 A_Wander
	LPHA D 1 A_Wander
	LPHA A 0 A_Wander
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	LPHA A 1 A_Wander
	LPHA A 0 A_Wander
	LPHA A 1 A_Wander
	LPHA A 0 A_Wander
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	LPHA B 1 A_Wander
	LPHA A 0 A_Wander
	LPHA B 1 A_Wander
	LPHA A 0 A_Wander
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	LPHA C 1 A_Wander
	LPHA A 0 A_Wander
	LPHA C 1 A_Wander
	LPHA A 0 A_Wander
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	LPHA D 1 A_Wander
	LPHA A 0 A_Wander
	LPHA D 1 A_Wander
	LPHA A 0 A_Wander
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	TNT1 A 0 A_Jump(48,"Idle")
	Loop
  Evade:
	TNT1 A 0 A_Jump(128,7)
	TNT1 A 0 ThrustThing(Angle*256/360+64,16,0,0)
	LPHA AAAA 3 A_Chase
	TNT1 A 0 A_Stop
	Goto See
	TNT1 A 0 ThrustThing(Angle*256/360+192,16,0,0)
	LPHA AAAA 3 A_Chase
	TNT1 A 0 A_Stop
	Goto See
  Phase:
	TNT1 A 0 A_PlaySound("phaseimp/teleport")
	LPHA E 2 A_FaceTarget
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.75)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.55)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.35)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.15)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
  Phased:
	LPHA AABBCCDDAABBCCDD 1 A_ExtChase(0,0)
	LPHA AABBCCDDAABBCCDDAABBCCDDAABBCCDD 1 A_Chase
	TNT1 A 0 A_Jump(24,"UnPhase","PhasedRun")
	Goto Phased+32
  UnPhase:
	TNT1 A 0 A_PlaySound("phaseimp/teleport")
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.15)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.35)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.55)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.75)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SetTranslucent(1)
	LPHA E 2 A_FaceTarget	
    Goto See
  PhaseIdle:
	TNT1 A 0 A_PlaySound("phaseimp/teleport")
	LPHA E 2 //A_FaceTarget
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.75)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.55)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.35)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.15)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
  PhasedIdle:
	LPHA AABBCCDDAABBCCDD 1 A_Wander
	LPHA AABBCCDDAABBCCDDAABBCCDDAABBCCDD 1 A_Wander
	TNT1 A 0 A_Jump(24,"UnPhaseIdle","PhasedRunIdle")
	Goto PhasedIdle+32
  UnPhaseIdle:
	TNT1 A 0 A_PlaySound("phaseimp/teleport")
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.15)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.35)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.55)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.75)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SetTranslucent(1)
	LPHA E 2 //A_FaceTarget	
    Goto Idle
  PhaseRun:
	TNT1 A 0 A_UnSetShootable
	TNT1 A 0 A_ChangeFlag(FRIGHTENED,1)
	TNT1 A 0 A_PlaySound("phaseimp/teleport")
	LPHA E 2 A_FaceTarget
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.75)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.55)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.35)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.15)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
  PhasedRun:
	LPHA A 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA A 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA B 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA B 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA C 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA C 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA D 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA D 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA A 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA A 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA B 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA B 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA C 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA C 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA D 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA D 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	TNT1 A 0 A_Jump(64,"UnPhaseRun")
	Loop
  UnPhaseRun:
	TNT1 A 0 A_SetShootable
	TNT1 A 0 A_ChangeFlag(FRIGHTENED,0)
	TNT1 A 0 A_PlaySound("phaseimp/teleport")
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.15)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.35)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.55)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.75)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SetTranslucent(1)
	LPHA E 2 A_FaceTarget	
    Goto See
  PhaseRunIdle:
	TNT1 A 0 A_UnSetShootable
	TNT1 A 0 A_ChangeFlag(FRIGHTENED,1)
	TNT1 A 0 A_PlaySound("phaseimp/teleport")
	LPHA E 2 //A_FaceTarget
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.75)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.55)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.35)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.15)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
  PhasedRunIdle:
	LPHA A 1 A_Wander
	LPHA A 0 A_Wander
	LPHA A 1 A_Wander
	LPHA A 0 A_Wander
	LPHA B 1 A_Wander
	LPHA A 0 A_Wander
	LPHA B 1 A_Wander
	LPHA A 0 A_Wander
	LPHA C 1 A_Wander
	LPHA A 0 A_Wander
	LPHA C 1 A_Wander
	LPHA A 0 A_Wander
	LPHA D 1 A_Wander
	LPHA A 0 A_Wander
	LPHA D 1 A_Wander
	LPHA A 0 A_Wander
	LPHA A 1 A_Wander
	LPHA A 0 A_Wander
	LPHA A 1 A_Wander
	LPHA A 0 A_Wander
	LPHA B 1 A_Wander
	LPHA A 0 A_Wander
	LPHA B 1 A_Wander
	LPHA A 0 A_Wander
	LPHA C 1 A_Wander
	LPHA A 0 A_Wander
	LPHA C 1 A_Wander
	LPHA A 0 A_Wander
	LPHA D 1 A_Wander
	LPHA A 0 A_Wander
	LPHA D 1 A_Wander
	LPHA A 0 A_Wander
	TNT1 A 0 A_Jump(64,"UnPhaseRunIdle")
	Loop
  UnPhaseRunIdle:
	TNT1 A 0 A_SetShootable
	TNT1 A 0 A_ChangeFlag(FRIGHTENED,0)
	TNT1 A 0 A_PlaySound("phaseimp/teleport")
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.15)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.35)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.55)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.75)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SetTranslucent(1)
	LPHA E 2 //A_FaceTarget	
    Goto idle
  Melee:
	LPHA EF 5 A_FaceTarget
	LPHA G 5 A_MeleeAttack
	LPHA FE 5 A_FaceTarget	
    Goto See
  Missile:
	TNT1 A 0 A_Jump(128,"FastMissile")
	TNT1 A 0 A_Jump(64,"Surprise","Laser")
	TNT1 A 0 Bright A_PlaySound("LPhaseImp/attack",7)
	LPHA EF 6 A_FaceTarget
	TNT1 A 0 Bright A_PlaySound("imp/attack")
	LPHA G 5 Bright A_CustomMissile("FLegImpSeekBall", 32, 0, 0)
	LPHA FE 4
	LPHA F 4 A_FaceTarget
	TNT1 A 0 Bright A_PlaySound("imp/attack")
	LPHA G 5 Bright A_CustomMissile("FLegImpSeekBall", 32, 0, 0)
	TNT1 A 0 ThrustThing(Angle*256/360+random(64,192),16,0,0)
	LPHA FEF 4
	TNT1 A 0 A_Stop
	TNT1 A 0 Bright A_PlaySound("imp/attack")
	LPHA G 5 Bright A_CustomMissile("FLegImpSeekBall", 32, 0, 0)
	LPHA FE 4
	LPHA F 4 A_FaceTarget
	TNT1 A 0 Bright A_PlaySound("imp/attack")
	LPHA G 5 Bright A_CustomMissile("FLegImpSeekBall", 32, 0, 0)
	TNT1 A 0 ThrustThing(Angle*256/360+random(64,192),16,0,0)
	LPHA FEF 4
	TNT1 A 0 A_Stop
	TNT1 A 0 Bright A_PlaySound("imp/attack")
	LPHA G 5 Bright A_CustomMissile("FLegImpSeekBall", 32, 0, 0)
	LPHA FE 4
	LPHA F 4 A_FaceTarget
	TNT1 A 0 Bright A_PlaySound("imp/attack")
	LPHA G 5 Bright A_CustomMissile("FLegImpSeekBall", 32, 0, 0)
	LPHA FEF 3
	TNT1 A 0 A_Stop
	Goto See
  FastMissile:
	TNT1 A 0 Bright A_PlaySound("LPhaseImp/attack",7)
	LPHA EF 4 A_FaceTarget
	TNT1 A 0 Bright A_PlaySound("imp/attack")
	LPHA G 3 Bright A_CustomMissile("FLegImpSeekBall", 32, 0, 0)
	LPHA FE 2
	LPHA F 2 A_FaceTarget
	TNT1 A 0 Bright A_PlaySound("imp/attack")
	LPHA G 3 Bright A_CustomMissile("FLegImpSeekBall", 32, 0, 0)
	TNT1 A 0 ThrustThing(Angle*256/360+random(64,192),32,0,0)
	LPHA FEF 2
	TNT1 A 0 A_Stop
	TNT1 A 0 Bright A_PlaySound("imp/attack")
	LPHA G 3 Bright A_CustomMissile("FLegImpSeekBall", 32, 0, 0)
	LPHA FE 2
	LPHA F 2 A_FaceTarget
	TNT1 A 0 Bright A_PlaySound("imp/attack")
	LPHA G 3 Bright A_CustomMissile("FLegImpSeekBall", 32, 0, 0)
	TNT1 A 0 ThrustThing(Angle*256/360+random(64,192),32,0,0)
	LPHA FEF 2
	TNT1 A 0 A_Stop
	TNT1 A 0 Bright A_PlaySound("imp/attack")
	LPHA G 3 Bright A_CustomMissile("FLegImpSeekBall", 32, 0, 0)
	LPHA FE 2
	LPHA F 2 A_FaceTarget
	TNT1 A 0 Bright A_PlaySound("imp/attack")
	LPHA G 3 Bright A_CustomMissile("FLegImpSeekBall", 32, 0, 0)
	LPHA FEF 3
	TNT1 A 0 A_Stop
	Goto See
  Laser:
	TNT1 A 0 Bright A_PlaySound("LPhaseImp/attack",7)
	LPHA EF 6 A_FaceTarget
	TNT1 A 0 Bright A_PlaySound("imp/attack")
	LPHA G 4 Bright A_CustomMissile("FLegPhaseLaser", 32, 0, 0)
	TNT1 A 0 A_Facetarget
	LPHA G 4 Bright A_CustomMissile("FLegPhaseLaser", 32, 0, 0)
	TNT1 A 0 A_Facetarget
	LPHA G 4 Bright A_CustomMissile("FLegPhaseLaser", 32, 0, 0)
	TNT1 A 0 A_Facetarget
	LPHA G 4 Bright A_CustomMissile("FLegPhaseLaser", 32, 0, 0)
	TNT1 A 0 A_Facetarget
	LPHA G 4 Bright A_CustomMissile("FLegPhaseLaser", 32, 0, 0)
	TNT1 A 0 A_Facetarget
	LPHA G 4 Bright A_CustomMissile("FLegPhaseLaser", 32, 0, 0)
	TNT1 A 0 A_Facetarget
	LPHA G 4 Bright A_CustomMissile("FLegPhaseLaser", 32, 0, 0)
	TNT1 A 0 A_Facetarget
	LPHA G 4 Bright A_CustomMissile("FLegPhaseLaser", 32, 0, 0)
	TNT1 A 0 A_Facetarget
	LPHA G 4 Bright A_CustomMissile("FLegPhaseLaser", 32, 0, 0)
	TNT1 A 0 A_Facetarget
	TNT1 A 0 ThrustThing(Angle*256/360+random(64,192),32,0,0)
	LPHA F 6
	TNT1 A 0 A_MonsterRefire(64,"See")
	TNT1 A 0 A_Jump(100,"See")
	Goto Laser+1
  Surprise:
	TNT1 A 0 A_PlaySound("phaseimp/teleport")
	LPHA E 2 A_FaceTarget
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.75)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.55)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.35)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LPHA E 1 A_SetTranslucent(0.15)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	Goto SurprisePhased
  SurprisePhased:
	LPHA A 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA A 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA B 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA B 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA C 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA C 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA D 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	LPHA D 1 A_ExtChase(0,0)
	LPHA A 0 A_ExtChase(0,0)
	TNT1 A 0 A_JumpIfCloser(200,"SurpriseUnphase")
	TNT1 A 0 A_Jump(8,"Unphase")
	Loop
  SurpriseUnphase:
	TNT1 A 0 A_SetTranslucent(1)
	TNT1 A 0 Bright A_PlaySound("LPhaseImp/Sight",7)
	LPHA EF 6 A_FaceTarget
	TNT1 A 0 Bright A_PlaySound("imp/attack")
	LPHA G 5 Bright A_CustomMissile("FLegImpSeekBall", 32, 0, 0)
	LPHA FE 4
	LPHA F 4 A_FaceTarget
	TNT1 A 0 Bright A_PlaySound("imp/attack")
	LPHA G 5 Bright A_CustomMissile("FLegImpSeekBall", 32, 0, 0)
	TNT1 A 0 A_Jump(128,"PhaseRun")
	Goto See
  Pain:
	TNT1 A 0 A_Jump(32,"PhaseRun")
	LPHA H 2
	LPHA H 2 A_Pain
	Goto See
  Death:
    TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	LPHA I 8 A_SetTranslucent(1)
	LPHA J 8 A_Scream
	LPHA K 6
	LPHA L 6 A_Fall
	LPHA M -1
	Stop
  XDeath:
	TNT1 A 0 A_SetTranslucent(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	LPHA N 3 A_RemoveChildren(1)
	LPHA O 3 A_XScream
	LPHA P 3 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
	LPHA Q 3 A_Fall
	LPHA RST 3
	LPHA U -1
	Stop
  }
}

Actor FriendlyLegendaryPhaseImp2 : FriendlyLegendaryPhaseImp
{
Tag "\c[z3]Friendly Legendary Phase Imp\c-"
States
{
  Spawn:
    LPHA A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	LPHA A 10 Bright A_Look
    Goto Idle
  Death:
    TNT1 A 0 A_RemoveChildren(1)
	LPHA I 8 A_SetTranslucent(1)
	LPHA J 8 A_Scream
	LPHA K 6
	LPHA L 6 A_Fall
	LPHA M -1
	Stop
  XDeath:
	TNT1 A 0 A_SetTranslucent(1)
	LPHA N 3 A_RemoveChildren(1)
	LPHA O 3 A_XScream
	LPHA P 3 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
	LPHA Q 3 A_Fall
	LPHA RST 3
	LPHA U -1
	Stop
	}
}

Actor FLegPhaseLaser : LegPhaseLaser { Species "Player" DamageType "FriendlyMonster" +MTHRUSPECIES }

ACTOR FriendlyLegendaryRevolverZombie : UACBaseMarine
{ 
Health 1015
Speed 12
Radius 20
Height 56
BloodColor "Blue"
PainChance 20
DamageFactor 0.70
DropItem "Legendary Revolver" 200 1
DropItem "LegendaryBulletMag" 250 3
DropItem "LegendaryBulletBox" 125 1
DropItem "LegendaryArmor" 90 1
DropItem "LegAmmoSphere" 93 1
DropItem "HandGrenadeAmmo" 235 2
DropItem "MineAmmo" 240 2
DropItem "Backpack" 200 1
DropItem "Armorplate" 210 1
DropItem "Portablemedkit" 215 1
DropItem "StimKit" 220 3
DropItem "HealthFlask" 225 5
DropItem "LegendaryRune" 30 1
DropItem "LegendaryPowerShard" 35 1
DropItem "LegendaryPowerSphere" 35 1
SeeSound "Legrevolzomb/Sight"
AttackSound "revfire"
PainSound "lcmdo/pain"
DeathSound "Legrevolzomb/Death"
ActiveSound "legzom/active"
Obituary "%o was killed by a friendly Legendary Revolver Zombie"
Tag "\c[z3]Friendly Legendary Revolver Zombie\c-"
+NOICEDEATH
var int user_protection;
var int user_protected;
States
{
  Spawn:
    LGRZ A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	LGRZ A 10 Bright A_Look
    Goto Idle
  Idle:
    //TNT1 A 0 A_SetuserVar(user_woke,0)
	LGRZ A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK) //TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK|LOF_NOSEESOUND)
	LGRZ AABB 3 Bright A_GiveInventory("AIPatroling",1)
	LGRZ C 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK) //TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK|LOF_NOSEESOUND)
    LGRZ CCDD 3 Bright A_GiveInventory("AIPatroling",1)
	LGRZ A 0 A_SpawnItem("FootStep",0,0,0,0)
	Loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  See:
    /*
    TNT1 A 0 A_JumpIf(user_woke == 1,3)
    TNT1 A 0 A_PlaySound("Legrevolzomb/Sight",CHAN_VOICE) 
    TNT1 A 0 A_SetuserVar(user_woke,1)
	*/
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Jump(16,"GiveUp")
    LGRZ A 0 A_JumpIfTargetInLOS("Strafing")
    LGRZ AABB 3 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	LGRZ A 0 A_JumpIfTargetInLOS("Strafing")
	LGRZ CCDD 3 Bright A_Chase
	LGRZ A 0 A_Jump(80,"Rush")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    Loop
  GiveUp:
    TNT1 A 0 A_ClearTarget
	LGRZ A 10 Bright
	Goto Idle
  Rush:
    LGRZ A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegRevZombieGhostA",0,0,0,0,0,0,0,128)
	LGRZ A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegRevZombieGhostA",0,0,0,0,0,0,0,128)
	LGRZ A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegRevZombieGhostB",0,0,0,0,0,0,0,128)
	LGRZ B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegRevZombieGhostB",0,0,0,0,0,0,0,128)
	LGRZ B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_SpawnItemEx("LegRevZombieGhostC",0,0,0,0,0,0,0,128)
	LGRZ C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegRevZombieGhostC",0,0,0,0,0,0,0,128)
	LGRZ C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegRevZombieGhostD",0,0,0,0,0,0,0,128)
	LGRZ D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegRevZombieGhostD",0,0,0,0,0,0,0,128)
	LGRZ D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",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
  Strafing:
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LGRZ AA 3 Bright A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LGRZ BB 3 Bright A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
    LGRZ CC 3 Bright A_GiveInventory("LegZombieStrafing",1)	
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LGRZ DD 3 Bright A_GiveInventory("LegZombieStrafing",1)
	Goto See
  Missile:
	TNT1 A 0 A_Jump(40,"Multipleshots") 
    TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
    LGRZ EEE 2 Bright A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
    TNT1 A 0 A_JumpIfInventory ("LegRevZombieAmmo", 6, "Reload")
    LGRZ E 2 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory ("LegRevZombieAmmo", 1)
	TNT1 A 0 A_CustomMissile("LegendaryBlueTracer", 0,0,0,0)
	LGRZ F 4 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2,"FriendlyLegendaryBulletPuff")
	LGRZ E 2 Bright A_FaceTarget
	TNT1 A 0 A_CPosRefire
    Goto Missile
  Multipleshots:
	TNT1 A 0 A_JumpIfInventory ("LegRevZombieAmmo", 1, "Reload")
    LGRZ E 3 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory ("LegRevZombieAmmo", 1)
	TNT1 A 0 A_CustomMissile("LegendaryBlueTracer", 0,0,0,0)
	LGRZ F 3 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2,"FriendlyLegendaryBulletPuff")
    LGRZ E 3 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory ("LegRevZombieAmmo", 1)
	TNT1 A 0 A_CustomMissile("LegendaryBlueTracer", 0,0,0,0)
	LGRZ F 3 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2,"FriendlyLegendaryBulletPuff")
	LGRZ E 3 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory ("LegRevZombieAmmo", 1)
	TNT1 A 0 A_CustomMissile("LegendaryBlueTracer", 0,0,0,0)
	LGRZ F 3 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2,"FriendlyLegendaryBulletPuff")
	LGRZ E 3 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory ("LegRevZombieAmmo", 1)
	TNT1 A 0 A_CustomMissile("LegendaryBlueTracer", 0,0,0,0)
	LGRZ F 3 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2,"FriendlyLegendaryBulletPuff")
	LGRZ E 3 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory ("LegRevZombieAmmo", 1)
	TNT1 A 0 A_CustomMissile("LegendaryBlueTracer", 0,0,0,0)
	LGRZ F 3 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2,"FriendlyLegendaryBulletPuff")
	LGRZ E 3 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory ("LegRevZombieAmmo", 1)
	TNT1 A 0 A_CustomMissile("LegendaryBlueTracer", 0,0,0,0)
	LGRZ F 3 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2,"FriendlyLegendaryBulletPuff")
	LGRZ E 3 Bright A_FaceTarget
	TNT1 A 0 A_CPosRefire 
  Reload:
    TNT1 A 0 A_ChangeFlag(NOPAIN,1)
    TNT1 A 0 A_PlaySound("REVOPEN")
	TNT1 AAAAAA 0 A_SpawnItemEx("LEGBulletCasing", -8, 7, 30, 4, 0, (0.1)*Random(30, 40), Random(-80, -90), 128)
    LGRZ E 24 Bright A_TakeInventory ("LegRevZombieAmmo", 6)
    LGRZ E 12 Bright A_PlaySound("REVINSR") 
	LGRZ E 12 Bright A_PlaySound("REVCLOSE")
	LGRZ E 1 Bright A_PlaySound("REVSPIN")
    TNT1 A 0 A_ChangeFlag(NOPAIN,0)
    Goto See
  Pain:
    TNT1 A 0 A_Jump(50,"Protection")
	TNT1 A 0 A_Jump(192,"PainMissile")
    LGRZ G 3 Bright A_GiveInventory("LegZombieStrafing",1)
    LGRZ G 0 A_Pain
	LGRZ G 3 Bright A_GiveInventory("LegZombieStrafing",1)
    Goto See
  PainMissile: 
    LGRZ G 3 Bright A_GiveInventory("LegZombieStrafing",1)
    LGRZ G 0 A_Pain
	LGRZ G 3 Bright A_GiveInventory("LegZombieStrafing",1)
    Goto Missile	
  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
	LGRZ E 2 Bright ACS_NamedExecuteAlways("LegendaryProtection",0,0,0,0)
	Goto See
  Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	LRZD U 5 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0) 
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LRZD V 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LRZD W 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LRZD "X" 5 A_SpawnItem("BodyCrash",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LRZD "Y" 5 A_SpawnItem("BodyCrash",0,0,0,0)
    LRZD "Z" 140
	LRZD "Z" 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LRZD ZZZZZZZZZZZZZZZZZ 2 Bright A_GiveInventory("LegSoulEvent",1)
	LRZD ZZZZZZZZZZZZZZZZZ 2 Bright A_GiveInventory("LegSoulEvent",1)
	LRZD ZZZZZZZZZZZZZZZZZ 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid+1)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	LRZD "Z" -1
	Stop
  XDeath:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
    LGRZ M 5 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    LGRZ N 5 A_XScream
    LGRZ O 5 A_Fall
    LGRZ PQRST 5
    LGRZ U -1
    Stop
  }
}

Actor FriendlyLegendaryBulletPuff : ModdedBulletPuff { DamageType "FriendlyMonster" }

Actor FriendlyLegendaryRevolverZombie2 : FriendlyLegendaryRevolverZombie
{
Tag "\c[z3]Friendly Legendary Revolver Zombie\c-"
States
{
  Spawn:
    LGRZ A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	LGRZ A 10 Bright A_Look
    Goto Idle
  Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	LRZD U 5 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0) 
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LRZD V 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LRZD W 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LRZD "X" 5 A_SpawnItem("BodyCrash",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LRZD "Y" 5 A_SpawnItem("BodyCrash",0,0,0,0)
    LRZD "Z" 140
	LRZD "Z" 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LRZD ZZZZZZZZZZZZZZZZZ 2 Bright A_GiveInventory("LegSoulEvent",1)
	LRZD ZZZZZZZZZZZZZZZZZ 2 Bright A_GiveInventory("LegSoulEvent",1)
	LRZD ZZZZZZZZZZZZZZZZZ 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	LRZD "Z" -1
	Stop
  XDeath:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
    LGRZ M 5 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    LGRZ N 5 A_XScream
    LGRZ O 5 A_Fall
    LGRZ PQRST 5
    LGRZ U -1
    Stop
	}
}

ACTOR FriendlyLegendaryCowboy : UACBaseMarine //NewLegendaryCowboy in TLCA
{ 
Health 1000
Speed 12
Radius 20
Height 56
BloodColor "Blue"
PainChance 20
DamageFactor 0.70
DropItem "BadLegendaryRevolver" 200 1 //for God Complex/CF Ultra/CF Turbo
DropItem "LegendaryBulletMag" 250 3
DropItem "LegendaryBulletBox" 125 1
DropItem "LegendaryArmor" 90 1
DropItem "LegAmmoSphere" 93 1
DropItem "HandGrenadeAmmo" 235 2
DropItem "MineAmmo" 240 2
DropItem "Backpack" 200 1
DropItem "Armorplate" 210 1
DropItem "Portablemedkit" 215 1
DropItem "StimKit" 220 3
DropItem "HealthFlask" 225 5
DropItem "LegendaryRune" 30 1
DropItem "LegendaryPowerShard" 35 1
DropItem "LegendaryPowerSphere" 35 1
AttackSound "REVFIRE"
SeeSound "LegendaryCowboy/See"
PainSound "LegendaryCowboy/Pain"
DeathSound "LegendaryCowboy/Dead"
ActiveSound "LegendaryCowboy/Active"
Obituary "%o was killed by a friendly Legendary Cowboy"
Tag "\c[z3]Friendly Legendary Cowboy\c-"
+NOICEDEATH
var int user_protection;
var int user_protected;
States
{
  Spawn:
    LWGU A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	LWGU A 10 Bright A_Look
    Goto Idle
  Idle:
	LWGU A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK)
	LWGU AABB 3 Bright A_GiveInventory("AIPatroling",1)
	LWGU C 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK)
    LWGU CCDD 3 Bright A_GiveInventory("AIPatroling",1)
	LWGU A 0 A_SpawnItem("FootStep",0,0,0,0)
	Loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  Taunt:
    TNT1 A 0 A_PlaySound("LegendaryCowboy/Taunt",CHAN_VOICE)
  See:
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Jump(16,"GiveUp")
    LWGU A 0 A_JumpIfTargetInLOS("Strafing")
    LWGU AABB 3 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	LWGU A 0 A_JumpIfTargetInLOS("Strafing")
	LWGU CCDD 3 Bright A_Chase
	LWGU A 0 A_Jump(80,"Rush")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    Loop
  GiveUp:
    TNT1 A 0 A_ClearTarget
	LWGU A 10 Bright
	Goto Idle
  Rush:
    LWGU A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegendaryCowboyGhostA",0,0,0,0,0,0,0,128)
	LWGU A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryCowboyGhostA",0,0,0,0,0,0,0,128)
	LWGU A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryCowboyGhostB",0,0,0,0,0,0,0,128)
	LWGU B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryCowboyGhostB",0,0,0,0,0,0,0,128)
	LWGU B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_SpawnItemEx("LegendaryCowboyGhostC",0,0,0,0,0,0,0,128)
	LWGU C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryCowboyGhostC",0,0,0,0,0,0,0,128)
	LWGU C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryCowboyGhostD",0,0,0,0,0,0,0,128)
	LWGU D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryCowboyGhostD",0,0,0,0,0,0,0,128)
	LWGU D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",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
  Strafing:
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LWGU AA 3 Bright A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LWGU BB 3 Bright A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
    LWGU CC 3 Bright A_GiveInventory("LegZombieStrafing",1)	
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LWGU DD 3 Bright A_GiveInventory("LegZombieStrafing",1)
	Goto See
  Missile:
    TNT1 A 0 A_Jump(64,"Multipleshots","SpecialShot")
    LWGU EEE 2 Bright A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
    TNT1 A 0 A_JumpIfInventory ("LegCowboyAmmo",6,"Reload")
    LWGU E 2 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory ("LegCowboyAmmo", 1)
	TNT1 A 0 Bright A_CustomMissile("LegendaryBlueTracer", 0,0,0,0)
	LWGU F 4 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2,"FriendlyLegendaryBulletPuff")
	LWGU E 2 Bright A_FaceTarget
	TNT1 A 0 A_JumpIfTargetInLOS(1,0,JLOSF_NOSIGHT|JLOSF_DEADNOJUMP)
	Goto Taunt
	TNT1 A 0 A_CPosRefire
    Goto Missile
  Multipleshots:
	TNT1 A 0 A_JumpIfInventory ("LegCowboyAmmo",1,"Reload")
    LWGU E 3 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory ("LegCowboyAmmo",1)
	TNT1 A 0 Bright A_CustomMissile("LegendaryBlueTracer", 0,0,0,0)
	LWGU F 3 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2,"FriendlyLegendaryBulletPuff")
    LWGU E 3 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory ("LegCowboyAmmo",1)
	TNT1 A 0 Bright A_CustomMissile("LegendaryBlueTracer", 0,0,0,0)
	LWGU F 3 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2,"FriendlyLegendaryBulletPuff")
	LWGU E 3 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory ("LegCowboyAmmo",1)
	TNT1 A 0 Bright A_CustomMissile("LegendaryBlueTracer", 0,0,0,0)
	LWGU F 3 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2,"FriendlyLegendaryBulletPuff")
	LWGU E 3 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory ("LegCowboyAmmo",1)
	TNT1 A 0 Bright A_CustomMissile("LegendaryBlueTracer", 0,0,0,0)
	LWGU F 3 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2,"FriendlyLegendaryBulletPuff")
	LWGU E 3 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory ("LegCowboyAmmo",1)
	TNT1 A 0 Bright A_CustomMissile("LegendaryBlueTracer", 0,0,0,0)
	LWGU F 3 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2,"FriendlyLegendaryBulletPuff")
	LWGU E 3 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory ("LegCowboyAmmo",1)
	TNT1 A 0 Bright A_CustomMissile("LegendaryBlueTracer", 0,0,0,0)
	LWGU F 3 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2,"FriendlyLegendaryBulletPuff")
	LWGU E 3 Bright A_FaceTarget
	TNT1 A 0 A_JumpIfTargetInLOS(1,0,JLOSF_NOSIGHT|JLOSF_DEADNOJUMP)
	Goto Taunt
	TNT1 A 0 Bright A_CPosRefire 
  Reload:
    TNT1 A 0 A_ChangeFlag(NOPAIN,1)
    TNT1 A 0 A_PlaySound("REVOPEN")
	TNT1 AAAAAA 0 A_SpawnItemEx("LegBulletCasing", -8, 7, 30, 4, 0, (0.1)*Random(30, 40), Random(-80, -90), 128)
    LWGU E 24 Bright A_TakeInventory ("LegCowboyAmmo", 6)
    LWGU E 12 Bright A_PlaySound("REVINSR") 
	LWGU E 12 Bright A_PlaySound("REVCLOSE")
	LWGU E 1 Bright A_PlaySound("REVSPIN")
    TNT1 A 0 A_ChangeFlag(NOPAIN,0)
    Goto See
  SpecialShot:
    LWGU EEE 2 Bright A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
    TNT1 A 0 A_JumpIfInventory ("LegCowboyAmmo",6,"Reload")
    LWGU E 2 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory ("LegCowboyAmmo", 1)
	TNT1 A 0 A_CustomMissile("FLegCowboySpecialShot",32,0,0,0)
	LWGU F 4 Bright
	LWGU E 2 Bright A_FaceTarget
	TNT1 A 0 A_JumpIfTargetInLOS(1,0,JLOSF_NOSIGHT|JLOSF_DEADNOJUMP)
	Goto Taunt
	TNT1 A 0
    Goto See
  Pain:
    TNT1 A 0 A_Jump(50,"Protection")
	TNT1 A 0 A_Jump(192,"PainMissile")
    LWGU G 3 Bright A_GiveInventory("LegZombieStrafing",1)
    LWGU G 0 A_Pain
	LWGU G 3 Bright A_GiveInventory("LegZombieStrafing",1)
    Goto See
  PainMissile: 
    LWGU G 3 Bright A_GiveInventory("LegZombieStrafing",1)
    LWGU G 0 A_Pain
	LWGU G 3 Bright A_GiveInventory("LegZombieStrafing",1)
    Goto Missile	
  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
	LWGU E 2 Bright ACS_NamedExecuteAlways("LegendaryProtection",0,0,0,0)
	Goto See	
  Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LWGU H 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LWGU I 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LWGU J 5 A_SpawnItem("BodyCrash",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LWGU K 5 
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LWGU L 140
	LWGU L 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LWGU LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LWGU LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LWGU LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid+1)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	LWGU L -1
	Stop
  XDeath:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	LWGU O 3 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    LWGU P 3 A_XScream
    LWGU Q 3 A_Fall
    LWGU RSTUV 3 
    LWGU W -1 
    Stop
  }
}

Actor FriendlyLegendaryCowboy2 : FriendlyLegendaryCowboy
{
Tag "\c[z3]Friendly Legendary Cowboy\c-"
States
{
  Spawn:
    LWGU A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	LWGU A 10 Bright A_Look
    Goto Idle
  Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LWGU H 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LWGU I 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LWGU J 5 A_SpawnItem("BodyCrash",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LWGU K 5 
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LWGU L 140
	LWGU L 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LWGU LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LWGU LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LWGU LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	LWGU L -1
	Stop
  XDeath:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	LWGU O 3 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    LWGU P 3 A_XScream
    LWGU Q 3 A_Fall
    LWGU RSTUV 3 
    LWGU W -1 
    Stop
	}
}

ACTOR FLegCowboySpecialShot : LegCowboySpecialShot { Species "Player" DamageType "FriendlyMonster" +MTHRUSPECIES }

ACTOR FriendlyLegendaryAssaultCaptain : UACBaseMarine
{ 
Health 1020
Speed 12
Radius 20
Height 56
BloodColor "Blue"
PainChance 20
DamageFactor 0.70
DropItem "LegendaryBossLifeEssence" 256
DropItem "LegendaryBossArmorBonusMax" 256
DropItem "Legendary Assault Shotgun" 202
DropItem "LegendaryShell" 256 4
DropItem "LegendaryShellBox" 130
DropItem "LegendaryPowerShard" 30 1
DropItem "LegendaryArmor" 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 "LegendaryRune" 27 1
AttackSound "REVFIRE"
SeeSound "lasgguy/sight"
AttackSound "Weapons/LegAutoShotgun"
PainSound "lasgguy/pain"
DeathSound "lasgguy/death"
ActiveSound "lasgguy/active"
Obituary "%o was killed by a friendly Legendary Assault Captain"
Tag "\c[z3]Friendly Legendary Assault Captain\c-"
+NOICEDEATH
var int user_protection;
var int user_protected;
States
{
  Spawn:
    LASG A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	LASG A 10 Bright A_Look
    Goto Idle
  Idle:
	LASG A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK)
	LASG AABB 3 Bright A_GiveInventory("AIPatroling",1)
	LASG C 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK)
    LASG CCDD 3 Bright A_GiveInventory("AIPatroling",1)
	LASG A 0 A_SpawnItem("FootStep",0,0,0,0)
	Loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  See:
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Jump(16,"GiveUp")
    LASG AABB 3 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	LASG A 0 A_JumpIfTargetInLOS("Strafing")
	LASG CCDD 3 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Jump(64,"Mine")
	LASG A 0 A_Jump(64,"Rush")
	TNT1 A 0 A_Jump(64,"DodgeLeft","DodgeRight")
	TNT1 A 0 A_Jump(64,"Chase")
    Loop
  GiveUp:
    TNT1 A 0 A_ClearTarget
	LASG A 10 Bright
	Goto Idle
  Chase:
	LASG AA 1 Bright A_FastChase
	TNT1 A 0 A_Jump(1,"Heal")
	LASG A 0 A_JumpIfCloser(130,"Dodge")
	LASG AA 1 Bright A_Chase
	LASG A 0 A_JumpIfCloser(130,"Dodge")
	LASG BB 1 Bright A_Chase
	LASG A 0 A_JumpIfCloser(130,"Dodge")
	LASG BB 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	LASG A 0 A_JumpIfCloser(150,"Dodge")
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	LASG CC 1 Bright A_Chase
	TNT1 A 0 A_Jump(10,"Heal")
	LASG A 0 A_JumpIfCloser(150,"Dodge")
	LASG CC 1 Bright A_FastChase
	LASG A 0 A_JumpIfCloser(130,"Dodge")
	LASG DD 1 Bright A_FastChase
	LASG A 0 A_JumpIfCloser(130,"Dodge")
	LASG DD 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	TNT1 A 0 A_Jump(95,"Mine")
	LASG A 0 A_Jump(128,"Dodge")
	Loop
  Rush:
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegASGZombieGhostA",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LASG A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegASGZombieGhostA",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LASG A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegASGZombieGhostB",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LASG B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegASGZombieGhostB",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LASG B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_SpawnItemEx("LegASGZombieGhostC",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LASG C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegASGZombieGhostC",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LASG C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegASGZombieGhostD",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LASG D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegASGZombieGhostD",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LASG D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_Jump(85,"See")
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	Loop
  Heal:
	TNT1 A 0 A_SpawnItem("GHellionSmokeSpawner",0,0,0,0)
	LASG A 5 Bright
	TNT1 A 0 A_SpawnItem("GHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 HealThing(5)
	TNT1 A 0 A_PlaySound("pickups/flask",0,1.0,0)
	Goto See
  Heal2:
	TNT1 A 0 A_SpawnItem("GHellionSmokeSpawner",0,0,0,0)
	LASG A 5 Bright
	TNT1 A 0 A_SpawnItem("GHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 HealThing(15)
	TNT1 A 0 A_PlaySound("pickups/pstimpack",0,1.0,0)
	Goto See
  Heal3:
	TNT1 A 0 A_SpawnItem("GHellionSmokeSpawner",0,0,0,0)
	LASG A 5 Bright
	TNT1 A 0 A_SpawnItem("GHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 HealThing(25)
	TNT1 A 0 A_PlaySound("pickups/pmedkit",0,1.0,0)
	Goto See
  SeeNoDodge:
	LASG AABB 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	LASG CCDD 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	LASG AABB 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	LASG CCDD 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	LASG AABB 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	LASG CCDD 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	Goto Chase
  Dodge:
	LASG A 1 Bright A_FaceTarget
	LASG E 0 ThrustThingZ(0, 20, 0, 0)
	LASG A 0 A_Jump(256, "DodgeRight", "DodgeLeft")
  DodgeLeft:
	LASG E 0 ThrustThing(angle*256/360+192, 15, 0, 0)
	TNT1 A 0 A_Jump(40,"Heal")
	TNT1 A 0 A_Jump(35,"Heal2")
	TNT1 A 0 A_Jump(30,"Heal3")
	Goto SeeNoDodge
  DodgeRight:
	LASG E 0 ThrustThing(angle*256/360+64, 15, 0, 0)
	TNT1 A 0 A_Jump(40,"Heal")
	TNT1 A 0 A_Jump(35,"Heal2")
	TNT1 A 0 A_Jump(30,"Heal3")
	Goto SeeNoDodge
  Strafing:
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LASG AA 3 Bright A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LASG BB 3 Bright A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LASG CC 3 Bright A_GiveInventory("LegZombieStrafing",1)	
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LASG DD 3 Bright A_GiveInventory("LegZombieStrafing",1)
	Goto See
  Mine:
	LASG C 1 Bright
	LASG C 12 Bright A_CustomMissile("FLACThrownMine",32,0,0,2,15)
	LASG E 12 Bright
	LASG C 3 Bright
	Goto See
  Grenade:
	TNT1 A 0 A_PlaySound("weapons/hgrenadepin",0,1.0,0)
	LASG CE 4 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("weapons/hgrenadethrow",0,1.0,0)
	LASG E 1 Bright A_CustomMissile("FLegThrownGrenade",32,0,0,2,4)
	Goto Dodge
  Missile:
    TNT1 A 0 A_SetShootable
    TNT1 A 0 A_UnsetInvulnerable
    TNT1 A 0 A_SetTranslucent(1)
	LASG E 3 Bright A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
    TNT1 A 0 A_JumpIfInventory ("ASGZAmmo", 16, "Reload")
    LASG E 4 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory ("ASGZAmmo", 1)
	TNT1 A 0 A_SpawnItemEx("BlueShellCasing", -8, 7, 30, 4, 0, (0.1)*Random(30, 40), Random(-80, -90), 128)
	TNT1 AAAA 0 Bright A_CustomMissile("LegendaryBlueTracer",Random(28,34),0,Random(6,-6),0)
	LASG F 2 Bright A_CustomBulletAttack(22.5,18.3,4,Random(5,15)*6,"FriendlyLegendaryBulletPuff")
	LASG E 4 Bright A_FaceTarget
	TNT1 A 0 Bright A_CPosRefire
    TNT1 A 0 A_Jump(6,"Heal")
    TNT1 A 0 A_Jump(5,"Heal2")
    TNT1 A 0 A_Jump(4,"Heal3")
	TNT1 A 0 A_Jump(10,"Grenade")
    TNT1 A 0 A_JumpIfCloser(300,"Grenade")
    Goto Missile+4
  Reload:
    TNT1 A 0 A_ChangeFlag("NoPain", 1)
    TNT1 A 0 A_PlaySound("lasgguy/asgout")
	TNT1 A 0 A_SpawnItemEx("LegendaryEmptyDrumSpawner", -8, 7, 30, 4, 0, (0.1)*Random(30, 40), Random(-80, -90), 128)
    LASG E 48 Bright A_TakeInventory ("ASGZAmmo", 16)
    LASG E 8 Bright A_PlaySound("lasgguy/asgin") 
	LASG E 20 Bright A_PlaySound("LShotgun/Cock")
    TNT1 A 0 A_ChangeFlag("NoPain", 0)
    Goto See
  Pain:
	TNT1 A 0 A_Jump(10,"Protection")
	TNT1 A 0 A_Jump(20,"Dodge")
	TNT1 A 0 A_Jump(192,"PainMissile")
    LASG G 3 Bright
    LASG G 3 Bright A_Pain
	TNT1 A 0 A_Jump(40,"Dodge")
    Goto See
  PainMissile:
    LASG G 3 Bright
    LASG G 3 Bright A_Pain
    Goto Missile	
  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
	LASG E 2 Bright ACS_NamedExecuteAlways("LegendaryProtection",0,0,0,0)
	Goto See		
  Death:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
    LASG H 5 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LASG I 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LASG J 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LASG J 5 A_SpawnItem("BodyCrash",0,0,0,0)
    LASG K 5 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LASG L 140 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LASG L 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LASG LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LASG LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LASG LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid+1)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	LASG L -1
    Stop
  XDeath:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
    LGRZ M 5 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    LGRZ N 5 A_XScream
    LGRZ O 5 A_Fall
    LGRZ PQRST 5
    LGRZ U -1
    Stop
  }
}

Actor FriendlyLegendaryAssaultCaptain2 : FriendlyLegendaryAssaultCaptain
{
Tag "\c[z3]Friendly Legendary Assault Captain\c-"
States
{
  Spawn:
    LASG A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	LASG A 10 Bright A_Look
    Goto Idle
  Death:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
    LASG H 5 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LASG I 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LASG J 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LASG J 5 A_SpawnItem("BodyCrash",0,0,0,0)
    LASG K 5 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LASG L 140 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LASG L 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LASG LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LASG LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LASG LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	LASG L -1
    Stop
  XDeath:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
    LGRZ M 5 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    LGRZ N 5 A_XScream
    LGRZ O 5 A_Fall
    LGRZ PQRST 5
    LGRZ U -1
    Stop
	}
}

Actor FLegThrownGrenade : LegThrownGrenade { Species "Player" DamageType "FriendlyMonster" +DONTHURTSPECIES +DONTHARMSPECIES }

Actor FLGrenade : LGrenade { Species "Player" DamageType "FriendlyMonster" +DONTHURTSPECIES +DONTHARMSPECIES }

Actor FLACThrownMine : LACThrownMine
{
Species "Player"
States
{
Spawn:
	TNT1 A 0
	TNT1 A 0 A_StopSound
    Goto Thrown
Thrown:
	LLIN A 30
	LLIN B 10 Bright
	Loop
Death:
	LLIN A 1
	LLIN A 1 A_SpawnItem("FLACLiveMine")
	Stop
	}
}

Actor FLACLiveMine : LACLiveMine 
{ 
Species "Player" 
DamageType "FriendlyMonster" 
+MTHRUSPECIES
States
{
Death:
	TNT1 A 0 A_Die
Explode:
	LLIN B 15 Bright A_PlaySound("weapons/minebeep")
	TNT1 A 0 A_AlertMonsters
	//TNT1 A 0 A_Explode(286,190)
	TNT1 A 0 A_CustomMissile("LegMarineLiveMineBomb",0,0,0,CMF_AIMDIRECTION)
	TNT1 A 0 A_SpawnItemEx ("BarrelKaboom",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	TNT1 A 0 A_PlaySound("weapons/mineexplode")
	TNT1 A 0 A_SpawnItemEx("BlueParticleSpawner", 0, 0, 0, 0, 0, 0, 0, 128) 
    TNT1 AAAA 0 A_CustomMissile("BlueKaboom3", 0, 0, random(0,360), 2, random(20,160))
	TNT1 AAAA 0 A_CustomMissile("SmokeFX2", 0, 0, random(0,360), 2, random(20,160))
	TNT1 AAAA 0 A_SpawnItemEx("Debris",0,0,0,Random(4,-4),Random(4,-4),Random(4,8),0,128)
    TNT1 A 1 A_SpawnItem("LegendaryBlueRocketEx")
    Stop
	}
}

Actor LegMarineLiveMineBomb
{
Projectile
Speed 0
Damage 0
+NOCLIP
+FORCERADIUSDMG
+DONTHURTSPECIES
+DONTHARMSPECIES
Species "Player"
Damagetype "AllyExplosion"
States
{
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_Explode(286,190)
    Stop
  }
}

ACTOR FriendlyLegendaryLieutenant : FriendlyLegendaryAssaultCaptain
{ 
Health 1150
Speed 12
PainChance 20
DropItem "LegendaryBossLifeEssence" 256
DropItem "LegendaryBossArmorBonusMax" 256
DropItem "LegendaryCoachgun" 202
DropItem "LegendaryShell" 256 4
DropItem "LegendaryShellBox" 130
DropItem "LegendaryPowerShard" 30 1
DropItem "LegendaryArmor" 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 "LegendaryRune" 27 1
SeeSound "Lieutenant/sight"
AttackSound " "
PainSound "Lieutenant/pain"
DeathSound "Lieutenant/death"
Obituary "%o was killed by a Friendly Legendary Lieutenant."
Tag "\c[z3]Friendly Legendary Lieutenant\c-"
+BRIGHT
var int user_reload;
States
{
  Spawn:
    LSZX A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	LSZX A 10 A_Look
    Goto Idle
  Idle:
    TNT1 A 0 A_ChangeFlag("NOPAIN",0)
	TNT1 A 0 A_SetShootable
	TNT1 A 0 A_SetTranslucent(1)
	LSZX A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK)
	LSZX AABB 3 A_GiveInventory("AIPatroling",1)
	LSZX C 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK)
    LSZX CCDD 3 A_GiveInventory("AIPatroling",1)
	LSZX A 0 A_SpawnItem("FootStep",0,0,0,0)
	Loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  See:
    TNT1 A 0 A_ChangeFlag("NOPAIN",0)
	TNT1 A 0 A_SetShootable
	TNT1 A 0 A_SetTranslucent(1)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Jump(16,"GiveUp")
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
    LSZX AABB 3 A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	LSZX A 0 A_JumpIfTargetInLOS("Strafing")
	LSZX CCDD 3 A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Jump(80,"Rush")
	TNT1 A 0 A_Jump(64,"Dodge")
    Loop
  GiveUp:
    TNT1 A 0 A_ClearTarget
	LSZX A 10
	Goto Idle
  Rush:
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItemEx("LHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("LegLieutenantGhostA",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	LSZX A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegLieutenantGhostA",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	LSZX A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegLieutenantGhostB",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	LSZX B 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegLieutenantGhostB",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	LSZX B 1 A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LHellionSmokeSpawner")
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_SpawnItemEx("LegLieutenantGhostC",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	LSZX C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegLieutenantGhostC",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	LSZX C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegLieutenantGhostD",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	LSZX D 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegLieutenantGhostD",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	LSZX 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)
	LSZX AA 3 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LSZX BB 3 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LSZX CC 3 A_GiveInventory("LegZombieStrafing",1)	
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LSZX DD 3 A_GiveInventory("LegZombieStrafing",1)
	Goto See
  Dodge:
	LSZX A 1 A_FaceTarget
	LSZX E 0 ThrustThingZ(0,20,0,0)
	LSZX A 0 A_Jump(256,"DodgeRight","DodgeLeft")
  DodgeLeft:
	LSZX E 0 ThrustThing(angle*256/360+192, 15, 0, 0)
	Goto See
  DodgeRight:
	LSZX E 0 ThrustThing(angle*256/360+64, 15, 0, 0)
	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(300,"Double")
  Normal:
	LSZX EE 4 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("Coachgun/Fire2",CHAN_WEAPON)
	TNT1 AAAA 0 A_CustomMissile("LegendaryBlueTracer",Random(28,34),0,Random(6,-6),0)
	TNT1 A 0 A_SetUserVar(user_reload,1)
	LSZX F 4 A_CustomBulletAttack(18,10,10,Random(20,28),"FriendlyLegendaryBulletPuff")
	LSZX EE 4 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_JumpIf(user_reload == 2,"Reload")
	TNT1 A 0 A_PlaySound("Coachgun/Fire2",CHAN_WEAPON)
	TNT1 AAAA 0 A_CustomMissile("LegendaryBlueTracer",Random(28,34),0,Random(6,-6),0)
	TNT1 A 0 A_SetUserVar(user_reload,2)
	LSZX F 4 A_CustomBulletAttack(18,10,10,Random(20,28),"FriendlyLegendaryBulletPuff")
	LSZX EE 4 A_GiveInventory("LegZombieStrafing",1)
	Goto Reload
  Double:
	TNT1 A 0 A_JumpIf(user_reload == 1,"Normal")
	TNT1 A 0 A_FaceTarget(45)
	LSZX E 5 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_FaceTarget(45)
	LSZX E 5 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_FaceTarget(45)
	LSZX E 5 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("Coachgun/Fire1",CHAN_WEAPON)
	TNT1 AAAAAAAA 0 A_CustomMissile("LegendaryBlueTracer",Random(28,34),0,Random(6,-6),0)
	TNT1 A 0 A_SetUserVar(user_reload,2)
	LSZX F 5 A_CustomBulletAttack(30,20,24,Random(20,28),"FriendlyLegendaryBulletPuff") 
	LSZX EEE 5 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_Jump(64,"Grenade")
	Goto Reload
  Grenade:
	TNT1 A 0 A_PlaySound("weapons/hgrenadepin",0,1.0,0)
	LSZX CE 4 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("weapons/hgrenadethrow",0,1.0,0)
	LSZX E 1 Bright A_CustomMissile("FLegThrownGrenade",32,0,0,2,4)
	TNT1 A 0 A_JumpIf(user_reload == 2,"Reload")
	Goto Dodge
  Reload:
	LSZX E 3 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	LSZX A 6 A_PlaySound("Coachgun/Open")
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_SpawnItemEx("BlueShellCasing",-8,6,36,Random(2,6),0,random(1,3),random(-80,-90),128)
	LSZX B 1 A_SpawnItemEx("BlueShellCasing",-10,6,36,Random(2,6),0,random(1,3),random(-80,-90),128)
	LSZX B 6 A_PlaySound("Coachgun/Load")
	TNT1 A 0 A_SetUserVar(user_reload,0)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	LSZX C 6 A_PlaySound("Coachgun/Close")
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	LSZX 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")
	LSZX G 3
	LSZX G 3 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
	LSZX E 2 ACS_NamedExecuteAlways("LegendaryProtection",0,0,0,0)
	Goto See		
  Death:
    TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	LSZX H 6 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LSZX I 6 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",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)
	LSZX J 6 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LSZX K 6 A_SpawnItem("BodyCrash",0,0,0,0)			
	LSZX L 6 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LSZX L 140 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LSZX LLLLLLLLLLLLLLLLL 2 A_GiveInventory("LegSoulEvent",1)
	LSZX LLLLLLLLLLLLLLLLL 2 A_GiveInventory("LegSoulEvent",1)
	LSZX LLLLLLLLLLLLLLLLL 2 A_GiveInventory("LegSoulEvent",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)
	LSZX L 525 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid+1)
	LSZX L 5 A_FadeOut(0.1,1)
	Wait
  XDeath:
    TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	TNT1 A 0 A_ChangeFlag("BRIGHT",0)
	LSZX M 5 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
	LSZX N 5 A_XScream
	LSZX O 5 A_Fall
	LSZX PQRST 5
	LSZX U -1
	Stop
  }
}

Actor FriendlyLegendaryLieutenant2 : FriendlyLegendaryLieutenant
{
Tag "\c[z3]Friendly Legendary Lieutenant\c-"
States
{
  Spawn:
    LSZX A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	LSZX A 10 A_Look
    Goto Idle
  Death:
    TNT1 A 0 A_RemoveChildren(1)
	LSZX H 6 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LSZX I 6 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",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)
	LSZX J 6 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LSZX K 6 A_SpawnItem("BodyCrash",0,0,0,0)			
	LSZX L 6 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LSZX L 140 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LSZX LLLLLLLLLLLLLLLLL 2 A_GiveInventory("LegSoulEvent",1)
	LSZX LLLLLLLLLLLLLLLLL 2 A_GiveInventory("LegSoulEvent",1)
	LSZX LLLLLLLLLLLLLLLLL 2 A_GiveInventory("LegSoulEvent",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)
	LSZX L 525 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid)
	LSZX L 5 A_FadeOut(0.1,1)
	Wait
  XDeath:
    TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 A_ChangeFlag("BRIGHT",0)
	LSZX M 5 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
	LSZX N 5 A_XScream
	LSZX O 5 A_Fall
	LSZX PQRST 5
	LSZX U -1
	Stop
	}
}

ACTOR FriendlyLegendaryAnnihilatorImp : UACBaseMarine
{
Health 1300
Scale 1.15
Speed 14
PainChance 50
MeleeDamage 15
BloodColor "Blue"
DamageFactor "PlayerNemesisPlasma", 0.0
DamageFactor "VileFires", 0.0
DamageType "FriendlyMonster"
DropItem "LegendaryRune" 15 1
DropItem "LegendaryBossLifeEssence" 256
DropItem "LegendaryBossArmorBonusMax" 256
DropItem "Legendary Assault Shotgun" 40 1
DropItem "Legendary Light Machine Gun" 40 1
DropItem "Legendary Plasmatic Rifle" 40 1
DropItem "LegendarySphere" 90 1
DropItem "LegendaryPowerSphere" 85 1
DropItem "LegendaryLMGBulletMag" 200 20
DropItem "LegendaryShell" 200 4
DropItem "LDemonAmmo" 200
DropItem "LegendaryBulletBox" 130
DropItem "LegendaryShellBox" 130
DropItem "LDemonAmmoBox" 130
SeeSound "cimp/sight"
PainSound "cimp/pain"
DeathSound "cimp/death"
ActiveSound "cimp/active"
MeleeSound "weapons/fistwiff"
Obituary "%o was killed by a Friendly Legendary Annihilator Imp."
Tag "\c[z3]Friendly Legendary Annihilator Imp\c-"
+BRIGHT
+NOICEDEATH
States
{
  Spawn:
    L1MP A 1
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	L1MP A 10 A_Look
    Goto Idle
  Idle:
	TNT1 A 0 A_ChangeFlag(NODROPOFF,1)
	LES2 A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Look
    L1MP AA 3 A_Wander
	TNT1 A 0 A_Look
	L1MP BB 3 A_Wander
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	TNT1 A 0 A_Look
	L1MP CC 3 A_Wander
	TNT1 A 0 A_Look
	L1MP DD 3 A_Wander
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	TNT1 A 0 A_Jump(30,"TeleportIdle")
	L1MP A 0 A_Jump(87,"RushIdle")
    Loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  RushIdle:
	LES2 A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegImpAnniGhostA",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	TNT1 A 0 A_Look
	L1MP A 1 A_Wander
	TNT1 A 0 A_SpawnItemEx("LegImpAnniGhostA",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	TNT1 A 0 A_Look
	L1MP A 1 A_Wander
	TNT1 A 0 A_SpawnItemEx("LegImpAnniGhostB",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	TNT1 A 0 A_Look
	L1MP B 1 A_Wander
	TNT1 A 0 A_SpawnItemEx("LegImpAnniGhostB",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	TNT1 A 0 A_Look
	L1MP B 1 A_Wander
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
    TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegImpAnniGhostC",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	TNT1 A 0 A_Look
	L1MP C 1 A_Wander
	TNT1 A 0 A_SpawnItemEx("LegImpAnniGhostC",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	TNT1 A 0 A_Look
	L1MP C 1 A_Wander
	TNT1 A 0 A_SpawnItemEx("LegImpAnniGhostD",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	TNT1 A 0 A_Look
	L1MP D 1 A_Wander
	TNT1 A 0 A_SpawnItemEx("LegImpAnniGhostD",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	TNT1 A 0 A_Look
	L1MP D 1 A_Wander
	TNT1 A 0 A_Jump(30,"TeleportIdle")
	TNT1 A 0 A_Jump(84,"Idle")
	Loop
  TeleportIdle:
    L1MP A 1 A_UnSetShootable
	L1MP AAAA 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	L1MP AAAAAAAAAA 1  A_FadeOut(0.1,0)
	L1MP A 2 
	L1MP AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
	L1MP AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
    L1MP A 1 A_PlayWeaponSound("boss/teleport")
	L1MP AAAA 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	L1MP AAAAAAAAAA 1 A_FadeIn(0.1)
    L1MP A 1 A_SetShootable
    Goto Idle
  See:
	TNT1 A 0 A_ChangeFlag(NODROPOFF,1)
    L1MP AABB 3 A_Chase
	TNT1 A 0 A_Jump(16,"GiveUp")
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	L1MP CCDD 3 A_Chase
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	TNT1 A 0 A_Jump(30,"Teleport")
  	TNT1 A 0 A_Jump(46,"Evade")
	L1MP A 0 A_Jump(87,"Rush")
    Loop
  GiveUp:
	L1MP A 10 A_ClearTarget
	Goto Idle
  Evade:
	TNT1 A 0 A_Jump(128,3)
	TNT1 A 0 ThrustThing(Angle*256/360+64,16,0,0)
	TNT1 A 0 A_Jump(256,2)
	TNT1 A 0 ThrustThing(Angle*256/360+192,16,0,0)
  	L1MP AAAA 3 A_Chase
	TNT1 A 0 A_Stop
	TNT1 A 0 A_JumpIfTargetInLOS("Missile")
	Goto See
  Rush:
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegImpAnniGhostA",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	L1MP A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegImpAnniGhostA",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	L1MP A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegImpAnniGhostB",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	L1MP B 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegImpAnniGhostB",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	L1MP B 1 A_Chase
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
    TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_SpawnItemEx("LegImpAnniGhostC",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	L1MP C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegImpAnniGhostC",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	L1MP C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegImpAnniGhostD",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	L1MP D 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegImpAnniGhostD",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	L1MP D 1 A_Chase
	TNT1 A 0 A_Jump(30,"Teleport")
  	TNT1 A 0 A_Jump(46,"Evade")
	TNT1 A 0 A_Jump(84,"See")
	Loop
  Teleport:
    L1MP A 1 A_UnSetShootable
	L1MP AAAA 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	L1MP AAAAAAAAAA 1  A_FadeOut(0.1,0)
	L1MP A 2 
	L1MP AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
	L1MP AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
    L1MP A 1 A_PlayWeaponSound("boss/teleport")
	L1MP AAAA 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	L1MP AAAAAAAAAA 1 A_FadeIn(0.1)
    L1MP A 1 A_SetShootable
    Goto See
  Melee: 
    L1MP EF 4 A_FaceTarget
    L1MP G 3 A_MeleeAttack
	L1MP FE 4 A_FaceTarget
    Goto See
  Missile:
    TNT1 A 0 A_SetShootable
    TNT1 A 0 A_UnsetInvulnerable
    TNT1 A 0 A_SetTranslucent(1)
    TNT1 A 0 A_Jump(96,2)
    TNT1 A 0 A_JumpIfCloser(300,"ASG")
    TNT1 A 0 A_JumpIfCloser(250,"Lunge")
    TNT1 A 0 A_Jump(140,"LightMachineGun","LegCannon","MiniRockets","ExpLasers")
  Normal:
	TNT1 A 0 A_PlaySound("weapons/charge15k")
    L1MP EE 6 A_FaceTarget
    L1MP W 10 A_CustomMissile("FLegendaryCyberBFG15KBall",39,-10,Random(2,-2)) 
	L1MP F 5
	L1MP G 6 A_FaceTarget
    L1MP V 10 A_CustomMissile("FLegendaryCyberBFG15KBall",39,10,Random(2,-2)) 
	L1MP G 5
	Goto See
  Lunge:
	TNT1 A 0 A_JumpIfCloser(300,1)
	Goto See
	TNT1 A 0 A_PlaySound("weapons/fistwiff")
	L1MP EF 5 A_FaceTarget
	TNT1 A 0 A_ChangeFlag(SLIDESONWALLS,1)
	TNT1 A 0 ThrustThingZ(0,25,0,1)
	L1MP G 2 A_Recoil(-30)
	L1MP G 3 A_CustomMissile("FLFLunge",18,0,0,CMF_AIMDIRECTION)
	L1MP G 3 
	L1MP F 2 A_ScaleVelocity(0.2)
	TNT1 A 0 A_ChangeFlag(SLIDESONWALLS,0)
	L1MP E 1 A_ScaleVelocity(0)
	Goto See
  LightMachineGun:
    L1MP G 10 A_FaceTarget
	TNT1 A 0 A_CustomMissile("LegendaryBlueTracer",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing",0,-12,36,Random(2,6),0,Random(1,3),Random(-80,-90),128)
	TNT1 A 0 A_CustomBulletAttack(42.5,14,1,Random(10,20)*6,"FriendlyLegendaryBulletPuff")
    L1MP V 2 A_PlaySoundEx("weapons/LMGFire","Weapon")
    L1MP G 4 A_FaceTarget
	TNT1 A 0 A_CustomMissile("LegendaryBlueTracer",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing",0,-12,36,Random(2,6),0,Random(1,3),Random(-80,-90),128)
	TNT1 A 0 A_CustomBulletAttack(42.5,14,1,Random(10,20)*6,"FriendlyLegendaryBulletPuff")
    L1MP V 2 A_PlaySoundEx("weapons/LMGFire","Weapon")
    L1MP G 4 A_FaceTarget
    TNT1 A 0 A_CPosRefire
	TNT1 A 0 A_Jump(20,"Pause2")
	Goto LightMachineGun+1
  ASG:
    L1MP E 8 A_FaceTarget
	L1MP E 8 A_FaceTarget
	TNT1 A 0 A_SpawnItemEx("BlueShellCasing",0,-12,36,Random(2,6),0,Random(1,3),Random(80,90),128)
	TNT1 AAAA 0 A_CustomMissile("LegendaryBlueTracer",Random(28,34),0,Random(6,-6),0)
	TNT1 A 0 A_CustomBulletAttack(22.5,18.3,4,Random(5,15)*6,"FriendlyLegendaryBulletPuff")
	L1MP W 4 A_PlaySoundEx("Weapons/LegAutoShotgun","Weapon")
    TNT1 A 0 A_Jump(64,"Pause")
    TNT1 A 0 A_SpidRefire
	Goto ASG+1
  LegCannon:
    L1MP E 0 A_FaceTarget
	L1MP E 15 A_PlaySound("legendarycannon/charge")
    L1MP W 2 A_CustomMissile("FLegRevBall",39,-10,0,0)
    L1MP EE 2 A_FaceTarget
    L1MP W 2 A_CustomMissile("FLegRevBall",39,-10,0,0)
    L1MP EE 2 A_FaceTarget
    L1MP W 2 A_CustomMissile("FLegRevBall",39,-10,0,0)
    L1MP EE 2 A_FaceTarget
    L1MP W 2 A_CustomMissile("FLegRevBall",39,-10,0,0)
    L1MP EE 2 A_FaceTarget
    TNT1 A 0 A_Jump(128,1)
    Goto See
  LegCannon2:
    L1MP F 5 A_FaceTarget
	L1MP G 15 A_PlaySound("legendarycannon/charge")
    L1MP V 2 A_CustomMissile("FLegRevBall",39,10,0,0)
    L1MP GG 2 A_FaceTarget
    L1MP V 2 A_CustomMissile("FLegRevBall",39,10,0,0)
    L1MP GG 2 A_FaceTarget
    L1MP V 2 A_CustomMissile("FLegRevBall",39,10,0,0)
    L1MP GG 2 A_FaceTarget
    L1MP V 2 A_CustomMissile("FLegRevBall",39,10,0,0)
    L1MP GG 2 A_FaceTarget
    Goto See
  MiniRockets:
    L1MP E 4 A_FaceTarget
    L1MP W 3 A_CustomMissile("FLegImpAnniMiniRocket",39,-10,0,0)
	L1MP E 4 A_FaceTarget
    L1MP W 3 A_CustomMissile("FLegImpAnniMiniRocket",39,-10,0,0)
	L1MP E 4 A_FaceTarget
    L1MP W 3 A_CustomMissile("FLegImpAnniMiniRocket",39,-10,0,0)
    L1MP F 4 A_FaceTarget
    L1MP G 4 A_FaceTarget
    L1MP V 3 A_CustomMissile("FLegImpAnniMiniRocket",39,10,0,0)
	L1MP G 4 A_FaceTarget
    L1MP V 3 A_CustomMissile("FLegImpAnniMiniRocket",39,10,0,0)
	L1MP G 4 A_FaceTarget
    L1MP V 3 A_CustomMissile("FLegImpAnniMiniRocket",39,10,0,0)
    Goto See
  ExpLasers:
	L1MP E 10 A_FaceTarget
	TNT1 A 0 A_PlaySound("monsters/fusionfire")
	L1MP W 3 A_CustomMissile("FVesselSpreadLaser",39,-10,frandom(2,-2))
	L1MP E 4 A_FaceTarget
	TNT1 A 0 A_PlaySound("monsters/fusionfire")
	L1MP W 3 A_CustomMissile("FVesselSpreadLaser",39,-10,frandom(2,-2))
	L1MP E 4 A_FaceTarget
	TNT1 A 0 A_PlaySound("monsters/fusionfire")
	L1MP W 3 A_CustomMissile("FVesselSpreadLaser",39,-10,frandom(2,-2))
	L1MP E 4 A_FaceTarget
	TNT1 A 0 A_PlaySound("monsters/fusionfire")
	L1MP W 3 A_CustomMissile("FVesselSpreadLaser",39,-10,frandom(2,-2))
	L1MP E 4 A_FaceTarget
    Goto See
  Pause:
	L1MP E 15
	Goto See
  Pause2:
	L1MP G 15
	Goto See
  Pain:
    TNT1 A 0 A_Jump(128,"PainMissile")
    L1MP H 2 Bright
    L1MP H 2 Bright A_Pain
	Goto See
  PainMissile:
    L1MP H 2 Bright
    L1MP H 2 Bright A_Pain
	Goto Missile
  Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_ChangeFlag(BRIGHT,0)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	L1MP I 8
    L1MP J 8 A_Scream
    L1MP K 6
    L1MP L 6 A_NoBlocking
    L1MP M -1
	Stop
  XDeath:
	TNT1 A 0 A_PlaySound("CerebralImp/ChargeDeath")
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
    L1MP HHHHHHHHHHHHHHHHHHHHHHHHH 2 Bright A_CustomMissile("LegendaryDRuneFlameSpawner",-20,0,random(0,-360),2,random(0,360))
    L1MP H 7
	TNT1 A 0 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    TNT1 A 0 A_ChangeFlag(BRIGHT,0)
    TNT1 A 0 A_PlaySound("weapons/dtech10kexplode")
    TNT1 A 0 A_Explode(500,200)
    L1MP N 4 A_SpawnItem("TLegCybDTBFGEx",0,-10)
	TNT1 A 0 A_custommissile("LegImpAnniArm2",30,-10,270)
	TNT1 A 0 A_custommissile("LegImpAnniArm1",30,10,93)
    L1MP O 2 A_XScream
	L1MP P 2 A_Explode(80,100)
    L1MP Q 2 A_NoBlocking
    L1MP RST 2
    L1MP U -1
    Stop
	}
}

Actor FriendlyLegendaryAnnihilatorImp2 : FriendlyLegendaryAnnihilatorImp
{
Tag "\c[z3]Friendly Legendary Annihilator Imp\c-"
States
{
  Spawn:
    L1MP A 1
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	L1MP A 10 A_Look
    Goto Idle
  Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_ChangeFlag(BRIGHT,0)
	TNT1 A 0 A_RemoveChildren(1)
	L1MP I 8
    L1MP J 8 A_Scream
    L1MP K 6
    L1MP L 6 A_NoBlocking
    L1MP M -1
	Stop
  XDeath:
	TNT1 A 0 A_PlaySound("CerebralImp/ChargeDeath")
	TNT1 A 0 A_RemoveChildren(1)
    L1MP HHHHHHHHHHHHHHHHHHHHHHHHH 2 Bright A_CustomMissile("LegendaryDRuneFlameSpawner",-20,0,random(0,-360),2,random(0,360))
    L1MP H 7
	TNT1 A 0 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    TNT1 A 0 A_ChangeFlag(BRIGHT,0)
    TNT1 A 0 A_PlaySound("weapons/dtech10kexplode")
    TNT1 A 0 A_Explode(500,200)
    L1MP N 4 A_SpawnItem("TLegCybDTBFGEx",0,-10)
	TNT1 A 0 A_custommissile("LegImpAnniArm2",30,-10,270)
	TNT1 A 0 A_custommissile("LegImpAnniArm1",30,10,93)
    L1MP O 2 A_XScream
	L1MP P 2 A_Explode(80,100)
    L1MP Q 2 A_NoBlocking
    L1MP RST 2
    L1MP U -1
    Stop
	}
}

Actor FLegImpAnniMiniRocket : LegImpAnniMiniRocket { Species "Player" DamageType "FriendlyMonster" +THRUSPECIES +MTHRUSPECIES }

ACTOR FriendlyLegendarySuperShotgunZombie : UACBaseMarine
{ 
Health 1150
Speed 12
Radius 20
Height 56
PainChance 20
DamageFactor 0.65
DropItem "Legendary Super Shotgun" 200
DropItem "LegendaryShell" 256 4
DropItem "LegendaryShellBox" 128
DropItem "LegendaryArmor" 90 1
DropItem "LegAmmoSphere" 93 1
DropItem "HandGrenadeAmmo" 235 2
DropItem "Backpack" 200 1
DropItem "Armorplate" 210 1
DropItem "Portablemedkit" 215 1
DropItem "StimKit" 220 3
DropItem "HealthFlask" 225 5
DropItem "LegendaryRune" 30 1
DropItem "LegendaryPowerShard" 35 1
DropItem "LegendaryPowerSphere" 35 1
SeeSound "Legssgzomb/sight"
PainSound "Legssgzomb/pain"
DeathSound "Legssgzomb/death"
ActiveSound "Legssgzomb/active"
Obituary "%o was killed by a Friendly Legendary Super Shotgun Zombie."
Tag "\c[z3]Friendly Legendary SuperShotgun Zombie\c-"
+NOICEDEATH
var int user_protection;
var int user_protected;
States
{
  Spawn:
    LES2 A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	LES2 A 10 Bright A_Look
    Goto Idle
  Idle:
	LES2 A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK)
	LES2 AABB 3 Bright A_GiveInventory("AIPatroling",1)
	LES2 C 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK)
    LES2 CCDD 3 Bright A_GiveInventory("AIPatroling",1)
	LES2 A 0 A_SpawnItem("FootStep",0,0,0,0)
	Loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  See:
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Jump(16,"GiveUp")
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
    LES2 AABB 3 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	LES2 A 0 A_JumpIfTargetInLOS("Strafing")
	LES2 CCDD 3 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    LES2 A 0 A_Jump(80,"Rush")
    Loop
  GiveUp:
    TNT1 A 0 A_ClearTarget
	LES2 A 10 Bright
	Goto Idle
  Rush:
    LES2 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegSsgguyGhostA",0,0,0,0,0,0,0,128)
	LES2 A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegSsgguyGhostA",0,0,0,0,0,0,0,128)
	LES2 A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendarySsgguyGhostB",0,0,0,0,0,0,0,128)
	LES2 B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendarySsgguyGhostB",0,0,0,0,0,0,0,128)
	LES2 B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegSsgguyGhostC",0,0,0,0,0,0,0,128)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	LES2 C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegSsgguyGhostC",0,0,0,0,0,0,0,128)
	LES2 C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendarySsgguyGhostD",0,0,0,0,0,0,0,128)
	LES2 D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendarySsgguyGhostD",0,0,0,0,0,0,0,128)
	LES2 D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",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
  Strafing:
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LES2 AA 3 Bright A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LES2 BB 3 Bright A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    LES2 CC 3 Bright A_GiveInventory("LegZombieStrafing",1)	
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LES2 DD 3 Bright A_GiveInventory("LegZombieStrafing",1)
	Goto See
  Missile:        
    TNT1 A 0 A_Jump(45,"LegNade")
	TNT1 A 0 A_JumpIfCloser(275,"Double")
  Normal:
    TNT1 A 0 A_SetShootable
    TNT1 A 0 A_UnsetInvulnerable
    TNT1 A 0 A_SetTranslucent(1)
	LES2 EE 1 Bright A_Facetarget
	LES2 E 1 Bright A_Facetarget
	TNT1 A 0 A_PlaySound("Weapons/LegSGsingle")
	TNT1 AAAA 0 A_CustomMissile("LegendaryBlueTracer",Random(28,34),0,Random(6,-6),0)
	LES2 F 3 Bright A_CustomBulletAttack(16.8,14.7,6,Random(7,16)*5,"FriendlyLegendaryBulletPuff")
	LES2 EE 3 Bright A_GiveInventory("LegZombieStrafing",1)
	LES2 E 0 Bright A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("Weapons/LegSGsingle")
	TNT1 AAAA 0 A_CustomMissile("LegendaryBlueTracer",Random(28,34),0,Random(6,-6),0)
	LES2 F 3 Bright A_CustomBulletAttack(22.5,0,3,Random(9,18)*2,"FriendlyLegendaryBulletPuff")
	LES2 EE 3 Bright A_GiveInventory("LegZombieStrafing",1)
	Goto Reload
  Double:
    TNT1 A 0 A_SetShootable
    TNT1 A 0 A_UnsetInvulnerable
    TNT1 A 0 A_SetTranslucent(1)
	LES2 EEE 3 Bright A_Facetarget
	LES2 E 0 Bright A_Facetarget
	TNT1 A 0 A_PlaySound("Weapons/LegSGboth")
	TNT1 AAAAAAAA 0 A_CustomMissile("LegendaryBlueTracer",Random(28,34),0,Random(6,-6),0)
	LES2 F 4 Bright A_CustomBulletAttack(19.5,15.3,14,Random(15,25)*5,"FriendlyLegendaryBulletPuff")
	LES2 EEE 2 Bright A_GiveInventory("LegZombieStrafing",1)
	Goto Reload
  Reload:
	LES2 E 3 Bright A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	LES2 E 6 Bright A_PlaySound("wWeapons/LegSGopen")
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_SpawnItemEx("BlueShellCasing", -8, 6, 36, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
	LES2 E 1 Bright A_SpawnItemEx("BlueShellCasing", -10, 6, 36, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
	LES2 E 6 Bright A_PlaySound("Weapons/LegSGin")
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	LES2 E 6 Bright A_PlaySound("Weapons/LegSGclose")
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	LES2 E 6 Bright A_CPosRefire
	Goto See
  LegNade:
	LES2 E 0 A_JumpIfCloser(280,"Missile")
    LES2 E 12 Bright A_GiveInventory("LegZombieStrafing",1)
    LES2 EEE 6 Bright A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
    LES2 E 6 Bright A_CustomMissile("FLegThrownGrenade",32,0,0,2,10)
	LES2 EE 25 Bright
	Goto See
  Pain:
    TNT1 A 0 A_Jump(10,"Protection")
	TNT1 A 0 A_Jump(192,"PainMissile")
    LES2 G 3 Bright A_GiveInventory("LegZombieStrafing",1)
    LES2 G 0 A_Pain
	LES2 G 3 Bright A_GiveInventory("LegZombieStrafing",1)
    Goto See
  PainMissile: 
    LES2 G 3 Bright A_GiveInventory("LegZombieStrafing",1)
    LES2 G 0 Bright A_Pain
	LES2 G 3 Bright A_GiveInventory("LegZombieStrafing",1)
    Goto Missile
  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
	LES2 E 2 Bright ACS_NamedExecuteAlways("LegendaryProtection",0,0,0,0)
	Goto See	
  Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LES2 H 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LES2 I 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LES2 J 5 A_SpawnItem("BodyCrash",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LES2 K 5 
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LES2 L 140
	LES2 L 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LES2 LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LES2 LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LES2 LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid+1)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	LES2 L -1
	Stop
  XDeath:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
    LASG O 5 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    LASG P 5 A_XScream
    LASG Q 5 A_Fall
    LASG RSTUV 5
    LASG W -1
    Stop
  }
}

Actor FriendlyLegendarySuperShotgunZombie2 : FriendlyLegendarySuperShotgunZombie
{
Tag "\c[z3]Friendly Legendary SuperShotgun Zombie\c-"
States
{
  Spawn:
    LES2 A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	LES2 A 10 Bright A_Look
    Goto Idle
  Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LES2 H 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LES2 I 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LES2 J 5 A_SpawnItem("BodyCrash",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LES2 K 5 
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LES2 L 140
	LES2 L 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LES2 LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LES2 LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LES2 LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	LES2 L -1
	Stop
  XDeath:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
    LASG O 5 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    LASG P 5 A_XScream
    LASG Q 5 A_Fall
    LASG RSTUV 5
    LASG W -1
    Stop
	}
}

ACTOR FriendlyLegendaryQuadShotgunZombie : FriendlyLegendaryLieutenant
{ 
Health 1450
Speed 12
PainChance 20
DropItem "LegendaryBossLifeEssence" 256
DropItem "LegendaryBossArmorBonusMax" 256
DropItem "LegendaryShell" 256 8
DropItem "LegendaryShellBox" 160
DropItem "LegendaryPowerShard" 30 1
DropItem "LegendaryArmor" 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" 27 1
SeeSound "legzom/sight"
AttackSound ""
PainSound "legzom/pain"
DeathSound "legzom/death"
ActiveSound "legzom/active"
Obituary "%o was killed by a Friendly Legendary Quad Shotgun Zombie."
Tag "\c[z3]Friendly Legendary Quad-Shotgun Zombie\c-"
+NOICEDEATH
States
{
  Spawn:
    LQSZ A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	LQSZ A 10 A_Look
    Goto Idle
  Idle:
    TNT1 A 0 A_ChangeFlag("NOPAIN",0)
	TNT1 A 0 A_SetShootable
	TNT1 A 0 A_SetTranslucent(1)
	LQSZ A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK)
	LQSZ AABB 3 A_GiveInventory("AIPatroling",1)
	LQSZ C 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK)
    LQSZ CCDD 3 A_GiveInventory("AIPatroling",1)
	LQSZ A 0 A_SpawnItem("FootStep",0,0,0,0)
	Loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  See:
    TNT1 A 0 A_ChangeFlag("NOPAIN",0)
	TNT1 A 0 A_SetShootable
	TNT1 A 0 A_SetTranslucent(1)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Jump(16,"GiveUp")
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
    LQSZ AABB 3 A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	LQSZ A 0 A_JumpIfTargetInLOS("Strafing")
	LQSZ CCDD 3 A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Jump(80,"Mine","Rush")
	TNT1 A 0 A_Jump(64,"Dodge")
    Loop
  GiveUp:
    TNT1 A 0 A_ClearTarget
	LQSZ A 10
	Goto Idle
  Rush:
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItemEx("LHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("LegQuadSGZombieGhostA",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	LQSZ A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegQuadSGZombieGhostA",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	LQSZ A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegQuadSGZombieGhostB",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	LQSZ B 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegQuadSGZombieGhostB",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	LQSZ B 1 A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LHellionSmokeSpawner")
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_SpawnItemEx("LegQuadSGZombieGhostC",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	LQSZ C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegQuadSGZombieGhostC",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	LQSZ C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegQuadSGZombieGhostD",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	LQSZ D 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegQuadSGZombieGhostD",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	LQSZ 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)
	LQSZ AA 3 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LQSZ BB 3 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LQSZ CC 3 A_GiveInventory("LegZombieStrafing",1)	
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LQSZ DD 3 A_GiveInventory("LegZombieStrafing",1)
	Goto See
  Dodge:
	LQSZ A 1 A_FaceTarget
	LQSZ E 0 ThrustThingZ(0,20,0,0)
	LQSZ A 0 A_Jump(256,"DodgeRight","DodgeLeft")
  DodgeLeft:
	LQSZ E 0 ThrustThing(angle*256/360+192, 15, 0, 0)
	Goto See
  DodgeRight:
	LQSZ E 0 ThrustThing(angle*256/360+64, 15, 0, 0)
	Goto See
  Mine:
	LQSZ C 1 Bright
    LQSZ C 12 Bright A_CustomMissile("FLACThrownMine",32,0,0,2,15)
	LQSZ E 12 Bright
    LQSZ 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:
	LQSZ EE 5 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("LegendaryQuadShotgun/DualFire",CHAN_WEAPON)
	TNT1 AAAAAAAA 0 A_CustomMissile("LegendaryBlueTracer",Random(28,34),0,Random(6,-6),0)
	TNT1 A 0 A_SetUserVar(user_reload,1)
	LQSZ F 5 A_CustomBulletAttack(30,20,24,Random(20,28),"FriendlyLegendaryBulletPuff")
	LQSZ EE 4 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_JumpIf(user_reload == 2,"Reload")
	TNT1 A 0 A_PlaySound("LegendaryQuadShotgun/DualFire",CHAN_WEAPON)
	TNT1 AAAAAAAA 0 A_CustomMissile("LegendaryBlueTracer",Random(28,34),0,Random(6,-6),0)
	TNT1 A 0 A_SetUserVar(user_reload,2)
	LQSZ F 5 A_CustomBulletAttack(30,20,24,Random(20,28),"FriendlyLegendaryBulletPuff")
	LQSZ EE 5 A_GiveInventory("LegZombieStrafing",1)
	Goto Reload
  Quad:
	TNT1 A 0 A_JumpIf(user_reload == 1,"Normal")
	TNT1 A 0 A_FaceTarget(45)
	LQSZ E 5 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_FaceTarget(45)
	LQSZ E 5 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_FaceTarget(45)
	LQSZ E 5 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("Coachgun/Fire1",CHAN_WEAPON)
	TNT1 AAAAAAAAAAAAAAAA 0 A_CustomMissile("LegendaryBlueTracer",Random(28,34),0,Random(6,-6),0)
	TNT1 A 0 A_SetUserVar(user_reload,4)
	LQSZ F 5 A_CustomBulletAttack(30,20,48,Random(20,28),"FriendlyLegendaryBulletPuff") //oh...
	LQSZ EEE 5 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_Jump(64,"Grenade")
	Goto Reload
  Grenade:
	TNT1 A 0 A_PlaySound("weapons/hgrenadepin",0,1.0,0)
	LQSZ CE 4 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("weapons/hgrenadethrow",0,1.0,0)
	LQSZ E 1 Bright A_CustomMissile("FLegThrownGrenade",32,0,0,2,4)
	TNT1 A 0 A_JumpIf(user_reload == 2,"Reload")
	Goto Dodge
  Reload:
	LQSZ E 3 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	LQSZ A 6 A_PlaySound("LegendaryQuadShotgun/Open")
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_SpawnItemEx("BlueShellCasing",-8,6,36,Random(2,6),0,random(1,3),random(-80,-90),128)
	LQSZ B 1 A_SpawnItemEx("BlueShellCasing",-10,6,36,Random(2,6),0,random(1,3),random(-80,-90),128)
	LQSZ B 6 A_PlaySound("LegendaryQuadShotgun/Load")
	TNT1 A 0 A_SpawnItemEx("BlueShellCasing",-8,6,36,Random(2,6),0,random(1,3),random(-80,-90),128)
	LQSZ B 1 A_SpawnItemEx("BlueShellCasing",-10,6,36,Random(2,6),0,random(1,3),random(-80,-90),128)
	LQSZ B 6 A_PlaySound("LegendaryQuadShotgun/Load")
	TNT1 A 0 A_SetUserVar(user_reload,0)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	LQSZ C 6 A_PlaySound("LegendaryQuadShotgun/Close")
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	LQSZ 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")
	LQSZ G 3
	LQSZ 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
	LQSZ E 2 ACS_NamedExecuteAlways("LegendaryProtection",0,0,0,0)
	Goto See		
  Death:
    TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	LQSZ H 6 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LQSZ I 6 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",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)
	LQSZ J 6 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LQSZ K 6 A_SpawnItem("BodyCrash",0,0,0,0)			
	LQSZ L 6 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LQSZ L 140 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LQSZ LLLLLLLLLLLLLLLLL 2 A_GiveInventory("LegSoulEvent",1)
	LQSZ LLLLLLLLLLLLLLLLL 2 A_GiveInventory("LegSoulEvent",1)
	LQSZ LLLLLLLLLLLLLLLLL 2 A_GiveInventory("LegSoulEvent",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)
	LQSZ L 525 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid+1)
	LQSZ L 5 A_FadeOut(0.1,1)
	Wait
  XDeath:
	TNT1 A 0 A_ChangeFlag("BRIGHT",0)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	LQSZ M 5 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
	LQSZ N 5 A_XScream
	LQSZ O 5 A_Fall
	LQSZ PQRST 5
	LQSZ U -1
	Stop
  }
}

Actor FriendlyLegendaryQuadShotgunZombie2 : FriendlyLegendaryQuadShotgunZombie
{
Tag "\c[z3]Friendly Legendary Quad-Shotgun Zombie\c-"
States
{
  Spawn:
    LQSZ A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	LQSZ A 10 A_Look
    Goto Idle
  Death:
    TNT1 A 0 A_RemoveChildren(1)
	LQSZ H 6 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LQSZ I 6 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",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)
	LQSZ J 6 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LQSZ K 6 A_SpawnItem("BodyCrash",0,0,0,0)			
	LQSZ L 6 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LQSZ L 140 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LQSZ LLLLLLLLLLLLLLLLL 2 A_GiveInventory("LegSoulEvent",1)
	LQSZ LLLLLLLLLLLLLLLLL 2 A_GiveInventory("LegSoulEvent",1)
	LQSZ LLLLLLLLLLLLLLLLL 2 A_GiveInventory("LegSoulEvent",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)
	LQSZ L 525 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid)
	LQSZ L 5 A_FadeOut(0.1,1)
	Wait
  XDeath:
	TNT1 A 0 A_ChangeFlag("BRIGHT",0)
	TNT1 A 0 A_RemoveChildren(1)
	LQSZ M 5 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
	LQSZ N 5 A_XScream
	LQSZ O 5 A_Fall
	LQSZ PQRST 5
	LQSZ U -1
	Stop
	}
}

ACTOR FriendlyLegendaryLeader : FriendlyLegendaryZombie
{
Health 1550
Mass 400
Speed 12
MaxStepHeight 64
PainChance 30
Reactiontime 25
BloodColor "Blue"
DamageFactor 0.65
DropItem "PortableMedCell", 150, 1
DropItem "StimKit", 180, 2
DropItem "ClipBox", 180
DropItem "HealthFlask", 200, 6
DropItem "LegendaryArmor" 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
SeeSound "PNZombie/See"
ActiveSound "PNZombie/Act"
PainSound "PNZombie/Pain"
DeathSound "PNZombie/Die"
Obituary "%o was killed by a friendly Legendary leader."
Tag "\c[z3]Friendly Legendary Elite Zombie Leader\c-"
+BRIGHT
States
{
  Spawn:
    LNGZ A 1
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	LNGZ A 10 A_Look
    Goto Idle
  Idle:
	TNT1 A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Look
	LNGZ AAAA 1 A_Wander
	TNT1 A 0 A_Look
	LNGZ BBBB 1 A_Wander
	TNT1 A 0 A_SpawnItemEx("FootStep2",0,0,5,0,0,-20)
	TNT1 A 0 A_Look
	LNGZ CCCC 1 A_Wander
	TNT1 A 0 A_Look
	LNGZ DDDD 1 A_Wander
	TNT1 A 0 HealThing(random(1,2))
	TNT1 A 0 A_SpawnItemEx("FootStep2",0,0,5,0,0,-20)
	Loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  See:
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Jump(16,"GiveUp")
	TNT1 A 0 A_JumpIfInventory("SnipeOn",1,"SnipeSee")
	LNGZ AAAABBBB 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep2",0,0,5,0,0,-20)
	LNGZ CCCCDDDD 1 A_Chase
	TNT1 A 0 HealThing(random(1,2))
	TNT1 A 0 A_SpawnItemEx("FootStep2",0,0,5,0,0,-20)
	Loop
  SnipeSee:
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Jump(16,"GiveUp")
	LNGZ AAAA 1 A_Chase("","SnipeFire")
	TNT1 A 0 A_FastChase
	TNT1 A 0 A_JumpIfCloser(192,"StopSnipe")
	LNGZ AAAA 1 A_Chase("","SnipeFire")
	TNT1 A 0 A_JumpIfCloser(192,"StopSnipe")
	LNGZ BBBB 1 A_Chase("","SnipeFire")
	TNT1 A 0 A_Jump(20,"Heal")
	TNT1 A 0 A_JumpIfCloser(192,"StopSnipe")
	LNGZ BBBB 1 A_Chase("","SnipeFire")
	TNT1 A 0 A_SpawnItemEx("FootStep2",0,0,5,0,0,-20)
	TNT1 A 0 A_JumpIfCloser(192,"StopSnipe")
	LNGZ CCCC 1 A_Chase("","SnipeFire")
	TNT1 A 0 A_Jump(20,"Heal")
	TNT1 A 0 A_JumpIfCloser(192,"StopSnipe")
	LNGZ CCCC 1 A_Chase("","SnipeFire")
	TNT1 A 0 A_FastChase
	TNT1 A 0 A_JumpIfCloser(192,"StopSnipe")
	LNGZ DDDD 1 A_Chase("","SnipeFire")
	TNT1 A 0 A_JumpIfCloser(192,"StopSnipe")
	TNT1 A 0 A_FastChase
	LNGZ DDDD 1 A_Chase("","SnipeFire")
	TNT1 A 0 A_SpawnItemEx("FootStep2",0,0,5,0,0,-20)
	Loop
  GiveUp:
    TNT1 A 0 A_ClearTarget
	LNGZ A 10
	Goto Idle
  Missile:
	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")
	LNGZ EEEEEEEEEE 1 A_FaceTarget(45)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	LNGZ F 2 A_CustomMissile("FLegSentientExplosiveTracer",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")
	LNGZ E 2 A_SpidRefire
	Goto Missile
  MissileEnd:
	LNGZ E 2 A_FaceTarget
	TNT1 AAA 0 A_FastChase
	Goto See
  Rage:
	LNGZ EEEEEEEEEE 1 A_FaceTarget(45)
	LNGZ E 3 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	LNGZ F 1 A_CustomMissile("FLegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	LNGZ E 2 A_FaceTarget
	TNT1 A 0 A_Jump(50,"Heal")
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	LNGZ F 1 A_CustomMissile("FLegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	LNGZ E 2 A_FaceTarget
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	LNGZ F 1 A_CustomMissile("FLegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	LNGZ E 2 A_FaceTarget
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	LNGZ F 1 A_CustomMissile("FLegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	LNGZ E 2 A_FaceTarget
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	LNGZ F 1 A_CustomMissile("FLegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	LNGZ E 2 A_FaceTarget
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	LNGZ F 1 A_CustomMissile("FLegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	LNGZ 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")
	LNGZ F 1 A_CustomMissile("FLegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	LNGZ E 2 A_FaceTarget
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	LNGZ F 1 A_CustomMissile("FLegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	LNGZ E 2 A_FaceTarget
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	LNGZ F 1 A_CustomMissile("FLegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	LNGZ 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")
	LNGZ F 1 A_CustomMissile("FLegSentientExplosiveTracer",34,9,random(4,-4),CMF_TRACKOWNER|CMF_OFFSETPITCH,frandom(-2.0,2.0))
	LNGZ 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)
	LNGZ CE 4 A_FaceTarget
	TNT1 A 0 A_PlaySound("weapons/hgrenadethrow",0,1.0,0)
	LNGZ E 1 A_CustomMissile("FLegThrownGrenade",32,0,0,2,4)
	Goto See
  SpreadFire:
	TNT1 A 0
	TNT1 A 0 A_FastChase
	LNGZ EEEEEEEEEE 1 A_FaceTarget
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("PulseNail/fire")
	TNT1 A 0 A_CustomMissile("FLegSentientExplosiveTracer",34,9,random(-8,8),CMF_OFFSETPITCH,frandom(-4.0,4.0))
	TNT1 A 0 A_CustomMissile("FLegSentientExplosiveTracer",34,9,random(-8,8),CMF_OFFSETPITCH,frandom(-4.0,4.0))
	TNT1 A 0 A_CustomMissile("FLegSentientExplosiveTracer",34,9,random(-8,8),CMF_OFFSETPITCH,frandom(-4.0,4.0))
	TNT1 A 0 A_CustomMissile("FLegSentientExplosiveTracer",34,9,random(-8,8),CMF_OFFSETPITCH,frandom(-4.0,4.0))
	LNGZ F 3 A_CustomMissile("FLegSentientExplosiveTracer",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")
	LNGZ E 3 A_SpidRefire
	TNT1 A 0 A_Jump(30,"Heal")
	Goto Missile
  SpreadFireEnd:
	LNGZ 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)
	LNGZ E 2 A_FaceTarget
	TNT1 A 0 A_Jump(64,2)
	LNGZ E 2 A_FaceTarget
	TNT1 A 0 A_Jump(64,2)
	LNGZ E 2 A_FaceTarget
	LNGZ E 2 A_FaceTarget
	LNGZ F 3 A_PlaySound("PulseNail/fire")
	TNT1 A 0 A_CustomMissile("FLegSentientExplosiveTracer",34,9,0)
	TNT1 AA 0 A_CustomMissile("FLegSentientExplosiveTracer",34,9,0,CMF_TRACKOWNER)
	TNT1 A 0 A_FaceTarget
	LNGZ 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:
	LNGZ G 3
	LNGZ 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:
	LNGZ A 1 A_Recoil(-16)
	TNT1 A 0 ThrustThingZ(0,11,0,0)
	LNGZ A 4
	GoTo See
  Heal:
	LNGZ 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 >= 110,"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 >= 110,"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 >= 110,"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 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	LNGZ H 5
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LNGZ I 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LNGZ J 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_ChangeFlag(BRIGHT,0)
	TNT1 A 0 A_SpawnItemEx("ExplosiveRifle",0,0,8,random(0,8),random(0,8),2,random(0,360),0,164)
    LNGZ K 5 A_SpawnItem("BodyCrash",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LNGZ LM 5 
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LNGZ N 140
	TNT1 A 0 A_ChangeFlag(BRIGHT,1)
	LNGZ N 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LNGZ NNNNNNNNNNNNNNNNN 2 A_GiveInventory("LegSoulEvent",1)
	LNGZ NNNNNNNNNNNNNNNNN 2 A_GiveInventory("LegSoulEvent",1)
	LNGZ NNNNNNNNNNNNNNNNN 2 A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid+1)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	TNT1 A 0 A_ChangeFlag(BRIGHT,0)
	LNGZ N -1
	Stop
  XDeath:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	TNT1 A 0 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
	LNGZ O 5 A_GiveInventory("XDeathCheck",1)
	LNGZ P 5 A_XScream
	LNGZ Q 5 A_Fall
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(298) == 1, "XAlwaysDrop")
	TNT1 A 0 A_SpawnItemEx("ExplosiveRifle",0,0,8,random(0,8),random(0,8),2,random(0,360),0,164)
    TNT1 A 0 A_ChangeFlag(BRIGHT,0)
	LNGZ RSTU 5
	LNGZ V -1
	Stop
	}
}

Actor FriendlyLegendaryLeader2 : FriendlyLegendaryLeader
{
Tag "\c[z3]Friendly Legendary Elite Zombie Leader\c-"
States
{
  Spawn:
    LNGZ A 1
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	LNGZ A 10 A_Look
    Goto Idle
  Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	LNGZ H 5
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LNGZ I 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LNGZ J 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_ChangeFlag(BRIGHT,0)
	TNT1 A 0 A_SpawnItemEx("ExplosiveRifle",0,0,8,random(0,8),random(0,8),2,random(0,360),0,164)
    LNGZ K 5 A_SpawnItem("BodyCrash",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LNGZ LM 5 
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LNGZ N 140
	TNT1 A 0 A_ChangeFlag(BRIGHT,1)
	LNGZ N 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LNGZ NNNNNNNNNNNNNNNNN 2 A_GiveInventory("LegSoulEvent",1)
	LNGZ NNNNNNNNNNNNNNNNN 2 A_GiveInventory("LegSoulEvent",1)
	LNGZ NNNNNNNNNNNNNNNNN 2 A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	TNT1 A 0 A_ChangeFlag(BRIGHT,0)
	LNGZ N -1
	Stop
  XDeath:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
	LNGZ O 5 A_GiveInventory("XDeathCheck",1)
	LNGZ P 5 A_XScream
	LNGZ Q 5 A_Fall
	TNT1 A 0 A_SpawnItemEx("ExplosiveRifle",0,0,8,random(0,8),random(0,8),2,random(0,360),0,164)
    TNT1 A 0 A_ChangeFlag(BRIGHT,0)
	LNGZ RSTU 5
	LNGZ V -1
	Stop
	}
}

ACTOR FriendlyLegendaryProShotgunner : UACBaseMarine
{ 
Health 1550
GibHealth 130
Speed 12
Height 56
Radius 20
BloodColor "Blue"
Mass 150
Speed 10
FastSpeed 14
PainChance 15
DamageFactor 0.70
DropItem "Legendary Assault Shotgun" 202
DropItem "LegendaryShell" 256 4
DropItem "LegendaryShellBox" 130
DropItem "LegendaryPowerShard" 25 1
DropItem "LegendaryArmor" 80 1
DropItem "LegAmmoSphere" 85 1
DropItem "HandGrenadeAmmo" 237 2
DropItem "MineAmmo" 242 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 "LegendaryRune" 23 1
SeeSound "grunt/sight"
AttackSound "legendarypro/fire"
PainSound "grunt/pain"
DeathSound "grunt/death"
ActiveSound "grunt/active"
Obituary "%o was killed by a Friendly Legendary Pro Shotgunner"
Tag "\c[z3]Friendly Legendary Pro Shotgunner\c-"
+NOICEDEATH
States
{
  Spawn:
    LPSG A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	LPSG A 10 Bright A_Look
    Goto Idle
  Idle:
	LPSG A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK)
	LPSG AABB 3 Bright A_GiveInventory("AIPatroling",1)
	LPSG C 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK)
    LPSG CCDD 3 Bright A_GiveInventory("AIPatroling",1)
	LPSG A 0 A_SpawnItem("FootStep",0,0,0,0)
	Loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  See:
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Jump(16,"GiveUp")
	LPSG AAA 1 Bright A_Chase("","")
	LPSG A 1 A_Chase
	TNT1 A 0 A_JumpIfTargetInLOS("DogdeSee",50,JLOSF_TARGETLOS)
	LPSG AAA 1 Bright A_Chase("","")
	LPSG A 1 A_Chase
	TNT1 A 0 A_JumpIfTargetInLOS("DogdeSee",50,JLOSF_TARGETLOS)
	LPSG BBB 1 Bright A_Chase("","")
	LPSG B 1 A_Chase
	TNT1 A 0 A_JumpIfTargetInLOS("DogdeSee",50,JLOSF_TARGETLOS)
	LPSG BBB 1 Bright A_Chase("","")
	LPSG B 1 A_Chase
	TNT1 A 0 A_JumpIfTargetInLOS("DogdeSee",50,JLOSF_TARGETLOS)
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	LPSG CCC 1 Bright A_Chase("","")
	LPSG C 1 A_Chase
	TNT1 A 0 A_JumpIfTargetInLOS("DogdeSee",50,JLOSF_TARGETLOS)
	LPSG CCC 1 Bright A_Chase("","")
	LPSG C 1 A_Chase
	TNT1 A 0 A_JumpIfTargetInLOS("DogdeSee",50,JLOSF_TARGETLOS)
	LPSG DDD 1 Bright A_Chase("","")
	LPSG D 1 A_Chase
	TNT1 A 0 A_JumpIfTargetInLOS("DogdeSee",50,JLOSF_TARGETLOS)
	LPSG DDD 1 Bright A_Chase("","")
	LPSG D 1 A_Chase
	TNT1 A 0 A_JumpIfTargetInLOS("DogdeSee",50,JLOSF_TARGETLOS)
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Jump(64,"Mine")
	LPSG A 0 A_Jump(64,"Rush")
	TNT1 A 0 A_Jump(64,"DodgeLeft","DodgeRight")
	TNT1 A 0 A_Jump(64,"Chase")
    Loop
  GiveUp:
    TNT1 A 0 A_ClearTarget
	LPSG A 10 Bright
	Goto Idle
  DogdeSee:
	TNT1 A 0 A_GiveInventory("SpecOpsStrafing",1)
	TNT1 A 0 A_FaceTarget
	LPSG AAA 1 Bright A_Chase("","",CHF_FASTCHASE)
	LPSG A 1 A_Chase
	TNT1 A 0 A_GiveInventory("SpecOpsStrafing",1)
	TNT1 A 0 A_CheckSight("See")
	TNT1 A 0 A_FaceTarget
	LPSG AAA 1 Bright A_Chase("","",CHF_FASTCHASE)
	LPSG A 1 A_Chase
	TNT1 A 0 A_GiveInventory("SpecOpsStrafing",1)
	TNT1 A 0 A_CheckSight("See")
	TNT1 A 0 A_FaceTarget
	LPSG BBB 1 Bright A_Chase("","",CHF_FASTCHASE)
	LPSG B 1 A_Chase
	TNT1 A 0 A_GiveInventory("SpecOpsStrafing",1)
	TNT1 A 0 A_CheckSight("See")
	TNT1 A 0 A_FaceTarget
	LPSG BBB 1 Bright A_Chase("","",CHF_FASTCHASE)
	LPSG B 1 A_Chase
	TNT1 A 0 A_GiveInventory("SpecOpsStrafing",1)
	TNT1 A 0 A_CheckSight("See")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	LPSG CCC 1 Bright A_Chase("","",CHF_FASTCHASE)
	LPSG C 1 A_Chase
	TNT1 A 0 A_GiveInventory("SpecOpsStrafing",1)
	TNT1 A 0 A_CheckSight("See")
	TNT1 A 0 A_FaceTarget
	LPSG CCC 1 Bright A_Chase("","",CHF_FASTCHASE)
	LPSG C 1 A_Chase
	TNT1 A 0 A_GiveInventory("SpecOpsStrafing",1)
	TNT1 A 0 A_CheckSight("See")
	TNT1 A 0 A_FaceTarget
	LPSG DDD 1 Bright A_Chase("","",CHF_FASTCHASE)
	LPSG D 1 A_Chase
	TNT1 A 0 A_GiveInventory("SpecOpsStrafing",1)
	TNT1 A 0 A_CheckSight("See")
	TNT1 A 0 A_FaceTarget
	LPSG DDD 1 Bright A_Chase("","",CHF_FASTCHASE)
	LPSG D 1 A_Chase
	TNT1 A 0 A_GiveInventory("SpecOpsStrafing",1)
	TNT1 A 0 A_CheckSight("See")
	TNT1 A 0 A_Jump(64,"Mine")
	LPSG A 0 A_Jump(64,"Rush")
	TNT1 A 0 A_Jump(64,"DodgeLeft","DodgeRight","DodgeGo")
	TNT1 A 0 A_Jump(64,"Chase")
	Loop
  Rush:
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegPSGZombieGhostA",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LPSG A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegPSGZombieGhostA",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LPSG A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegPSGZombieGhostB",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LPSG B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegPSGZombieGhostB",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LPSG B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_SpawnItemEx("LegPSGZombieGhostC",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LPSG C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegPSGZombieGhostC",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LPSG C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegPSGZombieGhostD",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LPSG D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegPSGZombieGhostD",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LPSG D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_Jump(85,"See")
	TNT1 A 0 A_Jump(200,"DodgeGo")
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	Loop
  Chase:
	LPSG AA 1 Bright A_FastChase
	LPSG A 0 A_JumpIfCloser(130,"Dodge")
	LPSG AA 1 Bright A_Chase
	LPSG A 0 A_JumpIfCloser(130,"Dodge")
	LPSG BB 1 Bright A_Chase
	LPSG A 0 A_JumpIfCloser(130,"Dodge")
	LPSG BB 1 Bright A_Chase
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	LPSG A 0 A_JumpIfCloser(150,"Dodge")
	LPSG CC 1 Bright A_Chase
	LPSG A 0 A_JumpIfCloser(150,"Dodge")
	LPSG CC 1 Bright A_FastChase
	LPSG A 0 A_JumpIfCloser(130,"Dodge")
	LPSG DD 1 Bright A_FastChase
	LPSG A 0 A_JumpIfCloser(130,"Dodge")
	LPSG DD 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	TNT1 A 0 A_Jump(95,"Mine")
	LPSG A 0 A_Jump(128,"Dodge")
	LPSG A 0 A_Jump(180,"DodgeGo")
	Loop
  SeeNoDodge:
	LPSG AABB 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	LPSG CCDD 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	LPSG AABB 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	LPSG CCDD 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	LPSG AABB 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	LPSG CCDD 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	Goto Chase
  Dodge:
	LPSG A 1 Bright A_FaceTarget
	LPSG E 0 ThrustThingZ(0, 20, 0, 0)
	LPSG A 0 A_Jump(256,"DodgeRight","DodgeLeft")
  DodgeLeft:
	LPSG E 0 ThrustThing(angle*256/360+192, 15, 0, 0)
	Goto SeeNoDodge
  DodgeRight:
	LPSG E 0 ThrustThing(angle*256/360+64, 15, 0, 0)
	Goto SeeNoDodge
  DodgeGo:
	TNT1 A 0 A_CheckSight("Dodge")
	LPSG E 4 A_FaceTarget
	TNT1 A 0 A_ChangeFlag(SLIDESONWALLS,1)
	TNT1 A 0 ThrustThingZ(0,20,0,1)
	TNT1 A 0 A_CustomBulletAttack(22.5,18.3,4,Random(5,15)*6,"FriendlyLegendaryBulletPuff")
	TNT1 AAAA 0 A_CustomMissile("LegendaryBlueTracer",random(28,34),0,random(-6,6),0)
	TNT1 A 0 A_SpawnItemEx("BlueShellCasing",-8,0,30,Random(2,6),0,Random(1,3),Random(-80,-90),SXF_CLIENTSIDE,0)
	LPSG E 2 A_Recoil(-36)
	TNT1 A 0 A_PlaySound("legendarypro/cock")
	LPSG E 6 A_CustomMissile("PinkyLunge")
	LPSG E 2  A_ScaleVelocity(0.2)
	TNT1 A 0 A_ChangeFlag(SLIDESONWALLS,0)
	LPSG E 1 A_ScaleVelocity(0)
	Goto Missile
  Mine:
	LPSG C 1 Bright
	LPSG C 12 Bright A_CustomMissile("FLACThrownMine",32,0,0,2,15)
	LPSG E 12 Bright
	LPSG C 3 Bright
	Goto See
  Missile:
	LPSG E 6 A_FaceTarget
	LPSG FF 1 Bright A_FaceTarget
	TNT1 A 0 A_ChangeFlag(SLIDESONWALLS,1)
	TNT1 A 0 ThrustThingZ(0,Random(20,40),0,1)
	TNT1 A 0 ThrustThing(angle*256/360+random(192.0,64.0),Random(15,30),0,0)
	TNT1 A 0 A_CustomBulletAttack(22.5,18.3,8,Random(5,15)*6,"FriendlyLegendaryBulletPuff")
	TNT1 AAAAAAAA 0 A_CustomMissile("LegendaryBlueTracer",random(28,34),0,random(-6,6),0)
	LPSG E 6 A_FaceTarget
	LPSG E 4 A_PlaySound("legendarypro/cock")
	TNT1 A 0 A_SpawnItemEx("BlueShellCasing",-8,0,30,Random(2,6),0,Random(1,3),Random(-80,-90),SXF_CLIENTSIDE,0)
	LPSG E 2  A_ScaleVelocity(0.2)
	TNT1 A 0 A_ChangeFlag(SLIDESONWALLS,0)
	LPSG E 4 Bright A_FaceTarget
	TNT1 A 0 A_CPosRefire
	TNT1 A 0 A_JumpIfTargetInLOS("DogdeSee",50,JLOSF_TARGETLOS)
	TNT1 A 0 A_Jump(40,"Mine")
	LPSG A 0 A_Jump(180,"DodgeGo")
	Goto Missile
  Pain:
	TNT1 A 0
	TNT1 A 0 A_Jump(20,"Dodge")
	TNT1 A 0 A_Jump(192,"PainMissile")
	TNT1 A 0 A_Jump(30,"Mine")
	Goto See
  PainMissile:
    LPSG G 3 Bright
    LPSG G 3 Bright A_Pain
    Goto Missile		
  Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
    TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPSG H 5 A_Scream
    TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPSG I 5 A_Fall
    TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPSG J 5 A_SpawnItem("BodyCrash",0,0,0,0)
    LPSG K 5 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPSG L 140 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPSG L 0 A_PlaySoundEx("brain/spit","Voice",0,2)
    LPSG LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LPSG LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LPSG LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid+1)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
    LPSG L -1
	Stop
  XDeath:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	LPSG G 3 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
	LPSG H 3 A_XScream
	LPSG I 3 A_Fall
	LPSG PQRSTUV 3
	LPSG W -1
	Stop
  }
}

Actor FriendlyLegendaryProShotgunner2 : FriendlyLegendaryProShotgunner
{
Tag "\c[z3]Friendly Legendary Pro Shotgunner\c-"
States
{
  Spawn:
    LPSG A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	LPSG A 10 Bright A_Look
    Goto Idle
  Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
    TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPSG H 5 A_Scream
    TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPSG I 5 A_Fall
    TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPSG J 5 A_SpawnItem("BodyCrash",0,0,0,0)
    LPSG K 5 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPSG L 140 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LPSG L 0 A_PlaySoundEx("brain/spit","Voice",0,2)
    LPSG LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LPSG LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LPSG LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
    LPSG L -1
	Stop
  XDeath:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	LPSG G 3 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
	LPSG H 3 A_XScream
	LPSG I 3 A_Fall
	LPSG PQRSTUV 3
	LPSG W -1
	Stop
	}
}

ACTOR FriendlyLegendaryCatharsi : UACBaseMarine
{ 
Health 1200
GibHealth 40
Speed 10
Radius 18
Height 56
BloodColor "Blue"
Mass 400
PainChance 40
DamageFactor 0.675
DropItem "LegendarySphere" 160 1
DropItem "LegendaryRune" 128 1
DropItem "LegGreaterDemonicEnergy" 256
DropItem "LegDemonicEnergy" 256
DropItem "BossLifeEssence" 256
DropItem "BossArmorBonusMax" 256
DropItem "Legendary Plasmatic Cannon" 64
DropItem "Legendary Plasmatic Rifle" 128
SeeSound "LegCatharsi/See"
PainSound "LegCatharsi/pain"
DeathSound "LegCatharsi/death"
ActiveSound "LegCatharsi/Act"
Obituary "%o was killed by a Friendly Legendary Catharsi"
Tag "\c[z3]Friendly Legendary Catharsi\c-"
+NOICEDEATH
+LOOKALLAROUND
var int user_rush;
var int user_missile;
States
{
  Spawn:
    LFRC A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	LFRC A 10 Bright A_Look
    Goto Idle
  Idle:
	LFRC A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK)
    TNT1 A 0 A_Jump(36,"RushIdle")
	TNT1 A 0 A_SetUserVar("user_missile",0)
	TNT1 A 0 A_SetUserVar("user_rush",0)
	LFRC AABB 2 Bright A_Wander
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK)
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	LFRC CCDD 2 Bright A_Wander
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	Loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  See:
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Jump(16,"GiveUp")
	TNT1 A 0 A_SetUserVar("user_missile",0)
	TNT1 A 0 A_SetUserVar("user_rush",0)
	TNT1 A 0 A_Jump(36,"Rush")
	LFRC AABB 2 Bright A_Chase
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	LFRC CCDD 2 Bright A_Chase
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
    Loop
  GiveUp:
    TNT1 A 0 A_ClearTarget
	LFRC A 10 Bright
	Goto Idle
  Rush:
	TNT1 A 0 A_JumpIf(user_rush == 4,"See")
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegFormGhostA",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	TNT1 AA 0 A_Chase
	LFRC A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegFormGhostB",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	TNT1 AA 0 A_Chase
	LFRC B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegFormGhostC",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	TNT1 AA 0 A_Chase
	LFRC C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegFormGhostD",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	TNT1 AA 0 A_Chase
	LFRC D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	TNT1 A 0 A_SetUserVar(user_rush,user_rush+1)
	Loop
  Rushidle:
	TNT1 A 0 A_JumpIf(user_rush == 4,"See")
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegFormGhostA",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	TNT1 AA 0 A_Wander
	LFRC A 1 Bright A_Wander
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegFormGhostB",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	TNT1 AA 0 A_Wander
	LFRC B 1 Bright A_Wander
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegFormGhostC",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	TNT1 AA 0 A_Wander
	LFRC C 1 Bright A_Wander
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegFormGhostD",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	TNT1 AA 0 A_Wander
	LFRC D 1 Bright A_Wander
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	TNT1 A 0 A_SetUserVar(user_rush,user_rush+1)
	Goto Idle
  Missile:
    TNT1 A 0 A_Jump(128,"10K","Cannon","Plasmatic","Railgun","Grenades")
  15K:
	TNT1 A 0 A_PlaySound("weapons/charge15k")
	LFRC EEEEEE 4 Bright A_FaceTarget
	LFRC F 8 Bright A_CustomMissile("FLFormicidaeBall",30,-3)
	LFRC E 5 Bright A_FaceTarget
	LFRC F 8 Bright A_CustomMissile("FLFormicidaeBall",30,-3)
	LFRC E 5 Bright A_FaceTarget
	LFRC F 8 Bright A_CustomMissile("FLFormicidaeBall",30,-3)
	LFRC E 5 Bright A_FaceTarget
	LFRC F 8 Bright A_CustomMissile("FLFormicidaeBall",30,-3)
	LFRC E 5 Bright A_FaceTarget
	LFRC F 8 Bright A_CustomMissile("FLFormicidaeBall",30,-3)
	LFRC E 11 Bright A_FaceTarget
	Goto See
  10K:
	TNT1 A 0 A_PlaySound("weapons/charge15k")
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LFRC E 4 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LFRC E 4 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LFRC E 4 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LFRC E 4 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LFRC E 4 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LFRC E 4 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_PlaySound("weapons/bfg15kfire")
	LFRC F 8 Bright A_CustomMissile("FLFRCharsi10KProjectile",30,-3,Random(-12,12))
	LFRC E 5 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_PlaySound("weapons/bfg15kfire")
	LFRC F 8 Bright A_CustomMissile("FLFRCharsi10KProjectile",30,-3,Random(-12,12))
	LFRC E 5 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_PlaySound("weapons/bfg15kfire")
	LFRC F 8 Bright A_CustomMissile("FLFRCharsi10KProjectile",30,-3,Random(-12,12))
	LFRC E 5 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_PlaySound("weapons/bfg15kfire")
	LFRC F 8 Bright A_CustomMissile("FLFRCharsi10KProjectile",30,-3,Random(-12,12))
	LFRC E 5 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_PlaySound("weapons/bfg15kfire")
	LFRC F 8 A_CustomMissile("FLFRCharsi10KProjectile",30,-3,Random(-12,12))
	LFRC E 11 Bright A_FaceTarget
	Goto See
  Cannon:
	TNT1 A 0 A_JumpIf(user_missile == 5,"See")
	LFRC EEEEE 2 Bright A_FaceTarget
	TNT1 A 0 A_CustomMissile("FLegBehCannonProj",30,-3,Random(-12,12))
	LFRC F 2 Bright A_PlaySoundEx("legendarycannon/fire","Weapon")
	TNT1 A 0 A_SetUserVar(user_missile,user_missile+1)
	Loop
  Plasmatic:
	TNT1 A 0 A_SetShootable
	TNT1 A 0 A_UnsetInvulnerable
	LFRC E 10 Bright A_FaceTarget
  PlasmaticLoop:
	TNT1 A 0 A_JumpIfCloser(350,"10K")
	LFRC E 3 Bright A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_CustomMissile("FLegendaryProjectile",30,-3,Random(-12,12),0)
	LFRC F 3 Bright A_PlaySoundEx("BlueDTRFire","Weapon")
	TNT1 A 0 A_SpidRefire
	TNT1 A 0 A_Jump(20,"See")
	TNT1 A 0 A_Jump(20,"Railgun","15k")
	Loop
  Railgun:
	TNT1 A 0 A_PlaySound("weapons/rgcharge")
	LFRC E 25 Bright A_FaceTarget
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_PlaySound("monsters/darkcyberrail",CHAN_WEAPON)
	LFRC F 5 Bright A_CustomMissile("FLegCatharsiRail",30,-3,Random(-12,12),0)
	LFRC E 10 Bright A_FaceTarget
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_PlaySound("monsters/darkcyberrail",CHAN_WEAPON)
	LFRC F 5 Bright A_CustomMissile("FLegCatharsiRail",30,-3,Random(-12,12),0)
	LFRC E 10 Bright A_FaceTarget
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_PlaySound("monsters/darkcyberrail",CHAN_WEAPON)
	LFRC F 5 Bright A_CustomMissile("FLegCatharsiRail",30,-3,Random(-12,12),0)
	LFRC E 10 Bright A_FaceTarget
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_PlaySound("monsters/darkcyberrail",CHAN_WEAPON)
	LFRC F 5 Bright A_CustomMissile("FLegCatharsiRail",30,-3,Random(-12,12),0)
	goto see
  Grenades:
	LFRC E 4 Bright A_FaceTarget
	LFRC F 3 Bright A_CustomMissile("FLegCatharsiGrenade",30,-3,Random(-12,12),0)
	LFRC E 4 Bright A_FaceTarget
	LFRC F 3 Bright A_CustomMissile("FLegCatharsiGrenade",30,-3,Random(-12,12),0)
	LFRC E 4 Bright A_FaceTarget
	LFRC F 3 Bright A_CustomMissile("FLegCatharsiGrenade",30,-3,Random(-12,12),0)
	LFRC E 4 Bright A_FaceTarget
	LFRC F 3 Bright A_CustomMissile("FLegCatharsiGrenade",30,-3,Random(-12,12),0)
	LFRC E 4 Bright A_FaceTarget
	LFRC F 3 Bright A_CustomMissile("FLegCatharsiGrenade",30,-3,Random(-12,12),0)
	LFRC E 3 Bright A_FaceTarget
	LFRC F 2 Bright A_CustomMissile("FLegCatharsiGrenade",30,-3,Random(-12,12),0)
	TNT1 A 0 A_Jump(87,"15K","10K","Railgun")
	Goto See
  Pain:
	LFRC G 3 Bright A_Pain
	TNT1 A 0 A_Jump(80,"Missile")
	Goto See
  Death:
    TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	LFRC H 4 Bright A_NoBlocking
	LFRC I 4 Bright A_Scream
	LFRC JKL 4 Bright
	LFRC M 4 
	LFRC N -1
	Stop
  XDeath:
	TNT1 A 0 A_Scream
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	TNT1 AA 0 A_CustomMissile("LegendaryDRuneFlameSpawner",-20,0,random(0,-360),2,random(0,360)) 
	LFRC G 2 A_PlaySound("monster/homingrockbeep",6)
	TNT1 AA 0 A_CustomMissile("LegendaryDRuneFlameSpawner",-20,0,random(0,-360),2,random(0,360)) 
	LFRC G 2 A_PlaySound("monster/homingrockbeep",6)
	TNT1 AA 0 A_CustomMissile("LegendaryDRuneFlameSpawner",-20,0,random(0,-360),2,random(0,360)) 
	LFRC G 2 A_PlaySound("monster/homingrockbeep",6)
	TNT1 AA 0 A_CustomMissile("LegendaryDRuneFlameSpawner",-20,0,random(0,-360),2,random(0,360)) 
	LFRC G 2 A_PlaySound("monster/homingrockbeep",6)
	TNT1 AA 0 A_CustomMissile("LegendaryDRuneFlameSpawner",-20,0,random(0,-360),2,random(0,360)) 
	LFRC G 2 A_PlaySound("monster/homingrockbeep",6)
	TNT1 AA 0 A_CustomMissile("LegendaryDRuneFlameSpawner",-20,0,random(0,-360),2,random(0,360)) 
	LFRC G 2 A_PlaySound("monster/homingrockbeep",6)
	TNT1 AA 0 A_CustomMissile("LegendaryDRuneFlameSpawner",-20,0,random(0,-360),2,random(0,360)) 
	LFRC G 2 A_PlaySound("monster/homingrockbeep",6)
	TNT1 AA 0 A_CustomMissile("LegendaryDRuneFlameSpawner",-20,0,random(0,-360),2,random(0,360)) 
	LFRC G 7 A_PlaySound("monster/homingrockbeep",6)
	TNT1 A 0 A_PlaySound("weapons/dtech10kexplode")
	TNT1 A 0 A_NoBlocking
	TNT1 A 0 A_Explode(100,200)
	LFRC N 4 A_SpawnItem("TLegCybDTBFGEx",0,-10)
	LFRC OPQRSTUV 4
	LFRC W -1
	Stop
	}
}

Actor FriendlyLegendaryCatharsi2 : FriendlyLegendaryCatharsi
{
Tag "\c[z3]Friendly Legendary Catharsi\c-"
States
{
  Spawn:
    LFRC A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	LFRC A 10 Bright A_Look
    Goto Idle
  Death:
    TNT1 A 0 A_RemoveChildren(1)
	LFRC H 4 Bright A_NoBlocking
	LFRC I 4 Bright A_Scream
	LFRC JKL 4 Bright
	LFRC M 4 
	LFRC N -1
	Stop
  XDeath:
	TNT1 A 0 A_Scream
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 AA 0 A_CustomMissile("LegendaryDRuneFlameSpawner",-20,0,random(0,-360),2,random(0,360)) 
	LFRC G 2 A_PlaySound("monster/homingrockbeep",6)
	TNT1 AA 0 A_CustomMissile("LegendaryDRuneFlameSpawner",-20,0,random(0,-360),2,random(0,360)) 
	LFRC G 2 A_PlaySound("monster/homingrockbeep",6)
	TNT1 AA 0 A_CustomMissile("LegendaryDRuneFlameSpawner",-20,0,random(0,-360),2,random(0,360)) 
	LFRC G 2 A_PlaySound("monster/homingrockbeep",6)
	TNT1 AA 0 A_CustomMissile("LegendaryDRuneFlameSpawner",-20,0,random(0,-360),2,random(0,360)) 
	LFRC G 2 A_PlaySound("monster/homingrockbeep",6)
	TNT1 AA 0 A_CustomMissile("LegendaryDRuneFlameSpawner",-20,0,random(0,-360),2,random(0,360)) 
	LFRC G 2 A_PlaySound("monster/homingrockbeep",6)
	TNT1 AA 0 A_CustomMissile("LegendaryDRuneFlameSpawner",-20,0,random(0,-360),2,random(0,360)) 
	LFRC G 2 A_PlaySound("monster/homingrockbeep",6)
	TNT1 AA 0 A_CustomMissile("LegendaryDRuneFlameSpawner",-20,0,random(0,-360),2,random(0,360)) 
	LFRC G 2 A_PlaySound("monster/homingrockbeep",6)
	TNT1 AA 0 A_CustomMissile("LegendaryDRuneFlameSpawner",-20,0,random(0,-360),2,random(0,360)) 
	LFRC G 7 A_PlaySound("monster/homingrockbeep",6)
	TNT1 A 0 A_PlaySound("weapons/dtech10kexplode")
	TNT1 A 0 A_NoBlocking
	TNT1 A 0 A_Explode(100,200)
	LFRC N 4 A_SpawnItem("TLegCybDTBFGEx",0,-10)
	LFRC OPQRSTUV 4
	LFRC W -1
	Stop
	}
}

Actor FLFormicidaeBall : TLegendaryCyberBFG15KBall
{
Speed 30
Damage 10
ExplosionDamage 32
ExplosionRadius 100
Species "Player"
DamageType "FriendlyMonster"
Scale 0.4
+MTHRUSPECIES
}

Actor FLFRCharsi10KProjectile : LFRCharsi10KProjectile
{
Species "Player"
States
{
Death:
   XDeath:  
      TNT1 A 0
      TNT1 A 1 A_SpawnItem("FLegCatharsi10KEx")
      Stop
	  }
}

Actor FLegCatharsi10KEx : LegCatharsi10KEx { Species "Player" DamageType "FriendlyMonster" +MTHRUSPECIES }


Actor FLegCatharsiRail : LegCatharsiRail { Species "Player" DamageType "FriendlyMonster" +MTHRUSPECIES }


Actor FLegCatharsiGrenade : LegCatharsiGrenade { Species "Player" DamageType "FriendlyMonster" +MTHRUSPECIES }

Actor NewFriendlyLegendaryPlasmaGunner : FriendlyLegendaryZombie
{
Health 1000
PainChance 15
PainChance "ZombieDemonTech", 0
BloodColor "Blue"
SeeSound "fem/sight"
PainSound "fem/pain"
DeathSound "fem/death"
ActiveSound "fem/active"
AttackSound "Null"
Tag "\c[z3]Friendly Legendary Plasma Gunner\c-"
Obituary "%o was killed by a Friendly Legendary Plasma Gunner."
+BRIGHT
var int user_protection;
var int user_protected;
States
{
  Spawn:
    LMAY A 1
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	LMAY A 10 A_Look
	Goto Idle
  Idle:
	LMAY A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	LMAY A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK|LOF_NOSEESOUND)
	LMAY AABB 3 A_GiveInventory("AIPatroling",1)
	LMAY C 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK|LOF_NOSEESOUND)
    LMAY CCDD 3 A_GiveInventory("AIPatroling",1)
	Loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  See:
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	LMAY AABB 3 A_Chase
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Jump(16,"GiveUp")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	LMAY CCDD 3 A_Chase
	TNT1 A 0 A_Jump(80,"Rush")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	Loop
  GiveUp:
	LMAY A 10 A_ClearTarget
	Goto Idle
  Rush:
	LMAY A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegFemaleZombieGhostA",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LMAY A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegFemaleZombieGhostA",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LMAY A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegFemaleZombieGhostB",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LMAY B 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegFemaleZombieGhostB",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LMAY B 1 A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_SpawnItemEx("LegFemaleZombieGhostC",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LMAY C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegFemaleZombieGhostC",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LMAY C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegFemaleZombieGhostD",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LMAY D 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegFemaleZombieGhostD",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LMAY D 1 A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_Jump(84,"Mine","See")
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	Loop
  Strafing:
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LMAY AA 3 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LMAY BB 3 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LMAY CC 3 A_GiveInventory("LegZombieStrafing",1)	
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LMAY DD 3 A_GiveInventory("LegZombieStrafing",1)
	Goto See
  Pause:
	LMAY E 0 A_PlaySound("weapons/demontechsteam")
	LMAY EEEEE 3 A_GiveInventory("LegZombieStrafing",1)
	Goto See
  Missile:
	TNT1 A 0 A_SetShootable
	TNT1 A 0 A_UnsetInvulnerable
	TNT1 A 0 A_SetTranslucent(1)
	LMAY EE 3 A_GiveInventory("LegZombieStrafing",1)
  MissileLoop:
	LMAY E 3 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_CustomMissile("FLegendaryProjectile",32,0,random(-2,2),0)
	LMAY F 3 A_PlaySoundEx("weapons/DemonTechRifle","Weapon")
	TNT1 A 0 A_Jump(24,"Pause")
	TNT1 A 0 A_SpidRefire
	TNT1 A 0 A_PlayWeaponSound("BlueDTRFire")
	LMAY E 3 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_CustomMissile("FLegendaryProjectile",32,0,random(-2,2),0)
	LMAY F 3 A_PlaySoundEx("weapons/DemonTechRifle","Weapon")
	TNT1 A 0 A_Jump(24,"Pause")
	TNT1 A 0 A_SpidRefire
	TNT1 A 0 A_PlayWeaponSound("BlueDTRFire")
	TNT1 A 0 A_Jump(45,"LegNade")
	TNT1 A 0 A_Jump(55,"Nade")
	Loop
  Nade:
    LMAY E 1 A_JumpIfCloser(1000,1)
	Goto Missile
	LMAY E 0 A_JumpIfCloser(280,"Missile")
    LMAY E 6 A_GiveInventory("LegZombieStrafing",1)
    LMAY EEE 4 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
    LMAY E 6 A_CustomMissile("FLGrenade",32,0,0,2,10)
	LMAY E 1
	Goto See
  LegNade:
    LMAY E 1 A_JumpIfCloser(1000,1)
	Goto Missile
	LMAY E 0 A_JumpIfCloser(280,"Missile")
    LMAY E 12 A_GiveInventory("LegZombieStrafing",1)
    LMAY EEE 6 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
    LMAY E 6 A_CustomMissile("FLegThrownGrenade",32,0,0,2,10)
	LMAY EE 25
	Goto See
  Mine:
	LMAY C 1
	LMAY C 12 A_CustomMissile("FLACThrownMine",32,0,0,2,15)
	LMAY E 12
	LMAY C 3
	Goto See
  Pain:
    TNT1 A 0 A_Jump(10,"Protection")
	TNT1 A 0 A_Jump(192,"PainMissile")
    LMAY G 3 A_GiveInventory("LegZombieStrafing",1)
    LMAY G 0 A_Pain
	LMAY G 3 A_GiveInventory("LegZombieStrafing",1)
    Goto See
  PainMissile:
    LMAY G 3 A_GiveInventory("LegZombieStrafing",1)
    LMAY G 0 A_Pain
	LMAY G 3 A_GiveInventory("LegZombieStrafing",1)
    Goto Missile	
  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
	LMAY E 2 ACS_NamedExecuteAlways("LegendaryProtection",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	Goto See
  Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_ChangeFlag(BRIGHT,0)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LMAY H 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LMAY I 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LMAY J 5 A_SpawnItem("BodyCrash",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LMAY K 5 
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LMAY L 140
	LMAY L 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LMAY LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LMAY LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LMAY LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid+1)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	LMAY L -1
	Stop
  XDeath:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 A_ChangeFlag(BRIGHT,0)
	LMAY O 3 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    LMAY P 3 A_XScream
    LMAY R 3 A_Fall
    LMAY STUV 3 
    LMAY W -1 
    Stop
	}
}

Actor NewFriendlyLegendaryPlasmaGunner2 : NewFriendlyLegendaryPlasmaGunner
{
Tag "\c[z3]Friendly Legendary Plasma Gunner\c-"
States
{
  Spawn:
    LMAY A 1
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	LMAY A 10 A_Look
	Goto Idle
  Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_ChangeFlag(BRIGHT,0)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LMAY H 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LMAY I 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LMAY J 5 A_SpawnItem("BodyCrash",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LMAY K 5 
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LMAY L 140
	LMAY L 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LMAY LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LMAY LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LMAY LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	LMAY L -1
	Stop
  XDeath:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 A_ChangeFlag(BRIGHT,0)
	LMAY O 3 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    LMAY P 3 A_XScream
    LMAY R 3 A_Fall
    LMAY STUV 3 
    LMAY W -1 
    Stop
	}
}

ACTOR FriendlyLegendaryPlasmaGunner : UACBaseMarine
{ 
Health 599
Speed 15
Radius 20
Height 56
BloodColor "Blue"
PainChance 15
DamageFactor 0.75
DropItem "HealthFlask" 35
DropItem "ArmorCharge" 35
DropItem "AmmoPack" 20
DropItem "HandGrenadeAmmo" 50 1
DropItem "MineAmmo" 25 1
DropItem "NewCell" 50 20
DropItem "LegendaryArmor" 85 1
DropItem "LegAmmoSphere" 88 1
DropItem "LegendaryPowerShard" 35 1
DropItem "HandGrenadeAmmo" 235 2
DropItem "MineAmmo" 235 2
DropItem "Backpack" 198 1
DropItem "Armorplate" 205 1
DropItem "Portablemedkit" 210 1
DropItem "LDemonAmmoBox" 200 
DropItem "LDemonAmmo" 250 
DropItem "LegendaryRune" 30 1
DropItem "Legendary Plasmatic Rifle" 155 1
SeeSound "fem/sight"
PainSound "fem/pain"
DeathSound "fem/death"
ActiveSound "fem/active"
Obituary "%o was killed by an Alpha Friendly Legendary Plasma Gunner"
Tag "\c[z3]Alpha Friendly Legendary Plasma Gunner\c-"
+NOICEDEATH
States
{
  Spawn:
    L3L9 A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	L3L9 A 10 Bright A_Look
    Goto Idle
  Idle:
	L3L9 A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK)
	L3L9 AABB 3 Bright A_GiveInventory("AIPatroling",1)
	L3L9 C 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK)
    L3L9 CCDD 3 Bright A_GiveInventory("AIPatroling",1)
	L3L9 A 0 A_SpawnItem("FootStep",0,0,0,0)
	Loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  See:
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Jump(16,"GiveUp")
    L3L9 AABB 3 Bright A_Chase
    TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    L3L9 CCDD 3 Bright A_Chase
    TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    Loop
  GiveUp:
    TNT1 A 0 A_ClearTarget
	L3L9 A 10 Bright
	Goto Idle
  Pause:
	L3L9 E 20 Bright
	Goto See
  Missile:
    L3L9 E 1 Bright A_FaceTarget
	TNT1 A 0 A_PlayWeaponSound("BlueDTRFire")
    L3L9 F 1 Bright A_CustomMissile("FLegendaryProjectile",30,4,0)
    L3L9 F 1 Bright A_CustomMissile("FLegImpSeekBall",30,4,0)
    L3L9 E 1 A_FaceTarget
    TNT1 A 0 A_Jump(102,"Pause")
    TNT1 A 0 A_SpidRefire
    Goto Missile+1
  Pain:
	L3L9 G 6 Bright A_Pain
	Goto See
  Death:
  XDeath:
    TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
    L3L9 H 5 Bright A_RemoveChildren(1)
	L3L9 H 3 Bright A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    L3L9 I 5 Bright A_Scream
	L3L9 I 3 Bright A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    L3L9 J 5 Bright A_Fall
	L3L9 J 3 Bright A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
	L3L9 K 8 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
	L3L9 L 3 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    L3L9 L 0 A_SpawnItem("FDeathBall2",0,0,0,0)
	L3L9 L -1
    Stop
	}
}

Actor FriendlyLegendaryPlasmaGunner2 : FriendlyLegendaryPlasmaGunner
{
Tag "\c[z3]Alpha Friendly Legendary Plasma Gunner\c-"
States
{
  Spawn:
    L3L9 A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	L3L9 A 10 Bright A_Look
    Goto Idle
  Death:
  XDeath:
    L3L9 H 5 Bright A_RemoveChildren(1)
	L3L9 H 3 Bright A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    L3L9 I 5 Bright A_Scream
	L3L9 I 3 Bright A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    L3L9 J 5 Bright A_Fall
	L3L9 J 3 Bright A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
	L3L9 K 8 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
	L3L9 L 3 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
    L3L9 L 0 A_SpawnItem("FDeathBall2",0,0,0,0)
	L3L9 L -1
    Stop
	}
}

ACTOR FriendlyLegendarySegwayZombie : UACBaseMarine
{ 
health 999
speed 1
Radius 20
Height 56
BloodColor "Blue"
PainChance 15
DamageFactor 0.75
meleedamage 65 //100000, Are you crazy?
meleerange 32
DamageType "FriendlyMonster"
DropItem "LegendaryArmor" 85 1
DropItem "LegAmmoSphere" 88 1
DropItem "HandGrenadeAmmo" 235 2
DropItem "MineAmmo" 235 2
DropItem "Backpack" 198 1
DropItem "Armorplate" 205 1
DropItem "Portablemedkit" 210 1
DropItem "LDemonAmmoBox" 200 
DropItem "LDemonAmmo" 250 
DropItem "LegendaryRune" 30 1
DropItem "Legendary Plasmatic Rifle" 155 1
SeeSound "legzom/sight"
AttackSound "Null"
PainSound "legzom/pain"
DeathSound "legzom/death"
ActiveSound "legzom/active"
Obituary "%o was killed by a Friendly Legendary Plasma Gunner"
Tag "\c[z3]Friendly Legendary Segway Zombie\c-"
+NOICEDEATH
+LOOKALLAROUND
States
{
  Spawn:
    ZSEG A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	TNT1 A 0 A_PlaySound("Segway/Music",5,1.0,TRUE)
	ZSEG A 10 Bright A_Look
    Goto Idle
  Idle:
	ZSEG A 0 A_Jump(2,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
    ZSEG A 1 Bright A_Wander
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK)
    ZSEG A 0 A_Recoil(-3)
    ZSEG A 0 A_PlaySoundEx("Segway/Go","SoundSlot7",1)
    loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  See:
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Jump(1,"GiveUp")
    ZSEG A 1 Bright A_Chase
    ZSEG A 0 A_Recoil(-3)
    ZSEG A 0 A_MeleeAttack
    ZSEG A 0 A_PlaySoundEx("Segway/Go","SoundSlot7",1)
    loop
  GiveUp:
    TNT1 A 0 A_ClearTarget
	ZSEG A 10 Bright
	Goto Idle
  Missile:
    ZSEG A 1 A_Recoil(-10)
    ZSEG A 0 A_MeleeAttack
    ZSEG A 0 A_MeleeAttack
    ZSEG A 0 A_MeleeAttack
    ZSEG A 0 A_PlaySoundEx("Segway/Go","SoundSlot7",1)
	Goto See
  Pain:
    ZSEG A 0 A_Recoil(5)
    ZSEG A 0 A_Pain
    ZSEG A 0 A_PlaySoundEx("Segway/Go","SoundSlot7",1)
    goto See
  Death:
  XDeath:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	TNT1 AAA 0 A_StopSound(5)
	TNT1 A 0 A_RemoveChildren(1)
    ZSEG B 5 A_SpawnItemEx("FDeathBall2",0,0,32,0,0,0,0,160)
    ZSEG B 0 A_StopSoundEx("SoundSlot7")
    ZSEG B 0 A_PlaySound("weapons/rocklx")
    ZSEG C 5 A_Scream
    ZSEG D 5 A_NoBlocking
    ZSEG E -1
    stop
	}
}

Actor FriendlyLegendarySegwayZombie2 : FriendlyLegendarySegwayZombie
{
Tag "\c[z3]Friendly Legendary Segway Zombie\c-"
States
{
  Spawn:
    ZSEG A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	TNT1 A 0 A_PlaySound("Segway/Music",5,1.0,TRUE)
	ZSEG A 10 Bright A_Look
    Goto Idle
  Death:
  XDeath:
    TNT1 A 0 A_StopSound(6)
	TNT1 AAA 0 A_StopSound(5)
	TNT1 A 0 A_RemoveChildren(1)
    ZSEG B 5 A_SpawnItemEx("FDeathBall2",0,0,32,0,0,0,0,160)
    ZSEG B 0 A_StopSoundEx("SoundSlot7")
    ZSEG B 0 A_PlaySound("weapons/rocklx")
    ZSEG C 5 A_Scream
    ZSEG D 5 A_NoBlocking
    ZSEG E -1
    stop
	}
}

ACTOR FriendlyEpicLegendaryZombie : UACBaseMarine
{
Health 2969
FloatSpeed 10
BloodColor "Blue"
DamageFactor 0.70
RadiusDamageFactor 0.55
DamageFactor "PlayerNemesisPlasma", 0.0
DamageFactor "VileFires", 0.0
DropItem "LegendaryArmor" 85 1
DropItem "LegAmmoSphere" 88 1
DropItem "LegendaryPowerShard" 35 1
DropItem "HandGrenadeAmmo" 235 2
DropItem "MineAmmo" 235 2
DropItem "Backpack" 198 1
DropItem "Armorplate" 205 1
DropItem "Portablemedkit" 210 1
DropItem "LDemonAmmoBox" 200 
DropItem "LDemonAmmo" 250 
DropItem "LegendaryRune" 80 1
DropItem "LegendaryUltraSphere" 30 1
DropItem "LegendarySphere" 30 1
DropItem "Legendary Plasmatic Rifle" 155 1
DropItem "DemonicChalice" 128
DropItem "SkullOfPower" 128
DropItem "PowerStimpack" 128
DropItem "TalismanOfChaos" 45 1
DropItem "MagicCard" 45 1
DropItem "Jetpack" 100 1
SeeSound "legzom/sight"
PainSound "legzom/pain"
DeathSound "legzom/death"
ActiveSound "legzom/active"
Obituary "%o was killed by a Epic Friendly Legendary Zombie."
Tag "\c[m5]Epic \c[z3]Friendly Legendary Zombie\c-"
-FLOORCLIP
+FLOAT
+FLOATBOB
+NOGRAVITY
+NOICEDEATH
var int user_protection;
var int user_protected;
States
{
  Spawn:
    LPOS A 1 Bright
	TNT1 A 0 ACS_NamedExecuteAlways("SpawnFireOnActor3", 0, 1)
	//TNT1 A 0 ThrustThingZ(0,13,0,1)
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	LPOS A 10 Bright A_Look
	Goto Idle
  Idle:
	LPOS A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK|LOF_NOSEESOUND)
	LPOS AAAA 1 Bright A_Wander //A_GiveInventory("AIPatroling",1)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK|LOF_NOSEESOUND)
    LPOS AAAA 1 Bright A_Wander
	Loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  See:
    TNT1 A 0 A_PlaySound("legzom/sight",CHAN_VOICE)
  SeeLoop:
    TNT1 A 0 A_jump(80,"Evade")
    LPOS AA 1 Bright A_Chase
	TNT1 A 0 A_FastChase
	TNT1 A 0 A_GiveInventory("EpicLegZombieStrafing",1)
	LPOS AAA 1 Bright A_Chase
	TNT1 A 0 A_FastChase
	TNT1 A 0 A_GiveInventory("EpicLegZombieStrafing",1)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	LPOS AAAA 1 Bright A_Chase
	TNT1 A 0 A_FastChase
	TNT1 A 0 A_GiveInventory("EpicLegZombieStrafing",1)
	LPOS AAA 1 Bright A_Chase
	TNT1 A 0 A_FastChase
	TNT1 A 0 A_GiveInventory("EpicLegZombieStrafing",1)
	TNT1 A 0 A_jump(80,"Evade")
	LPOS AAA 1 Bright A_Chase
	TNT1 A 0 A_FastChase
	TNT1 A 0 A_GiveInventory("EpicLegZombieStrafing",1)
	TNT1 A 0 A_Jump(16,"GiveUp")
    Loop
  GiveUp:
	LPOS A 10 Bright A_ClearTarget
	Goto Idle
  Evade:
    TNT1 A 0 A_Jump(128,3)
	TNT1 A 0 ThrustThing(Angle*256/360+64,20,0,0)
	TNT1 A 0 A_Jump(256,2)
	TNT1 A 0 ThrustThing(angle*256/360+192,20,0,0)
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS A 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS A 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS A 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	LPOS A 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS A 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS A 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS A 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS A 2 Bright A_Chase
	TNT1 A 0 A_Stop
	Goto SeeLoop
  Pause:
	LPOS E 0 A_PlaySound("weapons/demontechsteam")
	LPOS EEEEE 3 Bright A_GiveInventory("EpicLegZombieStrafing",1)
	TNT1 A 0 A_JumpIfTargetInLOS(1,0,JLOSF_DEADNOJUMP)
	Goto See
	TNT1 A 0 A_jump(128,"Missile","NewAttack0","NewAttack1","NewAttack2")
	Goto See
  Missile:
    TNT1 A 0 A_jump(128,"NewAttack0","NewAttack1","NewAttack2")
  LegendaryRifle:
    TNT1 A 0 A_SetShootable
    TNT1 A 0 A_UnsetInvulnerable
    TNT1 A 0 A_SetTranslucent(1)
	LPOS EEE 3 Bright A_GiveInventory("EpicLegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("EpicLegZombieStrafing",1)
	TNT1 A 0 A_CustomMissile("FLegendaryProjectile",32,0,random(-2,2),0)
	LPOS F 3 Bright A_PlaySoundEx("weapons/DemonTechRifle","Weapon")
	TNT1 A 0 A_Jump(24,"Pause")
	TNT1 A 0 A_SpidRefire
    TNT1 A 0 A_PlayWeaponSound("BlueDTRFire")
	goto LegendaryRifle+5
  NewAttack0:
	LPOS EEEEE 2 Bright A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	TNT1 A 0 A_FaceTarget
	LPOS EEEEE 2 Bright A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	TNT1 A 0 A_FaceTarget
	LPOS EEEEE 2 Bright A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	TNT1 A 0 A_FaceTarget
	LPOS EEEEE 2 Bright A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	TNT1 A 0 A_FaceTarget
	LPOS EEEEE 2 Bright A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	TNT1 A 0 A_FaceTarget
	LPOS EEEEE 2 Bright A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	TNT1 A 0 A_FaceTarget
	LPOS EEEEE 2 Bright A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS F 4 Bright A_CustomMissile("FLegSoulBigBall",32,0,random(-2,2),0)
	LPOS E 4 A_UnSetInvulnerable
    Goto SeeLoop
  NewAttack1:
	LPOS A 2 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory("EpicLegZombieStrafing",1)
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS A 2 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS A 2 Bright A_FaceTarget
  NewAttack1Loop:
	TNT1 A 0 A_SpawnItemEx("YellowShellCasing", 10, 12, 40, Random(2, 6), 0, Random(1, 3), Random(80, 90), 128)
	TNT1 A 0 A_PlaySound("sentient/fire")
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS F 1 Bright A_CustomMissile("FLegSentientExplosiveTracer",32,0,random(-2,2),0)
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS F 2 Bright A_CustomMissile("FLegSentientExplosiveTracer",32,0,random(-2,2),0)
	TNT1 A 0 A_GiveInventory("EpicLegZombieStrafing",1)
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
    TNT1 A 0 A_SpawnItemEx("YellowShellCasing", 10, -12, 40, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
	TNT1 A 0 A_PlaySound("sentient/fire")
	LPOS E 3 Bright A_CustomMissile("FLegSentientExplosiveTracer",32,0,random(-2,2),0)
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	TNT1 A 0 A_StopSoundEx("Weapon")	
	TNT1 A 0 A_Jump(3,"SeeLoop","Missile")
    TNT1 A 0 A_SpidRefire
    Loop
  NewAttack2:
	TNT1 A 0 A_PlaySound("weapons/charge15k")
	LPOS E 2 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS E 2 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS E 2 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory("EpicLegZombieStrafing",1)
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS E 2 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS E 2 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS E 2 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory("EpicLegZombieStrafing",1)
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS E 2 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS E 2 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS E 2 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory("EpicLegZombieStrafing",1)
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS E 2 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS E 2 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS E 2 Bright A_FaceTarget
  NewAttack2Loop:
	TNT1 A 0 A_PlaySound("weapons/bfg15kfire")
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS F 3 Bright A_CustomMissile("FLegendary10KProjectile",32,0,random(-2,2),0)
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS E 4 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory("EpicLegZombieStrafing",1)
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	TNT1 A 0 A_PlaySound("weapons/bfg15kfire")
	LPOS F 3 Bright A_CustomMissile("FLegendary10KProjectile",32,0,random(-2,2),0)
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS E 4 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory("EpicLegZombieStrafing",1)
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	TNT1 A 0 A_PlaySound("weapons/bfg15kfire")
	LPOS F 3 Bright A_CustomMissile("FLegendary10KProjectile",32,0,random(-2,2),0)
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS E 4 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	TNT1 A 0 A_PlaySound("weapons/bfg15kfire")
    LPOS F 3 Bright A_CustomMissile("FLegendary10KProjectile",32,0,random(-2,2),0)
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS E 4 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory("EpicLegZombieStrafing",1)
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	TNT1 A 0 A_PlaySound("weapons/bfg15kfire")
	LPOS F 3 Bright A_CustomMissile("FLegendary10KProjectile",32,0,random(-2,2),0)
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	LPOS E 4 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory("EpicLegZombieStrafing",1)
	TNT1 A 0 A_SpawnItemEx("LegCardinalFire",-17,0,30,random(-3,1),random(-2,2),random(-2,-6),0,128)
	TNT1 A 0 A_Jump(64,"see","Missile")
    Loop
  Pain:
    TNT1 A 0 A_Jump(10,"Protection")
	TNT1 A 0 A_Jump(192,"PainMissile")
    LPOS G 3 Bright A_GiveInventory("EpicLegZombieStrafing",1)
    LPOS G 0 A_Pain
	LPOS G 3 Bright A_GiveInventory("EpicLegZombieStrafing",1)
    Goto See
  PainMissile: 
    LPOS G 3 Bright A_GiveInventory("EpicLegZombieStrafing",1)
    LPOS G 0 A_Pain
	LPOS G 3 Bright A_GiveInventory("EpicLegZombieStrafing",1)
    Goto Missile	
  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
	LPOS E 2 Bright ACS_NamedExecuteAlways("LegendaryProtection",0,0,0,0)
	TNT1 A 0 A_SpawnItem("TrueLegendaryCyberFlameSpawner",0,0,0,0)
	Goto See
  Death:
  XDeath:
    //TNT1 A 0 A_Jump(36,"TrueLeg")
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_Scream
	TNT1 A 0 A_ChangeFlag("FloatBob",0)
	TNT1 A 0 A_ChangeFlag("Float",0)
	TNT1 A 0 A_RemoveChildren(1)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
    LOPZ A 2 ThrustThingZ(0, random(2, 8), 0, 0)
    LOPZ A 0 ThrustThing(random(0, 255), random(2, 8), 0, 0)
    LOPZ B 2 A_NoBlocking
    LOPZ CDE 2
	TNT1 A 0 A_SpawnItemEx("PainfulDeathKaboom", Random(-20, 20), Random(-20, 20), Random(20, 40), 0, 0, 0, 0, 128)
	LOPZ ABC 2
	TNT1 A 0 A_SpawnItemEx("PainfulDeathKaboom", Random(-20, 20), Random(-20, 20), Random(20, 40), 0, 0, 0, 0, 128)
	LOPZ DEA 2
    LOPZ EA 2
    LOPZ B 2 A_SpawnItemEx("PainfulDeathKaboom", Random(-20, 20), Random(-20, 20), Random(20, 40), 0, 0, 0, 0, 128)
    LOPZ CD 2
    LOPZ A 2 A_SpawnItemEx("PainfulDeathKaboom", Random(-20, 20), Random(-20, 20), Random(20, 40), 0, 0, 0, 0, 128)
    LOPZ BC 2
    LOPZ D 2 A_SpawnItemEx("PainfulDeathKaboom", Random(-20, 20), Random(-20, 20), Random(20, 40), 0, 0, 0, 0, 128)
	TNT1 A 0 A_PlaySound("weapons/mineexplode",0,1.0,0)
    LOPZ AAAAAA 0 A_SpawnItemEx("PainfulDeathKaboom", Random(-30, 30), Random(-30, 30), Random(20, 40), 0, 0, 0, 0, 128)
	LPOS O 3 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
	LPOS P 3
    LPOS R 3
    LPOS STUV 3
    LPOS W 140
	LPOS W 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LPOS WWWWWWWWWWWWWWWWW 2 Bright A_GiveInventory("LegSoulEvent",1)
	LPOS WWWWWWWWWWWWWWWWW 2 Bright A_GiveInventory("LegSoulEvent",1)
	LPOS WWWWWWWWWWWWWWWWW 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid+1)
	TNT1 A 0 ACS_NamedExecuteAlways("SpawnHeroSoul",0,tid+1) //ALRIGHT HERE HE GO
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	LPOS W -1
	Stop
	}
}

Actor FriendlyEpicLegendaryZombie2 : FriendlyEpicLegendaryZombie
{
Tag "\c[m5]Epic \c[z3]Friendly Legendary Zombie\c-"
States
{
  Spawn:
    LPOS A 1 Bright
	TNT1 A 0 ACS_NamedExecuteAlways("SpawnFireOnActor3", 0, 1)
	//TNT1 A 0 ThrustThingZ(0,13,0,1)
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	LPOS A 10 Bright A_Look
	Goto Idle
  Death:
  XDeath:
    //TNT1 A 0 A_Jump(36,"TrueLeg")
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_Scream
	TNT1 A 0 A_ChangeFlag("FloatBob",0)
	TNT1 A 0 A_ChangeFlag("Float",0)
	TNT1 A 0 A_RemoveChildren(1)
    LOPZ A 2 ThrustThingZ(0, random(2, 8), 0, 0)
    LOPZ A 0 ThrustThing(random(0, 255), random(2, 8), 0, 0)
    LOPZ B 2 A_NoBlocking
    LOPZ CDE 2
	TNT1 A 0 A_SpawnItemEx("PainfulDeathKaboom", Random(-20, 20), Random(-20, 20), Random(20, 40), 0, 0, 0, 0, 128)
	LOPZ ABC 2
	TNT1 A 0 A_SpawnItemEx("PainfulDeathKaboom", Random(-20, 20), Random(-20, 20), Random(20, 40), 0, 0, 0, 0, 128)
	LOPZ DEA 2
    LOPZ EA 2
    LOPZ B 2 A_SpawnItemEx("PainfulDeathKaboom", Random(-20, 20), Random(-20, 20), Random(20, 40), 0, 0, 0, 0, 128)
    LOPZ CD 2
    LOPZ A 2 A_SpawnItemEx("PainfulDeathKaboom", Random(-20, 20), Random(-20, 20), Random(20, 40), 0, 0, 0, 0, 128)
    LOPZ BC 2
    LOPZ D 2 A_SpawnItemEx("PainfulDeathKaboom", Random(-20, 20), Random(-20, 20), Random(20, 40), 0, 0, 0, 0, 128)
	TNT1 A 0 A_PlaySound("weapons/mineexplode",0,1.0,0)
    LOPZ AAAAAA 0 A_SpawnItemEx("PainfulDeathKaboom", Random(-30, 30), Random(-30, 30), Random(20, 40), 0, 0, 0, 0, 128)
	LPOS O 3 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
	LPOS P 3
    LPOS R 3
    LPOS STUV 3
    LPOS W 140
	LPOS W 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LPOS WWWWWWWWWWWWWWWWW 2 Bright A_GiveInventory("LegSoulEvent",1)
	LPOS WWWWWWWWWWWWWWWWW 2 Bright A_GiveInventory("LegSoulEvent",1)
	LPOS WWWWWWWWWWWWWWWWW 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid)
	TNT1 A 0 ACS_NamedExecuteAlways("SpawnHeroSoul",0,tid) //ALRIGHT HERE HE GO
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	LPOS W -1
	Stop
	}
}

ACTOR FriendlyLegendaryRailgunZombie : UACBaseMarine
{
Health 1200
Speed 10
BloodColor "Blue"
DamageFactor 0.75
RadiusDamageFactor 0.55
DamageFactor "PlayerNemesisPlasma", 0.0
DamageFactor "VileFires", 0.0
Damagetype "FriendlyMonster"
DropItem "LegendaryBossLifeEssence" 256
DropItem "LegendaryBossArmorBonusMax" 256
DropItem "LegendaryArmor" 110 1
DropItem "LegAmmoSphere" 117 1
DropItem "HandGrenadeAmmo" 237 2
DropItem "MineAmmo" 237 2
DropItem "Backpack" 200 1
DropItem "Armorplate" 207 1
DropItem "Portablemedkit" 212 1
DropItem "LDemonAmmo" 250
DropItem "LDemonAmmoBox" 200
DropItem "LegendaryRune" 50 1
DropItem "Legendary Railgun " 128 1
DropItem "LegendaryPowerShard" 100 1
SeeSound "legzom/sight"
PainSound "legzom/pain"
DeathSound "legzom/death"
ActiveSound "legzom/active"
Obituary "%o was killed by a friendly Legendary Railgun Zombie."
Tag "\c[z3]Friendly Legendary Railgun Zombie\c-"
+NOICEDEATH
var int user_protection;
var int user_protected;
States
{
  Spawn:
    LRZM A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	LRZM A 10 Bright A_Look
	Goto Idle
  Idle:
	LRZM A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	LRZM A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK|LOF_NOSEESOUND)
	LRZM AABB 3 Bright A_GiveInventory("AIPatroling",1)
	LRZM C 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK|LOF_NOSEESOUND)
    LRZM CCDD 3 Bright A_GiveInventory("AIPatroling",1)
	Loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  Taunt:
    TNT1 A 0 A_PlaySound("Vadrigar/Impressive",7)
	Goto SeeLoop
  See:
    TNT1 A 0 A_PlaySound("legzom/sight",CHAN_VOICE)
  SeeLoop:
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	LRZM AABB 3 Bright A_Chase
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Jump(16,"GiveUp")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	LRZM CCDD 3 Bright A_Chase
	TNT1 A 0 A_Jump(80,"Rush")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	Loop
  GiveUp:
	LRZM A 10 Bright A_ClearTarget
	Goto Idle
  Rush:
    LRZM A 0 A_JumpIfTargetInLOS("Strafing")
	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("LegRailZombieGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LRZM A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegRailZombieGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LRZM A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegRailZombieGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LRZM B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegRailZombieGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LRZM 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 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_SpawnItemEx("LegRailZombieGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LRZM C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegRailZombieGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LRZM C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegRailZombieGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LRZM D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegRailZombieGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LRZM 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,"SeeLoop")
	TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	Loop
  Strafing:
	LRZM A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LRZM A 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LRZM A 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LRZM B 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LRZM B 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	LRZM C 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    LRZM C 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    LRZM C 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    LRZM D 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    LRZM D 3 Bright A_GiveInventory("AIStrafing",1)
	Goto SeeLoop 
  Missile:
	TNT1 A 0 A_SetShootable
    TNT1 A 0 A_UnsetInvulnerable
    TNT1 A 0 A_SetTranslucent(1)
	TNT1 A 0 A_PlaySound("weapons/rgcharge")
	LRZM EEEEE 5 Bright A_FaceTarget
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_PlayWeaponSound("lrailat")
	TNT1 A 0 A_CustomMissile("RailgunImpact",30,0,0,0)
	TNT1 A 0 A_CustomMissile("FLegendaryRailgunPROJ",30,0,0,0)
	LRZM F 5 Bright A_CustomRailgun(random(100,300),0,none,none,RGF_SILENT,1,0,"FPlayerRailPuffBlue",0,0,0,0,0.5,0.5,"LegRailCoreTrail")
	LRZM E 10
	TNT1 A 0 A_JumpIfTargetInLOS(1,0,JLOSF_NOSIGHT|JLOSF_DEADNOJUMP)
	Goto Taunt
	TNT1 A 0
	Goto See
  Pain:
	TNT1 A 0 A_Jump(25,"Protection")
	TNT1 A 0 A_Jump(192,"PainMissile")
	LRZM G 3 Bright
	LRZM G 3 Bright A_Pain
	Goto See
  PainMissile:
	LRZM G 3 Bright
	LRZM G 3 Bright A_Pain
	Goto Missile	
  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
	LRZM E 2 Bright ACS_NamedExecuteAlways("LegendaryProtection",0,0,0,0)
	Goto See
  XDeath:
  Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_RemoveChildren(1)
	LRZM H 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LRZM I 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LRZM J 5 A_SpawnItem("BodyCrash",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LRZM K 5 
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LRZM L 140
	LRZM L 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LRZM LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LRZM LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LRZM LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid+1)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	LRZM L -1
	Stop
  }
}

Actor FriendlyLegendaryRailgunZombie2 : FriendlyLegendaryRailgunZombie
{
Tag "\c[z3]Friendly Legendary Railgun Zombie\c-"
States
{
  Spawn:
    LRZM A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	LRZM A 10 Bright A_Look
	Goto Idle
  XDeath:
  Death:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_RemoveChildren(1)
	LRZM H 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LRZM I 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LRZM J 5 A_SpawnItem("BodyCrash",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LRZM K 5 
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    LRZM L 140
	LRZM L 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LRZM LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LRZM LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	LRZM LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	LRZM L -1
	Stop
	}
}

Actor FLegendaryRailgunPROJ : LegendaryRailgunPROJ { DamageType "FriendlyMonster" } //This may or may not be broken

Actor FPlayerRailPuffBlue : PlayerRailPuffBlue { Species "Player" Damagetype "FriendlyMonster" }

ACTOR FriendlyLegendaryDevastatorZombie : UACBaseMarine
{ 
health 1500
speed 14
painchance 22
BloodColor "Blue"
DamageFactor 0.60
RadiusDamageFactor 0.55
DamageFactor "PlayerNemesisPlasma", 0.0
DamageFactor "VileFires", 0.0
DropItem "HandGrenadeAmmo" 235 2
DropItem "MineAmmo" 235 2
DropItem "Backpack" 198 1
DropItem "LDemonAmmo" 250
DropItem "LDemonAmmoBox" 200
DropItem "LegAmmoSphere" 108 1
DropItem "LegendaryArmor" 105 1
DropItem "Legendary Demon Tech Devastator", 70 1
DropItem "LegendaryRune" 45 1
DropItem "LegendaryPowerShard" 50 1 
SeeSound "lcmdo/sight"
AttackSound "Null"
PainSound "lcmdo/pain"
DeathSound "lcmdo/death"
ActiveSound "lcmdo/active"
AttackSound "Null"
Obituary "%o was killed by a friendly Legendary Zombie."
Tag "\c[z3]Friendly Legendary Devastator Zombie\c-"
+NOICEDEATH
States
{
  Spawn:
    LDEZ A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetGiveToken",0)
	LDEZ A 10 Bright A_Look
	Goto Idle
  Idle:
	LDEZ A 0 A_Jump(48,"Find")
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	LDEZ A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK|LOF_NOSEESOUND)
	LDEZ AABB 3 Bright A_GiveInventory("AIPatroling",1)
	LDEZ C 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_LookEx(LOF_NOSOUNDCHECK|LOF_NOSEESOUND)
    LDEZ CCDD 3 Bright A_GiveInventory("AIPatroling",1)
	Loop
  Find:
	TNT1 A 0 ACS_NamedExecuteAlways("Find Master Player",0,0,0,0)
    Goto Idle
  See:
    TNT1 A 0 A_PlaySound("legzom/sight",CHAN_VOICE)
  SeeLoop:
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	LDEZ AABB 3 Bright A_Chase
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_Jump(16,"GiveUp")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	LDEZ CCDD 3 Bright A_Chase
	TNT1 A 0 A_Jump(80,"Rush")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	Loop
  GiveUp:
	LDEZ A 10 Bright A_ClearTarget
	Goto Idle
  Rush:
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegDevastatorGhostA",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LDEZ A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegDevastatorGhostA",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LDEZ A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegDevastatorGhostB",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LDEZ B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegDevastatorGhostB",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LDEZ B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	TNT1 A 0 A_SpawnItemEx("LegDevastatorGhostC",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LDEZ C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegDevastatorGhostC",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LDEZ C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegDevastatorGhostD",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LDEZ D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("LegDevastatorGhostD",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	LDEZ D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Jump(84,"SeeLoop")
	Loop
  Strafing:
	LDEZ A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LDEZ A 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LDEZ A 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LDEZ B 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	LDEZ B 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 ACS_NamedExecuteAlways("CheckFriendlyPlayerHelpMonster",0,user_plus,0,0)
	LDEZ C 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    LDEZ C 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    LDEZ C 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    LDEZ D 3 Bright A_GiveInventory("AIStrafing",1)
    TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    LDEZ D 3 Bright A_GiveInventory("AIStrafing",1)
	Goto SeeLoop  
  Missile:
    LDEZ E 0 A_FaceTarget
	TNT1 A 0 A_StopSound(6)
    LDEZ E 0 A_PlaySound ("devastator/charge")
	TNT1 A 0 A_ChangeFlag("NOPAIN",1)
    LDEZ EEEEEEEEEEEEEEEEEEE 2 Bright A_FaceTarget
	LDEZ F 8 Bright
    LDEZ F 0 A_PlaySound ("devastator/fire")
    LDEZ F 10 Bright A_Custommissile("FLegendaryDevastatorBall")
	TNT1 A 0 A_ChangeFlag("NOPAIN",0)
    LDEZ E 50
    goto SeeLoop
  Pain:
    LDEZ G 3 Bright
    LDEZ G 3 Bright A_Pain
    goto SeeLoop
  Death:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 ACS_NamedExecuteAlways("SignetTakeToken",0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_RemoveChildren(1)
	LDEZ H 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LDEZ I 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LDEZ J 5 A_SpawnItem("BodyCrash",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LDEZ K 5 
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LDEZ L 5
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LCOS M 5
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LDEZ N 140
	LDEZ N 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LDEZ NNNNNNNNNNNNNNNNN 2 Bright A_GiveInventory("LegSoulEvent",1)
	LDEZ NNNNNNNNNNNNNNNNN 2 Bright A_GiveInventory("LegSoulEvent",1)
	LDEZ NNNNNNNNNNNNNNNNN 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid+1)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	LDEZ N -1
	Stop
  XDeath:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	LDEZ O 5 ACS_NamedExecuteAlways("SignetTakeToken",0)
	LDEZ O 3 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
	LDEZ P 5 A_XScream
	LDEZ Q 5 A_NoBlocking
	LDEZ RS 5
	LDEZ T -1
    stop
  }
}

Actor FriendlyLegendaryDevastatorZombie2 : FriendlyLegendaryDevastatorZombie
{
Tag "\c[z3]Friendly Legendary Devastator Zombie\c-"
States
{
  Spawn:
    LDEZ A 1 Bright
	TNT1 A 0 A_SpawnItemEx("FriendlyRedHeart",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION,0,56)
	TNT1 A 0 ACS_NamedExecuteAlways("FLegendaryEffectSpawnerT1",0)
	LDEZ A 10 Bright A_Look
	Goto Idle
  Death:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_RemoveChildren(1)
	LDEZ H 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LDEZ I 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LDEZ J 5 A_SpawnItem("BodyCrash",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LDEZ K 5 
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LDEZ L 5
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LCOS M 5
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	LDEZ N 140
	LDEZ N 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	LDEZ NNNNNNNNNNNNNNNNN 2 Bright A_GiveInventory("LegSoulEvent",1)
	LDEZ NNNNNNNNNNNNNNNNN 2 Bright A_GiveInventory("LegSoulEvent",1)
	LDEZ NNNNNNNNNNNNNNNNN 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("FriendlyLegendarySoul",0,0,16,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION,0,tid)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	LDEZ N -1
	Stop
  XDeath:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_RemoveChildren(1)
	LDEZ O 5
	LDEZ O 3 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
	LDEZ P 5 A_XScream
	LDEZ Q 5 A_NoBlocking
	LDEZ RS 5
	LDEZ T -1
    stop
	}
}