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

import com.rs.game.WorldTile;
import com.rs.game.player.dialogues.Dialogue;

public class WizardFinix extends Dialogue {
	
	private int npcId;
	
	@Override
	public void start() {
		npcId = (Integer) parameters[0];
		sendNPCDialogue(npcId, 9827, "Hey " + player.getUsername() + ", What is it you want young Runecrafter?" );
	}
	
	public void run(int interfaceId, int componentId) {
		if (stage == -1) {
	    int option;
		sendOptionsDialogue("Wizard Finix", "I would like to leave please.", "Can I buy runes from you?.", "What do I do here?");
		stage = 2;
		} else if (stage == 2) {
		if(componentId == OPTION_1) {
			stage = 7;
		    sendNPCDialogue(npcId, 9827, "Alright off you go!" );
		}
		if(componentId == OPTION_2) {
		    sendNPCDialogue(npcId, 9827, "No sorry I do not sell anything inside the Runespan.", "Collect points and I will sell you some nice wares", "in the Wizards Tower.");
			stage = 3;
		}
    	if(componentId == OPTION_3) {
		    sendNPCDialogue(npcId, 9827, "You can siphon off Rune Energy from these creatures with blank Runes.", "It may not be how you are used to using Altars,", "but the EXP is very nice!");
			stage = 4;
		}
		}else if (stage == 3) {
			stage = 8;
			sendPlayerDialogue( 9845, "Alright I will look for your shop when I'm done." );
		}else if (stage == 4) {
			stage = 5;
			sendPlayerDialogue( 9845, "Well why are we using creatures instead of Altars?" );
		}else if (stage == 5) {
			stage = 6;
		    sendNPCDialogue(npcId, 9827, "Because one day the Altars will eventually run out of magic.", "At least this doesnt hurt the creatures." );
		}else if (stage == 6) {
			stage = 8;
			sendPlayerDialogue( 9845, "Alright I guess thats a good enough explanation." );
		}else if (stage == 7) {
			//player.reset();
			//player.setRunespanInventoryPoints2(0);
			//player.removeRunespanItems();
			player.getInventory().reset();
			//player.setNextWorldTile(new WorldTile(3107, 3160, 1));
			player.getControlerManager().forceStop();
			end();
		} else if (stage == 8) {
		end();
	  }
	}

	@Override
	public void finish() {

	}

}
