
ACTOR Bormereth
{
    Health 1200
    Radius 30
    Height 64
    Speed 10
    PainChance 75
    Mass 2500
    BloodColor Red
    MONSTER 
    Meleedamage 8
    +MISSILEEVENMORE
    +FLOORCLIP
    +BOSS
    +NORADIUSDMG
    SeeSound "DMage/Attack"
    PainSound "DMage/Pain"
    ActiveSound "DMage/idle"
    DeathSound "DMage/death"
    Obituary "%o was incinerated by the rage of Bormereth."
    HitObituary "%o was smashed by Bormereth."
    States
    {
    Spawn:
        BORM A 10 A_Look
        Loop
    See:
//        BORM AABBCCDD 4 A_VileChase  //well, if you think he should... i removed that because he is already a bit hard.
        BORM AABBCCDD 4 A_Chase
        Loop
    Missile:
	  TNT1 A 0 A_Jump(60,"Missile2")

	  TNT1 A 0 A_Jump(128,17)
	  BORM E 6 A_FaceTarget
	  BORM F 6 A_FaceTarget
	  TNT1 A 0 A_PlaySoundEx("bormereth/missilesimple","SoundSlot5")
	  BORM G 6 Bright A_CustomMissile("WraithFX12",25,0,0)
	  BORM E 6 A_FaceTarget
	  BORM F 6 A_FaceTarget
	  TNT1 A 0 A_PlaySoundEx("bormereth/missilesimple","SoundSlot5")
	  BORM G 6 Bright A_CustomMissile("WraithFX12",25,0,0)
	  BORM E 6 A_FaceTarget
	  BORM F 6 A_FaceTarget
	  TNT1 A 0 A_PlaySoundEx("bormereth/missilesimple","SoundSlot5")
	  BORM G 6 Bright A_CustomMissile("WraithFX12",25,0,0)
	  BORM E 6 A_FaceTarget
	  BORM F 6 A_FaceTarget
	  TNT1 A 0 A_PlaySoundEx("bormereth/missilesimple","SoundSlot5")
	  BORM G 6 Bright A_CustomMissile("WraithFX12",25,0,0)
	  Goto see

	  TNT1 A 0 A_Jump(128,9)
	  BORM E 6 A_FaceTarget
	  BORM F 3 A_FaceTarget
	  TNT1 A 0 A_PlaySoundEx("bormereth/missilesimple","SoundSlot5")
	  BORM F 3 Bright A_CustomMissile("WraithFX12",31,10,0)
	  TNT1 A 0 A_PlaySoundEx("bormereth/missilesimple","SoundSlot5")
	  BORM G 3 Bright A_CustomMissile("WraithFX12",28,5,0)
	  TNT1 A 0 A_PlaySoundEx("bormereth/missilesimple","SoundSlot5")
	  BORM G 3 Bright A_CustomMissile("WraithFX12",25,0,0)
	  Goto see

	  BORM E 6 A_FaceTarget
	  BORM F 6 A_FaceTarget
	  TNT1 A 0 A_PlaySoundEx("bormereth/missilesimple","SoundSlot5")
	  BORM G 0 A_CustomMissile("WraithFX12",25,0,20)
	  BORM G 0 A_CustomMissile("WraithFX12",25,0,0)
	  BORM G 0 A_CustomMissile("WraithFX12",25,0,-20)
	  BORM G 6 Bright 
	  Goto see
    Missile2:
	  BORM F 5 A_FaceTarget
	  TNT1 A 0 A_PlaySoundEx("bormereth/missile2prepare","SoundSlot5")
	  TNT1 A 0 A_SpawnItemEx("PossEttFakeFireBall",5,25,64,0,0,0,0,128)
	  BORM EEEEE 5 A_FaceTarget
	  BORM E 3 A_FaceTarget
	  TNT1 A 0 A_CustomMissile("PossEttFireBall",64,25,0)
	  BORM F 5 A_FaceTarget
	  BORM G 5 A_FaceTarget
	  goto see
    Melee:
	  BORM E 6 A_FaceTarget
	  BORM F 6 A_FaceTarget
	  BORM G 6 A_MeleeAttack
	  BORM E 0 A_CPosRefire
	  Goto see
    Pain:
	  TNT1 A 0 A_CustomMissile("FirePillarStarter",32,0,0)
	  TNT1 A 0 A_CustomMissile("FirePillarStarter",32,0,90)
	  TNT1 A 0 A_CustomMissile("FirePillarStarter",32,0,180)
	  TNT1 A 0 A_CustomMissile("FirePillarStarter",32,0,270)
	  TNT1 A 0 A_CustomMissile("FirePillarStarter",32,0,45)
	  TNT1 A 0 A_CustomMissile("FirePillarStarter",32,0,135)
	  TNT1 A 0 A_CustomMissile("FirePillarStarter",32,0,-45)
	  TNT1 A 0 A_CustomMissile("FirePillarStarter",32,0,-135)
        BORM H 2 A_SetInvulnerable
        BORM H 2 A_Pain
        BORM H 20
        BORM H 2 A_UnSetInvulnerable
        Goto See
/*    Death:
        BORM I 5
        BORM J 5 A_Scream
        BORM K 5 A_NoBlocking
        BORM L 5 A_Fall
        BORM MNOP 5
        BORM Q -1
        Stop
*/
    Death:		//I just like this death too much! :P
	  TNT1 A 0 A_PlaySound("misc/gibbed")
        BORB A 5 A_Scream
        BORB B 5 A_SpawnItemEx("DBigEttinMace", 0, 0, 32, 3, 0, 0, -90, 128)
        BORB C 5 A_NoBlocking
        BORB D 5 A_Fall
        BORB EFGHIJK 5
        BORB L -1
        Stop
    Raise:
        BORM QPONMLKJI 5
        Goto See
    }
}


actor DBigEttinMace
{
    +DOOMBOUNCE
    Speed 3
    States
    {
    Spawn:
        BORB MNOPQR 5
        BORB S -1
        Stop
    }
}

Actor WraithFX12 : WraithFX1
{
	DeathSound "bormereth/missilesimpledeath"
	Scale 0.85
	Speed 35
	Damage 10
	Decal DoomImpScorch
}

Actor PossEttFakeFireBall : WraithFX1
{
	+NOCLIP
	Damage 0
	Speed 0
	Scale 1.1
	States
	{
	Spawn:
		TNT1 AA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360))
		WRBL A 1 Bright A_SetTranslucent(0.1)
		WRBL A 1 Bright A_SetTranslucent(0.15)
		WRBL A 1 Bright A_SetTranslucent(0.2)
		TNT1 AAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360))
		WRBL B 1 Bright A_SetTranslucent(0.25)
		WRBL B 1 Bright A_SetTranslucent(0.3)
		WRBL B 1 Bright A_SetTranslucent(0.35)
		TNT1 AAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360))
		WRBL C 1 Bright A_SetTranslucent(0.4)
		WRBL C 1 Bright A_SetTranslucent(0.45)
		WRBL C 1 Bright A_SetTranslucent(0.5)
		TNT1 AAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360))
		WRBL A 1 Bright A_SetTranslucent(0.55)
		WRBL A 1 Bright A_SetTranslucent(0.6)
		WRBL A 1 Bright A_SetTranslucent(0.65)
		TNT1 AAAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360))
		WRBL B 1 Bright A_SetTranslucent(0.7)
		WRBL B 1 Bright A_SetTranslucent(0.75)
		WRBL B 1 Bright A_SetTranslucent(0.8)
		TNT1 AAAAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360))
		WRBL C 1 Bright A_SetTranslucent(0.85)
		WRBL C 1 Bright A_SetTranslucent(0.9)
		WRBL C 1 Bright A_SetTranslucent(0.95)
		TNT1 AAAAAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360))
		WRBL A 3 Bright 
		TNT1 AAAAAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360))
		WRBL B 3 Bright 
		TNT1 AAAAAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360))
		WRBL C 3 Bright 
		Stop
	}
}

Actor PossEttFireBall: WraithFX1
{
	Damage 10
	Scale 1.1
	Speed 20
    +LOOKALLAROUND
	+SEEKERMISSILE
	SeeSound "bormereth/missile2fired"
	DeathSound "bormereth/missile2death"
	Decal DoomImpScorch
	States
	{
  Spawn:
        TNT1 A 0
        TNT1 A 0 A_RearrangePointers(AAPTR_NULL,AAPTR_TARGET,AAPTR_TRACER)
        TNT1 A 0 A_LookEx(0,0,0,0,0,"Acquired")
        TNT1 A 0 A_RearrangePointers(AAPTR_MASTER,AAPTR_MASTER,AAPTR_TRACER)
        Goto Idle
    Acquired:
        TNT1 A 0 A_RearrangePointers(AAPTR_MASTER,AAPTR_MASTER,AAPTR_TARGET)
        Goto Idle
	Idle:
		TNT1 AAAAAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360),128)
		WRBL A 1 Bright A_SeekerMissile(1,90)
		TNT1 A 0 A_SpawnItemEx("PEFBTrail",0,0,0,0,0,0,0,128)
		WRBL A 1 Bright A_SeekerMissile(1,90)
		TNT1 A 0 A_SpawnItemEx("PEFBTrail",0,0,0,0,0,0,0,128)
		WRBL A 1 Bright A_SeekerMissile(1,90)
		TNT1 A 0 A_SpawnItemEx("PEFBTrail",0,0,0,0,0,0,0,128)
		TNT1 AAAAAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360),128)
		WRBL B 1 Bright A_SeekerMissile(1,90)
		TNT1 A 0 A_SpawnItemEx("PEFBTrail",0,0,0,0,0,0,0,128)
		WRBL B 1 Bright A_SeekerMissile(1,90)
		TNT1 A 0 A_SpawnItemEx("PEFBTrail",0,0,0,0,0,0,0,128)
		WRBL B 1 Bright A_SeekerMissile(1,90)
		TNT1 A 0 A_SpawnItemEx("PEFBTrail",0,0,0,0,0,0,0,128)
		TNT1 AAAAAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360),128)
		WRBL C 1 Bright A_SeekerMissile(1,90)
		TNT1 A 0 A_SpawnItemEx("PEFBTrail",0,0,0,0,0,0,0,128)
		WRBL C 1 Bright A_SeekerMissile(1,90)
		TNT1 A 0 A_SpawnItemEx("PEFBTrail",0,0,0,0,0,0,0,128)
		WRBL C 1 Bright A_SeekerMissile(1,90)
		TNT1 A 0 A_SpawnItemEx("PEFBTrail",0,0,0,0,0,0,0,128)
		Loop
	Death:
		TNT1 A 0 A_CustomMissile("PEFBExplo",0,0,0)
		TNT1 A 0 A_Explode(80,80)
		TNT1 AAAAAAAAAAAAAAA 0 A_SpawnItemEx("WraithFX23",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360),128)
		TNT1 AAAAAAAAAAAAAAA 0 A_SpawnItemEx("WraithFX22",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(1,360),128)
		WRBL DEF 3 Bright
		WRBL GHI 3
		Stop
}
}	

Actor WraithFX22
{
	Projectile
	Damage 0
	+RIPPER
	+BLOODLESSIMPACT
	Speed 0
	Radius 1
	Height 1
	Scale 0.75
	States
	{
	Spawn:
		WRBL KLKL 2 Bright
		TNT1 A 0 A_Jump(128,1)
		Loop
		WRBL MNOP 2 Bright
		WRBL P 1 Bright A_FadeOut
		Wait
	Death:
		TNT1 A 1
		Stop
	}
}

Actor WraithFX23
{
	Projectile
	Damage 0
	+RIPPER
	+BLOODLESSIMPACT
	Speed 0
	Radius 1
	Height 1
	States
	{
	Spawn:
		WRBL KLKL 2 Bright
		TNT1 A 0 A_Jump(128,1)
		Loop
		WRBL MNOP 2 Bright
		WRBL P 1 Bright A_FadeOut
		Wait
	Death:
		TNT1 A 1
		Stop
	}
}

Actor PEFBExplo
{
	Projectile
	Speed 0
	Damage 0
	+NOCLIP
	RenderStyle Add
	Alpha 0.6
	States
	{
	Spawn:
		FX58 ABCDEFGHIJKLMNOPQ 1 Bright
		Stop
	}
}

Actor PEFBTrail
{
	Projectile
	Speed 0
	Damage 0
	+NOCLIP
	RenderStyle Add
	Scale 0.4
	Alpha 0.45
	States
	{
	Spawn:
		FX50 ABCDEFG 1 
		FX50 HIJKLMNOPQR 1 
		Stop
	}
}


//-------------------------------------------------------
Actor FirePillarStarter
{
	Projectile
	+RIPPER
	Speed 28
	Damage 0
	+NOTARGET
	+RIPPER
	+BLOODLESSIMPACT
	RenderStyle None
	States
	{
	Spawn:
		PLAY A 3 
		Goto Death
	Death:
		PLAY A 3 A_CustomMissile("FirePillarBase",-20,0,0)
		Stop
	}
}

Actor FirePillarBase
{
	Projectile
	Speed 0
	+NOCLIP
	Damage 0
	RenderStyle None
	States
	{
	Spawn:
		PLAY A 2 A_CustomMissile("FirePillarShot",5,0,0)
		PLAY A 2 A_CustomMissile("FirePillarShot2",5,0,0)
		PLAY A 2 A_CustomMissile("FirePillarShot",5,0,0)
		PLAY A 2 A_CustomMissile("FirePillarShot2",5,0,0)
		PLAY A 2 A_CustomMissile("FirePillarShot",5,0,0)
		PLAY A 2 A_CustomMissile("FirePillarShot2",5,0,0)
		PLAY A 2 A_CustomMissile("FirePillarShot",5,0,0)
		PLAY A 2 A_CustomMissile("FirePillarShot2",5,0,0)
		PLAY A 2 A_CustomMissile("FirePillarShot",5,0,0)
		PLAY A 2 A_CustomMissile("FirePillarShot2",5,0,0)
		PLAY A 2 A_CustomMissile("FirePillarShot",5,0,0)
		Stop
	}
}

Actor FirePillarShot
{
	Projectile
	Speed 0
	Radius 4
	Height 3
	Damage 3
	DamageType Fire
	Scale 0.5
	RenderStyle Add
	Alpha 0.6
	States
	{
	Spawn:
		TNT1 AAAA 0
		INFE ABCD 1 Bright ThrustThingZ(0,7,0,1)
		INFE EFGHIJKLMNOPQRST 1 Bright 
		Stop	
	}
}	

Actor FirePillarShot2 : FirePillarShot	//this one wont have light definition
{
	Alpha 0.59
}

ACTOR BormerethMorpher : PowerupGiver 
{
Scale 2
radius 48
height 128
powerup.type Bormereth
inventory.pickupmessage ""
powerup.duration 99999999999999
states
{
Spawn:
TNT1 A 6
loop
 }
 }


actor PowerBormereth : PowerMorph
{
powerup.duration 99999999999999
PowerMorph.PlayerClass "BormerethPlayer"
}

ACTOR BormerethPlayer : PlayerPawn
{
  Health 1000
  Radius 30
  Height 64
  Speed 0.95
  mass 2000
  Player.ColorRange 0, 0
  Player.JumpZ 8
  Player.MaxHealth 16000
  Player.DisplayName "Bormereth"
  Player.SoundClass "Bormereth"
  Player.MorphWeapon "BormerethWeapon0"
  Player.StartItem "Mana", 100
  limitedtoteam 1
  damagefactor "boss", 0
  Species "Boss"
  SeeSound "DMage/Attack"
  PainSound "DMage/Pain"
  ActiveSound "DMage/idle"
  DeathSound "DMage/death"
  bloodcolor red
  +NOSKIN
  -PICKUP
  states
{
	Spawn:
		BORM AB 10 SetPlayerProperty(0, 1, 1)
		Loop
	See:
		BORM AABBCCDD 3 SetPlayerProperty(0, 1, 1)
		Loop
	Melee:
	Missile:
	    BORM E 1 A_JumpIfInventory("UsingBloodStone", 1, "BloodStone")
		BORM E 1 A_JumpIfInventory("UsingShrine", 1, "Shrine")
		BORM E 2 Bright
		BORM FG 4 Bright  
		Goto Spawn
	BloodStone:
	    BORM FEEEEE 5 Bright  
	    BORM E 3 Bright
	    BORM FG 5 Bright
	    goto spawn
	Shrine:
	    BORM H 24
		Goto Spawn
	Death:
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 a_givetotarget("BOSSKILLEDSTAT", 1)
		TNT1 A 0 a_givetotarget("reward", 1)
		TNT1 A 0 A_PlaySound("misc/gibbed")
        BORB A 5 A_Scream
        BORB B 5 A_SpawnItemEx("DBigEttinMace", 0, 0, 32, 3, 0, 0, -90, 128)
        BORB C 5 A_NoBlocking
        BORB D 5 A_Fall
        BORB EFGHIJK 5
        BORB L -1
		Stop
}
}

ACTOR BormerethWeapon0 : Weapon 
{
 Weapon.SelectionOrder 800
 Obituary "%o was engulfed in flames by %k"
 Inventory.PickupMessage ""
 Inventory.PickupSound "misc/pk_up"
 Weapon.AmmoUse 5
 Weapon.AmmoGive 0
 Weapon.AmmoType "Mana"
 +WEAPON.NOAUTOAIM
  States
 {
  Spawn:
       TNT1 A -1
       Loop
  Ready:
       TNT1 A 1 A_WeaponReady
       goto AltFire
  Fire:
  TNT1 A 1
  goto AltFire
  Deselect:
       TNT1 A 1 A_Lower
       Loop
  Select:
       TNT1 A 0 A_Raise
       Loop
  AltFire:
       TNT1 A 0 A_GiveInventory("BormerethWeapon")
       TNT1 A 0 A_SelectWeapon("BormerethWeapon")
       TNT1 A 0 
       goto deselect
  Flash:
       SNIF F 3 Bright A_Light2
       SNIF F 3 Bright A_Light1
       SNIF F 0 Bright A_Light0
       Goto LightDone     
       }
}


actor Bormerethattackmode1 : Inventory
{
Inventory.Amount 1
Inventory.MaxAmount 1
  States
  {
  Spawn:
    TNT1 A -1
    Stop
  }
}

actor Bormerethattackmode2 : Inventory
{
Inventory.Amount 1
Inventory.MaxAmount 1
  States
  {
  Spawn:
    TNT1 A -1
    Stop
  }
}

actor Bormerethattackmode3 : Inventory
{
Inventory.Amount 1
Inventory.MaxAmount 1
  States
  {
  Spawn:
    TNT1 A -1
    Stop
  }
}

actor Bormerethattackmode4 : Inventory
{
Inventory.Amount 1
Inventory.MaxAmount 1
  States
  {
  Spawn:
    TNT1 A -1
    Stop
  }
}

ACTOR BormerethWeapon : Weapon 
{
 Weapon.SelectionOrder 800
 Obituary "%o was engulfed in flames by %k"
 Inventory.PickupMessage ""
 Inventory.PickupSound "misc/pk_up"
 Weapon.AmmoUse 0
 Weapon.AmmoGive 0
 Weapon.AmmoType "Mana"
 +WEAPON.NOAUTOAIM
 +INVENTORY.UNDROPPABLE
  States
 {
  Spawn:
       TNT1 A -1
       Loop
  Ready:
       CLA2 A 1 A_WeaponReady(WRF_ALLOWRELOAD)
       goto ready
  Deselect:
       CLA2 A 1 A_Lower
       Loop
  Select:
       CLA2 A 0 A_Raise
       Loop
  Fire:
       CLA2 A 0 A_jumpIfinventory("Bormerethattackmode1", 1, "FireballAttackcheck")
       CLA2 A 0 A_jumpIfinventory("Bormerethattackmode2", 1, "SpreadAttackcheck")
       CLA2 A 0 A_jumpIfinventory("Bormerethattackmode3", 1, "BloodStonecheck")
	   CLA2 A 0 A_jumpIfinventory("Bormerethattackmode4", 1, "Shrinecheck")
	   Goto ready
  AltFire:
  	   CLA2 A 1 ACS_execute(812)
       CLA2 A 1
       CLA2 A 23
       goto ready
  FireballAttack:
       CLA2 A 0 A_Takeinventory("mana", 10)
       CLA2 A 0 A_PlayWeaponSound("bormereth/missilesimple")
       CLA2 A 4 A_GunFlash
       CLA2 A 0 A_FireCustomMissile("WraithFX12",0,0,0,0)
       CLA2 B 8
       goto ready
  SpreadAttack:
       CLA2 A 0 A_Takeinventory("mana", 25)
       CLA2 A 0 A_PlayWeaponSound("bormereth/missilesimple")
       CLA2 A 4 A_GunFlash
       CLA2 A 0 A_FireCustomMissile("BormerethAltar",0,0,0,0)
       CLA2 B 8
       goto ready
  BloodStone:
       CLA2 A 0 A_Giveinventory("UsingBloodStone", 1)
       CLA2 A 0 A_Takeinventory("mana", 40)
	   CLA2 A 5 A_GunFlash
       CLA2 A 0 A_PlayWeaponSound("bormereth/missile2prepare")
	   TNT1 A 0 A_SpawnItemEx("PossEttFakeFireBall",5,25,64,0,0,0,0,128)
       CLA2 A 28 A_GunFlash
       CLA2 A 0 A_FireCustomMissile("PossEttFireBall",0,0,0,0)
       CLA2 B 10
	   CLA2 A 0 A_Takeinventory("UsingBloodStone", 1)
       goto ready
  Shrine:
       CLA2 A 0 A_Takeinventory("mana", 100)
	   CLA2 A 0 A_Giveinventory("UsingShrine", 1)
	   CLA2 A 0 A_GiveInventory("ShrineCooldown",1)
	   CLA2 A 0 A_Giveinventory("PowerShrine", 1)
	   TNT1 A 0 SetPlayerProperty (0, 1, 0)
	   TNT1 A 0 A_PlaySound("DMage/Pain",CHAN_7,1.0,FALSE,ATTN_NONE)
	   TNT1 A 0 A_Stop
       CLA2 A 0 A_FireCustomMissile("FirePillarStarter",0,0,0,0)
	   CLA2 A 0 A_FireCustomMissile("FirePillarStarter",90,0,0,0)
	   CLA2 A 0 A_FireCustomMissile("FirePillarStarter",180,0,0,0)
	   CLA2 A 0 A_FireCustomMissile("FirePillarStarter",270,0,0,0)
	   CLA2 A 0 A_FireCustomMissile("FirePillarStarter",45,0,0,0)
	   CLA2 A 0 A_FireCustomMissile("FirePillarStarter",135,0,0,0)
	   CLA2 A 0 A_FireCustomMissile("FirePillarStarter",-45,0,0,0)
	   CLA2 A 0 A_FireCustomMissile("FirePillarStarter",-135,0,0,0)
       CLA2 B 26
	   CLA2 A 0 A_Takeinventory("UsingShrine", 1)
	   TNT1 A 0 SetPlayerProperty (0, 0, 0)
       goto ready
  Reload:
	   TNT1 A 0 A_GunFlash
	   TNT1 A 0 A_PlayWeaponSound("Centaur/Melee")
	   CLA2 B 6 Bright A_CustomPunch(150 , 1 , 0, "BulletPuffCent", 108)
	   CLA2 B 6 Bright A_CustomPunch(150 , 1 , 0, "BulletPuffCent", 108)
	   CLA2 B 6 Bright A_CustomPunch(150 , 1 , 0, "BulletPuffCent", 108)
	   CLA2 A 6
       Goto Ready
  FireballAttackcheck:
       TNT1 A 0 A_jumpIfinventory("mana", 10, "FireballAttack")
  goto ready
  SpreadAttackcheck:
       TNT1 A 0 A_jumpIfinventory("mana", 30, "SpreadAttack")  
  goto ready
  BloodStonecheck:
       TNT1 A 0 A_jumpIfinventory("mana", 40, "BloodStone")  
  goto ready
  Shrinecheck:
       TNT1 A 0 A_jumpIfinventory("ShrineCooldown", 1,"Ready")   
       TNT1 A 0 A_jumpIfinventory("mana", 100, "Shrine")  
  goto ready
  Flash:
       SNIF F 3 Bright A_Light2
       SNIF F 3 Bright A_Light1
       SNIF F 0 Bright A_Light0
       Goto LightDone     
       }
}

Actor UsingBloodStone : Inventory
{
	inventory.maxamount 1
}

Actor UsingShrine : Inventory
{
	inventory.maxamount 1
}

actor PowerShrine : PowerInvulnerable
{
Powerup.Color RedMap
powerup.duration -20
}

Actor ShrineCooldown : PowerDamage
{
	DamageFactor "Nothing", 1.0
	PowerUp.Duration -60
}

ACTOR ClayTree1 1050
{
//$Category Decoration
    Height 128
	Radius 10
	+SOLID
	States
	{
	Spawn:
	    TREB A -1
	    Stop
	}
}

Actor BormerethAltar
{
Radius 48
Height 16
Health 20
Damage 1
DamageType "Boss"
Species "Boss"
Mass 1000000
Scale 0.3
Speed 0
DontHurtShooter
+NOGRAVITY
+THRUSPECIES
+NOEXPLODEFLOOR
+NOBLOOD
-SHOOTABLE
+MISSILE
+THRUGHOST
+FORCERADIUSDMG
States
	{
	Spawn:
		XXBF A 3 Bright
        Loop
	Death:
		XXBF A 0 A_SetScale(1.0)
	    XXBF A 0 Bright A_RadiusGive("BormerethMineStun",96,RGF_PLAYERS,1)
		XXBF A 0 A_PlaySound("weapons/rocklx")
		XXBF AB 3 Bright
    	XXBF C 3 Bright A_Explode(64,96,0)
		XXBF DEFGHIJKLMNOPQRST 3 Bright
     	Stop 
	}
}

ACTOR PowerAltarStun : PowerSpeed
{
  Speed 0.05
}

actor BormerethMineStun : PowerupGiver
{
	inventory.pickupmessage "The Fire Destroys your feets"
	radius 64
	height 64
	powerup.color "RedMap"
	inventory.maxamount 0
	powerup.type PowerAltarStun
	powerup.duration -5
	+AUTOACTIVATE
	states
	{
		Spawn:
			NULL ABCD 6 bright
			stop
	}
}

ACTOR ClayTree2 : ClayTree1 1051
{
//$Category Decoration
    Height 128
	Radius 5
	States
	{
	Spawn:
		TREM A -1
	    Stop
	}
}

ACTOR ClayBush1 1052
{
//$Category Decoration
    Height 33
	Radius 30
	States
	{
	Spawn:
		BSHM A -1
	    Stop
	}
}

ACTOR ClayBush2 1053
{
//$Category Decoration
    Height 72
	Radius 40
	States
	{
	Spawn:
		BSHS A -1
	    Stop
	}
}

ACTOR ClayBush3 1054
{
//$Category Decoration
    Height 82
	Radius 55
	States
	{
	Spawn:
		BSHT A -1
	    Stop
	}
}

ACTOR ClayBush4 1055
{
//$Category Decoration
    Height 98
	Radius 62
	States
	{
	Spawn:
		BSHQ A -1
	    Stop
	}
}