OX Map Command

Skilled Illusionist
Joined
Aug 16, 2010
Messages
346
Reaction score
111
This has got to be my simplest release yet. It's a single, easy-to-add, user-friendly command for all your True/False events on the OX Map.

Features:
- Fully automatic. Upon using the command, the question will be asked, and after the time is up, the losers will detected and kicked
- Intelligent. Will not kick players if there are no winners for that round.
- Interactive. Has "START", "WIN", "LOSE" and "TIMEOUT" animations and music playing, as well as a timer
- Easy to add to servers

Add this command to your source:
Code:
     public static class AskOX extends CommandExecute {

        @Override
        public int execute(MapleClient c, String[] splitted) {
            if (c.getPlayer().getMapId() != 109020001) {
                c.getPlayer().changeMap(109020001, 0);
                c.getPlayer().dropMessage(6, "Warp other players to this map to begin the event");
                return 0;
            }
            final MapleCharacter asker = c.getPlayer();
            final MapleMap thisMap =  asker.getMap();        
            String[] trueCmd = {"true", "t", "left", "l", "o"};
            String[] falseCmd = {"false", "f", "right", "r", "x"};
            boolean tempAns;
            if (Arrays.asList(trueCmd).contains(splitted[1].toLowerCase())) {
                tempAns = true;
            } else if (Arrays.asList(falseCmd).contains(splitted[1].toLowerCase())) {   
                tempAns = false;
            } else {
                c.getPlayer().dropMessage(6, "Syntax: !AskOX <True/False> <Time> <Question>");
                return 1;
            }
            final boolean ans = tempAns;
            final int timeLimit = Math.min(Math.max(Integer.parseInt(splitted[2]), 1), 60);
            final String question = StringUtil.joinStringFrom(splitted, 3);

            thisMap.broadcastMessage(CField.MapEff("SportsDay/EndMessage/Start"));
            thisMap.broadcastMessage(CField.playSound("Dojang/start"));
            Timer.MapTimer.getInstance().schedule(new Runnable() {
                @Override
                public void run() {
                    thisMap.broadcastMessage(CWvsContext.serverNotice(0, question));
                    thisMap.broadcastMessage(CField.getClock(timeLimit));
                    Timer.MapTimer.getInstance().schedule(new Runnable() {
                        @Override
                        public void run() {
                            List<MapleCharacter> winners = new ArrayList<MapleCharacter>();
                            for (final MapleCharacter victim : thisMap.getCharacters()) {
                                if (victim == asker) {
                                    continue;
                                }
                                if ((victim.getPosition().x > -308 && victim.getPosition().x < -142) || victim.getPosition().y <= -206) {
                                    // NO ANSWER
                                    victim.getClient().getSession().write(CField.MapEff("SportsDay/EndMessage/TimeOver"));
                                    victim.getClient().getSession().write(CField.playSound("phantom/skaia"));
                                } else if (victim.getPosition().x > -308 ^ ans) {
                                    // CORRECT ANSWER
                                    winners.add(victim);
                                    victim.getClient().getSession().write(CField.MapEff("SportsDay/EndMessage/Win"));
                                    victim.getClient().getSession().write(CField.playSound("Party1/Clear"));  
                                } else {
                                    // WRONG ANSWER
                                    victim.getClient().getSession().write(CField.MapEff("SportsDay/EndMessage/Lose"));
                                    victim.getClient().getSession().write(CField.playSound("Party1/Failed"));
                                }
                            }
                            if (winners.size() > 0) {
                                for (final MapleCharacter victim : thisMap.getCharacters()) {
                                    if (victim != asker && !winners.contains(victim)) {
                                        // WARP OUT IN 5 SEC
                                        Timer.MapTimer.getInstance().schedule(new Runnable() {
                                        @Override
                                            public void run() {
                                                victim.changeMap(100000000, 0);
                                            }
                                         }, 5000);
                                    }
                                }
                            } else {
                                thisMap.broadcastMessage(CWvsContext.serverNotice(6, "Since there are no winners for this round, all participants will proceed on to the next round"));
                            }
                        }
                    }, timeLimit * 1000);
                }
             }, 2000);
            return 1;
        }
    }

To use the command, say !AskOX <True/False> <Time> <Question>.
- True/False = Is the answer True or False?
- Time = The time limit for the question (A time between 1 to 60 seconds)
- Question = The true/false question asked

So let's say I want to ask the question: "Is water made out of H2O?" with a time limit of 10 seconds, the command I would use is: "!AskOX true 5 Is water made out of H2O?

Have fun.
 
!AskOX false 5 Is water made out of H2O?**

Water is not made out of h20. Are people made out of people?

Anyways, does this just make the event customizable?

Water as in the liquid, made out of H2O molecules. And yea of course it's customizable :O Just use whatever questions you like, and enter the correct answer.

The only way this could backfire is if the host put in the wrong question/answer. And cause all the correct answers to be warped out. LOL. Because once the command is out, there is no stopping it.
 
I'm actually really impressed by this. I'm not Coding Whiz but this is pretty darn creative. Should a source above 138 be released, I would like to use this.

Not that 138 is mandatory, just a personal preference of mine!
 
I haven't actually played a normal private server in a long time, but my experience is that the event classes themselves have never been used. GMs just use crude crowd control like !muteall, !killall, !healall, and !warpdead
 
With the release of cryptic that changed. Kevin also coded the events in Moople. Unfortunately, some of the commands are not working properly, coconut's reactors don't work, and OX completely bugs the map. Probably just because it's a SEA based source.
 
You could code the original commands, and the autoevent.

With the release of cryptic that changed. Kevin also coded the events in Moople. Unfortunately, some of the commands are not working properly, coconut's reactors don't work, and OX completely bugs the map. Probably just because it's a SEA based source.

No. It's because there are no questions in the sql.
 
well lithium was terrible actually why would anyone make a items,mob-skills,quest dumper ? the struct was a failure to be honest.. wont never understand on why people keep on using it just because it is widely updated ?
 
well lithium was terrible actually why would anyone make a items,mob-skills,quest dumper ? the struct was a failure to be honest.. wont never understand on why people keep on using it just because it is widely updated ?

Because some info is better to be stored in database for faster process.
 
well lithium was terrible actually why would anyone make a items,mob-skills,quest dumper ? the struct was a failure to be honest.. wont never understand on why people keep on using it just because it is widely updated ?

All you do is complain about other's work. You don't like it? Don't use it. Why go around every lithium thread saying Lithium is a failure? Make your own source before complaining that Lithium was a failure. And honestly, one time is enough. No need to say it on almost every lithium related thread. Oh and when I meant your own source, I didn't mean the one you gave up, Source Sux.
 
I would agree but I still feel that it was a big mistake to do it only for those.. there was mcdb floating around why not used it at all..
You are a fucking moron. That source was based off of crypticsea(tetrasea), which was based off of aurasea, which had those dumpers since 1.02 sea and probably before then. It's not like the developer of lithium was like OH MY GOD GUYS LETS ADD THIS!!!1!11!!
Regardless, none of this has anything to do with this thread.
 
*Attempts to change topic*

With the release of cryptic that changed. Kevin also coded the events in Moople. Unfortunately, some of the commands are not working properly, coconut's reactors don't work, and OX completely bugs the map. Probably just because it's a SEA based source.

Well I don't like the default questions from the Wz file anyway.
- They were created since long ago, probably pre-BigBang, so questions on mobs, locations, etc would mostly be wrong. Not to mention how they would be on non-GMS-like servers
- Questions are boring and/or simply stupid (in my opinion anyway). Or simply biased towards Maple Otakus To prove my point, here are some examples:

1) If you sell 2 Red Snail Shells, 2 Pig Heads, and 1 Slime Bubble at the store, you'll get 140 mesos.
2) The price of 128 pieces of Croko Skin is 6,500 mesos.
3) Blue White-Lined Boots, which is available for thieves over LV. 35, has the item option of LUK + 1 and DEX + 1.
4) To make the Moon Rock, you'll need to take the a Plate of Mithril, Steel, Bronze, Adamantium, Silver, Orihalcon, and Gold each at Arwen the Fairy.
5) AXE STUMP is a monster borne of rage towards a lumberjack that forgot to take off the axe from the tree.
6) RED SNAILS can only be found at the Maple Island, where the beginners play.
7) JR. WRAITH, a monster that resembles ghost, occasionally offers a [Blue Tablecloth].
8) The fastest monster in MapleStory is the STONE GOLLEM.
9) Sunset Dew can be sold to the stores for 5,050 mesos.
10) The Deed to the Land you need to clear the quest of "Building a New House for Blackbull" can be obtained through Cold Eye.
And those are literally the first 10 I picked out (except for the questions in Korean). Not hand-picked for stupidity.

For the benefit of those who don't know, use HaRepacker and open Etc.wz. Find OXQuiz.img to get all the questions.
Each question has 3 variables:
q - Question
a - Answer (0 = false, 1 = true)
d - Description (Explains the answer)
 
Back