Thread: [718] Need help with this Dialogue.

Results 1 to 3 of 3
  1. #1 [718] Need help with this Dialogue. 
    Registered Member Equity's Avatar
    Join Date
    Aug 2013
    Posts
    388
    Thanks given
    57
    Thanks received
    15
    Rep Power
    15
    Hi everybody, I've been working on this for literally 3 hours. Can't figure out why it is no outputting what I want it to.

    Here is my Dialogue code:
    [Java] package com.ew.game.player.dialogues; public class BrotherJered extends Dia - Pastebin.com

    1st Issue:
    Completely skips this section:
    Code:
    			case OPTION_2:
    				sendPlayerDialogue(9827, "No thanks, Thats far too expensive for me.");
    				break;
    Even though I clicked the Option 2
    Example:


    2nd Issue:
    Completely Skips this part when I don't have enough coins:
    Code:
                            } else sendNPCDialogue(npcId, 9827, "Looks like you can't afford it.");
                                    break;
    Example:


    I appreciate any help!

    Thanks & Repping.
    Attached image
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Feb 2013
    Posts
    4,409
    Thanks given
    59
    Thanks received
    478
    Rep Power
    138
    Code:
    public class BrotherJered extends Dialogue {
    
    	private int npcId;
    
    	@Override
    	public void start() {
    		npcId = (Integer) parameters[0];
    		sendNPCDialogue(
    				npcId,
    				9827,
    				"That's a fine looking shield you've got there "
    						+ player.getUsername() + ".");
    	}
    
    	@Override
    	public void run(int interfaceId, int componentId) {
    		switch (stage) {
    		case -1:
    			stage = 0;
    			sendPlayerDialogue(9827,
    					"Thanks, Do you think you could bless it for me?");
    			break;
    		case 0:
    			stage = 1;
    			sendNPCDialogue(npcId, 9827, "It's going to cost you 1,000,000gp.",
    					"Do you still want me to bless the shield?");
    			break;
    		case 1:
    			sendOptionsDialogue(SEND_DEFAULT_OPTIONS_TITLE,
    					"Yes, Bless my shield.", "No, Thats too expensive.");
    			stage = 2;
    			break;
    		case 2:
    			switch (componentId) {
    			case OPTION_1:
    				stage = 3;
    				if (player.getInventory().containsItem(995, 1000000)) {
    					player.getInventory().deleteItem(995, 1000000);
    					player.getInventory().deleteItem(13734, 1);
    					player.getInventory().addItem(13736, 1);
    					sendPlayerDialogue(9827, "Thank you.");
    					stage = 4;
    				} else if (player.getMoneyPouch().getCoinsAmount() >= 1000000) {
    					player.getMoneyPouch().sendAddOrRemove(1000000, true);
    					player.getInventory().deleteItem(13734, 1);
    					player.getInventory().addItem(13736, 1);
    					sendPlayerDialogue(9827, "Thank you.");
    					stage = 4;
    				} else
    					sendNPCDialogue(npcId, 9827,
    							"Looks like you can't afford it.");
    				stage = 4;
    				break;
    			case OPTION_2:
    				sendPlayerDialogue(9827,
    						"No thanks, Thats far too expensive for me.");
    				stage = 4;
    			}
    			break;
    		case 4:
    			end();
    			break;
    		default:
    			end();
    		}
    	}
    
    	@Override
    	public void finish() {
    		// TODO Auto-generated method stub
    
    	}
    
    }
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member Equity's Avatar
    Join Date
    Aug 2013
    Posts
    388
    Thanks given
    57
    Thanks received
    15
    Rep Power
    15
    Quote Originally Posted by Datbeastmayne View Post
    Code:
    public class BrotherJered extends Dialogue {
    
    	private int npcId;
    
    	@Override
    	public void start() {
    		npcId = (Integer) parameters[0];
    		sendNPCDialogue(
    				npcId,
    				9827,
    				"That's a fine looking shield you've got there "
    						+ player.getUsername() + ".");
    	}
    
    	@Override
    	public void run(int interfaceId, int componentId) {
    		switch (stage) {
    		case -1:
    			stage = 0;
    			sendPlayerDialogue(9827,
    					"Thanks, Do you think you could bless it for me?");
    			break;
    		case 0:
    			stage = 1;
    			sendNPCDialogue(npcId, 9827, "It's going to cost you 1,000,000gp.",
    					"Do you still want me to bless the shield?");
    			break;
    		case 1:
    			sendOptionsDialogue(SEND_DEFAULT_OPTIONS_TITLE,
    					"Yes, Bless my shield.", "No, Thats too expensive.");
    			stage = 2;
    			break;
    		case 2:
    			switch (componentId) {
    			case OPTION_1:
    				stage = 3;
    				if (player.getInventory().containsItem(995, 1000000)) {
    					player.getInventory().deleteItem(995, 1000000);
    					player.getInventory().deleteItem(13734, 1);
    					player.getInventory().addItem(13736, 1);
    					sendPlayerDialogue(9827, "Thank you.");
    					stage = 4;
    				} else if (player.getMoneyPouch().getCoinsAmount() >= 1000000) {
    					player.getMoneyPouch().sendAddOrRemove(1000000, true);
    					player.getInventory().deleteItem(13734, 1);
    					player.getInventory().addItem(13736, 1);
    					sendPlayerDialogue(9827, "Thank you.");
    					stage = 4;
    				} else
    					sendNPCDialogue(npcId, 9827,
    							"Looks like you can't afford it.");
    				stage = 4;
    				break;
    			case OPTION_2:
    				sendPlayerDialogue(9827,
    						"No thanks, Thats far too expensive for me.");
    				stage = 4;
    			}
    			break;
    		case 4:
    			end();
    			break;
    		default:
    			end();
    		}
    	}
    
    	@Override
    	public void finish() {
    		// TODO Auto-generated method stub
    
    	}
    
    }
    Damn, Absolutely flawless. Thank you very much good sir!
    Attached image
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 3
    Last Post: 05-13-2013, 08:46 PM
  2. [718+]Need help with this command.
    By Cya Forever in forum Help
    Replies: 4
    Last Post: 04-30-2013, 01:31 AM
  3. [718] Need help with this.
    By Derrezed in forum Help
    Replies: 2
    Last Post: 11-21-2012, 12:54 AM
  4. Need help with this command
    By jat1802 in forum Help
    Replies: 7
    Last Post: 02-21-2009, 03:08 AM
  5. need help with this
    By Gluon in forum Configuration
    Replies: 6
    Last Post: 01-05-2009, 08:43 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •