Jump to content

Kara

Banned
  • Posts

    2,100
  • Credits

  • Joined

  • Last visited

  • Days Won

    46
  • Feedback

    100%

Community Answers

  1. Kara's post in Help for MAX_IP code noting heppen was marked as the answer   
    What exactly are you trying to do? Set max online users on the server?
    If that's what you want to do using login system to block access such edit the file
     
    RequestServerLogin.java  
    and in 
     
    public void run()  
    Before send the:
     
    getClient().setJoinedGS(true); getClient().sendPacket(new PlayOk(sk));  
    You can add a check or you can do the same thing easier using
     
    EnterWorld.java  
    and add a simple check to kick player if for example
     
    if (L2World.getInstance().getPlayersSize() > 100) { activeChar.logout(false); }  
  2. Kara's post in Allow dyes for all classes? was marked as the answer   
    RequestHennaEquip.java
  3. Kara's post in Wear (ShopPreviewList) at Community Board - HELP was marked as the answer   
    First of all you have to dig the messages in console to understand which java file has the "problem". An example can be the following:
     
    Search for L2Buylist in your project and you locate what files are using this class. 
    For example in RequestBuyItem.java you can find the following check:
     
    if (!player.isGM()) { if (!(target instanceof L2MerchantInstance) || !player.isInsideRadius(target, INTERACTION_DISTANCE, true, false) || player.getInstanceId() != target.getInstanceId()) { sendPacket(ActionFailed.STATIC_PACKET); return; } merchant = (L2Character) target; }  
    This can stop your code since there is no merchant around you to buy item. It might have more checks
    (Consider these are from L2JServer, i don't bother work or check amateur trash packs such as Mythras, Scripts e.t.c.)
     
    PS. You can also join my discord's community. It's mostly for clients but i have also people from MAXC.
     
     
    Check in my topic you will find the invitation link
  4. Kara's post in Need help l2jacis, I will be grateful! was marked as the answer   
    flip() method which is missing, is introduced in JDK-8. This mean your project is not using JDK-8 version. Remove completely any installed java you have on your machine and install JDK-8. 
     
    Also make sure to edit all project properties to show JDK-8 including edit the build.xml and eclipse's settings. 
  5. Kara's post in Specific respawn time was marked as the answer   
    Χρειαζεται java modification, καποιο Calendar που κανει generate στατικο date πχ Sunday 20:00 και το περναει στο variable των raid καθε φορα που πεθαινουν. 
     
  6. Kara's post in nonamenpc was marked as the answer   
    NPC name can be displayed by system or server depend on the xml configuration you've set. 
    In case it's from system it's because npcname-e.dat has some corrupted data.
     
    Ex. if you have duplicated ID's it stop reading from that moment and on so every item or npc will display noNameItem or noNameNpc.
     
    Replace this file with a retail one and check again. 
  7. Kara's post in Community Top: Pk/PvP was marked as the answer   
    Ouch ! 

     
    The code you've given is like... Java had a head on collision on Autobahn while a meteor in size of earth fall on it at the same time. Let's just mention few of the "abnormalities".
     
    1.
    if (command.startsWith("toppk")) This part is not required because you have only 1 String inside the array hence the only time this method is called only when a voice command matches the given String
    2. Why the if check exists anyway? It doesn't do anything. Remove it completely
    3.
    player.getPkkills(); Why this code exists? It does nothing. It won't pass the player's kill in any variable.
    4. Why you initialize a list while it does nothing?
    5. Why the title of Pk kill is replaced dynamic though the code while html is clearly only for Pk list?
    6. What is the "pl" variable that you try to fetch data from? It doesn't exist in the code.
    7. Why it has return false and then return true?
    8.
    { CommunityBoardHandler.seperateAndSend... } Why is this line inside two brackets? 
    9. Why you open a request topic and your code is an image instead of pastebin or something?
    10. Why you initialize a String and load html from cache and replace while you don't use it or send it to player?
     
    I'm really confused.
  8. Kara's post in PET MANAGER was marked as the answer   
    What you mean "adapt". You need a functionality to be done in a different chronicle. Simply code it. 
    There is no limit in java code regarding chronicle. If you want your pet manager to exchange a Strider to Red Strider then simply make it using a bypass. Create a new bypass in the NPC's class and do your work.
     
  9. Kara's post in Monsters HP multiplier (*2 *4 *5...) was marked as the answer   
    If the base HP stat is in sql simply make a query which multiply the value of their stat. 
    Here i made you an example query:
     
    UPDATE items SET items.count = items.count * 10 WHERE items.owner_id = '268481377' AND items.object_id = '268481516';  
    Basically what i do here is that i multiply and update the count by 10.
    You can use that in your database without WHERE (if you don't want specific checks)
     
    Now if your npc information is in XML you can search how to replace using patterns in Notepad++ to read the base HP info and multiply it in all templates
     
     
  10. Kara's post in Is that a DDos attack error. or? What... was marked as the answer   
    How come someone have your IP while you haven't share it. Could be backdoor in a project you probably bough i guess? Else there is no other explanation unless NPC crawlers came for your server
     
  11. Kara's post in Grand boss quest was marked as the answer   
    I had the same thing with my ex. Whenever i asked her to make out she said you're either not carrying the quest item or you don't meet the criteria.
     
    Overall you need to check if your script is loaded cause this look like NPC is not binded to any script or GrandBossTeleporters.java is not loaded at all.
  12. Kara's post in i need little bit of help was marked as the answer   
    First of all when you compare level use Math.abs() to avoid negative values such as:
     
    if (Math.abs(actor.getLevel() - target.getLevel()) > Config.PROTECTION_DIFFERENCE_LEVEL) { //Executed code }  
    Second, i don't really get failed to do. Why don't you simply interrupt any attack/spell in L2Playable.java -> onIntentionCast() and onIntentionAttack() and you make it that way?
  13. Kara's post in a little help with ArrayList and Map was marked as the answer   
    You basically ask me to describe/code you a whole system. 
     
    Before you code something you need to think of a hierarchy, means how your code will look like.
    Ex. each guard belong to a flag and maybe flags belong to a bases. So guards are children of flags and flags are children of bases. 
     
    So we start from the top to the bottom, we move from the parents to the children.
     
    Let's say we have a Flag class, we want upon spawn to spawn guards around it and upon delete or capture to delete guards. So basically this flag will own a List with the spawned guards.
     
    So you create a ArrayList inside the flag that accepts guards as objects. 
    Each instance has overriden methods such as onDie(), onSpawn(), deleteMe() e.t.c. 
    In these events you must handle the guards.
     
    Example:
     
    @Override public void onSpawn() { super.onSpawn(); }  
    Here you should spawn and add to the list all your guards. 
    I guess you know how to manage a spawn of an NPC.
     
    After you do that you have a list full of guard objects that belong to this flag. 
    Now you can manage onDie() method. Same way in there you do a for in your guard list to delete all guards, they will respawn again once the flag is spawned cause the onSpawn() will be called.
     
    You should really do some tests and some practice before make such systems. 
    You need learn over super and overriden methods, difference between map and a list, thread safety e.t.c. 
     
     
     
     
  14. Kara's post in Premium problem time. was marked as the answer   
    Either you learn to code your self or request help for fix something. What you do here is requesting a mod to avoid pay, do not complain.
     
    Regardless about your request you need to do a database check upon login in EnterWorld.java or in method located in Player.java called onPlayerEnter()
     
    Your code should look like this:
     
    try (Connection con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement ps = con.prepareStatement("SELECT premium_time FROM accounts WHERE login=?")) { ps.setString(1, name); try (final ResultSet rset = ps.executeQuery()) { if (rset.next()) { final long premiumTime = rset.getLong(1); } } } catch (final Exception ex) { Logger.getLogger().log(Level.WARNING, "Failed to retrieve premium info for player: " + this, ex); }  
    After you retrieve the premiumTime which gonna be a long type value that include System.currentMillisecond + the duration of the premium, you can do your check.
     
    Also you need to move the premiumTime from Characters table to the Accounts and remove any relative code that read it from Characters table.
     
     
  15. Kara's post in increase adena limit was marked as the answer   
    Your problem is not to change INT to LONG to support higher rate. Your problem is if client support a long value.
  16. Kara's post in Where i find this?! was marked as the answer   
    Search ExHeroList something in server packets
  17. Kara's post in Raidboss Status Community was marked as the answer   
    First of all drop this 
     
    //@formatter:off int[] BOSSES = { 29001, // Queen Ant 29006, // Core 29014, // Orfen 29068, // Antharas 29020, // Baium //29022, // Zaken 29028, // Valakas 29118 // Beleth }; //@formatter:on  
    and make it outside the method as a static field and convert it to 
     
    Java 7
     
    private static final List<Integer> BOSSES = Arrays.asList(1, 2, 3);  
    Java 11+
     
    private static final List<Integer> BOSSES = List.of(1, 2, 3);  
    Now regarding your problem, this:
     
    replyMSG.append("</center></body></html>");  
    shouldn't exist in for cause it terminate the html. It should be outside for. Basic html structure. 
  18. Kara's post in Community command error was marked as the answer   
    Hi. There are million ways to solve this including streams or fix the getClass() method and send only player.getSubClasses() but the easiest way to do that is by doing a check before that if player has any subclass then do what you do else replace with "-" 
     
    So kinda like this:
     
    returnHtml = returnHtml.replace("%subclass%", player.getSubClasses().size() > 0 ? ClassListData.getInstance().getClass(player.getSubClasses().get(1).getClassId()).getClientCode() : "-");  
     
  19. Kara's post in offline mode l2jfrozen 1132 was marked as the answer   
    Which means that your code doesn't update setOnlineStatus(false, false); 
    So what you gonna do is to search in i guess L2GameClient judging by L2JServer, where your code is checking whether a player is going into store mode, to set him offline status. 
     
  20. Kara's post in missing files in my tool directory was marked as the answer   
    Hello little. Go to your desktop and create a folder. Create a .bat file inside and paste this code
    type *.sql > procedure.sql  
    Now copy all your SQL files in the same directory and double click on .bat file you've just created. 
    All your SQL files are now merged into a single procedure.sql file. 
     
    You can simply execute this single SQL file and you're happy. 
  21. Kara's post in What to add was marked as the answer   
    There are 2 ways to proceed. 
     
    Either you create a new condition which you gonna do it your self after spend few times in some skills that has conditions such as SEX, RACE, MOUNT e.t.c, or you gonna create a new
     
    <set name="olympiadRestricted" val="true" />   
    then go inside Skill.java where it parse the structure (you can search for ex. hpConsume to see how it's done), create a new boolean read it as
     
    public boolean isOlympiadRestricted() { return _olympiadRestricted; }  
    and then you have to find the method that does casting check (in L2J  is the following in L2PcInstance.java)
     
    public boolean checkDoCastConditions  
    and add your own check, for example
     
    if (activeChar.isInOlympiad() && skill.isOlympiadRestricted()) { return false; }  
  22. Kara's post in Loginserver error was marked as the answer   
    Check your LoginServerThread.java
  23. Kara's post in [L2jServerH5] Chat question mark handle was marked as the answer   
    I'm not sure if this event is handled by server at least in lower chronicles such as HighFive, but you can find the L2GameClientPacket and log this way:
     
    try { System.out.println("Packet: " + getClass().getSimpleName()); readImpl(); return true; }  
    Upon click it will show you if it handled by server or not in console.
  24. Kara's post in Raidboss earthquake was marked as the answer   
    The next comment will be a video with animations explaining how 2 variables work. 
    And the very next will be FBI consider him as a terrorism action.
  25. Kara's post in NullPointer AITask.java L2JRoboto was marked as the answer   
    If i'm correct regarding line the 29 is the:
    if (!p.getFakeAi().isBusyThinking()) The object P cannot be null (unless modified intentionaly). The null here is the getFakeAI(),
    check that method.
     
    Also from what i see u removed the lambda expression which mean you use shitty java 7. Pointless. You can download java 8 at least, add it on eclipse update libs and done
×
×
  • Create New...