• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

JZ's Help Thread

Newbie Spellweaver
Joined
Feb 8, 2015
Messages
38
Reaction score
0
zaMgegM - JZ's Help Thread - RaGEZONE Forums

Hello everyone, instead of endlessly spamming the Help section with multiple threads. I'd rather just put all my questions, problems, etc. into one thread to prevent that. Thank you ahead of time for your help and I'd like to say it's very much appreciated. I will keep this thread organized, as maybe it will help others? Also, please keep in mind that before posting anything that I wish to receive help with. I DO search endlessly online for a fix and even attempt to go throughout the code messing with it myself. Once again, thank you for your time. <3

______________________________________________________________________

I am currently using MoopleDEV v83.
______________________________________________________________________


[1]
OyvSnbi - JZ's Help Thread - RaGEZONE Forums
: How would I disable the creation of a specific class?
Goals:
  • Disable the creation of Cygnus or Aran, clicking either won't have the player directed to the creation screen.
  • Upon clicking either Cygnus or Aran, player receives an error message.


HCenOJK - JZ's Help Thread - RaGEZONE Forums


Solution:
By using a function that creates a pop-up message and adding a return statement to cancel creation of character, ex:
Code:
if (job == 0) { // Knights of Cygnus               c.announce(MaplePacketCreator.serverNotice(1, "You cannot create a Knight of Cygnus.")); // message
               return; // stop here so they may not create this character
            // newchar.setJob(MapleJob.NOBLESSE);
            // newchar.setMapId(130030000); 
            // newchar.getInventory(MapleInventoryType.ETC).addItem(new Item(4161047, (byte) 0, (short) 1));
Credit: chunkarama

[2]
OyvSnbi - JZ's Help Thread - RaGEZONE Forums
: How would I disable specific maps?
Goals:
  • If a player enters a disabled map, they are redirected to another.
  • **Note: I am aware that this can be coded, but where exactly would I code the functions? I admit I am nothing near experienced in actual scripting/source development, only "experienced" in understanding what code is executing and such. Yes, I am willing to learn if I receive support.

Solution:
First navigate to GameConstants.java and add:
Code:
public static int[] disabledMaps = { 100000000, 200000000 }; // Example maps (Henesys and Orbis)

Secondly, you will need to add the following function to MapleCharacter.java, particularly under the function named changeMapBanish:
Code:
private void changeMapInternal(final MapleMap to, final Point pos, final byte[] warpPacket) {
        for (int i : GameConstants.disabledMaps) {
            if (to.getId() == i && !this.isGM()) { // if PLAYER
                dropMessage(1, "Unfortunately, the map you are trying to access is disabled for players.");
                return; // Prevents entry of any disabled maps.
            } else if (to.getId() == i && this.isGM()) { // if ADMIN
                dropMessage(0, "Please keep in mind, the map you have entered is disabled for players."); // Only sends a message, does not prevent entry of disabled maps. Not entirely necessary, but is an option to have.
            }
        }

FAIL-SAFE:
If a player log-ins and is in a disabled map, they will be warped out.
First navigate to GameConstants.java and add:
Code:
public static int returnMap = 200000000; // Example map (Orbis)

Secondly, find PlayerLoggedinHandler.java and under:
Code:
player.sendMacros();
Add:
Code:
 for (int i : GameConstants.disabledMaps) {                        
if (player.getMap().getId() == i && !player.isGM()) {
                player.changeMap(GameConstants.returnMap);
                player.dropMessage(1, "Upon logging in, you were found in a map which has been disabled. As a result, you have been warped to Orbis.");
            }
        }


Credit: Tenchio, chunkarama

[3] How would I fix client-side quests?
Information: Upon clicking to receive quest, or go into the detail of the quest. There is no result other than the NPC closing. **I've went through .wz files, but need further information on how to successfully fix the quests.

Goals:
  • To fix these bugged client-side quests.

9D3N6se - JZ's Help Thread - RaGEZONE Forums


Solution:
There is currently no solution.

[4]
OyvSnbi - JZ's Help Thread - RaGEZONE Forums
: How would I change the symbol for GM commands?
Goal:
  • For future reference.
  • **For shits and giggles.

Solution:
Search through source files, open GeneralChatHandler.java and edit any of the heading values to a symbol of your choice.
Code:
if (heading == '/' || heading == '!' || heading == '@') {            String[] sp = s.split(" ");
            sp[0] = sp[0].toLowerCase().substring(1);
            if (!Commands.executePlayerCommand(c, sp, heading)) {
                if (chr.isGM()) {
                    if (!Commands.executeGMCommand(c, sp, heading)) {
                        Commands.executeAdminCommand(c, sp, heading);
                    }
                }
            }
Credit: chunkarama

[5]
OyvSnbi - JZ's Help Thread - RaGEZONE Forums
: Re-enabling UI after Victoria(Lith Harbor) scene/cutscene?
Description: After searching Google & RageZone, every thread about the "fix" says "enable UI." Simple enough, no? Wrong. Where do you enable UI? In the event script, changeMapHandler.java, mapScriptMethods.java?

I do know the function that is needed to re-enable UI.
Oh5YNMW - JZ's Help Thread - RaGEZONE Forums

I've tried enabling UI after cut-scene but as javascript doesn't wait, it executes the entire script ending up with the UI available during the cut-scene.
3lgKjTC - JZ's Help Thread - RaGEZONE Forums

*How would I delay a function?
**I've tried many other locations, no successful results though.

Solution:
First navigate to scripts/map/onUserEnter and open explorationPoint.java.

Then replace:
Code:
if (ms.getPlayer().getMapId() == 104000000) {
        ms.mapEffect("maplemap/enter/104000000");
    }
}
with:
Code:
else if (ms.getPlayer().getMapId() == 104000000) {
        ms.mapEffect("maplemap/enter/104000000");
    }
    ms.unlockUI();
}
Final result:
7NvZqRI - JZ's Help Thread - RaGEZONE Forums
Credit: Tenchio and myself.

Just kidding, we're not done. Finally release all your stress out on Nanazion!
JonnyZevos - JZ's Help Thread - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Last edited:
Newbie Spellweaver
Joined
Feb 8, 2015
Messages
38
Reaction score
0
-- Updated Thread --
Added new problem, need some kind on advice as I've been working on this problem for hours on end and no working result. OCD, f-ck you.
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,139
-- Updated Thread --
Added new problem, need some kind on advice as I've been working on this problem for hours on end and no working result. OCD, f-ck you.

Aha, you can change your server-sided functions, but not WZ-sided. The string in the function is loaded from the WZ. This is named by Nexon and cannot be changed (unless you wz edit, which is silly). This is why we name our portal files and other misc. things odd names. It's because we either need to, or we like to copy the official server's method names.
 
Upvote 0
Newbie Spellweaver
Joined
Feb 8, 2015
Messages
38
Reaction score
0
Aha, you can change your server-sided functions, but not WZ-sided. The string in the function is loaded from the WZ. This is named by Nexon and cannot be changed (unless you wz edit, which is silly). This is why we name our portal files and other misc. things odd names. It's because we either need to, or we like to copy the official server's method names.
Thanks man, you just saved me much of my time as I would have continued trying. -lol-
 
Upvote 0
Joined
Apr 10, 2008
Messages
4,087
Reaction score
1,264
-cough- Did you care to read the the first post at all?



* Added new problem: Lith Harbor UI re-enable. Don't flame, read the first post. Thanks!

Well, I did, but it seems like you're more into fancy poop instead of actually asking questions.

Anyways, back to the topic.

For the quests - there are actually server-sided, not client-sided. Roger's Apple, as far as I remember, is a server-side quest. Hence why it doesn't work for you. If it was a client-sided quest, the client would show up a dialog and would do all the work. You're missing the quest script for Roger's Apple quest, that is all.

For the UI - Neckson created a packet that tells the client to wait x milliseconds before sending a response back to the server. Since whoever coded the crappy v.140+ source wasn't smart enough to figure out how it works, you need to delay the server by using Thread.sleep.
 
Upvote 0
Newbie Spellweaver
Joined
Feb 8, 2015
Messages
38
Reaction score
0
Well, I did, but it seems like you're more into fancy poop instead of actually asking questions.

For the quests - there are actually server-sided, not client-sided. Roger's Apple, as far as I remember, is a server-side quest. Hence why it doesn't work for you. If it was a client-sided quest, the client would show up a dialog and would do all the work. You're missing the quest script for Roger's Apple quest, that is all.
Ah, thanks. I will have to check through the script for typos/mistakes.

For the UI - Neckson created a packet that tells the client to wait x milliseconds before sending a response back to the server. Since whoever coded the crappy v.140+ source wasn't smart enough to figure out how it works, you need to delay the server by using Thread.sleep.
Lulz, I would say the only 'fancy poop' is the 'banner' but I have most stuff in spoilers as it would stretch the page. I am using MoopleDEV v83 though,
 
Upvote 0
Joined
Apr 10, 2008
Messages
4,087
Reaction score
1,264
Ah, thanks. I will have to check through the script for typos/mistakes.


Lulz, I would say the only 'fancy poop' is the 'banner' but I have most stuff in spoilers as it would stretch the page. I am using MoopleDEV v83 though,

Well, I'm not sure if the delay method exists in v.83. Like I said, you can use Thread.sleep to delay the execution from the server's side. I'm not sure if there's a different approach to this, or I just can't recall any. I suggest asking kevintjuh93, as he's more familiar with this version than I am.
 
Upvote 0
Newbie Spellweaver
Joined
Feb 8, 2015
Messages
38
Reaction score
0
Well, I'm not sure if the delay method exists in v.83. Like I said, you can use Thread.sleep to delay the execution from the server's side. I'm not sure if there's a different approach to this, or I just can't recall any. I suggest asking @kevintjuh93, as he's more familiar with this version than I am.
I messaged him, but in the meantime. Have any other ideas on how to fix this? ;^;

**http://forum.ragezone.com/f566/moopledev-stuck-using-ship-lith-998579/
-facepalm- One of the threads I came across.
 
Last edited:
Upvote 0
Junior Spellweaver
Joined
Jan 4, 2013
Messages
162
Reaction score
29
I Should have read the whole post :L

Ok, I think I got a patch for it.
On the destination map, there should be a OnUserEnter script.
Just add "ms.unlockUI();" to the end of the script.

What will happen is that when the UI is locked and playing the scene on map 2010000, after the scene finish it will warp you to your destination map. On entering that map, you will forcefully enable UI.



File: explorationPoint.js
Location: scripts\map\onUserEnter\

Code:
Code:
/*
    This file is part of the OdinMS Maple Story Server
    Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
               Matthias Butz <matze@odinms.de>
               Jan Christian Meyer <vimes@odinms.de>


    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation version 3 as published by
    the Free Software Foundation. You may not use, modify or distribute
    this program under any other version of the GNU Affero General Public
    License.


    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.


    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/


/*
 * Author: kevintjuh93
 *
*/
function start(ms) {
    if (ms.getPlayer().getMapId() == 110000000 || (ms.getPlayer().getMapId() >= 100000000 && ms.getPlayer().getMapId() < 105040300)) {    
        ms.explorerQuest(29005, "Beginner Explorer");//Beginner Explorer    
    } else if (ms.getPlayer().getMapId() >= 105040300 && ms.getPlayer().getMapId() <= 105090900) {
        ms.explorerQuest(29014, "Sleepywood Explorer");//Sleepywood Explorer
    } else if (ms.getPlayer().getMapId() >= 200000000 && ms.getPlayer().getMapId() <= 211041800) {
        ms.explorerQuest(29006, "El Nath Mts. Explorer");//El Nath Mts. Explorer
    } else if (ms.getPlayer().getMapId() >= 220000000 && ms.getPlayer().getMapId() <= 222010400) {
        ms.explorerQuest(29007, "Ludus Lake Explorer");//Ludus Lake Explorer
    } else if (ms.getPlayer().getMapId() >= 230000000 && ms.getPlayer().getMapId() <= 230040401) {
        ms.explorerQuest(29008, "Undersea Explorer");//Undersea Explorer
    } else if (ms.getPlayer().getMapId() >= 250000000 && ms.getPlayer().getMapId() <= 251010500) {
        ms.explorerQuest(29009, "Mu Lung Explorer");//Mu Lung Explorer
    } else if (ms.getPlayer().getMapId() >= 260000000 && ms.getPlayer().getMapId() <= 261030000) {
        ms.explorerQuest(29010, "Nihal Desert Explorer");//Nihal Desert Explorer
    } else if (ms.getPlayer().getMapId() >= 240000000 && ms.getPlayer().getMapId() <= 240050000) {
        ms.explorerQuest(29011, "Minar Forest Explorer");//Minar Forest Explorer
    } 
    if (ms.getPlayer().getMapId() == 104000000) {           
        ms.mapEffect("maplemap/enter/104000000");
    }
    [B]ms.unlockUI(); // This was what I added![/B]
}

I am not responsible if any issue that may occur from my patches! Those patches may conflict with future or pre- existing / existing code.

Taken me awhile, since the files doesn't update in sync with the server, since all the map files are loaded on server start-up.
 
Last edited:
Upvote 0
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,139
@Tenchio I remember coding in SOME of these for v117, and I used Timers because sending unlockUI immediately will cause the cutscene to go off with an unlocked UI. If this is the same thing as v117, then your method will cause players to move around during a cutscene.

I forgot how I got the time or if I guessed it, but I just had a simple timer like this:
Code:
Timer.schedule(new Runnable() {
  @Override
  public void run() {
    map.unlockUI(); // idek what mine was called anymore lol
  }
}, 1000 * time); // I had calculated time by seconds, so time would = 30 for 30seconds.
 
Upvote 0
Junior Spellweaver
Joined
Jan 4, 2013
Messages
162
Reaction score
29
It shouldn't happen. What happens is that the UI is locked for the whole scene. once the scene finish, you'll be warped to the main map. Then my thing with make it unlock the UI. Since doing it directly in the goLith() method will just run everything. It working for me ATM, if you would like I can provide a video of it? I've been using moopledev source, so I can't say what will happen for other sources.

Flow example:
Warp to map 2010000 > on entering that map goLith() method runs > Once scene finish, warp player out to Lith Harbor > On entering Lith Harbor force unlock of UI using the "onUserEnter" script for that map.

I really suck at explaining things. :L
Hope the flow example explains it. Nothing is wrong using the timer either, just peoples preference.
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
Feb 8, 2015
Messages
38
Reaction score
0
It shouldn't happen. What happens is that the UI is locked for the whole scene. once the scene finish, you'll be warped to the main map. Then my thing with make it unlock the UI. Since doing it directly in the goLith() method will just run everything. It working for me ATM, if you would like I can provide a video of it? I've been using moopledev source, so I can't say what will happen for other sources.

Flow example:
Warp to map 2010000 > on entering that map goLith() method runs > Once scene finish, warp player out to Lith Harbor > On entering Lith Harbor force unlock of UI using the "onUserEnter" script for that map.

I really suck at explaining things. :L
Hope the flow example explains it. Nothing is wrong using the timer either, just peoples preference.
Well, the thing that I'm confused about is that the first cut-scene of the game (goAdventure.java) works perfectly and when it redirects you to map 0 it restores UI WHEN it has the SAME exact code. Possibly packets that are not working?
 
Last edited:
Upvote 0
Junior Spellweaver
Joined
Jan 4, 2013
Messages
162
Reaction score
29
That is because it doesn't redirect you to map 0, it warps you to map 1000, which has a script that runs on entering. The script is called go10000.js. It already contains "ms.unlockUI();". Its a funny thing, I just found this when you were asking why. The cut-scene run on map 0, but when the cut-scene finish your warped onto map 1000.
 
Upvote 0
Newbie Spellweaver
Joined
Feb 8, 2015
Messages
38
Reaction score
0
There's your fix:

7NvZqRI - JZ's Help Thread - RaGEZONE Forums


Original Code:
Code:
/*
 * Author: kevintjuh93
 *
*/
function start(ms) {
    if (ms.getPlayer().getMapId() == 110000000 || (ms.getPlayer().getMapId() >= 100000000 && ms.getPlayer().getMapId() < 105040300)) {    
        ms.explorerQuest(29005, "Beginner Explorer");//Beginner Explorer    
    } else if (ms.getPlayer().getMapId() >= 105040300 && ms.getPlayer().getMapId() <= 105090900) {
        ms.explorerQuest(29014, "Sleepywood Explorer");//Sleepywood Explorer
    } else if (ms.getPlayer().getMapId() >= 200000000 && ms.getPlayer().getMapId() <= 211041800) {
        ms.explorerQuest(29006, "El Nath Mts. Explorer");//El Nath Mts. Explorer
    } else if (ms.getPlayer().getMapId() >= 220000000 && ms.getPlayer().getMapId() <= 222010400) {
        ms.explorerQuest(29007, "Ludus Lake Explorer");//Ludus Lake Explorer
    } else if (ms.getPlayer().getMapId() >= 230000000 && ms.getPlayer().getMapId() <= 230040401) {
        ms.explorerQuest(29008, "Undersea Explorer");//Undersea Explorer
    } else if (ms.getPlayer().getMapId() >= 250000000 && ms.getPlayer().getMapId() <= 251010500) {
        ms.explorerQuest(29009, "Mu Lung Explorer");//Mu Lung Explorer
    } else if (ms.getPlayer().getMapId() >= 260000000 && ms.getPlayer().getMapId() <= 261030000) {
        ms.explorerQuest(29010, "Nihal Desert Explorer");//Nihal Desert Explorer
    } else if (ms.getPlayer().getMapId() >= 240000000 && ms.getPlayer().getMapId() <= 240050000) {
        ms.explorerQuest(29011, "Minar Forest Explorer");//Minar Forest Explorer
    } 
    if (ms.getPlayer().getMapId() == 104000000) {           
        ms.mapEffect("maplemap/enter/104000000");
    }
    [B]ms.unlockUI(); // This was what I added!
}[/B]

With ms.unlockUI() + the simple addition of "else" you will have a functional event.
 

Attachments

You must be registered for see attachments list
Upvote 0
Junior Spellweaver
Joined
Jan 4, 2013
Messages
162
Reaction score
29
[STRIKE]I don't really think you need to add else. since "ms.getPlayer().getMapId() == 104000000" display the map name on entering and having unlockUI would only really effect you when your using it for a scene, but for stuff like "ms.explorerQuest(29005, "Beginner Explorer");//Beginner Explorer " it shouldn't really effect it.[/STRIKE]

I really need to pay more attention to people's post, getting wrong ideas way too may times.
 
Upvote 0
Newbie Spellweaver
Joined
Feb 8, 2015
Messages
38
Reaction score
0
[STRIKE]I don't really think you need to add else. since "ms.getPlayer().getMapId() == 104000000" display the map name on entering and having unlockUI would only really effect you when your using it for a scene, but for stuff like "ms.explorerQuest(29005, "Beginner Explorer");//Beginner Explorer " it shouldn't really effect it.[/STRIKE]

I really need to pay more attention to people's post, getting wrong ideas way too may times.
Well, from my belief. The entire MS function is executed, correct? So once it's found the map ID, it executes inside that brackets then continues to the last bracket. Please inform me if I'm wrong, only what I've learned/understood.
 
Upvote 0
Junior Spellweaver
Joined
Jan 4, 2013
Messages
162
Reaction score
29
nope. If your doing an if and else if, it would only run one of the if or else if, depending on the condition, but everything under that if / else if would run. Since, all the other if statement relates to other mapId, you should be fine.

ex.
kill = 3

if (kill > 1) {
score += 1;
crit chance += 1;
} else if (kill > 2) {
score += 2;
crit chance += 3;
}

output:
score = 1
crit chance = 1;

"} else if (kill > 2) {" will never run since "if (kill > 1) {" will always be true.

Note: I would place "ms.unlockUI();" under "if (ms.getPlayer().getMapId() == 104000000) {" Since there are other maps that use that script. Just to avoid any conflict with other quest / events.
 
Last edited:
Upvote 0
Back
Top