{
	code: "wolf",
	class: "EntityAgent",
	tags: ["animal", "huntable", "adult", "predator", "ferocious", "habitat-land"],
	weight: 76,
	variantgroups:  [ 
		{ code: "type", states: ["eurasian"]},
		{ code: "age", states: ["adult"] },
		{ code: "gender", states: ["male", "female"] },
	] ,
	hitboxSize: { x: 1.2, y: 1 },
	deadHitboxSize: { x: 1, y: 0.75 },
	eyeHeight: 0.9,
	drops: [],
	attributes: {
		creatureDiet: {
			weightedFoodTags: [
				{ weight: 0.9, code: "meat" },
				{ weight: 1, code: "egg" }
			]
		},
		trappable: {
			"small": { trapChance: 0.0,	trapDestroyChance: 0.7 },
			"large": { trapChance: 0.0,	trapDestroyChance: 0.05 }
		},
		killedByInfoText: "deadcreature-eaten-large",
		"handbook": {
			"groupcode": "creaturegroup-wolf",
			trappableGroupCode: "creaturegroup-wolf-{type}-{age}"
		}
	},
	client: {
		renderer: "Shape",
		shape: { base: "entity/animal/mammal/wolf/{type}-{age}" },
		sizeByType: {
			"*-male": 1.05,
			"*": 0.95
		},
		texture: { base: "entity/animal/mammal/wolf/eurasian-adult1", alternates: [ { base: "entity/animal/mammal/wolf/eurasian-adult2" }, { base: "entity/animal/mammal/wolf/eurasian-adult3" }, { base: "entity/animal/mammal/wolf/eurasian-adult4" }, { base: "entity/animal/mammal/wolf/eurasian-adult5" }, { base: "entity/animal/mammal/wolf/eurasian-adult6" }, { base: "entity/animal/mammal/wolf/eurasian-adult7" }, { base: "entity/animal/mammal/wolf/eurasian-adult8" }, { base: "entity/animal/mammal/wolf/eurasian-adult9" }, { base: "entity/animal/mammal/wolf/eurasian-adult10" } ] },
		behaviors: [
			{ code: "repulseagents" }, 
			{ code: "controlledphysics", stepHeight: 1.1251 }, 
			{ code: "floatupwhenstuck", onlyWhenDead: true },
			{ code: "interpolateposition" },
			{ code: "harvestable" },
			{ code: "despawn", minPlayerDistance: 16, belowLightLevel: 8, minSeconds: 300, afterDays: 14 },
			{ code: "ropetieable", minGeneration: 2 }
		],
		animations: [
			{
				code: "hurt",
				animation: "hurt", 
				animationSpeed: 2.2,
				weight: 10,
				blendMode: "AddAverage" 
			},
			{
				code: "die",
				animation: "death", 
				animationSpeed: 1.25,
				weight: 10,
				blendMode: "Average",
				triggeredBy: { onControls: ["dead"] }
			},
			{ 
				code: "idle", 
				animation: "idle",
				blendMode: "AddAverage",
				easeOutSpeed: 4,
				triggeredBy: { defaultAnim: true },
			},
			{
				code: "sleep", 
				animation: "sleep",
				easeInSpeed: 4,
				easeOutSpeed: 4,
				weight: 5,
				blendMode: "Average", 
			},
			{ 
				code: "eat",
				animation: "Eat",
				blendMode: "Average", 
			},
			{
				code: "sit", 
				animation: "sit",
				easeInSpeed: 4,
				easeOutSpeed: 4,
				weight: 10,
				blendMode: "Average", 
			},
			{
				"code": "attack-withwindup",
				"animation": "attack-withwindup",
				"animationSpeed": 1,
				"blendMode": "Average",
				"weight": 100
            },
			{
				code: "Walk", 
				animation: "Walk",
                animationSounds: [{frame: 2, range: 10, location: "creature/wolf/footsteps/dirt/footstep-wolf-dirt*", pitch: { avg: 1.0, var: 0.15 }, volume: {avg: 1.2}}, {frame: 13, range: 10, location: "creature/wolf/footsteps/dirt/footstep-wolf-dirt*", pitch: { avg: 1.0, var: 0.15 }, volume: {avg: 1.2}}, {frame: 30, range: 10, location: "creature/wolf/footsteps/dirt/footstep-wolf-dirt*", pitch: { avg: 1.0, var: 0.15 }, volume: {avg: 1.2}}, {frame: 42, range: 10, location: "creature/wolf/footsteps/dirt/footstep-wolf-dirt*", pitch: { avg: 1.0, var: 0.15 }, volume: {avg: 1.2}}],
            },
			{
				code: "Run", 
				animation: "Run",
                animationSounds: [{frame: 5, range: 15, location: "creature/wolf/footsteps/dirt/footstep-wolf-dirt*", pitch: { avg: 1.0, var: 0.15 }, volume: {avg: 1.2}}, {frame: 7, range: 15, location: "creature/wolf/footsteps/dirt/footstep-wolf-dirt*", pitch: { avg: 1.0, var: 0.15 }, volume: {avg: 1.2}}, {frame: 17, range: 15, location: "creature/wolf/footsteps/dirt/footstep-wolf-dirt*", pitch: { avg: 1.0, var: 0.15 }, volume: {avg: 1.2}}, {frame: 20, range: 15, location: "creature/wolf/footsteps/dirt/footstep-wolf-dirt*", pitch: { avg: 1.0, var: 0.15 }, volume: {avg: 1.2}}],
            },
            {
                code: "Canter", 
				animation: "Canter",
                animationSounds: [{frame: 2, range: 15, location: "creature/wolf/footsteps/dirt/footstep-wolf-dirt*", pitch: { avg: 1.0, var: 0.15 }, volume: {avg: 1.2}}, {frame: 6, range: 15, location: "creature/wolf/footsteps/dirt/footstep-wolf-dirt*", pitch: { avg: 1.0, var: 0.15 }, volume: {avg: 1.2}}, {frame: 12, range: 15, location: "creature/wolf/footsteps/dirt/footstep-wolf-dirt*", pitch: { avg: 1.0, var: 0.15 }, volume: {avg: 1.2}}, {frame: 14, range: 15, location: "creature/wolf/footsteps/dirt/footstep-wolf-dirt*", pitch: { avg: 1.0, var: 0.15 }, volume: {avg: 1.2}}],
			}
		]
	},
	server: {
		behaviors: [
			{ code: "repulseagents" }, 
			{ code: "controlledphysics", stepHeight: 1.1251 },
			{ code: "despawn", minPlayerDistance: 8, belowLightLevel: 8, minSeconds: 300 },
			{ code: "health", 
				currenthealthByType: {
					"*-male": 15,
					"*": 14
				},
				maxhealthByType: {
					"*-male": 15,
					"*": 14
				}
			},
			{ code: "deaddecay", hoursToDecay: 96, decayedBlock: "carcass-medium" },
			{ code: "floatupwhenstuck", onlyWhenDead: true },
			{ code: "harvestable", drops: [
				{
					type: "item", 
					code: "bushmeat-raw", 
					quantity: { avg: 7, var: 1 } 
				},
				{
					type: "item", 
					code: "hide-raw-medium", 
					quantity: { avg: 1.5, var: 0 } 
				},
				{
					type: "item", 
					code: "fat", 
					quantity: { avg: 1.25, var: 0 } 
				}
				]
			},
			{ code: "breathe" },
			{ 
				code: "multiply",
				enabledByType: {
					"*-female": true,
					"*": false
				},
				quantityPerDay: 0,
				spawnEntityCodes: [ { code:"wolf-{type}-baby-male"}, {code: "wolf-{type}-baby-female"} ],
				growthCapQuantity: 10,
				growthCapRange: 15,
				growthCapEntityCodes: ["wolf-{type}-adult-male", "wolf-{type}-adult-female", "wolf-{type}-baby-male", "wolf-{type}-baby-female"],
				requiresNearbyEntityCode: "wolf-{type}-adult-male",
				requiresNearbyEntityRange: 10
			},
			{ 
				code: "emotionstates",
				states: [
					{ code: "fleeondamage", duration: 60, chance: 0.75, slot: 2, priority: 5, accumType: "max", whenHealthRelBelow: 0.3 },
					{ 
						code: "saturated", 
						duration: 1200, chance: 1, slot: 0, priority: 1, accumType: "sum",
						belowTempDuration: 600,
						belowTempThreshold: -5
					},
					{ code: "aggressiveondamage", duration: 30, chance: 1, slot: 2, priority: 2, accumType: "noaccum" },
					{ code: "alarmherdondamage", chance: 1, slot: 1, priority: 1, accumType: "max" }
				],
			},
			{
				code: "taskai",
				aiCreatureType: "LandCreature",
				aitasks: [
					{
						code: "meleeattack",
						entityCodes: ["deer-*", "gazelle-*", "sheep-bighorn-baby-*", "goat-*", "player"],
						priority: 2.1,
						damage: 8,
						damageTier: 2,
						damageType: "SlashingAttack",
						slot: 1,
						mincooldown: 500, 
						maxcooldown: 1500, 
						attackDurationMs: 1200,
						damagePlayerAtMs: 900,
						animation: "attack-withwindup",
						animationSpeed: 1.5,
						sound: "creature/wolf/attack*"
					},
					{
						code: "meleeattack",
						entityCodes: ["player"],
						priority: 2,
						damage: 8,
						damageTier: 2,
						damageType: "SlashingAttack",
						slot: 1,
						mincooldown: 30000, 
						maxcooldown: 35000, 
						attackDurationMs: 800,
						damagePlayerAtMs: 500,
						animation: "Attack-High",
						animationSpeed: 1.5,
						sound: "creature/wolf/attack*"
					},
					{
						code: "meleeattack",
						entityCodes: ["chicken-*", "hare-*", "pig-eurasian-baby-*", "raccoon-*"],
						priority: 2,
						damage: 8,
						damageTier: 2,
						damageType: "SlashingAttack",
						slot: 1,
						mincooldown: 1500, 
						maxcooldown: 1500, 
						attackDurationMs: 800,
						damagePlayerAtMs: 500,
						retaliateAttacks: false,
						animation: "Attack-Low",
						animationSpeed: 1.5,
						sound: "creature/wolf/attack*"
					},
					{
						code: "fleeentity",
						entityCodes: ["player"],
						priority: 1.6,
						movespeed: 0.052,
						seekingRange: 20,
						animation: "Run",
						animationSpeed: 2,
						whenInEmotionState: "fleeondamage"
					},
					{
						code: "seekentity",
						entityCodes: ["player"],
						priority: 1.51,
						movespeed: 0.045,
						seekingRange: 9,
						
						belowTempSeekingRange: 25,
						belowTempThreshold: -5,
						
						animation: "Run",
						leapAtTarget: true,
						leapAnimation: null,
						animationSpeed: 2,
						leapChance: 0.01,
						sound: "creature/wolf/growl*",
						whenNotInEmotionState: "saturated"
					},
					{
						code: "seekentity",
						entityCodes: ["player", "chicken-*", "gazelle-*", "goat-*", "sheep-bighorn-baby-*", "pig-eurasian-baby-*", "hare-*", "deer-*", "raccoon-*"],
						priority: 1.5,
						movespeed: 0.045,
						seekingRange: 15,
						
						belowTempSeekingRange: 25,
						belowTempThreshold: -5,
						
						animation: "Canter",
						leapAtTarget: true,
						leapAnimation: null,
						animationSpeed: 1.5,
						leapChance: 0.01,
						sound: "creature/wolf/growl*",
						whenNotInEmotionState: "saturated"
					},
					{
						code: "seekentity",
						entityCodes: ["player"],
						priority: 1.49,
						movespeed: 0.045,
						seekingRange: 15,
						animation: "Run",
						leapAtTarget: true,
						leapAnimation: null,
						animationSpeed: 2,
						leapChance: 0.01,
						sound: "creature/wolf/growl*",
						whenInEmotionState: "aggressiveondamage"
					},
					{
						code: "followleadholder",
						minGeneration: 2,
						priority: 1.47,
						animation: "walk",
						animationSpeed: 1,
						movespeed: 0.015
					},
					{
						code: "getoutofwater",
						priority: 1.4,
						movespeed: 0.015,
						animation: "Swim",
						animationSpeed: 1
					},
					{
						code: "stayclosetoentity",
						priority: 1.4,
						enabledByType: {
							"*-male": false,
							"*": true
						},
						entityCode: "wolf-{type}-adult-male",
						movespeed: 0.04,
						maxDistance: 10,
						searchRange: 25,
						animationSpeed: 2,
						animation: "Canter"
					},					
					{
						code: "idle",
						animation: "Sleep",
						priority: 1.35,
						priorityForCancel: 1.55,
						minduration: 200000,
						maxduration: 800000,
						mincooldown: 10000,
						maxcooldown: 30000,
						whenNotInEmotionState: "aggressiveondamage",
						duringDayTimeFrames: [ { fromHour: 10, toHour: 18 }, { fromHour: 1, toHour: 3 } ],
						stopOnNearbyEntityCodes: ["player"],
						stopRange: 10,
						stopOnHurt: true
					},
					{
						code: "seekfoodandeat",
						movespeed: 0.006,
						priority: 1.3,
						eatItemCategories: ["protein"],
						eatSound: "creature/animal-eat1",
						eatTime: 1.5,
						minduration: 4000,
						maxduration: 4000,
						animation: "Eat",
						animationSpeed: 1,
						mincooldownHours: 1,
						maxcooldownHours: 4
					},
					{
						code: "idle",
						animation: "Howl",
						priority: 1.25,
						priorityForCancel: 1.35,
						minduration: 4667,
						maxduration: 4667,
						mincooldown: 80000,
						maxcooldown: 500000,
						animationSpeed: 0.7,
						sound: "creature/wolf/howl*",
						soundRange: 110
					},
					{
						code: "idle",
						animation: "Sniff",
						priority: 1.2,
						priorityForCancel: 1.35,
						minduration: 5000,
						maxduration: 5000,
						mincooldown: 6000,
						maxcooldown: 20000,
						animationSpeed: 1,
						whenNotInEmotionState: "aggressiveondamage"
					},
					{
						code: "wander", 
						animation: "Walk",
						priority: 1.0, 
						priorityForCancel: 1.35,
						movespeed: 0.006,
						animationSpeed: 1.25,
						preferredLightLevel: 20
					},
					{
						code: "idle",
						animation: "Sit",
						priority: 0.9,
						minduration: 5000,
						maxduration: 30000,
						mincooldown: 2000,
						maxcooldown: 120000,
						priorityForCancel: 1.33,
						whenNotInEmotionState: "aggressiveondamage"
					},
					{ 
						code: "lookaround", 
						priority: 0.5
					}
				]
			},
			{ code: "ropetieable", minGeneration: 2 },
			{ code: "pettable", minGeneration: 1 },
			{ code: "entitystatetags" }
		],
		spawnconditionsByType: {
			"*-male": {
				worldgen: {
					TriesPerChunk: { avg: 0.07, var: 0 },
					tryOnlySurface: true,
					groupSize: { dist: "verynarrowgaussian", avg: 2, var: 3 },
					insideBlockCodes: ["air", "tallgrass-*"],
					minTemp: -15,
					maxTemp: 15,
					minRain: 0.25,
					minForest: 0.5,
					companions: ["wolf-{type}-adult-female", "wolf-{type}-baby-male", "wolf-{type}-baby-female"]
				},
				runtime: {
					group: "hostile",
					MinDistanceToPlayer: 24,
					tryOnlySurface: true,
					chance: 0.0002,
					maxQuantity: 5,
					// Make them spawn away from artifical light so they don't spawn inside farmland
					maxLightLevel: 7,
					lightLevelType: "onlyBlockLight",					
					groupSize: { dist: "verynarrowgaussian", avg: 3, var: 2 },
					insideBlockCodes: ["air", "tallgrass-*"],
					minTemp: -15,
					maxTemp: 15,
					minRain: 0.25,
					minForest: 0.5,
					companions: ["wolf-{type}-adult-female", "wolf-{type}-baby-male", "wolf-{type}-baby-female"]
				}
			},
			"*": null,
		}
	},
	sounds: {
		hurt: "creature/wolf/hurt",
		death: "creature/wolf/hurt",
		idle: { path: "creature/wolf/howl*", pitch: { avg: 1, var: 0.25 } }
	},
	idleSoundChance: 0
}
