ACTOR ChaosWyvern 12349
{
	Monster
	Health 1000
	Painchance 16
	Speed 14
	Height 65
	Radius 32
	Mass 0x7fffffff
	Monster
	+NOGRAVITY
	+FLOAT
	+BOSS
	+DONTMORPH
	+NOTARGET
	+MISSILEMORE
	+FLOATBOB
	+SPAWNFLOAT
	Obituary "%o was cremated by the Chaos Wyvern."

	SeeSound "ChaosWyvern/Sight"
	ActiveSound "ChaosWyvern/Act"
	PainSound "ChaosWyvern/Pain"
	DeathSound "ChaosWyvern/Death"

	States
	{
	Spawn:
		CWYV DCBABC 5 A_Look
		Loop
	See:
		CWYV CB 5
	Fly:
		CWYV AABBCCDDCCBB 2 A_Chase
		Goto Fly
	Pain:
		CWYV F 10 A_Pain
		Goto Fly
	Missile:
		CWYV # 1 A_FaceTarget
		CWYV # 0 A_JumpIfCloser(256, "Melee")
		CWYV # 8 Bright A_CustomMissile("WyvernBall")
		Goto Fly
	Melee:
		CWYV E 1 Bright A_CustomMissile("WyvernBreath", 40, 0, random(-5,5))
		CWYV E 1 Bright A_CustomMissile("WyvernBreath", 40, 0, random(-5,5))
		CWYV E 0 Bright A_Chase
		CWYV E 0 Bright A_FaceTarget
		CWYV E 1 Bright A_CustomMissile("WyvernBreath", 40, 0, random(-5,5))
		CWYV E 1 Bright A_CustomMissile("WyvernBreath", 40, 0, random(-5,5))
		CWYV E 0 Bright A_Chase
		CWYV E 0 Bright A_FaceTarget
		CWYV E 1 Bright A_CustomMissile("WyvernBreath", 40, 0, random(-5,5))
		CWYV E 1 Bright A_CustomMissile("WyvernBreath", 40, 0, random(-5,5))
		CWYV E 0 Bright A_Chase
		CWYV E 0 Bright A_FaceTarget
		CWYV E 1 Bright A_CustomMissile("WyvernBreath", 40, 0, random(-5,5))
		CWYV E 1 Bright A_CustomMissile("WyvernBreath", 40, 0, random(-5,5))
		CWYV E 0 Bright A_Chase
		CWYV E 0 Bright A_FaceTarget
		CWYV A 0 A_Jump(32, "Fly")
		Goto Melee
	XDeath:
	Death:
		CWYV G 0 A_ChangeFlag(FloatBob, 0)
	    CWYV G 5 A_Scream
		CWYV H 4 A_NoBlocking
		CWYV I 4
		CWYV J 4
		Wait
	Crash:
		CWYV KL 5
		CWYV M -1
		Stop
	Ice:
		CWYV G 0 A_ChangeFlag(FloatBob, 0)
		CWYV N 5 A_FreezeDeath
		CWYV N 1 A_FreezeDeathChunks
		Wait
	}
}
		
Actor WyvernBall
{
	Radius 6
	Height 16
	Speed 20
	Damage 4
	RenderStyle Add
	Alpha 1
	DamageType "Fire"
	Projectile

	SeeSound "ChaosWyvern/Breath"
	DeathSound "ChaosWyvern/Bomb"

	States
	{
	Spawn:
		CWVB AABB 2 Bright A_SpawnItemEx("Puffy", random2[BeastPuff]()*0.015625, random2[BeastPuff]()*0.015625, 
                                    random2[BeastPuff]()*0.015625, 0,0,0,0,SXF_ABSOLUTEPOSITION | SXF_CLIENTSIDE, 64)
		Loop
	Death:
		CWVB C 4 Bright
		CWVB D 4 Bright A_Explode(80, 128, false)
		CWVB EFG 4 Bright
		Stop
	}
}

Actor WyvernBreath : PhoenixFX2
{
	Speed 20
	Alpha 1
	Damage 1
	SeeSound "ChaosWyvern/Toast"
}

actor ChaosWyvernSpot : CustomMonsterInvasionSpot 12350
{
dropitem ChaosWyvern
}