package com.rs.game.player.dialogues.impl;

import com.rs.game.WorldObject;
import com.rs.game.player.actions.EnchantingBolts;
import com.rs.game.player.actions.EnchantingBolts.SmeltingBar;
import com.rs.game.player.content.SkillsDialogue;
import com.rs.game.player.content.SkillsDialogue.SkillDialogueResult;
import com.rs.game.player.dialogues.Dialogue;

public class EnchantingBoltsD extends Dialogue {

	private WorldObject object;

	@Override
	public void start() {
		SmeltingBar bar = (SmeltingBar) parameters[1];
		SkillsDialogue.sendSkillDialogueByProduce(player, bar.getProducedBar().getId());
	}

	@Override
	public void run(int interfaceId, int componentId) {
		SkillDialogueResult result = SkillsDialogue.getResult(player);
		end();
		SmeltingBar bar = SmeltingBar.getBarByProduce(result.getProduce());
		if(bar == null)
			return;
		player.getActionManager().setAction(new EnchantingBolts(bar, player, result.getQuantity()));
	}

	@Override
	public void finish() {
	}
}
