Jump to content

An4rchy

Legendary Member
  • Posts

    2,656
  • Credits

  • Joined

  • Last visited

  • Days Won

    26
  • Feedback

    100%

Everything posted by An4rchy

  1. Lol. A whole new table in database and db connections for a single number. Dude, use streams.
  2. There are small differences, i know, but you could, instead of pretending the smartass(check pic), tell him your opinion.
  3. Man, kalitera na sigentroseis idees kai na anoikseis enan diko sou server, me unique features kai oxi mlkies opos to 100% twn pvp server smr. Klasika, x5000 No custom. Safe 5 Max 20 70%. TvT, Ctf, kai stin kaliteri phoenix engine. Tadam! New server. -beep-ies. Unique features paei na pei kainourgia events, kainourgia mods, kainourgios tropos gameplay.
  4. I have tested it, but there might be bugs i didn't check..
  5. Yeah, some testing by someone else would be good, because i haven't got enough time for tests too. Guys the 2 new ideas will come at different versions(vampir's and Howl3r's), because i haven't got enough time these 3 days...
  6. Every party leader can press .partycontrol to 'control' his party. He can choose many options for his party, like setting it in pvp mode, organizing fights with another parties, gathering his party members etc... Thanks guys.
  7. I think i'll choose the second, it's amazing :) It will show a list of parties in pvp mode, with a button to start the task. Once again, really thanks.
  8. Yeah, i took a few mins to see how this class works. But it's good to inform me since i have used it before. My problem is another, where to set the marker, maybe at the leader of the enemy party or something?
  9. You mean that i must schedule a task every x time to find where the enemy is or something? Thanks btw :)
  10. Ah, the arrow above the player's head?
  11. L2Infogate. 1k+ atoma ;) Iparxei akoma, alla einai freya kai legete L2HanGoveR. http://infogatel2.gr/home.html
  12. Radar refers to the map? I mean if i use this method will it add a marker in the player's map?
  13. Wrong place to ask for this, also there are many, just search.
  14. Good luck. But stop writing Like This. You don't need to add an uppercase letter at each word.
  15. Thanks ;) I'll start working on vampir's idea in a while..
  16. That's amazing. I'll definitely do it, thanks for the idea. It will take some time, because it's a bit complicated, but i think i can do it. Thanks again :)
  17. Hello everyone. An event i created some time ago(1-2 months). Every x minutes a question is poped and players have to answer it in trade(+) chat. First who answers correctly wins. /* * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * 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 General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */ package net.sf.l2j.gameserver.model.entity.events; import java.util.Map; import javolution.util.FastList; import javolution.util.FastMap; import net.sf.l2j.Config; import net.sf.l2j.gameserver.ThreadPoolManager; import net.sf.l2j.gameserver.datatables.ItemTable; import net.sf.l2j.gameserver.model.L2World; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.network.clientpackets.Say2; import net.sf.l2j.gameserver.network.serverpackets.CreatureSay; import net.sf.l2j.util.Rnd; /** * @author Anarchy * */ public class Quiz { private static FastList<String> availableQuestions = new FastList<String>(); private static String currentQuestion = null, lastQuestion = null; public static String currentAnswer = null; private static int currentRewardId = 0, currentRewardCount = 0; public static boolean generatedQuestion = false; public static void getInstance() { int time = getRandomTime(Config.QUIZ_EVENT_TIME[0], Config.QUIZ_EVENT_TIME[1]); ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable() { @Override public void run() { if (!generatedQuestion) { generateQuestion(); } } }, time*1000*60/2, time*1000*60); } public static void announceWinner(L2PcInstance p) { p.addItem("Quiz event winner.", currentRewardId, currentRewardCount, p, true); announce("Winner: "+p.getName()+" Answer: "+currentAnswer); lastQuestion = currentQuestion; currentQuestion = null; currentAnswer = null; currentRewardId = 0; currentRewardCount = 0; generatedQuestion = false; availableQuestions.clear(); } private static void generateQuestion() { currentQuestion = getRandomQuestion(); setReward(); announce(currentQuestion); announce("Reward: "+currentRewardCount+" "+ItemTable.getInstance().getTemplate(currentRewardId).getName()); announce("You have to answer in trade(+) chat."); announce("You have 5 minutes to answer."); generatedQuestion = true; ThreadPoolManager.getInstance().scheduleGeneral(new NoAnswerTask(), 5*1000*60); } private static class NoAnswerTask implements Runnable { @Override public void run() { if (!generatedQuestion) { return; } generatedQuestion = false; lastQuestion = currentQuestion; currentQuestion = null; currentAnswer = null; currentRewardId = 0; currentRewardCount = 0; availableQuestions.clear(); announce("There was no correct answer, so the question has been canceled."); } } private static void setReward() { Map<String, String> questionsKey = new FastMap<String, String>(); questionsKey.put(currentQuestion, currentAnswer); Map<Integer, Integer> questionsValue = Config.QUIZ_EVENT_QUESTIONS.get(questionsKey); for (int i : questionsValue.keySet()) { currentRewardId = i; currentRewardCount = questionsValue.get(i); } } private static String getRandomQuestion() { for (String s : Config.QUIZ_EVENT_QUESTIONS_KEYSET.keySet()) { if (s.equals(lastQuestion)) { continue; } availableQuestions.add(s); } int randomQuestionId = Rnd.get(availableQuestions.size()); String question = availableQuestions.get(randomQuestionId); currentAnswer = Config.QUIZ_EVENT_QUESTIONS_KEYSET.get(question); return question; } private static void announce(String msg) { CreatureSay cs = new CreatureSay(0, Say2.TRADE, "Quiz Event", msg); for (L2PcInstance p : L2World.getInstance().getAllPlayers().values()) { p.sendPacket(cs); } } private static int getRandomTime(int min, int max) { int time = Rnd.get(min, max); return time; } } Configs: # Quiz event. AllowQuizEvent = True # Quiz event time(in minutes) between questions. # Must be set like: min/max. # Time will be randomly chosen, for example if you put 5,15 it may be 7 or 9 or 13. QuizEventTime = 10,20 # Quiz event questions. # Must be set like: question,answer,rewardid,rewardcount;question,answer,rewardid,rewardcount; QuizEventQuestions = Who created this event?,Anarchy,3470,5;What is the name of this server?,L2Server,57,100000000; public static boolean ALLOW_QUIZ_EVENT; public static int[] QUIZ_EVENT_TIME = new int[2]; public static Map<Map<String, String>, Map<Integer, Integer>> QUIZ_EVENT_QUESTIONS = new FastMap<Map<String, String>, Map<Integer, Integer>>(); public static Map<String, String> QUIZ_EVENT_QUESTIONS_KEYSET = new FastMap<String, String>(); // Hidden variable. ALLOW_QUIZ_EVENT = Boolean.parseBoolean(elcardia.getProperty("AllowQuizEvent", "false")); String quiz_event_time = elcardia.getProperty("QuizEventTime", "10,20"); QUIZ_EVENT_TIME[0] = Integer.parseInt(quiz_event_time.split(",")[0]); QUIZ_EVENT_TIME[1] = Integer.parseInt(quiz_event_time.split(",")[1]); String quiz_event_questions = elcardia.getProperty("QuizEventQuestions"," Who created this event?,Anarchy,3470,5;What is the name of this server?,L2Server,57,100000000;"); String[] quiz_event_questions_splitted_1 = quiz_event_questions.split(";"); for (String s : quiz_event_questions_splitted_1) { String[] quiz_event_questions_splitted_2 = s.split(","); Map<String, String> string_map = new FastMap<String, String>(); string_map.put(quiz_event_questions_splitted_2[0], quiz_event_questions_splitted_2[1]); Map<Integer, Integer> int_map = new FastMap<Integer, Integer>(); int_map.put(Integer.parseInt(quiz_event_questions_splitted_2[2]), Integer.parseInt(quiz_event_questions_splitted_2[3])); QUIZ_EVENT_QUESTIONS.put(string_map, int_map); QUIZ_EVENT_QUESTIONS_KEYSET.put(quiz_event_questions_splitted_2[0], quiz_event_questions_splitted_2[1]); } GameServer.java if (Config.ALLOW_QUIZ_EVENT) { Quiz.getInstance(); } I know it's created before and shared too, but this one is coded in another way(configs) and created from scratch by me. Have fun.
  18. I'll check it :) Thanks again. P.S. Unfortunately there aren't packets for setting mark on map :/ (at least on il).
  19. This sounds more like an event or something.. Didn't get that one, attack point like a mark or something? And what exactly is respawn point? I think i'll do these ones, a bit modified. Thank you :)
  20. More real gameplay? Bah! I saw L2NewClassic.
  21. Simply because there are not such files that you can buy. Especially with 65 euro.
×
×
  • Create New...