The Great Victoria Island Race

Page 1 of 5 12345 LastLast
Results 1 to 15 of 71
  1. #1
    Interesting... SharpAceX is offline
    MemberRank
    Oct 2008 Join Date
    2,011Posts

    The Great Victoria Island Race

    I usually don't like releasing my crap here on RZ since all I really get here are flames and no constructive criticism, but I'll just make an exception and copy+paste it over from KDev.

    The Great Victoria Island Race


    Info: Do not ask me where I got inspired to make this, because I don't even remember. I had this done for a while now, I might as well release it rather than it just sitting there. Sorry if it's useless to some of you.

    Basically this is an event where players gather up in Henesys and race around Victoria Island, back to Henesys. Of course, there's more to this. There is a custom waiting time, I've included a primitive anti-cheat system, total number of players is announced, winner is auto-announced, the event gives you messages to guide you on your path and race auto-ends when winner gets to Henesys.

    This event is almost entirely automatic. All the GMs have to do is type one command, and hand out the prize.

    There are 32 maps in total to race on. It should be a blast with like 5+ players. Alright, let's begin. I'll group the code in chunks to make it easier to copy+paste for some of you. D:

    MapleCharacter.java


    Code:
    private int entryNumber = 0;
        private int progress = 0;
    Code:
     public int getEntryNumber() {
            return entryNumber;
        }
    
            public void setEntryNumber(int number) {
                this.entryNumber = number;
            }
    
             public int getProgress() {
            return progress;
        }
    
            public void setProgress(int number) {
                this.progress = number;
            }
    
            public void setWinnerAndEndRace() {
                    client.getChannelServer().setRace(false);
                    client.getChannelServer().setCompetitors(0);
                    client.getChannelServer().setWaiting(false);
                                            try {
              client.getChannelServer().getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(6, "[Event]: Congradulations to " + getName() + " on winning the Great Victoria Island Race! Thanks to those who played!").getBytes());
                 } catch (RemoteException x) {
                   client.getChannelServer().reconnectWorld();
                     }
            }
    
            public void raceStatus (){
                if (getProgress() == 4){
                    dropMessage("[Notice]: You're off to a nice start!");
                }
                if (getProgress() == 7){
                    dropMessage("[Notice]: Nice, you made it to the Magician town, Ellinia!");
                }
                if (getProgress() == 8){
                    dropMessage("[Notice]: You're making good progress.");
                }
                if (getProgress() == 15){
                    dropMessage("[Notice]: You are halfway there! Don't give up now!");
                }
                if (getProgress() == 16){
                    dropMessage("[Notice]: You made it to the Desert town of Perion!");
                }
                 if (getProgress() == 22){
                    dropMessage("[Notice]: You made it to the hood, Kerning City.");
                }
                if (getProgress() == 24){
                    dropMessage("[Notice]: You're almost there.");
                }
                if (getProgress() == 31){
                    dropMessage("[Notice]: Just one more map!");
                }
                if (getProgress() == 32){
                    dropMessage("[Notice]: You did it! You have won the race!");
                    setWinnerAndEndRace();
                }
            }
    Replace your:
    Code:
      public void changeMap(final MapleMap to, final MaplePortal pto) {
    with this:
    Code:
     public void changeMap(final MapleMap to, final MaplePortal pto) {
             int z = getProgress();
            if ((to.getId() == 100010000 && z == 0) || (to.getId() == 100020000 && z == 1) || (to.getId() == 100030000 && z == 2) || (to.getId() == 100040000 && z == 3) || (to.getId() == 100040100 && z == 4) || (to.getId() == 100050000 && z == 5) || (to.getId() == 101000000 && z == 6) || (to.getId() == 101010000 && z == 7) || (to.getId() == 101010100 && z == 8) || (to.getId() == 101030000 && z == 9) || (to.getId() == 101030100 && z == 10) || (to.getId() == 101030200 && z == 11) || (to.getId() == 101030300 && z == 12) || (to.getId() == 101030400 && z == 13) || (to.getId() == 101040000 && z == 14) || (to.getId() == 102000000 && z == 15) || (to.getId() == 102010000 && z == 16) || (to.getId() == 102020000 && z == 17) || (to.getId() == 102030000 && z == 18) || (to.getId() == 102040000 && z == 19) || (to.getId() == 102050000 && z == 20) || (to.getId() == 103000000 && z == 21) || (to.getId() == 103010000 && z == 22) || (to.getId() == 103020000 && z == 23) || (to.getId() == 103020100 && z == 24) || (to.getId() == 103020200 && z == 25) || (to.getId() == 103030000 && z == 26) || (to.getId() == 104010000 && z == 27) || (to.getId() == 104020000 && z == 28) || (to.getId() == 104030000 && z == 29) || (to.getId() == 104040000 && z == 30) || (to.getId() == 100000000 && z == 31)) {
                changeMapInternal(to, pto.getPosition(), MaplePacketCreator.getWarpToMap(to, pto.getId(), this));
                if (client.getChannelServer().getRace() == true && client.getChannelServer().getWaiting() == false){
             setProgress(getProgress() + 1);
             raceStatus();
                }
                 } else if (client.getChannelServer().getRace() == true && client.getChannelServer().getWaiting() == false) {
                     changeMapInternal(to, pto.getPosition(), MaplePacketCreator.getWarpToMap(to, pto.getId(), this));
                dropMessage("[Notice]: You are either cheating, or going the wrong direction. Your progress is not being counted.");
        } else if (to.getId() == 100000200 || to.getId() == 211000100 || to.getId() == 220000300) {
                changeMapInternal(to, pto.getPosition(), MaplePacketCreator.getWarpToMap(to, pto.getId() - 2, this));
            } else {
                changeMapInternal(to, pto.getPosition(), MaplePacketCreator.getWarpToMap(to, pto.getId(), this));
            }
        }
    GM Commands file

    Code:
                 } else if (splitted[0].equals("startrace")) {
                     if (!cserv.getRace() && !cserv.getWaiting()){
                cserv.setWaiting(true);
                cserv.setWaitingTime(X); //Replace with time in minutes you want to wait.
                cserv.raceCountdown();
                try {
               cserv.getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(6, "[Event]: The Great Victoria Island Race will begin soon! Please head to Henesys!").getBytes());
                 } catch (RemoteException e) {
                   cserv.reconnectWorld();
                     }
                            try {
               cserv.getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(6, "Use @joinrace to join and @rules to see the rules and regulations of this event.").getBytes());
                 } catch (RemoteException e) {
                   cserv.reconnectWorld();
                     }
                     }else{
                        player.dropMessage("[Notice]: A race is still in progress.");
                     }
    ChannelServer.java


    Code:
    private boolean hasWaitingStarted = false;
        private boolean race = false;
        private int competitors = 0;
        private int waitingTime;
    Code:
       public int getWaitingTime() {
           return waitingTime;
        }
    
        public void setWaitingTime(int set){
            this.waitingTime = set;
        }
    
    
          public void raceCountdown() {
            TimerManager.getInstance().schedule(new Runnable() {
                public void run() {
                    if (getWaiting() && getWaitingTime() > 1) {
                        setWaitingTime(getWaitingTime() - 1);
                        if (getWaitingTime() > 1){
                                                try {
               getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(6, "[Event]: The Great Victoria Island Race will start in " + getWaitingTime() + " minutes! There are " + getCompetitors() + " players in the race.").getBytes());
                 } catch (RemoteException e) {
                   reconnectWorld();
                     }
                        } else {
                       try {
               getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(6, "[Event]: The Great Victoria Island Race will start in " + getWaitingTime() + " minute! There are " + getCompetitors() + " players in the race.").getBytes());
                 } catch (RemoteException e) {
                   reconnectWorld();
                     }
                        }
                        raceCountdown();
                    } else if (getWaiting() && getWaitingTime() <= 1) {
                   setRace(true);
                    setWaiting(false);
                     try {
               getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(6, "[Event]: The Great Victoria Island Race has begun! Race all the way around Victoria Island going East, to win!").getBytes());
                 } catch (RemoteException c) {
                   reconnectWorld();
                     }
                   }
                }
            }, 1 * 60 * 1000);
        }
    
        public boolean getRace() {
           return race;
        }
    
        public void setRace(boolean set){
            this.race = set;
        }
    
        public boolean getWaiting() {
           return hasWaitingStarted;
        }
    
        public void setWaiting(boolean set){
            this.hasWaitingStarted = set;
        }
    
            public int getCompetitors() {
           return competitors;
        }
    
        public void setCompetitors(int set){
            this.competitors = set;
        }
    Player Commands file


    Code:
     } else if (splitted[0].equals("joinrace")) {
                       if (c.getPlayer().getEntryNumber() < 1) {
                       if (c.getPlayer().getMapId() == 100000000){
                       if (cserv.getWaiting()){
                           c.getPlayer().setEntryNumber(cserv.getCompetitors() + 1);
                           cserv.setCompetitors(cserv.getCompetitors() + 1);
    		player.dropMessage("[Notice]: You have successfully joined the race! Your entry number is " + c.getPlayer().getEntryNumber() + ".");
                       } else {
                           player.dropMessage("There is no event currently taking place.");
                       }
                       } else {
                            player.dropMessage("You are not at Henesys.");
                       }
                       }else{
                             player.dropMessage("You have already joined this race.");
                       }
                     } else if (splitted[0].equals("rules")) {
                       if (cserv.getWaiting() || cserv.getRace()) {
    		player.message("The Official Rules and Regulations of the Great Victoria Island Race:");
                    player.message("-------------------------------------------------------------------------------------------");
                    player.message("To win you must race from Henesys all the way to Henesys going Eastward.");
                    player.message("Rule #1: No cheating. You can't use any warping commands, or you'll be disqualified.");
                    player.message("Rule #2: You may use any form of transportation. This includes Teleport, Flash Jump and Mounts.");
                    player.message("Rule #3: You are NOT allowed to kill any monsters in your way. They are obstacles.");
                    player.message("Rule #4: You may start from anywhere in Henesys, but moving on to the next map before the start won't work.");
                       } else {
                           player.message("There is no event currently taking place.");
                       }
    To-do list:

    -Make Anti-Cheat system 100% accurate.
    -Make joining the race actually matter. (A simple check fixes this.)
    -Add "is in the lead" messages.
    -Fix that slight ChangeMap error which wrongly displays an error messages.

    Screenshots:











    Do what you want with this, it's better than nothing. Have fun and good luck adding this without errors.


  2. #2
    Account Upgraded | Title Enabled! Carrino is offline
    MemberRank
    Mar 2010 Join Date
    1,114Posts

    Re: The Great Victoria Island Race

    Screenies shows that you put in some efforts for sure.
    Good job.

  3. #3
    Zzzz... billybombill is offline
    MemberRank
    Dec 2008 Join Date
    1,355Posts

    Re: The Great Victoria Island Race

    Looks good, does it disqualify if they break rules? (etc hitting monster, FJ?)

  4. #4
    Member BleachFan is offline
    MemberRank
    Jun 2010 Join Date
    68Posts

    Re: The Great Victoria Island Race

    This is soooo awesome!

  5. #5
    Account Upgraded | Title Enabled! Carrino is offline
    MemberRank
    Mar 2010 Join Date
    1,114Posts

    Re: The Great Victoria Island Race

    Rule #1: No cheating. You can't use any warping commands, or you'll be disqualified.
    Make a local variable in commands, then when the event starts, make variable to one and commands will be disabled when variable become one.
    Rule #2: You may use any form of transportation. This includes Teleport, Flash Jump and Mounts.
    Disable them in MapleStatEffect.
    Rule #3: You are NOT allowed to kill any monsters in your way. They are obstacles.
    Zoo animal
    Rule #4: You may start from anywhere in Henesys, but moving on to the next map before the start won't work.
    Disable them changing before start
    Last edited by Carrino; 03-07-10 at 07:47 PM.

  6. #6
    Interesting... SharpAceX is offline
    MemberRank
    Oct 2008 Join Date
    2,011Posts

    Re: The Great Victoria Island Race

    Quote Originally Posted by Carrino View Post
    Rule #1: No cheating. You can't use any warping commands, or you'll be disqualified.
    Make a local variable in commands, then when then disable a command when the variable become one.
    Rule #2: You may use any form of transportation. This includes Teleport, Flash Jump and Mounts.
    Disable them in MapleStatEffect.
    Rule #3: You are NOT allowed to kill any monsters in your way. They are obstacles.
    Zoo animal
    Rule #4: You may start from anywhere in Henesys, but moving on to the next map before the start won't work.
    Disable them changing before start
    Woah, thanks a lot. This would make cheating almost impossible.

    Really appreciate this post. :)

  7. #7
    Zzzz... billybombill is offline
    MemberRank
    Dec 2008 Join Date
    1,355Posts

    Re: The Great Victoria Island Race

    Quote Originally Posted by Carrino View Post
    Rule #3: You are NOT allowed to kill any monsters in your way. They are obstacles.
    Zoo animal
    Zoo animals can't be hit but you cant be hit by them either. Try using the super monsters (Super Jr.Necki etc)

  8. #8
    Account Upgraded | Title Enabled! Carrino is offline
    MemberRank
    Mar 2010 Join Date
    1,114Posts

    Re: The Great Victoria Island Race

    Quote Originally Posted by billybombill View Post
    Zoo animals can't be hit but you cant be hit by them either. Try using the super monsters (Super Jr.Necki etc)
    Super Jr.Necki?
    I think everyone will be dead before reaching the destination.
    Suggest using unused monsters and make their hp really high.
    Last edited by Carrino; 03-07-10 at 07:48 PM.

  9. #9
    Account Upgraded | Title Enabled! Expedia is offline
    MemberRank
    Nov 2009 Join Date
    884Posts

    Re: The Great Victoria Island Race

    Has this actually been tested? Because i see a few problems

  10. #10
    Account Upgraded | Title Enabled! macboy3000 is offline
    MemberRank
    Jan 2009 Join Date
    Nerds'r'Us MS!Location
    449Posts

    Re: The Great Victoria Island Race

    override their stats.

  11. #11
    Interesting... SharpAceX is offline
    MemberRank
    Oct 2008 Join Date
    2,011Posts

    Re: The Great Victoria Island Race

    Quote Originally Posted by Expedia View Post
    Has this actually been tested? Because i see a few problems
    Well, as you can tell by the screens, I went around Vic island just to take pictures of the event.

    Mind telling me what the problems are? I know it's not 100% since there is a to-do list for a reason.

  12. #12
    Zzzz... billybombill is offline
    MemberRank
    Dec 2008 Join Date
    1,355Posts

    Re: The Great Victoria Island Race

    Super Jr.Necki?
    I think everyone will be dead before reaching the destination.
    Suggest using unused monsters and make their hp really high.
    The super ones they use the the jump quests, that do like 1 dmg. All they do is bump you out of the way (unless someone changed them)

  13. #13
    Account Upgraded | Title Enabled! Carrino is offline
    MemberRank
    Mar 2010 Join Date
    1,114Posts

    Re: The Great Victoria Island Race

    Quote Originally Posted by billybombill View Post
    The super ones they use the the jump quests, that do like 1 dmg. All they do is bump you out of the way (unless someone changed them)
    I thought those does 3k dmg.

    EDIT : Bloodangel, your henesys background is ludi? O_O
    I see legos.
    Last edited by Carrino; 03-07-10 at 07:58 PM.

  14. #14
    Interesting... SharpAceX is offline
    MemberRank
    Oct 2008 Join Date
    2,011Posts

    Re: The Great Victoria Island Race

    Quote Originally Posted by Carrino View Post
    I thought those does 3k dmg.

    EDIT : Bloodangel, your henesys background is ludi? O_O
    I see legos.
    Lol yeah. :D I made that WZ edit so long ago. Like months ago.

    Quote Originally Posted by Expedia View Post
    I mean with more then 1 player, things may look like they're working perfectly when you're alone. But as soon as more poeple log on to test you find out the bugs
    I tested it with a friend and got it to the first progress message.

    The message that tells you your Entry Numbers works with more than 1 person.
    The message that tells the entire server how many players, works with more than 1 person.
    Progress saves PER person, so I don't see how progress messages can screw up.
    Changing maps tracks progress PER person.
    When someone reaches Henesys, it disables the race for everyone.

    But, can you just tell me what EXACTLY would go wrong, and I'll go in-game and test it with 2 clients.

  15. #15
    Account Upgraded | Title Enabled! Carrino is offline
    MemberRank
    Mar 2010 Join Date
    1,114Posts

    Re: The Great Victoria Island Race

    Quote Originally Posted by Expedia View Post
    I mean with more then 1 player, things may look like they're working perfectly when you're alone. But as soon as more poeple log on to test you find out the bugs
    Try to connect it?



Page 1 of 5 12345 LastLast

Advertisement