Jump to content
  • 0

L2j Problem with L2PCInstance


Question

Posted

i have one problem with l2j gameserver (instances. L2PCinstance) when every player log in game lose all skills active and passive..

 

this is the file (i just added a part of the problem)

 

// Remove a skill from the L2Character and its Func objects from calculator set of the L2Character
        final L2Skill oldSkill = super.removeSkill(skill);
        if (oldSkill != null)
        {
            Connection con = null;
            try
            {
                // Remove or update a L2PcInstance skill from the character_skills table of the database
                con = L2DatabaseFactory.getInstance().getConnection();
                PreparedStatement statement = con.prepareStatement(DELETE_SKILL_FROM_CHAR);
                
                statement.setInt(1, oldSkill.getId());
                statement.setInt(2, getObjectId());
                statement.setInt(3, getClassIndex());
                statement.execute();
                statement.close();
            }
            catch (Exception e)
            {
                _log.log(Level.WARNING, "Error could not delete skill: " + e.getMessage(), e);
            }
            finally
            {
                L2DatabaseFactory.close(con);
            }
        }
        
        if (transformId() > 0 || isCursedWeaponEquipped())
            return oldSkill;
        
        final L2ShortCut[] allShortCuts = getAllShortCuts();
        for (L2ShortCut sc : allShortCuts)
        {
            if ((sc != null) && (skill != null) && (sc.getId() == skill.getId()) && (sc.getType() == L2ShortCut.TYPE_SKILL)
                && !(skill.getId() >= 3080 && skill.getId() <= 3259)) // FIXME: Rough fix for shortcuts of augments getting removed. Find a better way
                deleteShortCut(sc.getSlot(), sc.getPage());
        }
        return oldSkill;
    }
    

 

Here my gameserver errors when i log in - ingame problem:

 

1)l2servproblem1.png

 

2)l2servproblem2.png

 

i hope i gave all the infos to have a respone.. if i am not right reply me what other to upload ... any answer is weclome.

Recommended Posts

  • 0
Posted

i have one problem with l2j gameserver (instances. L2PCinstance) when every player log in game lose all skills active and passive..

 

this is the file (i just added a part of the problem)

 

// Remove a skill from the L2Character and its Func objects from calculator set of the L2Character
        final L2Skill oldSkill = super.removeSkill(skill);
        if (oldSkill != null)
        {
            Connection con = null;
            try
            {
                // Remove or update a L2PcInstance skill from the character_skills table of the database
                con = L2DatabaseFactory.getInstance().getConnection();
                PreparedStatement statement = con.prepareStatement(DELETE_SKILL_FROM_CHAR);
                
                statement.setInt(1, oldSkill.getId());
                statement.setInt(2, getObjectId());
                statement.setInt(3, getClassIndex());
                statement.execute();
                statement.close();
            }
            catch (Exception e)
            {
                _log.log(Level.WARNING, "Error could not delete skill: " + e.getMessage(), e);
            }
            finally
            {
                L2DatabaseFactory.close(con);
            }
        }
        
        if (transformId() > 0 || isCursedWeaponEquipped())
            return oldSkill;
        
        final L2ShortCut[] allShortCuts = getAllShortCuts();
        for (L2ShortCut sc : allShortCuts)
        {
            if ((sc != null) && (skill != null) && (sc.getId() == skill.getId()) && (sc.getType() == L2ShortCut.TYPE_SKILL)
                && !(skill.getId() >= 3080 && skill.getId() <= 3259)) // FIXME: Rough fix for shortcuts of augments getting removed. Find a better way
                deleteShortCut(sc.getSlot(), sc.getPage());
        }
        return oldSkill;
    }
    

 

Here my gameserver errors when i log in - ingame problem:

 

1)l2servproblem1.png

 

2)l2servproblem2.png

 

i hope i gave all the infos to have a respone.. if i am not right reply me what other to upload ... any answer is weclome.

  • 0
Posted

i have one problem with l2j gameserver (instances. L2PCinstance) when every player log in game lose all skills active and passive..

 

this is the file (i just added a part of the problem)

 

// Remove a skill from the L2Character and its Func objects from calculator set of the L2Character
        final L2Skill oldSkill = super.removeSkill(skill);
        if (oldSkill != null)
        {
            Connection con = null;
            try
            {
                // Remove or update a L2PcInstance skill from the character_skills table of the database
                con = L2DatabaseFactory.getInstance().getConnection();
                PreparedStatement statement = con.prepareStatement(DELETE_SKILL_FROM_CHAR);
                
                statement.setInt(1, oldSkill.getId());
                statement.setInt(2, getObjectId());
                statement.setInt(3, getClassIndex());
                statement.execute();
                statement.close();
            }
            catch (Exception e)
            {
                _log.log(Level.WARNING, "Error could not delete skill: " + e.getMessage(), e);
            }
            finally
            {
                L2DatabaseFactory.close(con);
            }
        }
        
        if (transformId() > 0 || isCursedWeaponEquipped())
            return oldSkill;
        
        final L2ShortCut[] allShortCuts = getAllShortCuts();
        for (L2ShortCut sc : allShortCuts)
        {
            if ((sc != null) && (skill != null) && (sc.getId() == skill.getId()) && (sc.getType() == L2ShortCut.TYPE_SKILL)
                && !(skill.getId() >= 3080 && skill.getId() <= 3259)) // FIXME: Rough fix for shortcuts of augments getting removed. Find a better way
                deleteShortCut(sc.getSlot(), sc.getPage());
        }
        return oldSkill;
    }
    

 

Here my gameserver errors when i log in - ingame problem:

 

1)l2servproblem1.png

 

2)l2servproblem2.png

 

i hope i gave all the infos to have a respone.. if i am not right reply me what other to upload ... any answer is weclome.

  • 0
Posted

The error is pretty self-explanatory, you have an NPE. First things first: add an NPE fix, and secondly, find out whats causing your NPE, you really just have to look at what you wrote to find it.

Secondly, this is not the area for questions.

  • 0
Posted

The error is pretty self-explanatory, you have an NPE. First things first: add an NPE fix, and secondly, find out whats causing your NPE, you really just have to look at what you wrote to find it.

Secondly, this is not the area for questions.

  • 0
Posted

The error is pretty self-explanatory, you have an NPE. First things first: add an NPE fix, and secondly, find out whats causing your NPE, you really just have to look at what you wrote to find it.

Secondly, this is not the area for questions.

  • 0
Posted

The error is pretty self-explanatory, you have an NPE. First things first: add an NPE fix, and secondly, find out whats causing your NPE, you really just have to look at what you wrote to find it.

Secondly, this is not the area for questions.

 

your answer is welcome anyway, but little missed.. explain me little better if is possible, maybe i am newbie :P also give me some infos about where i can add this kind of posts... thanks

  • 0
Posted

The error is pretty self-explanatory, you have an NPE. First things first: add an NPE fix, and secondly, find out whats causing your NPE, you really just have to look at what you wrote to find it.

Secondly, this is not the area for questions.

 

your answer is welcome anyway, but little missed.. explain me little better if is possible, maybe i am newbie :P also give me some infos about where i can add this kind of posts... thanks

  • 0
Posted

The error is pretty self-explanatory, you have an NPE. First things first: add an NPE fix, and secondly, find out whats causing your NPE, you really just have to look at what you wrote to find it.

Secondly, this is not the area for questions.

 

your answer is welcome anyway, but little missed.. explain me little better if is possible, maybe i am newbie :P also give me some infos about where i can add this kind of posts... thanks

  • 0
Posted

Somehow: it can't restore skills.

 

As you can't restore skills, it doesn't fill skills array.

As skills array isn't filled, skills array is still null and so when it goes deeper it finds nothing, so you got a NPE.

 

The problem isn't the NPE, it's why it can't restore skills.

 

PS : your empty skills window is normal, as array is null.

PS2 : I would check the method which restore skills. It got nothing with removeSkill() method. It's about character loading. Search with error description "could not restore character" using ctrl+H.

  • 0
Posted

Somehow: it can't restore skills.

 

As you can't restore skills, it doesn't fill skills array.

As skills array isn't filled, skills array is still null and so when it goes deeper it finds nothing, so you got a NPE.

 

The problem isn't the NPE, it's why it can't restore skills.

 

PS : your empty skills window is normal, as array is null.

PS2 : I would check the method which restore skills. It got nothing with removeSkill() method. It's about character loading. Search with error description "could not restore character" using ctrl+H.

  • 0
Posted

Somehow: it can't restore skills.

 

As you can't restore skills, it doesn't fill skills array.

As skills array isn't filled, skills array is still null and so when it goes deeper it finds nothing, so you got a NPE.

 

The problem isn't the NPE, it's why it can't restore skills.

 

PS : your empty skills window is normal, as array is null.

PS2 : I would check the method which restore skills. It got nothing with removeSkill() method. It's about character loading. Search with error description "could not restore character" using ctrl+H.

  • 0
Posted

Somehow: it can't restore skills.

 

As you can't restore skills, it doesn't fill skills array.

As skills array isn't filled, skills array is still null and so when it goes deeper it finds nothing, so you got a NPE.

 

 

 

The problem isn't the NPE, it's why it can't restore skills.

 

PS : your empty skills window is normal, as array is null.

PS2 : I would check the method which restore skills. It got nothing with removeSkill() method. It's about character loading. Search with error description "could not restore character" using ctrl+H.

 

 

Your answer seems good, can you tell me please which file to open to search for that?

  • 0
Posted

If I used yellow in previous answer, that was to avoid to repeat myself.

 

i asked you for wich file name i have to search... my name is thepwned yes my name is thepwned but that can't give you full sentence about who i am.... BTW if you're not borred to write me the file name i'll get it as intention.. Thanks.

  • 0
Posted

Search with error description "could not restore character" using ctrl+H.

 

If u dont know whch file is it, u can start with L2PcInstance.

Guest
This topic is now closed to further replies.


  • Posts

    • TG Support: https://t.me/buyingproxysup | Channel: https://t.me/buyingproxycom Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server!  Create your free account here
    • Dalam World — This is a new gaming project that brings together all the mechanics of your favorite games! I want to say right away that the game will run on all devices: Windows, Linux, macOS (Intel/Apple)! The Dalam World client features advanced graphics that will look great! The client also provides stable FPS even with a huge number of players! Dalam World is not a Salve or Chronicle client ported upward — it’s a completely remade game on its own proprietary game engine! Dalam World servers allow more than 100,000 people to exist in a single world without virtual instances, thanks to server technologies built with Elixir and Rust! Dalam World is the childhood game we love so much! From each of our favorite MMOs we took only the best elements! Low system requirements will let the game run on an old laptop! We redesigned the game so there are no bots or real-money traders! Game website: https://Dalam.World Game forum: https://Dalam.World/forums/ For arbitragers: https://careers.dalam.world/ Discord: https://discord.gg/vbQ347nuxd Telegram: https://t.me/+u1DNZPzscaRmNjYx Opening July 16, 2026 at 16:00 UTC!  
    • I'll give you my wallet if you want, haha
    • To make up for some of the waiting time we’re hosting a 3v3 Tournament on open Beta, and this time we’re raising the stakes with a $1,300 prize pool 💰   🏆 PRIZE POOL BREAKDOWN (Over 2000$ Worth of prices total)   🥇 1st Place — $700 🥈 2nd Place —$300 🥉 3rd Place — $200 🏅 4th Place — $100  5th -6th Place - $100 in Gold Coins each    All Participating Teams: $50 in Gold!   All Prices will be Paid out instantly after the tour, no waiting time and conditions. This is not simply a marketing move, we want to give back to the community.   📅 Date: Wednesday 06.05.2026 ⏰ Time: 20:00 Central European Timezone (Berlin) 📍Format: 3v3   ⚔️Why join? Cash Prices for top 4 and rewards for all participants Payments to winners sent out straight after the tournament - No waiting time or rules that you have to play live server to obtain the reward. Clean format, smooth matches, and solid prize pool and a chance to experience our brand new files   📝How to join: Form your 3-player team Group Leader Sign up here: ⁠📍・3v3-tour-registration (Include Name of Group, Name of Group Leader)   Be ready on match day!     A separate post with rules for the tournament and class setups will follow shortly.   Tag your teammates, lock in your roster, and get ready to compete. We'll be happy to see you on the OBT!   💬 Questions? Ask in ⁠🎫・ticket or send us a message   See you on L2Dark! 😏   Discord: https://discord.gg/FAJwnFpb8M
    • You should check if that condition is supported by your current sources. You can find this in  DocumentBase#parsePlayerCondition If it isnt there and you want to follow the same pattern of the other item conditions, create a custom condition to parse the classId (or multiple class ids) (there are examples to copy the code). Alternatively, you can create your own condition handler. Your condition should look like this: <cond msgId="1518"> <or> <player classId="ADVENTURER" /> <player classId="PALADIN" /> </or> </cond> or <cond msgId="1518"> <or> <player classId="93" /> <player classId="5" /> </or> </cond>  
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..