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

here is l2pcinstance that i searched with ctr + h..

 

_log.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);

}

finally

{

L2DatabaseFactory.close(con);

}

}

 

/**

* Retrieve from the database all skill effects of this L2PcInstance and add them to the player.

*/

@Override

public void restoreEffects()

{

Connection con = null;

 

try

{

con = L2DatabaseFactory.getInstance().getConnection();

PreparedStatement statement;

ResultSet rset;

 

statement = con.prepareStatement(RESTORE_SKILL_SAVE);

statement.setInt(1, getObjectId());

statement.setInt(2, getClassIndex());

rset = statement.executeQuery();

 

while (rset.next())

{

int effectCount = rset.getInt("effect_count");

int effectCurTime = rset.getInt("effect_cur_time");

long reuseDelay = rset.getLong("reuse_delay");

long systime = rset.getLong("systime");

int restoreType = rset.getInt("restore_type");

 

final L2Skill skill = SkillTable.getInstance().getInfo(rset.getInt("skill_id"), rset.getInt("skill_level"));

if (skill == null)

continue;

 

final long remainingTime = systime - System.currentTimeMillis();

if (remainingTime > 10)

{

disableSkill(skill, remainingTime);

addTimeStamp(skill, reuseDelay, systime);

}

 

/**

*  Restore Type 1

*  The remaning skills lost effect upon logout but

*  were still under a high reuse delay.

*/

if (restoreType > 0)

continue;

 

/**

*  Restore Type 0

*  These skill were still in effect on the character

*  upon logout. Some of which were self casted and

*  might still have had a long reuse delay which also

*  is restored.

*

*/

if (skill.hasEffects())

{

Env env = new Env();

env.player = this;

env.target = this;

env.skill = skill;

L2Effect ef;

for (EffectTemplate et : skill.getEffectTemplates())

{

ef = et.getEffect(env);

if (ef != null)

{

ef.setCount(effectCount);

ef.setFirstTime(effectCurTime);

ef.scheduleEffect();

}

}

}

}

 

rset.close();

statement.close();

 

statement = con.prepareStatement(DELETE_SKILL_SAVE);

statement.setInt(1, getObjectId());

statement.setInt(2, getClassIndex());

statement.executeUpdate();

statement.close();

}

catch (Exception e)

{

_log.log(Level.WARNING, "Could not restore "+this+" active effect data: " + e.getMessage(), e);

}

finally

{

L2DatabaseFactory.close(con);

}

}

Guest
This topic is now closed to further replies.


  • Posts

    • Παίρνουμε μια δόση ντοπαμίνης και ξανά γυρνάμε στις ρουτίνες μας!
    • Σαγαπω απλά έκλαψα !🤣🤣
    • https://t.me/l2fungame   You can find updates on our project in our Telegram channel.  
    • L2 Pearl — Fresh Interlude Lineage 2 Server L2 Pearl is a fresh Interlude Lineage 2 server focused on fair progression, competitive PvP and long-term gameplay. Every player starts from zero, with a clean economy, balanced progression and a strong focus on active community and clan gameplay. Server Timeline Account Creation: 29 September 2026 Open Beta: 2 October 2026 Grand Opening: 9 October 2026 First Seal Validation: 23 October 2026 First Mammon Appearance: 23 October 2026 First Olympiad Match: 23 October 2026 Mammon A-Grade Services: 24–25 October 2026 First Castle Siege: 25 October 2026 Open Beta progress will be wiped before the official launch. Main Features Interlude Chronicle with Classic GUI XP / SP x5 Adena x3 General Drop x2 Spoil x3 Key Materials and Recipes x2 Quest Item Drop x2 Maximum Level 80 Up to 3 Subclasses Offline Shops Full Geodata with Pathnodes Events available from Level 20 One box per PC Two boxes with VIP .menu System The .menu command gives players quick access to useful quality-of-life features: Block unwanted buffs Block system messages Delevel your character Set up and manage an offline shop Enable automatic HP potions Enable automatic CP potions Configure personal gameplay preferences The system is designed to make everyday gameplay easier while keeping the classic Interlude experience intact. Events and Rewards Events are available from Level 20 and include: Team vs Team Capture the Flag Deathmatch Special Live Events Players will receive full buffs during events, allowing everyone to focus on teamwork and PvP. By participating in events, players can earn Glittering Medals and exchange them for event-related rewards. Rates and Economy XP / SP: x5 Adena: x3 General Drop: x2 Spoil: x3 Key Materials and Recipes: x2 Quest Item Drop: x2 Equipment: x1 Quest Rewards: x1 Raid and Epic Drops: x1 Equipment and major rewards remain at x1 to preserve their value and keep farming, crafting, trading and party play meaningful. Enchant and Progression Safe Enchant: +3 Maximum Weapon Enchant: +16 Maximum Armor Enchant: +10 Normal Scroll Success Rate: 55% Blessed Scroll Success Rate: 65% 1st and 2nd Class Changes: Free 3rd Class Change: Quest or donation Nobless: Quest or donation Barakiel required for the Nobless quest PvP and Endgame Content Olympiad Seven Signs Mammon Services Castle Sieges Weekly Sieges Team vs Team Capture the Flag Deathmatch Special Live Events Fair Play No Pay-to-Win shop Dedicated anti-cheat protection Active GM support Clean economy from launch Progression based on effort, teamwork and skill L2 Pearl is built for players who want a fresh start, meaningful progression and a competitive environment where clans and individuals can build their own reputation. Create your account from 29 September, invite your friends and prepare your clan. The gates of L2 Pearl open on 9 October 2026.   Website: www.l2pearl.com
  • 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..