Thread: SkillsDialogue (option 8 don't work)

Results 1 to 2 of 2
  1. #1 SkillsDialogue (option 8 don't work) 
    Registered Member
    Stimulant's Avatar
    Join Date
    Jan 2013
    Age
    27
    Posts
    1,457
    Thanks given
    248
    Thanks received
    187
    Rep Power
    578
    I've been trying so figure out why the option 8 don't seems to work, I've also printed the component who is (26).

    Attached image

    The array:
    Code:
    private static final int PRODUCTS[] = { 1919, 4527, 4522, 229, 6667, 567, 4542, 10973 };
    To start the dialogue:
    Code:
    player.getDialogueManager().startDialogue("GlassBlowingD", Glass.forId(PRODUCTS[0]), Glass.forId(PRODUCTS[1]), Glass.forId(PRODUCTS[2]), Glass.forId(PRODUCTS[3]), Glass.forId(PRODUCTS[4]), Glass.forId(PRODUCTS[5]), Glass.forId(PRODUCTS[6]), Glass.forId(PRODUCTS[7]));
    GlassBlowingD:
    Code:
    package com.rs.game.content.dialogues.impl.skills;
    
    import com.rs.game.content.action.skills.Skills;
    import com.rs.game.content.action.skills.crafting.GlassBlowing;
    import com.rs.game.content.action.skills.crafting.GlassBlowing.Glass;
    import com.rs.game.content.dialogues.Dialogue;
    import com.rs.game.content.dialogues.impl.skills.SkillsDialogue.ItemNameFilter;
    
    /**
     * @author Stimulant
     *
     * 26 mars 2018
     */
    public class GlassBlowingD extends Dialogue {
    	
    	@Override
    	public void start() {
    		int[] items = new int[parameters.length];
    		for (int i = 0; i < items.length; i++) {
    			items[i] = ((Glass) parameters[i]).getProduct();
    		}
    		SkillsDialogue.sendSkillsDialogue(player, SkillsDialogue.MAKE, "Choose how many you wish to make,<br>then click on the item to begin.", 28, items, new ItemNameFilter() {
    
    			int count = 0;
    
    			@Override
    			public String rename(String name) {
    				Glass glass = Glass.values()[count++];
    				if (player.getSkills().getLevel(Skills.CRAFTING) < glass.getLevel()) {
    					name = "<col=ff0000>" + name + "<br><col=ff0000>Level " + glass.getLevel();
    				}
    				return name;
    			}
    		});
    	}
    
    	@Override
    	public void run(int interfaceId, int componentId) {
    		int option = SkillsDialogue.getItemSlot(componentId);
    		if (option > parameters.length) {
    			end();
    			return;
    		}
    		Glass glass = (Glass) parameters[option];
    		int quantity = SkillsDialogue.getQuantity(player);
    		int invQuantity = player.getInventory().getItems().getNumberOf(glass.getItemId());
    		if (quantity > invQuantity) {
    			quantity = invQuantity;
    		}
    		player.getActionManager().setAction(new GlassBlowing(glass, quantity));
    		end();
    	}
    
    	@Override
    	public void finish() {
    
    	}
    }
    SkillsDialogue, method "getItemSlot":
    Code:
    public static int getItemSlot(int componentId) {
    		if (componentId < 14) {
    			return 0;
    		}
    		return componentId - 14;
    	}
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    May 2012
    Posts
    286
    Thanks given
    7
    Thanks received
    49
    Rep Power
    25
    Your code seems to work fine for me as far as the actions triggering go. So as I don't have your GlassBlowing action the problem is either there or in your SkillsDialogue.java. Try to look at those and if you can't find anything post them here so I (or someone else) can take a look.
    Open Source 667 Divergent667
    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. Money pouch options don't work
    By lucasouwens in forum Help
    Replies: 0
    Last Post: 08-22-2015, 07:51 PM
  2. First option dialogues don't work
    By OneCrazyPanda in forum Help
    Replies: 2
    Last Post: 01-31-2015, 02:11 AM
  3. Replies: 2
    Last Post: 11-27-2009, 10:05 PM
  4. Explanation - Mapdata dumper don't work
    By Call of Duty in forum RS 503+ Client & Server
    Replies: 3
    Last Post: 01-19-2009, 04:24 AM
  5. Replies: 13
    Last Post: 05-24-2008, 07:34 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •