Actor Goldenboner
{
	Health 500
    Radius 25
    Height 5
	projectilepassheight 40
    Speed 20
    PainChance 30
	Painchance "grappler", 256
	mass 1000
    scale 0.35
	Monster
    +FLOORCLIP
	+avoidmelee
	+DONTRIP
	+lookallaround
	+NORADIUSDMG
	+bright
	-countkill
	MinMissileChance 800
	bloodtype goldbonespray
	SeeSound "goldskeleton/sight"
    PainSound "goldskeleton/pain"
    DeathSound "skeleton/gib"
    ActiveSound "goldskeleton/chatter"
	states
	{
	spawn:
		TNT1 A 0 a_giveinventory ("HighstunCD",1)
		GBNR AB 2 a_look
		TNT1 A 0 a_giveinventory ("dontpullme",1)
		TNT1 A 0 a_giveinventory ("HighstunCD",1)
		loop
	see:
		TNT1 A 0 a_giveinventory ("HighstunCD",1)
		GBNR ABCDEF 2 a_chase
		TNT1 A 0 a_giveinventory ("dontpullme",1)
		TNT1 A 0 a_giveinventory ("HighstunCD",1)
		TNT1 A 0 a_giveinventory ("fleetimer", 1)
		TNT1 A 0 a_jumpifinventory ("fleetimer", 30, "flee")
		TNT1 A 0 a_jump (60, "runaway")
		loop
	runaway:
		TNT1 A 0 a_giveinventory ("fleetimer", 1)
		TNT1 A 0 a_jumpifinventory ("fleetimer", 30, "flee")
		TNT1 A 0 a_changeflag ("frightened", 1)
		TNT1 A 0 thrustthingz (0,50,0,0)
		TNT1 A 0 ThrustThing(angle*256/360+192,random(16,24),0,0)
		GBNR ABCDEF 2 a_chase
		GBNR AAABBBCCCDDDEEEFFF 2 a_fastchase
		GBNR AAABBBCCCDDDEEEFFF 2 a_fastchase
		GBNR AAABBBCCCDDDEEEFFF 2 a_fastchase
		TNT1 A 0 a_changeflag ("frightened", 0)		
		goto see
	pain:
		TNT1 A 0 a_spawnitemex ("goldenbonerminorloot", 0, 0, 0, random (-10, 10), random (-10, 10), random (5, 12))
		TNT1 A 0 a_spawnitemex ("goldenbonerminorloot", 0, 0, 0, random (-10, 10), random (-10, 10), random (3, 10))
		TNT1 A 0 a_takeinventory ("fleetimer", 3)
		TNT1 A 0 a_playsound ("skeleton/allpain",0,1,0,0.5)
		GBNR J 8 a_pain
		GBNR AAABBBCCCDDDEEEFFF 2 a_fastchase
		GBNR AAABBBCCCDDDEEEFFF 2 a_fastchase
		goto see
	missile:
		TNT1 A 0 a_giveinventory ("fleetimer", 3)
		TNT1 A 0 a_playsound ("goldskeleton/taunt",0)
		GBDN ABABABAB 4 a_fastchase
		TNT1 A 0 a_jumpifinventory ("fleetimer", 20, "flee")
		goto see
	pain.grappler:
		GBNR J 8 a_pain
		GBNR AAABBBCCCDDDEEEFFF 2 a_fastchase
		GBNR AAABBBCCCDDDEEEFFF 2 a_fastchase
		GBNR AAABBBCCCDDDEEEFFF 2 a_fastchase
		GBNR AAABBBCCCDDDEEEFFF 2 a_fastchase
		goto see
	flee:
		TNT1 A 0 a_stop
		TNT1 A 0 a_noblocking
		TNT1 A 0 a_changeflag ("nodamage", 1)
		TNT1 A 0 a_changeflag ("nointeraction", 1)
		TNT1 A 0  a_playsound ("goldskeleton/spin",0)
		GSPN ABCDFGH 2
		GSPN A 2
		TNT1 A 0 a_playsound ("goldskeleton/spin",0)
		GSPN ABCDEFGH 1 
		GSPN AB 1 
		TNT1 A 0 a_playsound ("goldskeleton/spin",0)		
		GSPN CD 1
		GSPN EF 1 
		GSPN GH 1
		TNT1 A 0 a_playsound ("goldskeleton/spin",0)		
		GSPN CD 1
		GSPN EF 1 
		GSPN GH 1
		TNT1 A 0 a_spawnitem ("winkout")
		TNT1 A 0 a_playsound ("goldskeleton/ding",0)
		stop
	death:
		GBNR KL 2 a_fall
		TNT1 A 0 a_scream
		TNT1 A 0 a_spawnitemex ("goldenbonerloot", 0, 0, 0, random (-10, 10), random (10, 10), random (4, 8))
		TNT1 A 0 a_spawnitemex ("goldenbonerloot", 0, 0, 0, random (-10, 10), random (10, 10), random (2, 4))
		TNT1 A 0 a_spawnitemex ("goldenbonerloot", 0, 0, 0, random (-10, 10), random (10, 10), random (3, 6))
		TNT1 A 0 a_spawnitemex ("biggoldenbonerloot", 0, 0, 0, random (-10, 10), random (10, 10), random (5, 9))
		TNT1 AAAAA 0 a_spawnitem ("goldbonespray")
		ISKL AAAA 0 a_spawnitemex("goldhipbone",0,0,0,random(-10,10),random(-10,10),10)
		ISKL A 0 a_spawnitemex("goldribcage",0,0,0,random(-10,10),random(-10,10),12)
		TNT1 A 1
		stop
	}
}

actor winkout
{
	+nogravity
	scale 2
	+BRIGHT
	+clientsideonly
	states
	{
	spawn:
		GDSP FEDCBA 2
		stop
	}
}

actor goldenbonerminorloot : randomspawner
{
	dropitem "smallbulletgemdrop", 256, 2
	dropitem "minorarcanecrystaldrop", 256, 2
	dropitem "smallspiritgemdrop", 256, 1
	dropitem "smalldarkgemdrop", 256, 1
}

actor goldenbonerloot : randomspawner
{
	dropitem "bigbulletgemdrop", 256, 2
	dropitem "arcanecrystaldrop", 256, 2
	dropitem "bigdarkgemdrop", 256, 1
}

actor biggoldenbonerloot : randomspawner
{
	dropitem "subrefresh", 256, 2
	dropitem "packdrop", 256, 1
	dropitem "armoramulet", 256, 1
	dropitem "bigspiritgemdrop", 256, 1
	dropitem "superburgerdrop", 256, 2
}

actor fleetimer : inventory
{
	inventory.maxamount 30
	inventory.amount 1
}