Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • Emulous: Come check out Emulous: [link]
      Today at 03:37:19 PM
    • Emulous:[link]
      Today at 03:37:00 PM
    • Travas: ur mom
      July 21, 2018, 06:04:50 PM
    • YNRDAB: Watcha big ballers up too?
      July 20, 2018, 11:01:06 AM
    • dark250: i need help for coding client
      July 19, 2018, 08:27:37 AM
    • Travas: yes
      July 14, 2018, 02:19:44 PM
    • drubrkletern: lmao racist and sexist much?
      July 14, 2018, 01:11:52 PM
    • Cole1497: yeah i got you lil boat give me a second
      July 13, 2018, 03:19:35 AM
    • B0ATY.: yo can anyone unban my ip, i got banned for saying i hope someone gets aids :p
      July 12, 2018, 09:16:00 PM
    • jme: ziplock this domain belongs to the kremlin now
      July 12, 2018, 06:54:31 PM
    • Pure_: lol
      July 12, 2018, 01:37:47 PM
    • ziplock: wtf is this forum? Haven't checked in in 4 years lmao
      July 11, 2018, 10:26:03 AM
    • ziplock: Idk
      July 11, 2018, 10:25:41 AM
    • _^_: guys is anyone still even here
      July 11, 2018, 01:54:43 AM
    • Travas: gay
      July 08, 2018, 02:00:14 PM
    • CheapOnlineHost: Hosting starting at $0.75 hostcheap.io
      July 08, 2018, 09:35:20 AM
    • q1w1e1r1t1y: is the server actually updating or is it down?? trying to log on for the first time in a few months and it says "server updating try again in 1 minute" for the last 10 minutes now
      July 07, 2018, 11:11:51 PM
    • Cole1497: gamers unite
      July 07, 2018, 04:26:07 PM
    • IamLation: LMFAO @cole
      July 06, 2018, 10:36:52 AM
    • drubrkletern: olfihsouhdiu
      July 04, 2018, 04:25:32 PM

    Author Topic: [718] Alter Dialogue  (Read 707 times)

    0 Members and 1 Guest are viewing this topic.

    OfflineMoosee

    • Member
    • **
    • Posts: 9
    • Thanks: +10/-10
      • View Profile
    [718] Alter Dialogue
    « on: October 31, 2015, 01:16:03 PM »
    I got this basically 50%.. but when I walk up to it it doesn't want to switch it, it just sits there even though the dialogue stays there..

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

    public class Lectern extends Dialogue {


        @Override
        public void start() {
            sendOptionsDialogue("Select a Spellbook",
                        "Lunars",
                        "Ancients",
                        "Normal");
        }


        @Override
        public void run(int interfaceId, int componentId) {
            switch (stage) {
           
            case 1:
            if (componentId == OPTION_1) {
                    sendDialogue(SEND_2_TEXT_CHAT, "Your mind clears and you switch", "back to the Lunar spellbook.");
            if (player.getCombatDefinitions().getSpellBook() != 430) {
                                    player.getCombatDefinitions().setSpellBook(2);
                     }
                }
                if (componentId == OPTION_2) {
                sendDialogue(SEND_2_TEXT_CHAT, "",
                            "Your mind clears and you switch",
                            "back to the Ancients spellbook.");
                    player.getCombatDefinitions().setSpellBook(3);
                }
                if (componentId == OPTION_3) {
                    sendDialogue(SEND_2_TEXT_CHAT, "",
                            "Your mind clears and you switch",
                            "back to the Nrmal spellbook.");
                    player.getCombatDefinitions().setSpellBook(0);
                    }
                }
                break;
            }
        }


        @Override
        public void finish() {
            // TODO Auto-generated method stub
           
        }
    }

    Help will be appreciated a lot  :)
    Runescape Gambling

    OfflinexXSh0ckXx

    • Member
    • ****
    • Posts: 642
    • Thanks: +0/-0
      • View Profile
    Re: [718] Alter Dialogue
    « Reply #1 on: November 01, 2015, 10:54:10 AM »
    You forgot to add the stage.

    If you're not declaring any stage in the start method, it'd remain at -1, so in the run method you'd instead of having a case of 1 you'd go with -1 (1 -> -1) or you just assign a value to the field "stage" (1) and it'll just do fine.
    Drop me a pm.

    They got money for wars, but can't feed the poors. - Tupac Shakur
    Old, but Gold.
    Runescape Gambling

    OfflineMoosee

    • Member
    • **
    • Posts: 9
    • Thanks: +10/-10
      • View Profile
    Re: [718] Alter Dialogue
    « Reply #2 on: November 01, 2015, 03:29:48 PM »
    I'm horrible at dialogues..so could you guide me in the direction of what I would need to put next?  :|
    Runescape Gambling

    OfflinexXSh0ckXx

    • Member
    • ****
    • Posts: 642
    • Thanks: +0/-0
      • View Profile
    Re: [718] Alter Dialogue
    « Reply #3 on: November 02, 2015, 03:17:51 AM »
    I'm horrible at dialogues..so could you guide me in the direction of what I would need to put next?  :|
    Has nothing to do with dialogues, you just didn't understand what I said.

    You either change
    Code: Java(TM) 2 Platform Standard Edition 5.0
    1. case1:
    to
    Code: Java(TM) 2 Platform Standard Edition 5.0
    1. case -1:
    or you assign a value to the stage field in the start method, which in this case would be 1.
    Code: Java(TM) 2 Platform Standard Edition 5.0
    1. stage = 1;
    Drop me a pm.

    They got money for wars, but can't feed the poors. - Tupac Shakur
    Old, but Gold.

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal