package com.zivilon.cinder_loe.entity.npc.evil_human;

import com.zivilon.cinder_loe.CinderLoE;

import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.world.World;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;

import lotr.common.LOTRLevelData;
import lotr.common.entity.npc.LOTRUnitTradeable;
import lotr.common.entity.npc.LOTRUnitTradeEntries;
import lotr.common.world.spawning.LOTRInvasions;


public class LimwaithChieftain extends LimwaithBoneWarrior implements LOTRUnitTradeable  {
    public LimwaithChieftain(World world) {
        super(world);
        addTargetTasks(false);
    }

    public float getAlignmentBonus() {
        return 5.0F;
    }

    public LOTRUnitTradeEntries getUnits() {
        return CinderLoE.LIMWAITH_COMMANDER;
    }

    public LOTRInvasions getWarhorn() {
        return LOTRInvasions.MOREDAIN;
    }

    public void onUnitTrade(EntityPlayer entityplayer) {
    }
    @Override
    public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
        data = super.onSpawnWithEgg(data);
        this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.truncheonLimwaith));

        this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon());
        setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsboneLimwaith));
        setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsboneLimwaith));
        setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyboneLimwaith));
        setCurrentItemOrArmor(4, null);
        return data;
    }
    public boolean canTradeWith(EntityPlayer entityplayer) {
        return (LOTRLevelData.getData(entityplayer).getAlignment(getFaction()) >= 150.0F && isFriendlyAndAligned(entityplayer));
    }
    @Override
    public ItemStack getPickedResult(MovingObjectPosition target) {
        return new ItemStack(CinderLoE.spawnEgg, 1, 9);
    }

    @Override
    public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) {

    }
}
