Jump to content

Escordia

Legendary Member
  • Posts

    3,514
  • Credits

  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Everything posted by Escordia

  1. i dont like the outcome :/ dont use so much the pattern tool :P specially on the render ok? :P render is a bit boring cause lack of action... usually the c4ds must give at the render one action and flow... dont use them away from the render... and white bg is not so cool seems too empty if u know what i mean... try next time to place the C4D over and under the render it will be more cool... and less pattern xD
  2. I LOVE HERRRRRRR SHE IS SO CUTEEEEEEEEE awwwww i cant resist awwwwwww
  3. clan leader??? you mean party leader?
  4. Hello people! I know that Ass4s1n has already made a guide for Task Managers, but I want to explain it even more because at his share there were complains.. So allow me to show you! I will make a simple code and explain every step. You can skip that Step. We always start with the GNU License (No reason actually, but its cool xD). /* * 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/>. */ Now lets define the package. As we are working on Tasks, the package has to be this: package com.l2jserver.gameserver.taskmanager.tasks; If you're using Interlude or other projects than L2JServer, you just need to fic those: com.l2jserver with net.sf.l2j Etcetera.. Now we have two options: 1) We can first add the imports that we will use, if we are sure about what we will make 2) We can start writing the code and leave the imports for later, to be added as quickfixes. I personally prefer to start writing the code immediately, so in case I need to add something extra, I will not have to worry! The only imports that you will need for sure are those: import com.l2jserver.gameserver.taskmanager.Task; import com.l2jserver.gameserver.taskmanager.TaskManager; import com.l2jserver.gameserver.taskmanager.TaskTypes; import com.l2jserver.gameserver.taskmanager.TaskManager.ExecutedTask; Let's continue. You can skip that Step. Now let's add the author's name (your name if you are the creator) just to be respected by the ones that will use the code, or simply to keep your credits. So, we will make something like: /** * * @author YourNameHere */ In my case, for example, it will be like: /** * * @author SoFaKi */ OK, now we will start with the main thingy! The code. Let's start as we always start: public class TaskNameHere extends Task { It's a public class (you have to replace the TaskNameHere with you class's name) which extends the Task class. Now let's talk about the Logger, since we may need it for catching exceptions below (we will :D). So write something like private static final Logger _log = Logger.getLogger(TaskNameHere.class.getName()); But now, you will have to import it either manually, or by the quickfix. So the import you have to add below is that: import java.util.logging.Logger; NOTE! L2JServer is using the random java logger, however other projects like L2jFree have advanced their commons one, so it will be kinda different at its use. Don't worry, the difference is not big!! OK, after this we will need to add one more code: public static final String NAME = "your_string"; This string defines something like.. The use of the code. For example, at the TaskSevenSignsUpdate.java class, that String is this: public static final String NAME = "seven_signs_update"; I hope you can understand everything until now :) Let's continue now, by setting the name. What do I mean? Check out: /** * * @see com.l2jserver.gameserver.taskmanager.Task#getName() */ @Override public String getName() { return NAME; } Here, we see the Task class (where we will register that task later) and return THIS task's name. The NAME is the one we defined above as a string (public static final String NAME = "your_string";). Add this, as the next step: /** * * @see com.l2jserver.gameserver.taskmanager.Task#onTimeElapsed(com.l2jserver.gameserver.taskmanager.TaskManager.ExecutedTask) */ @Override public void onTimeElapsed(ExecutedTask task) { try { //your action } catch (Exception e) { _log.warning("Error X : " + e); } } Here is the MAIN part, imo. At this part, we define which will be the use of the task - important, don't you agree? The public void "onTimeElapsed" defines the use of the code, after the proper time (we will set it below) has passed, and it's time to use the code. And in this, we set the use. The use of the task is at the "try". Here you will set your own stuff. And I have set it to catch an exception, in case something goes wrong.. Note that you can make it normally, without setting any tries, or so, but it depends on what you want to do. For example, the TaskOlympiadSave class, is setting the task's use like that: if (Olympiad.getInstance().inCompPeriod()) { Olympiad.getInstance().saveOlympiadStatus(); _log.info("Olympiad System: Data updated."); } I suppose you can understand me. And we are almost done. Now, we must define how much time will be needed to execute the task. We will define it in this way: /** * * @see com.l2jserver.gameserver.taskmanager.Task#initializate() */ @Override public void initializate() { super.initializate(); TaskManager.addUniqueTask(NAME, TaskTypes.TYPE_FIXED_SHEDULED, "60000", "60000", ""); } As you can see, we use the NAME (we set it above) and the TaskType set as sheduled task. Take care of the time though: Those numbers aren't minutes, but miliseconds! What does that mean? For example, 1 minute is 60000 miliseconds! So be careful: Don't use too small values but also don't use too high ones! First calculate them! And this is how we end the class! Our task is now ready (considering that you have set a use for the task)! Let's see how did the code become: /* * 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 com.l2jserver.gameserver.taskmanager.tasks; import java.util.logging.Logger; import com.l2jserver.gameserver.taskmanager.Task; import com.l2jserver.gameserver.taskmanager.TaskManager; import com.l2jserver.gameserver.taskmanager.TaskTypes; import com.l2jserver.gameserver.taskmanager.TaskManager.ExecutedTask; /** * * @author YourNameHere */ public class TaskNameHere extends Task { private static final Logger _log = Logger.getLogger(TaskNameHere.class.getName()); public static final String NAME = "your_string"; /** * * @see com.l2jserver.gameserver.taskmanager.Task#getName() */ @Override public String getName() { return NAME; } /** * * @see com.l2jserver.gameserver.taskmanager.Task#onTimeElapsed(com.l2jserver.gameserver.taskmanager.TaskManager.ExecutedTask) */ @Override public void onTimeElapsed(ExecutedTask task) { try { //your action } catch (Exception e) { _log.warning("Error X : " + e); } } /** * * @see com.l2jserver.gameserver.taskmanager.Task#initializate() */ @Override public void initializate() { super.initializate(); TaskManager.addUniqueTask(NAME, TaskTypes.TYPE_FIXED_SHEDULED, "60000", "60000", ""); } } Yes, this is the code :) Now, let's finish by registering the task. If you have previously worked with Handlers, you may understand what we are going to talk about. Let's go to the file TaskManager.java to set the task which will be initializated. Let me explain just a few things about the TaskManager class, before continuing. In this class, the tasks are getting imported into the global_tasks sql file, to be executed from there properly. It is auto, that's why you don't have to touch anything. This is the main use and that's why it's called "Manager". Anyway, let's now find that line: private void initializate() Below, you just have to set the task to be initializated. So, under that: registerTask(new TaskShutdown()); Add that line: registerTask(new TaskNameHere()); Don't forget to import your task's class!! And ofc don't forget to replace the "TaskNameHere" with your class's name. That's all with the guide!! I explained it as well as I good, so that newbies can understand it! I know that I didn't give a professional explanation, since I am not a professional, but I hope that people can understand it :) Let me give you the class of a Task that I made, just to give a nice example. /* * 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 com.l2jserver.gameserver.taskmanager.tasks; import java.util.logging.Logger; import com.l2jserver.Config; import com.l2jserver.gameserver.Announcements; import com.l2jserver.gameserver.model.L2World; import com.l2jserver.gameserver.taskmanager.Task; import com.l2jserver.gameserver.taskmanager.TaskManager; import com.l2jserver.gameserver.taskmanager.TaskTypes; import com.l2jserver.gameserver.taskmanager.TaskManager.ExecutedTask; /** * * @author Sofia */ public class TaskFactionOnline extends Task { private static final Logger _log = Logger.getLogger(TaskFactionOnline.class.getName()); public static final String NAME = "your_string"; /** * * @see com.l2jserver.gameserver.taskmanager.Task#getName() */ @Override public String getName() { return NAME; } /** * * @see com.l2jserver.gameserver.taskmanager.Task#onTimeElapsed(com.l2jserver.gameserver.taskmanager.TaskManager.ExecutedTask) */ @Override public void onTimeElapsed(ExecutedTask task) { try { Announcements.getInstance().announceToAll(Config.FACTION_TEAM1_NAME + " " + L2World.getInstance().getAllTeam1PlayersCount() + " || " + Config.FACTION_TEAM2_NAME + " " + L2World.getInstance().getAllTeam2PlayersCount() + " || " + Config.FACTION_TEAM3_NAME + " " + L2World.getInstance().getAllTeam3PlayersCount()); } catch (Exception e) { _log.warning("Faction Engine: There was an error while trying to execute the TaskFactionOnline Task. Please fix it! " + e); } } /** * * @see com.l2jserver.gameserver.taskmanager.Task#initializate() */ @Override public void initializate() { super.initializate(); TaskManager.addUniqueTask(NAME, TaskTypes.TYPE_FIXED_SHEDULED, "60000", "60000", ""); } } What we see here? This is a code related to this Faction Engine!! What happens? Well, an announcement appears every time the task is executed, which shows the online ammount of Neutral, Devs and Cheaters Factions! And ofc it needs a registeration, as every task. Note that here we used extra imports, because of the different use! To be more exact: import com.l2jserver.Config; import com.l2jserver.gameserver.Announcements; import com.l2jserver.gameserver.model.L2World; That's all ppl! Thanks for reading my guide!! See you soon!! Credits: SoFaKi aka Kokkinoula Thanks to Ass4s1n for the inspiration!!
  5. none taken :P its ok :P well i am not 13 :) i am 18 xD and i have full adult rights ;) hmmm @GrisoM stop the shitty edit xD @raule maybe i will have one t-shirt like this soon :P @project ofc i will not add ur name on my hands :P @Ghost Of Sparta you the heck are u? XD
  6. http://www.4shared.com/file/f9Ar7-iR/Sexy_Dress.html re-uploaded and link replaced
  7. Aden's texture file is wrong or corrupted.... try to replace it with one patch from a srv :)
  8. you cant make jokes with that :/ some ppl borned greek for sure :/ how she let the babe untied in the middle of the street lol
  9. One mother let the babe untied from the babechair or whats the name... the babe fall off from this and went into the road.... then a bus came and guess what happened :/ 5 months girl :/
  10. i am 18 omg :S for Greeks: did u heart about the 5month old lil girl? :( i still cant realize how this happened :(
  11. karma or promo request for more.... if someone send me more than 4k adena with theme Spamtopic > Pics i will add +2 everytime :o i am not kiddin
  12. Lets start: you have 666 messages, 0 are new. Total time logged in: 27 days, 17 hours and 56 minutes.
  13. [gr] oute to Cinema 4d einai gia signature!!! gia 3D models einai!!
  14. [gr] to after effects den einai gia signatures xD einai gia Movies :P 2 atoma 3eroun edw mesa to after effects :P kai einai CS movie makers :o [/gr]
  15. WTF??????? this code dont EDIT video.... it makes this EFFECT in game!!!!!! then you record with fraps and edit it at sony vegas... lol man
×
×
  • Create New...