Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • stCky: yeah so at least my mom has a pussy
      Today at 12:29:06 AM
    • Travas: your mom is a faggot
      January 17, 2018, 08:21:57 PM
    • stCky: mom wont let me meet internet strangers
      January 17, 2018, 04:20:53 PM
    • Saltyspade10: Moparmeetupppp
      January 16, 2018, 07:07:04 PM
    • stCky: but my car is japanese
      January 16, 2018, 07:06:25 PM
    • Saltyspade10: Mopar meet up?
      January 16, 2018, 07:05:59 PM
    • stCky: pfft my rb25det cefiro will eat ur tiny 1960s v8 for breakfast kid
      January 16, 2018, 07:01:30 PM
    • Travas: fag
      January 16, 2018, 01:16:43 PM
    • Oblit: ph*
      January 16, 2018, 12:34:04 PM
    • Oblit: pk balance
      January 16, 2018, 12:33:17 PM
    • Travas: racist bigot
      January 15, 2018, 09:33:12 PM
    • stCky: wheres the fun in that you immagint synthesizer
      January 15, 2018, 09:24:14 PM
    • Travas: no trump no kkk no fascist usa
      January 15, 2018, 09:11:29 PM
    • stCky: im lit
      January 15, 2018, 07:49:10 PM
    • Travas: hi
      January 15, 2018, 07:21:21 PM
    • runerunerune: hi
      January 15, 2018, 05:44:20 AM
    • shulker: anyone selling onyx? trade me in game ill negotiate an offer for like 5 trades per person
      January 15, 2018, 12:56:09 AM
    • Travas: o shit wadup
      January 14, 2018, 11:59:49 PM
    • stCky: pass me that blunt boi u know whats up
      January 14, 2018, 06:50:41 PM
    • Travas: TITS and ASS
      January 14, 2018, 02:43:33 PM

    Author Topic: [718] Alter Dialogue  (Read 665 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  :)
    RS2Ad banner

    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.
    RS2Ad banner

    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?  :|
    RS2Ad banner

    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