{
	code: "erel",
	class: "EntityErel",
	tags: ["mechanical", "boss", "habitat-air"],
	variantgroups: [
		{ code: "type", states: ["pristine", "corrupted"]}
	],
	weight: 4800,
	fallDamageMultiplier: 0.0,
	habitat: "Air",
	hitboxSize: { x: 6, y: 6 },
	deadHitboxSize: { x: 6, y: 6 },
	eyeHeight: 0.3,
	attributes: {
		spawnDamageParticles: true,
		isMechanical: true
	},
	client: {
		renderer: "Shape",
		shape: { base: "entity/lore/erel/{type}", alternates:[{base: "entity/lore/erel/pristine"}, {base: "entity/lore/erel/corrupted"}]},
		glowLevel: 32,
		size: 1.2,
		behaviors: [
			{ code: "repulseagents" },
			{ code: "controlledphysics", stepHeight: 1.1251 },
			{ code: "floatupwhenstuck", onlyWhenDead: true },
			{ code: "interpolateposition" },
			{ code: "openablecontainer" },
			{ code: "bossErel", bossHpBarRange: 60, showHealthBarBetweenDimensions: true },
		],
		animations: [
			{
				code: "hurt",
				animation: "hurt",
				animationSpeed: 2.2,
				weight: 5,
				blendMode: "AddAverage"
			},
			{
				code: "die",
				animation: "die",
				animationSpeed: 1.25,
				weight: 10,
				blendMode: "Average",
				triggeredBy: { onControls: ["dead"] }
			},
			{
				code: "idle",
				animation: "fly-flapcruise",
				blendMode: "Average",
				triggeredBy: { defaultAnim: true }
			},
			{
				code: "fly-idle",
				animation: "fly-idle",
				blendMode: "Average"
			},
			{
				code: "fly-turnright",
				animation: "fly-turnright",
				blendMode: "Average",
				weight: 1
			},
			{
				code: "fly-turnleft",
				animation: "fly-turnleft",
				blendMode: "Average",
				weight: 1
			},
			{
				code: "fly-flapcruise",
				animation: "fly-flapcruise",
				blendMode: "AddAverage",
				animationSounds: [{
					frame: 0,
					location: "creature/erel/flap*",
					pitch: { avg: 1.0, var: 0.25 },
					range: 32
				}]
			},
			{
				code: "fly-flapactive",
				animation: "fly-flapactive",
				blendMode: "Average",
				weight: 100,
				animationSounds: [{
					frame: 0,
					location: "creature/erel/flap*",
					pitch: { avg: 1.0, var: 0.25 },
					range: 64
				}]
			},
			{
				code: "fly-flapactive-fast",
				animation: "fly-flapactive",
				blendMode: "AddAverage",
				animationSpeed: 2,
				animationSounds: [{
					frame: 0,
					location: "creature/erel/flap*",
					pitch: { avg: 1.0, var: 0.25 },
					range: 64
				}]
			},
			{
				code: "fire",
				animation: "fire",
				blendMode: "Average",
				weight: 100,
				elementWeight: {
					"Spine1": 1,
				},
				elementBlendMode: {
					"Spine1": "Average"
				}
			},
			{
				code: "soar",
				animation: "soar",
				blendMode: "AddAverage"
			},
			{
				code: "dive",
				animation: "dive",
				blendMode: "Average",
				animationSounds: [{
					frame: 0,
					location: "creature/erel/dive",
					looping: true,
					range: 24
				}]
			},
			{
				code: "takeoff",
				animation: "takeoff",
				blendMode: "AddAverage"
			},
			{
				code: "slam",
				animation: "slam",
				blendMode: "Average",
				animationSounds: [{
					frame: 0,
					location: "creature/erel/slam",
					range: 64
				}]
			},
			{
				code: "defeat",
				animation: "defeat",
				blendMode: "AddAverage",
				weight: 50
			}
		]
	},
	server: {
		attributes: {
			pathfinder: {
				minTurnAnglePerSec: 35,
				maxTurnAnglePerSec: 50
			}
		},
		behaviors: [
			{ code: "repulseagents" },
			{ code: "controlledphysics", stepHeight: 1.1251 },
			{ code: "health", health: 200, maxhealth: 200 },
			{ code: "deaddecay", hoursToDecay: 24 },
			{ code: "floatupwhenstuck", onlyWhenDead: true },
			{
				code: "emotionstates",
				states: [
					{ code: "fleeondamage", duration: 10, chance: 0.2, slot: 0, priority: 1, accumType: "max" },
					{ code: "aggressiveondamage", duration: 200, chance: 1, slot: 0, priority: 0.5, accumType: "noaccum" },
				]
			},
			{ code: "openablecontainer" },
			{
				code: "taskai",
				shuffle: true,
				aitasks: [
					{
						priority: 3,
						code: "flyleave",
						radius: 700,
						minDistance: 500,
						mincooldown: 0,
						maxcooldown: 0,
						stayNearSpawn: true,
						height: 650,
						animation: "fly-idle",
						animationSpeed: 1,
						moveSpeed: 0.1
					},
					{
						priority: 2,
						priorityForCancel: 2.1,
						code: "flydiveattack",
						entityCodes: ["player"],
						damage: 20,
						mincooldown: 20000,
						maxcooldown: 30000,
						globalAttackCooldownMs: 5000,
						timeoutSec: 15,
						damageType: "BluntAttack",
						knockbackStrength: 1,
						seekingRangeHor: 110,
						seekingRangeVer: 80,
						damageRange: 6,
						animation: "fly-flapactive-fast",
						animationSpeed: 3,
						moveSpeed: 0.08,
						diveHeight: 60.0
					},
					{
						priority: 2,
						priorityForCancel: 2.1,
						code: "flyswoopattack",
						entityCodes: ["player"],
						damage: 15,
						mincooldown: 15000,
						maxcooldown: 25000,
						globalAttackCooldownMs: 5000,
						timeoutSec: 15,
						damageType: "BluntAttack",
						knockbackStrength: 2,
						seekingRangeHor: 130,
						seekingRangeVer: 80,
						damageRange: 6,
						animation: "fly-idle",
						animationSpeed: 1,
						moveSpeed: 0.12,
						pathLength: 25,
						speedThresholdForDamage: 0.3,
						minVerticalDistance: 5,
						minHorizontalDistance: 15
					},
					{
						priority: 2,
						priorityForCancel: 2.1,
						code: "firefeathersattack",
						entityCodes: ["player"],
						mincooldown: 25000,
						maxcooldown: 35000,
						globalAttackCooldownMs: 5000,
						seekingRangeHor: 60,
						seekingRangeVer: 40,
						fireAfterMs: 1666,
						durationMs: 4000,
						stayNearSpawn: true,
						minRadius: 15,
						maxRadius: 25,
						height: 75,
						minVerticalDistance: 5,
						minHorizontalDistance: 10,
						animation: "fire",
						animationSpeed: 1,
						moveSpeed: 0.08,
						projectileConfigs: [
							{ code: "erelprojectile-large-usable", collectibleStack: { type: "item", code: "spear-generic-erel" }, damage: 9, damageType: "PiercingAttack", damageTier: 1, quantity: { avg: 2, var: 0.75 } },
							{ code: "erelprojectile-small-usable", collectibleStack: { type: "item", code: "arrow-erel" }, damage: 4.5, damageType: "PiercingAttack", damageTier: 0, quantity: { avg: 4, var: 0.75 } },
							{ code: "erelprojectile-large-broken", damage: 9, damageType: "PiercingAttack", damageTier: 1, quantity: { avg: 8, var: 5 } },
							{ code: "erelprojectile-small-broken", damage: 4.5, damageType: "PiercingAttack", damageTier: 0, quantity: { avg: 15, var: 5 } },
						]
					},
					{
						priority: 1.8,
						code: "flycircleifentity",
						entityCodes: ["player"],
						seekingRangeHor: 100,
						seekingRangeVer: 100,
						stayNearSpawn: true,
						minRadius: 14,
						maxRadius: 18,
						height: 70,
						animation: "fly-idle",
						animationSpeed: 1,
						moveSpeed: 0.06
					},
					{
						priority: 1.7,
						code: "flycircletarget",
						entityCodes: ["player"],
						stayNearSpawn: false,
						seekingRangeHor: 160,
						seekingRangeVer: 80,
						minRadius: 30,
						maxRadius: 40,
						height: 60,
						animation: "fly-idle",
						animationSpeed: 1,
						moveSpeed: 0.10
					},
					{
						priority: 1.6,
						code: "flywander",
						radius: 500,
						minDistance: 100,
						stayNearSpawn: true,
						height: 65,
						mincooldown: 10000,
						maxcooldown: 120000,
						animation: "fly-idle",
						animationSpeed: 1,
						moveSpeed: 0.08
					},
					{
						priority: 1.4,
						code: "flycircle",
						stayNearSpawn: false,
						minRadius: 25,
						maxRadius: 60,
						height: 65,
						animation: "fly-idle",
						animationSpeed: 1,
						moveSpeed: 0.08
					},
					{
						code: "idle",
						priority: 1.2,
						priorityForCancel: 1.35,
						minduration: 10000,
						maxduration: 30000,
						mincooldown: 30000,
						maxcooldown: 60000,
						animation: "idle",
						animationSpeed: 1.75
					}
				]
			}
		]
	},
	sounds: {
		hurt: "creature/erel/hurt",
		idle: { path: "creature/erel/call*", range: 240, pitch: { avg: 1, var: 0.25 } }
	},
	idleSoundChance: 0.05
}
