Macro.add('npcDecription', {
	skipArgs : false,
	handler  : function () {
		try {
            const npcIdOrObject:string|NPC = this.args[0];
			jQuery(this.output).wiki(setup.npcDescription(npcIdOrObject));
		}
		catch (ex) {
			return this.error('Error in npcDecription: ' + ex.message);
		}
	}
});

setup.npcDescription = function(npcIdOrObject:string|NPC):string{
    let npc:NPC;
    if(typeof npcIdOrObject == "string")
        npc = State.variables.npcs.npc(npcIdOrObject);
    else
        npc = npcIdOrObject;

    let result:string = '';

    const _age = npc.age;
	if(_age <= 1){
		result += npc.w('He')+' is an infant.';
	}else if(_age <= 5){
		result += npc.w('He')+' is a little child.';
	}else if(_age <= 12){
		result += npc.w('He')+' is a child.';
	}else if(_age <= 14){
		result += npc.w('He')+' is in '+npc.w('his')+' early teens.';
	}else if(_age < 20){
		result += npc.w('He')+' is a teenager.';
	}else if(_age <= 23){
		result += npc.w('He')+' is in '+npc.w('his')+' early twenties.';
	}else if(_age <= 26){
		result += npc.w('He')+' is in '+npc.w('his')+' mid-twenties.';
	}else if(_age < 30){
		result += npc.w('He')+' is in '+npc.w('his')+' late twenties.';
	}else if(_age <= 33){
		result += npc.w('He')+' is in '+npc.w('his')+' early thirties.';
	}else if(_age <= 36){
		result += npc.w('He')+' is in '+npc.w('his')+' mid-thirties.';
	}else if(_age < 40){
		result += npc.w('He')+' is in '+npc.w('his')+' late thirties.';
	}else if(_age < 50){
		result += npc.w('He')+' is in '+npc.w('his')+' forties.';
	}else if(_age < 60){
		result += npc.w('He')+' is in '+npc.w('his')+' fifties.';
	}else if(_age < 70){
		result += npc.w('He')+' is in '+npc.w('his')+' sixties.';
	}else if(_age < 80){
		result += npc.w('He')+' is in '+npc.w('his')+' seventies.';
	}else if(_age >= 80){
		result += npc.w('He')+' is at least in '+npc.w('his')+' eighties.';
	}

	const _height = npc.height;
	//<<set _heightApprox = Math.round(_height / 3) * 3>>
	const _pc_height = State.variables.pc.height;
	const _heightQutient = _pc_height / _height;

	// Comment references are for Svetas default hight of 170cm -->
	if(_heightQutient > 3.4){// Smaller than 50cm -->
		result += npc.w('He')+' is tiny.';
	}else if(_heightQutient > 2.4){// Smaller than 70cm -->
		result += npc.w('He')+' reaches up to your knees.';
	}else if(_heightQutient > 2.4){// Smaller than 70cm -->
		result += npc.w('He')+' reaches up to your knees.';
	}else if(_heightQutient > 1.9){// Smaller than 90cm -->
		result += npc.w('He')+' reaches up to your hips.';
	}else if(_heightQutient > 1.55){// Smaller than 110cm -->
		result += npc.w('He')+' reaches up to belly button.';
	}else if(_heightQutient > 1.3){// Smaller than 130cm -->
		result += npc.w('He')+' reaches up to your breasts.';
	}else if(_heightQutient > 1.13){// Smaller than 150cm -->
		result += npc.w('He')+' reaches up to your shoulder.';
	}else if(_heightQutient > 1.09){// Smaller than 155cm -->
		result += npc.w('He')+' reaches up to your chin.';
	}else if(_heightQutient > 1.09){// Smaller than 160cm -->
		result += npc.w('He')+' is a little smaller than you. You can barely look over '+npc.w('his')+' head.';
	}else if(_heightQutient > 1.02){// Smaller than 167cm -->
		result += npc.w('He')+' is a tiny bit smaller than you.';
	}else if(_heightQutient > 0.98){// Smaller than 173cm -->
		result += npc.w('He')+' is almost the exact same height as you.';
	}else if(_heightQutient > 0.94){// Smaller than 180cm -->
		result += npc.w('He')+' is a tiny bit taller than you.';
	}else if(_heightQutient > 0.92){// Smaller than 185cm -->
		result += npc.w('He')+' is a little taller than you. '+npc.w('He')+' can likely look over your head.';
	}else if(_heightQutient > 0.89){// Smaller than 190cm -->
		result += npc.w('He')+' is taller than you. Your eyes are as high as '+npc.w('his')+' neck.';
	}else if(_heightQutient > 0.87){// Smaller than 195cm -->
		result += npc.w('He')+' is taller than you. Your eyes are as high as '+npc.w('his')+' upper chest.';
	}else if(_heightQutient > 0.85){// Smaller than 200cm -->
		result += npc.w('He')+' is way taller than you. Your eyes are as high as '+npc.w('his')+' chest.';
	}else if(_heightQutient > 0.77){// Smaller than 220cm -->
		result += npc.w('He')+' is way taller than you. Your eyes are as high as '+npc.w('his')+' lower chest.';
	}else if(_heightQutient > 0.65){// Smaller than 240cm -->
		result += npc.w('He')+' is way taller than you. Your eyes are as high as '+npc.w('his')+' belly.';
	}else if(_heightQutient > 0.5){// Smaller than 240cm -->
		result += npc.w('He')+' is way way taller than you. Your eyes are as high as '+npc.w('his')+' hips.';
	}else{
		result += npc.w('He')+' is way way taller than you. Your don\'t even reach '+npc.w('his')+' hips.';
	}

    return result;
}