{
	code: "humanoid-trader-survivalgoods",
	class: "EntityTrader",
	tags: ["humanoid", "trader", "human", "habitat-land"],
	weight: 80,
	canClimb: true,
	hitboxSize: { x: 0.6, y: 1.75 },
	deadHitboxSize: { x: 0.75, y: 0.5 },
    behaviorConfigs: {
        nametag: {
            showtagonlywhentargeted: true,
            triggeredNameReveal: true,
            unrevealedDisplayName: "nametag-trader-unrevealedname"
        }
    },
	client: {
		renderer: "Shape",
		shape: { base: "entity/humanoid/trader" },
		texture: { base: "entity/humanoid/trader", alternates: [
            { base: "entity/humanoid/traderclothes/set1" },
            { base: "entity/humanoid/traderclothes/set2" },
            { base: "entity/humanoid/traderclothes/set3" },
            { base: "entity/humanoid/traderclothes/set4" },
            { base: "entity/humanoid/traderclothes/set5" }
        ] },
		behaviors: [
			{ code: "nametag" },
			{ code: "repulseagents" },
			{ code: "controlledphysics", stepHeight: 1.01 },
			{ code: "interpolateposition" },
            { code: "conversable", dialogue: "config/dialogue/trader" }
		],
		animations: [
			{
				code: "die",
				animation: "die",
				animationSpeed: 1.75,
				weight: 10,
				blendMode: "AddAverage"
			},
			{
				code: "hurt",
				animation: "hurt",
				animationSpeed: 2,
				blendMode: "AddAverage"
			},
            { code: "formal-walk", animation: "formal-walk", animationSpeed: 1.5 },
		]
	},
    attributes: {
        tradePropsFile: "config/tradelists/trader-survivalgoods",
        tradeProps: {
            money: { avg: 30, var: 10 }
        }
    },
	server: {
		attributes: {
			pathfinder: {
				minTurnAnglePerSec: 720,
				maxTurnAnglePerSec: 1440
			},

		},
		behaviors: [
			{ code: "nametag", "showtagonlywhentargeted": true, selectFromRandomName: ["Hubert", "Wilding", "Shem", "Tybal", "Loon", "Axe", "Karl", "Sprig"] },
			{ code: "repulseagents" },
			{ code: "controlledphysics", stepHeight: 1.01 },
			{ code: "reviveondeath", minHours: 24, maxHours: 72 },
			{ code: "health", currenthealth: 25, maxhealth: 25 },
			{
				code: "emotionstates",
				states: [
					{ code: "aggressiveondamage", duration: 6, chance: 0.6, slot: 0, priority: 2, accumType: "noaccum" },
					{ code: "fleeondamage", duration: 10, chance: 0.4, slot: 0, priority: 1, accumType: "max" }
				],
			},
			{
				code: "taskai",
				aitasks: [
					{
						code: "meleeattack",
						entityCodes: ["player"],
						priority: 2,
						damage: 5,
						mincooldown: 2500,
						maxcooldown: 3500,
						attackDurationMs: 900,
						damagePlayerAtMs: 300,
						animation: "Attack",
						animationSpeed: 2,
						whenInEmotionState: "aggressiveondamage",
					},
					{
						code: "seekentity",
						entityCodes: ["player"],
						priority: 1.5,
						mincooldown: 1000,
						maxcooldown: 1500,
						seekingRange: 20,
						movespeed: 0.035,
						animation: "Run",
						animationSpeed: 1.75,
						whenInEmotionState: "aggressiveondamage"
					},
					{
						code: "fleeentity",
						entityCodes: ["player"],
						priority: 1.5,
						movespeed: 0.035,
						seekingRange: 12,
						animation: "Run",
						animationSpeed: 1.75,
						whenInEmotionState: "fleeondamage"
					},
					{
						code: "idle",
						priority: 1.2,
						minduration: 2500,
						maxduration: 2500,
						mincooldown: 2000,
						maxcooldown: 10000,
						animation: "laugh"
					},
					{
						code: "idle",
						priority: 1.2,
						minduration: 2500,
						maxduration: 2500,
						mincooldown: 5000,
						maxcooldown: 30000,
						animation: "idle2"
					},
					{
						code: "wander",
						priority: 1.0,
						movespeed: 0.01,
						animation: "Walk",
						executionChance: 0.005,
						maxDistanceToSpawn: 4,
						wanderRangeMin: 1,
						wanderRangeMax: 3
					},
					{
						code: "lookaround",
						priority: 0.5
					}
				]
			},
            { code: "conversable", dialogue: "config/dialogue/trader" },
			{ code: "entitystatetags" }
		],
	},
	sounds: {
	}
}
