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

import com.zivilon.cinder_loe.CinderLoE;

import lotr.common.quest.LOTRMiniQuest;
import lotr.common.quest.LOTRMiniQuestFactory;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.world.World;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;

public class BattleNun extends ArnorSoldier {
    public BattleNun(World world) {
        super(world);
        this.spawnRidingHorse = false;
        this.questInfo.setOfferChance(4000);
        this.questInfo.setMinAlignment(150.0f);
        this.npcShield = null;
    }

    @Override
    public void setupNPCGender() {
        this.familyInfo.setMale(false);
    }

    public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
        data = super.onSpawnWithEgg(data);
        this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.maceArnor));
        this.npcItemsInv.setIdleItem(new ItemStack(CinderLoE.maceArnor));
        setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsArnorBanner));
        setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsArnorBanner));
        setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyArnorBanner));
        if (this.rand.nextBoolean()) {
            this.setCurrentItemOrArmor(4, new ItemStack(CinderLoE.helmetArnorBanner));
        } else {
            this.setCurrentItemOrArmor(4, null);
        }
        return data;
    }

    @Override
    public LOTRMiniQuest createMiniQuest() {
        return LOTRMiniQuestFactory.RANGER_NORTH.createQuest(this);
    }

    @Override
    public ItemStack getPickedResult(MovingObjectPosition target) {
        return new ItemStack(CinderLoE.spawnEgg, 1, 17);
    }
}
