     Actor HelmlessRifleMerc : GenericHumanScum 
       {
  scale 1.0
  obituary "%o was moved down by the helmless, but not helpless Rifle Privateer"
  health 172
  radius 15
  height 54
  mass 100
  speed 12
  Species "KNIGHT"
  +DONTHARMSPECIES
  painchance 165
  SeeSound "StMerc/See"
  PainSound "StMerc/pain"
  DeathSound "StMerc/Death"
  ActiveSound "StMerc/Active"
  dropitem "Chaingun", 5
  Translation "112:127=96:111"	
  Tag "Rifle Privateer"
  MONSTER
  +FLOORCLIP
  States
       {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("STFUCheck") == 1, "STFU")
	TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult ("VanJumpCheck") == 1, "VanJump")
	TNT1 A 0 A_SetScale (scaleX+frandom(-0.02, 0.02), scaleY+frandom(-0.08,0.08))	
   Spawn2:	
    MER1 S 10 A_Look
    loop
  STFU:
     TNT1 A 0
	 TNT1 A 0 ACS_NamedExecute ("STFUStMerc")
	 Goto Spawn+2
  VanJump:
	 TNT1 A 0
	 TNT1 A 0  NODELAY ACS_NamedExecuteAlways ("VanillaHeights")
	Goto Spawn+3	 
  See:
   "####" A random(1,5)
    TNT1 A 0 A_Jump (70, "DodgeLeft", "DodgeRight", "DodgeLeftF", "DodgeLeftB", "DodgeRightF", "DodgeRightB")
	TNT1 A 0 A_Jump (180, "MissileCheck")
  SeeLoop:
    TNT1 A 0 A_CheckSight ("CheckReload")
    TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	TNT1 A 0 A_Jump (199, "DodgeLeft", "DodgeRight", "DodgeLeftF", "DodgeLeftB", "DodgeRightF", "DodgeRightB")
    MER1 AABBCCDD 3 A_Chase
    loop
  CheckReload:
    TNT1 A 0 A_Jump (150, "CheckReload2")
 	Goto SeeLoop+1
  CheckReload2:
    TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	Goto SeeLoop+1
  DodgeLeft:
        TNT1 A 0 A_FaceTarget
	    MER2 AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (228, "MissileCheck")
		TNT1 A 0 A_Jump (50, "DodgeRight")
		Goto SeeLoop+1
	DodgeLeftF:
	    TNT1 A 0 A_FaceTarget
	    TNT1 A 0 ThrustThingZ (0, 15, 0, 0)
	    TNT1 A 0 A_Recoil (random (-8,-3))
	    MER2 AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (228, "MissileCheck")
		Goto SeeLoop+1
    DodgeLeftB:
	    TNT1 A 0 A_FaceTarget
	    TNT1 A 0 ThrustThingZ (0, 15, 0, 0)
	    TNT1 A 0 A_Recoil (random (3,8))
	    MER2 AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (228, "MissileCheck")
		Goto SeeLoop+1
	DodgeRight:
	    TNT1 A 0 A_FaceTarget
	    MER2 AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (228, "MissileCheck")
		Goto SeeLoop+1
	DodgeRightF:
	    TNT1 A 0 A_FaceTarget
	    TNT1 A 0 ThrustThingZ (0, 15, 0, 0)
	    TNT1 A 0 A_Recoil ( random (-8,-3)) 
	    MER2 AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (228, "MissileCheck")
		Goto SeeLoop+1
	DodgeRightB:
	    TNT1 A 0 A_FaceTarget
	    TNT1 A 0 ThrustThingZ (0, 15, 0, 0)
	    TNT1 A 0 A_Recoil ( random (3,8)) 
	    MER2 AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (228, "MissileCheck")
		Goto SeeLoop+1
  MissileCheck:
	TNT1 A 0 A_JumpIfInventory ("GrenadeCoolDown", 1, 2)
    TNT1 A 0 A_Jump (175, "40mmCheck") 
    TNT1 A 0 A_JumpIfTargetInLos ("Missile", 0, JLOSF_DEADNOJUMP)
	Goto SeeLoop
  Missile:
    MER1 E 7 A_FaceTarget
	TNT1 A 0 A_TakeInventory ("GrenadeCoolDown", 1)
	TNT1 A 0 A_JumpIfTargetInLos ("TriShot", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 0, 950) 
	TNT1 A 0 A_JumpIfTargetInLos ("Accuracy", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 0, 1500)
	TNT1 A 0 A_Jump (69, "StrafeMissileLeft")
  MissileLoop:
    MER1 E 1 A_FaceTarget
    TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	MER1 F 1 BRIGHT A_CustomMissile ("AKTracer",42,9,random (-3,3))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	//TNT1 A 0 A_JumpIfInTargetLos ("DodgeCheck")
	TNT1 A 0 A_FaceTarget
    MER1 E 1 A_MonsterRefire (40, "SeeLoop")
	TNT1 A 0 A_Jump (25, "SeeLoop")
	goto MissileLoop
  StrafeMissileLeft:
    TNT1 A 0 A_FaceTarget
    MER1 AABB 2 ThrustThing(angle*256/360+192, 1, 0, 0)
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	MER1 F 1 BRIGHT A_CustomMissile ("AKTracer",42,9, random (-5,5))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	MER1 CCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	MER1 F 1 BRIGHT A_CustomMissile ("AKTracer",42,9, random (-5,5))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	MER1 AABB 2 ThrustThing(angle*256/360+192, 1, 0, 0)
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	MER1 F 1 BRIGHT A_CustomMissile ("AKTracer",42,9, random (-5,5))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	MER1 CCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	MER1 F 1 BRIGHT A_CustomMissile ("AKTracer",42,9, random (-5,5))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	MER1 AABB 2 ThrustThing(angle*256/360+192, 1, 0, 0)
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	MER1 F 1 BRIGHT A_CustomMissile ("AKTracer",42,9, random (-5,5))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	MER1 CCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	MER1 F 1 BRIGHT A_CustomMissile ("AKTracer",42,9, random (-5,5))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	MER1 AABB 2 ThrustThing(angle*256/360+192, 1, 0, 0)
	MER1 CCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
   Goto SeeLoop
   StrafeMissileRight:
    TNT1 A 0 A_FaceTarget
    MER1 AABB 2 ThrustThing(angle*256/360+64, 1, 0, 0)
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	MER1 F 1 BRIGHT A_CustomMissile ("AKTracer",42,9, random (-5,5))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	MER1 CCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	MER1 F 1 BRIGHT A_CustomMissile ("AKTracer",42,9, random (-5,5))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	MER1 AABB 2 ThrustThing(angle*256/360+64, 1, 0, 0)
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	MER1 F 1 BRIGHT A_CustomMissile ("AKTracer",42,9, random (-5,5))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	MER1 CCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	MER1 F 1 BRIGHT A_CustomMissile ("AKTracer",42,9, random (-5,5))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	MER1 AABB 2 ThrustThing(angle*256/360+64, 1, 0, 0)
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	MER1 F 1 BRIGHT A_CustomMissile ("AKTracer",42,9, random (-5,5))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	MER1 CCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	MER1 F 1 BRIGHT A_CustomMissile ("AKTracer",42,9, random (-5,5))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	MER1 AABB 2 ThrustThing(angle*256/360+64, 1, 0, 0)
	MER1 CCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
   Goto SeeLoop
  Trishot:
    TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	MER1 F 1 BRIGHT A_CustomMissile ("AKTracer",42,9)
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	MER1 E 2 A_FaceTarget 
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	MER1 F 1 BRIGHT A_CustomMissile ("AKTracer",42,9,random (-1,1))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	MER1 E 2 A_FaceTarget
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	MER1 F 1 BRIGHT A_CustomMissile ("AKTracer",42,9,random (-2,2))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	MER1 E 2 A_MonsterRefire (40, "SeeLoop")
	Goto SeeLoop
  Accuracy:
    MER1 E 7 A_FaceTarget
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	MER1 F 2 BRIGHT A_CustomMissile ("AKTracer",42,9)
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	Goto SeeLoop
  40mmCheck:
    TNT1 A 0 A_JumpIfTargetInLos ("40mm", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 1200, 400)
	Goto MissileCheck+1
  40mm:
    MER2 E 9 A_FaceTarget
	TNT1 A 0 A_PlaySound ("GLFIR", CHAN_WEAPON)
	MER2 F 2 BRIGHT A_CustomMissile ("Grenade40mm", 32, 0, random (-3,3), CMF_OFFSETPITCH, random (10, 16))
	TNT1 A 0 A_GiveInventory ("GrenadeCoolDown", 3)
	Goto SeeLoop
  Reload:
    MER1 E 14 A_Playsound ("RIFOUT")
	TNT1 A 0 A_TakeInventory ("AKShotCounter", 30)
	MER1 D 28 A_Playsound ("RIFIN")
	MER1 E 16 A_Playsound ("RIFCOCK")
	Goto SeeLoop
  Pain:
    MER1 H 3
    MER1 H 3 A_Pain
    goto SeeLoop
  Death:
  	//TNT1 A 0 A_Jump(20, "Suren")
    MER1 I 5 A_Scream
    MER1 J 5
    MER1 K 5 A_NoBlocking
    MER1 KL 5
    MER1 M -1
    stop
  XDeath:
    TNT1 A 0
    TNT1 A 0 A_SpawnItemEx ("VgavnonahCore", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    MER1 U 5
    MER1 V 5 A_XScream
    PGIB A 5 A_NoBlocking
    PGIB BCD 5
    PGIB E -1
    Stop
  Raise:
    TNT1 A 0 
	TNT1 A 0 A_SpawnItemEx ("NanoResEffect", 0, 0, 15, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	NER1 MLKJI 4
   Goto See	
  Idle:
    MER1 AA 4 A_Wander
    MER1 A 0 A_Look
    MER1 BB 4 A_Wander
    MER1 A 0 A_Look
    MER1 CC 4 A_Wander
    MER1 A 0 A_Look
    MER1 DD 4 A_Wander
    MER1 A 0 A_Look
    loop
  }
	
}


	Actor HelmLessRifleMercSpawner : RandomSpawner
		{
		 DropItem HelmLessRifleMerc
		 DropItem HelmlessRifleMercHaki
		 DropItem HelmLessRifleMercBlack
		}



	Actor HelmlessRifleMercHaki : HelmlessRifleMerc 
		{
		 Translation "112:127=5:12" 
		}

	Actor HelmLessRifleMercBlack : HelmlessRifleMerc 
		{
		 Translation "112:114=102:104", "115:115=3:3", "116:122=105:111", "123:126=5:8", "127:127=0:0"
		}