Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.Deathwish.world.content.minigames.impl;
- import org.Deathwish.util.MathUtils;
- import org.Deathwish.util.Misc;
- import org.Deathwish.world.entity.player.Player;
- import org.Deathwish.world.entity.player.PlayerHandler;
- /**
- * TriviaBot asks random questions and rewards players
- *
- * @author nand0
- */
- public class TriviaBot {
- /**
- * The current selected question.
- */
- public static String currentQuestion = null;
- /**
- * The current selected answer.
- */
- public static String currentAnswer = null;
- /**
- * This will hold all of the different variety of questions, and answers
- * which the trivia bot could ask in-game.
- */
- public static final String[][] data = {
- { "What defence level requirement does a bandos armour piece have?","65" },
- { "What do you get when you type backwards reversed?", "sdrawkcab" },
- { "Who is Nando's favorite artist?", "eminem" },
- { "Fuck that lil mouse couse im an!", "albatroaz" },
- { "What was the first planet to be discovered using the telescope, in 1781?","uranus" },
- { "Which forum software we are currently using?", "vbulletin" },
- { "What level is required to equip corrupt items?", "20" },
- { "What element begins with the letter K?", "krypton" },
- { "What drug is getting more poplair also reffered to as Special K?", "ketamine" },
- { "What should be the main substance of an xtc pill?", "mdma" },
- { "What is sushi traditionally wrapped in?", "seaweed" },
- { "Couse everbody knows that ****? is the word. **** **** **** is the word","bird" },
- { "An expulsion of wind from the vulva during coitus, what is this named?","queef" },
- { "Name the world's largest ocean", "pacific" },
- { "What is the name of princess super mario is always trying to safe?","peach" },
- { "What is the capital city of Spain?", "madrid" },
- { "What is the capital city of Russia?", "moscow" },
- { "Who flew too close to the sun and had his wings melted?", "icarus" },
- { "Who forgets, will be destined to remember?", "nothingman" },
- { "What helped a lot of underage drinkers get drunk?", "alcopop" },
- { "20% of what is in the metal part at the end of a pencil", "sulphur" },
- { "24-karat gold has to have a amount of ? in it to keep it from being too soft", "copper" },
- { "3.26 light years is equal to one", "parsec" },
- { "3-D that can be seen without glasses is also known as this", "stereoscopic" },
- { "What is the name of the main character in the legend of zelda games?","link" },
- { "What fish can you catch at level 76?","shark" },
- { "What another name used for the super nintendo?", "snes" },
- { "What game console was used back in the days to play sonic the hedgehock on?","sega" },
- { "What is Deathwish spelled backwards?", "hsiwhtaed" },
- { "Which summoned npc holds the most items for you?", "packyak" },
- { "Don't forget to ::****? every 12 hours or more if you got a vpn", "vote" },
- { "What colour is Absynth?", "green" },
- { "Which country has the largest area: Australia, Brazil or India??", "brazil" },
- { "Where is Notre Dame?", "paris" },
- { "What Spanish artist said he would eat his wife when she died??", "dali" },
- { "How many oscars did Alfred Hitchcock win?", "none" },
- { "What's the capital of Ecuador?", "quito" },
- { "What's the capital of Denmark?", "copenhagen" },
- { "What's the capital of Finland?", "helsinki" },
- { "How many wives did Henry the Eighth have?", "six" },
- { "What's the name of the main airport in Madrid?", "barajas" },
- { "Where is the smallest bone in the body?", "ear" },
- { "Which is the only mammal that can't jump?", "elephant" },
- { "What's the hardest rock?", "diamond" },
- { "What horoscope sign has a crab?", "cancer" },
- { "Where did the first atomic bomb explode for the first time in Japan?", "hiroshima" },
- { "Which is the smallest ocean?", "artic" },
- { "What's the highest mountain in Africa?", "kilimanjaro" },
- { "How many states are there in the United States of America??", "50" },
- { "What's the highest mountain in the world?", "everest" },
- { "What's the capital of Scotland?", "edinburgh" },
- { "What is the capital city of the netherlands?", "amsterdam" },
- { "What is the name of the ranged avatar that can drop handcannon", "arzinian" },
- { "What is the capital city of germany?", "berlin" },
- { "Which country gave the USA the 'Statute of Liberty?", "france" },
- { "What is the dutch word for cancer often taken offensive by usa/uk?", "kanker" },
- { "Which skill is not trainable on Deathwish?", "construction" },
- { "What process involves heating an ore to obtain a metal?","smelting" },
- { "What prayer level is required to use the hawk eye prayer?","26" },
- { "What prayer is used to drain your oppenents prayer?", "smite" },
- { "How many k tokkul is required to upgrade your fire cape to TokHaar-Kal?","50k" },
- { "What framework is Deathwish build on?", "niobe" },
- { "How much of a percentage does a bgs special requires?", "100" },
- { "Vegita! What does the scouter say about his powerlevel? it's over???","9000" },
- { "What is the maximum number of unstackable items in your inventory? ","28" },
- { "What is maximum combat level in Deathwish", "138" },
- { "What 3 letters are commenly used to describe king black dragon?","kbd" },
- { "What was the highest highest combat possible before summoning came out?","126" },
- { "What year did jagex remove the wilderness?", "2007" },
- { "Who caused the Falador Masacre on 6/6/6?", "durial321" },
- { "Which herb is required to make agility potions?", "toadflax" },
- { "Which herb is required with an eye of newt when you start training herblore?","guam" },
- { "How many runes does blood barrage use per cast??", "9" },
- { "What skill would you need to train in order to obtain iron ores?","mining" },
- { "Which armour set lower a players run energy? ", "torags" },
- { "How much is 9+2+6+2-10+16-8+4+2-1+3-1+16? ", "40" },
- { "How much is 9+2+6+2-10-8+4+2-1+3-1+6? ", "14" },
- { "How much is 9*2-16+2-1+7+115-25? ", "100" },
- { "What is the substance name which is sold as speed ?","amphetamine" },
- { "What substance gave way to the term melting face?","acid" },
- { "What drug is also known as moonrocks?","mdma" },
- { "Who was ranked #1 on runescape for many years?", "zezima" } };
- private static int tick;
- public static void process() {
- if(tick >= 2600) {
- if (currentQuestion != null) {
- yell("<shad=0EBFE9>@red@[TRIVIA]@mag@ " + currentQuestion);
- return;
- }
- assignQuestion();
- tick = 0;
- }
- tick++;
- }
- /**
- * This will generate a new current answer, and question.
- */
- public static void assignQuestion() {
- for (int i = 0; i < data.length; i++) {
- if (Misc.getRandom(i) == i) {
- currentQuestion = data[i][0];
- currentAnswer = data[i][1];
- }
- }
- yell("<shad=0EBFE9>@red@[TRIVIA]@mag@ " + currentQuestion);
- yell("<shad=0EBFE9>@red@[TRIVIA]@mag@If you think you know the answer simply ");
- yell("<shad=0EBFE9>@red@[TRIVIA]@mag@use the command ::answer with the answer after it");
- }
- /**
- * It will reset the current question, and answer.
- */
- public static void resetQuestion() {
- currentAnswer = null;
- currentQuestion = null;
- }
- /**
- * This will check whether the player's answer entered is incorrect, or
- * correct.
- *
- * @param message
- * The player's answer.
- */
- public static void attemptQuestion(Player c, String message) {
- if (currentQuestion == null) {
- c.getPacketSender().sendMessage(
- "@red@There is no question assigned to the trivia bot..");
- return;
- }
- if (message.equalsIgnoreCase(currentAnswer)) {
- final int random = MathUtils.random(20);
- switch (random) {
- case 0:
- c.getPointsHandler().setPkPoints(+25, true);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername()+ " entered the correct answer, and received 25 pk points!");
- resetQuestion();
- return;
- case 1:
- c.getInventory().add(989, 1);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername()+ " entered the correct answer, and received a crystal key!");
- resetQuestion();
- return;
- case 2:
- c.getInventory().add(995, 5000000);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername()+ " entered the correct answer, and received 5m!");
- resetQuestion();
- return;
- case 3:
- c.getInventory().add(989, 1);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername()+ " entered the correct answer, and received a crystal key!");
- resetQuestion();
- return;
- case 4:
- c.getInventory().add(995, 5000000);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername()+ " entered the correct answer, and received 5m!");
- resetQuestion();
- return;
- case 5:
- c.getInventory().add(13853, 1);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername()+ " entered the correct answer, and received a brawling gloves(hunter)!");
- resetQuestion();
- return;
- case 6:
- c.getInventory().add(7774, 5);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername()+ " entered the correct answer, and received 5 voting certificates!");
- resetQuestion();
- return;
- case 7:
- c.getInventory().add(7774, 2);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername()+ " entered the correct answer, and received 2 voting certificates!");
- resetQuestion();
- return;
- case 8:
- c.getInventory().add(989, 1);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername()+ " entered the correct answer, and received a crystal key!");
- resetQuestion();
- return;
- case 9:
- c.getInventory().add(995, 10000000);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername()+ " entered the correct answer, and recieved 10m coins!");
- resetQuestion();
- return;
- case 10:
- c.getInventory().add(995, 10000000);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername()+ " entered the correct answer, and recieved 10m coins!");
- resetQuestion();
- return;
- case 11:
- c.getInventory().add(995, 5000000);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername()+ " entered the correct answer, and received 5m!");
- resetQuestion();
- return;
- case 12:
- c.getInventory().add(1631, 1);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername()+ " entered the correct answer, and an uncut dragon stone!");
- resetQuestion();
- return;
- case 13:
- c.getInventory().add(995, 5000000);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername()+ " entered the correct answer, and received 5m!");
- resetQuestion();
- return;
- case 15:
- c.getInventory().add(995, 5000000);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername()+ " entered the correct answer, and received 5m!");
- resetQuestion();
- return;
- case 16:
- c.getInventory().add(13849, 1);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername()+ " entered the correct answer, and received a brawling gloves(agility)!");
- resetQuestion();
- return;
- case 17:
- c.getInventory().add(13856, 1);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername()+ " entered the correct answer, and recieved brawling gloves(fishing)!");
- resetQuestion();
- return;
- case 18:
- c.getInventory().add(13854, 1);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername() + " entered the correct answer, and recieved brawling gloves(thieving)!");
- resetQuestion();
- return;
- case 19:
- c.getInventory().add(995, 5000000);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername()+ " entered the correct answer, and received 5m!");
- resetQuestion();
- return;
- case 20:
- c.getInventory().add(989, 1);
- PlayerHandler.sendGlobalPlayerMessage("<shad=0EBFE9>@red@[TRIVIA]@mag@"+ c.getUsername()+ " entered the correct answer, and received a crystal key!");
- resetQuestion();
- return;
- }
- } else {
- c.getPacketSender().sendMessage("@red@The answer entered was incorrect!");
- }
- }
- /**
- * Sends a global message to the server.
- *
- * @param s
- * The message which is going to be sent.
- */
- public static void yell(String s) {
- PlayerHandler.sendGlobalPlayerMessage(s);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement