Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] improved !goto command

Newbie Spellweaver
Joined
Jul 12, 2008
Messages
21
Reaction score
1
since i had nothing to do at work i decided to make a new !goto command. an easier editable command.

so this is the command. it should also fix the "ArrayIndexOutOfBounds" error since im not using any normal arrays :D:

first you need this import
PHP:
import java.util.HashMap;
then replace the old !goto command with this one
PHP:
// if syntax is not right 
// give error message
if (splitted.length < 2){
    mc.dropMessage("Syntax: !goto <mapname>");
}else{
    // init gotomaps hashmap
    HashMap<String, Integer> gotomaps = new HashMap<String, Integer>();

    // add maps to gotomaps hashmap
    gotomaps.put("gmmap", 180000000);
    gotomaps.put("southperry", 60000);
    gotomaps.put("amherst", 1010000);
    gotomaps.put("henesys", 100000000);
    gotomaps.put("ellinia", 101000000);
    gotomaps.put("perion", 102000000);
    gotomaps.put("kerning", 103000000);
    gotomaps.put("lith", 104000000);
    gotomaps.put("sleepywood", 105040300);
    gotomaps.put("florina", 110000000);
    gotomaps.put("orbis", 200000000);
    gotomaps.put("happy", 209000000);
    gotomaps.put("elnath", 211000000);
    gotomaps.put("ludi", 220000000);
    gotomaps.put("aqua", 230000000);
    gotomaps.put("leafre", 240000000);
    gotomaps.put("mulung", 250000000);
    gotomaps.put("herb", 251000000);
    gotomaps.put("omega", 221000000);
    gotomaps.put("korean", 222000000);
    gotomaps.put("nlc", 600000000);
    gotomaps.put("excavation", 990000000);
    gotomaps.put("pianus", 230040420);
    gotomaps.put("horntail", 240060200);
    gotomaps.put("mushmom", 100000005);
    gotomaps.put("griffey", 240020101);
    gotomaps.put("manon", 240020401);
    gotomaps.put("horseman", 682000001);
    gotomaps.put("balrog", 105090900);
    gotomaps.put("zakum", 280030000);
    gotomaps.put("papu", 220080001);
    gotomaps.put("showa", 801000000);
    gotomaps.put("guild", 200000301);
    gotomaps.put("shrine", 800000000);
    gotomaps.put("fm", 910000000);
    gotomaps.put("skelegon", 240040511);

    // if place is in hashmap
    if (gotomaps.containsKey(splitted[1])){

        // prepare for changemap
        MapleMap target = cserv.getMapFactory().getMap(gotomaps.get(splitted[1]));
        MaplePortal targetPortal = target.getPortal(0);
        MapleCharacter player = c.getPlayer();

        // changemap
        player.changeMap(target, targetPortal);

    }else{
        // else give error message
        mc.dropMessage("There is no such place !!!");
    }

}
the good thing about this new command is that it is way more easier to add / edit places.

when you want to add a new place to the command you just have to add this
PHP:
gotomaps.put("mapname", MapID);
Note: tested this on v60 server but it should work on any other server version too.
Note2: please make sure that the var "cserv" is available in your script. else just add it xD
PHP:
ChannelServer cserv = c.getChannelServer();
hope this helps a little bit :D:

Credits: to me :laugh:
btw this is my first release :blushing:

[EDIT]
Note3:
PHP:
HashMap<String, Integer> gotomaps = new HashMap<String, Integer>();
that's correct. so don't change it >.<
 
Last edited:
The almighty chicken
Loyal Member
Joined
Apr 7, 2008
Messages
570
Reaction score
31
I must admit that this is a nice one
 
Newbie Spellweaver
Joined
Jul 12, 2008
Messages
21
Reaction score
1
only made this one because its really annoying to add / edit / delete maps in the old command. >.<
 
Divine Celestial
Loyal Member
Joined
Jul 19, 2008
Messages
830
Reaction score
2
Good job son !
Nice improvements
 
Initiate Mage
Joined
Dec 21, 2008
Messages
1
Reaction score
0
Thanks man, sshould I replace it with th !goto command in the CommandProccesor right?
 
Mother effin' clouds
Loyal Member
Joined
Apr 13, 2008
Messages
1,534
Reaction score
448
Thanks man, sshould I replace it with th !goto command in the CommandProccesor right?
wherever your !goto command was o.o
And real great release ;) i just changed mine, bahaha :)
 
Newbie Spellweaver
Joined
Jul 12, 2008
Messages
21
Reaction score
1
i actually got that command ready a few days now. but i couldnt test it for some reason xD

anyways have fun with that command :D
 
Initiate Mage
Joined
May 1, 2008
Messages
1
Reaction score
0
In SineMS Revision 18 where do I add this?
Cause there is no 'goto' command normally.
 
Newbie Spellweaver
Joined
Jul 12, 2008
Messages
21
Reaction score
1
hmm just add it where you think it fits the best. I dont know SineMS and i i personally would just put it into the GMCommand.java. dont know. its your choice. (and dont know about the gm level (i hate them >.<) )
 
Initiate Mage
Joined
Dec 17, 2008
Messages
1
Reaction score
0
does it really matter where u add the command in the commands?
 
Newbie Spellweaver
Joined
Oct 31, 2008
Messages
14
Reaction score
0
it looks cool

btw it gave me this error :

D:\Sadeq\New Folder (6)\trunk\src\net\sf\odinms\client\messages\commands\gotoCommands.java:70: cannot find symbol
symbol : method getMap(java.lang.Object)
location: class net.sf.odinms.server.maps.MapleMapFactory
MapleMap target = cserv.getMapFactory().getMap(gotomaps.get(splitted[1]));
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
BUILD FAILED (total time: 8 seconds)


thanks
 
Newbie Spellweaver
Joined
Jul 12, 2008
Messages
21
Reaction score
1
is the var "cserv" available in your script? i said that in the note2 that that var has to be there. else it wont work
 
Back
Top