That code makes no sense.
|
So i have gotten close to this Dialogue working but i just cant seem to get it right? could someone Help me fix this so it runs like it should? i just want how it says ... Change Difficulty, Yes or No, that shows, then when i click yes it goes to easy medium and stuff, but then when i click the difficulty it does nothing? i have it set up. just need help withCode:package com.rs.game.player.dialogues; import com.rs.game.player.content.custom.StarterItems; import com.rs.game.player.dialogues.Dialogue; import com.rs.cache.loaders.NPCDefinitions; import com.rs.game.WorldTile; import com.rs.game.npc.NPC; import com.rs.game.player.Player; import com.rs.game.npc.familiar.Familiar; import com.rs.game.npc.slayer.Strykewyrm; import com.rs.game.minigames.CastleWars; import com.rs.game.player.content.Magic; import com.rs.utils.ShopsHandler; public class Newperson2 extends Dialogue { public static final int MAX_STARTER_COUNT = 1; int starter; int difficulty; private int npcId; @Override public void start() { sendDialogue(SEND_2_OPTIONS, "Change your Difficulty?", "Yes.", "No."); } @Override public void run(int interfaceId, int componentId) { if (interfaceId == SEND_2_OPTIONS && componentId == 1) { { sendDialogue(SEND_5_OPTIONS, "Select an Option", "Very Easy", "Easy", "Normal", "Hard", "Extreme"); } if (interfaceId == SEND_5_OPTIONS && componentId == 1) { this.difficulty = 1; sendNext_2(); this.starter = StarterItems.FIGHTER; } if (interfaceId == SEND_5_OPTIONS && componentId == 2) { this.difficulty = 2; sendNext_2(); this.starter = StarterItems.FIGHTER; } if (interfaceId == SEND_5_OPTIONS && componentId == 3) { this.difficulty = 3; sendNext_2(); this.starter = StarterItems.FIGHTER; } if (interfaceId == SEND_5_OPTIONS && componentId == 4) { this.difficulty = 4; sendNext_2(); this.starter = StarterItems.FIGHTER; } if (interfaceId == SEND_5_OPTIONS && componentId == 5) { this.difficulty = 5; sendNext_2(); this.starter = StarterItems.FIGHTER; } } } private void sendOptionsDialogue(String string, String string2, String string3, String string4, String string5, String string6) { // TODO Auto-generated method stub } private void sendOptionsDialogue(String string, String string2, String string3, String string4) { // TODO Auto-generated method stub } public void sendNext_1() { sendEntityDialogue(IS_NPC, "Guardian Manager", 13768, 9827, "Very good! Now all you need to do is select", "your difficulty. Please keep in mind that harder", "difficulties have low exp, but have better drops", "while lower difficulties are the opposite!"); stage = 3; } public void sendNext_2() { sendEntityDialogue(IS_NPC, "Guardian Manager", 13768, 9827, "Very good! You've chosen to play on "+diffs[difficulty - 1]+",", "Now what are you waiting for? Go out and have some fun!", "Just click the button below and everything will", "be given to you! We hope you enjoy your stay!"); stage = 5; } public static String[] diffs = { "Super Easy", "Easy", "Normal", "Hard", "Extreme" }; @Override public void finish() { // TODO Auto-generated method stub } private void sendEntityDialogue(byte isNpc, String string, int i, int j, String string2, String string3, String string4, String string5) { // TODO Auto-generated method stub } }
That code makes no sense.
Code:package com.rs.game.player.dialogues; import com.rs.game.player.content.custom.StarterItems; import com.rs.game.player.dialogues.Dialogue; import com.rs.cache.loaders.NPCDefinitions; import com.rs.game.WorldTile; import com.rs.game.npc.NPC; import com.rs.game.player.Player; import com.rs.game.npc.familiar.Familiar; import com.rs.game.npc.slayer.Strykewyrm; import com.rs.game.minigames.CastleWars; import com.rs.game.player.content.Magic; import com.rs.utils.ShopsHandler; public class Newperson2 extends Dialogue { public static final int MAX_STARTER_COUNT = 1; int starter; int difficulty; private int npcId; @Override public void start() { sendDialogue(SEND_2_OPTIONS, "Change your Difficulty?", "Yes.", "No."); } //This shows up, as the Dialogue and i can click yes then it goes to... @Override public void run(int interfaceId, int componentId) { if (interfaceId == SEND_2_OPTIONS && componentId == 1) { { sendDialogue(SEND_5_OPTIONS, "Select an Option", "Very Easy", "Easy", "Normal", "Hard", "Extreme"); } //This but then once i click one of the Options "Very Easy, Easy Ect." It does not run... these if (interfaceId == SEND_5_OPTIONS && componentId == 1) { this.difficulty = 1; sendNext_2(); this.starter = StarterItems.FIGHTER; } if (interfaceId == SEND_5_OPTIONS && componentId == 2) { this.difficulty = 2; sendNext_2(); this.starter = StarterItems.FIGHTER; } if (interfaceId == SEND_5_OPTIONS && componentId == 3) { this.difficulty = 3; sendNext_2(); this.starter = StarterItems.FIGHTER; } if (interfaceId == SEND_5_OPTIONS && componentId == 4) { this.difficulty = 4; sendNext_2(); this.starter = StarterItems.FIGHTER; } if (interfaceId == SEND_5_OPTIONS && componentId == 5) { this.difficulty = 5; sendNext_2(); this.starter = StarterItems.FIGHTER; } } } private void sendOptionsDialogue(String string, String string2, String string3, String string4, String string5, String string6) { // TODO Auto-generated method stub } private void sendOptionsDialogue(String string, String string2, String string3, String string4) { // TODO Auto-generated method stub } public void sendNext_1() { sendEntityDialogue(IS_NPC, "Guardian Manager", 13768, 9827, "Very good! Now all you need to do is select", "your difficulty. Please keep in mind that harder", "difficulties have low exp, but have better drops", "while lower difficulties are the opposite!"); stage = 3; } public void sendNext_2() { sendEntityDialogue(IS_NPC, "Guardian Manager", 13768, 9827, "Very good! You've chosen to play on "+diffs[difficulty - 1]+",", "Now what are you waiting for? Go out and have some fun!", "Just click the button below and everything will", "be given to you! We hope you enjoy your stay!"); stage = 5; } public static String[] diffs = { "Super Easy", "Easy", "Normal", "Hard", "Extreme" }; @Override public void finish() { // TODO Auto-generated method stub } private void sendEntityDialogue(byte isNpc, String string, int i, int j, String string2, String string3, String string4, String string5) { // TODO Auto-generated method stub } }
You need to use stages.
Why are you using SEND_2_OPTIONS and SEND_5_OPTIONS to match the interface.
You have methods for option dialogues, use them.
Thank you i figured it out. But i have a new problem now, i have what i need for the xp to click, interfaces, so it works. Just the only thing i need now, which i am unsure of why its not working... is why the xp rates are not changing...
Could you help me with that?
Skills.javaCode:public void addXp(int skill, double exp) { if (player.isXpLocked() || locked[skill]) { return; } if (player.allowChange() == true) { player.setAllowChange(false); player.sendMessage("<col=FF0000>You can now no longer change your Difficulty."); } if (player.getDifficulty() == 1) { exp *= 140; // Super Easy } else if (player.getDifficulty() == 2) { exp *= 110; // Easy } else if (player.getDifficulty() == 3) { exp *= 80; // Normal } else if (player.getDifficulty() == 4) { exp *= 50; // Hard } else if (player.getDifficulty() == 5) { exp *= 20; // Extreme } player.getControlerManager().trackXP(skill, (int) exp); exp *= player.getAuraManager().usingWisdom() == true ? 1.025 : 1; exp *= TimeManager.isWeekend() == true ? 1.7 : 1.0; int oldLevel = getLevelForXp(skill); xp[skill] += exp; for (int i = 0; i < trackSkills.length; i++) { if (trackSkills[i]) { if (trackSkillsIds[i] == 30 || (trackSkillsIds[i] == 29 && (skill == Skills.ATTACK || skill == Skills.DEFENCE || skill == Skills.STRENGTH || skill == Skills.MAGIC || skill == Skills.RANGE || skill == Skills.HITPOINTS)) || trackSkillsIds[i] == getCounterSkill(skill)) { xpTracks[i] += exp; refreshCounterXp(i); } } }
Dialogue - Newperson.javaCode:public static final int MAX_STARTER_COUNT = 1; int starter; int difficulty; if (interfaceId == SEND_5_OPTIONS && componentId == 1) { this.difficulty = 1; sendNext_2(); this.starter = StarterItems.FIGHTER; //exp *= 140; // Super Easy player.getPackets().sendGameMessage("You have chose 'Very Easy'"); } if (interfaceId == SEND_5_OPTIONS && componentId == 2) { this.difficulty = 2; sendNext_2(); this.starter = StarterItems.FIGHTER; //exp *= 110; // Easy player.getPackets().sendGameMessage("You have chose 'Easy'"); } if (interfaceId == SEND_5_OPTIONS && componentId == 3) { this.difficulty = 3; sendNext_2(); this.starter = StarterItems.FIGHTER; //exp *= 80; // Normal player.getPackets().sendGameMessage("You have chose 'Normal'"); } if (interfaceId == SEND_5_OPTIONS && componentId == 4) { this.difficulty = 4; sendNext_2(); this.starter = StarterItems.FIGHTER; //exp *= 50; // Hard player.getPackets().sendGameMessage("You have chose 'Hard'"); } if (interfaceId == SEND_5_OPTIONS && componentId == 5) { this.difficulty = 5; sendNext_2(); this.starter = StarterItems.FIGHTER; // exp *= 20; // Extreme player.getPackets().sendGameMessage("You have chose 'Extreme'");
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |