Jump to content
  • 0

Stuck After Attacking The Npc


Question

Posted

Hello,

 

I have problem, when attacking NPC (not mob) with skill for example gatekeeper in random zone, character gets stuck. You cant move, use skills, use /unstuck command or escape scrolls you have to reconnect. Pack is L2jAcis.

 

Please, help me to sort out this problem, thank you ;)

Recommended Posts

  • 0
Posted

You both suck :troll:

 

L2Playable is the correct place. About issue, probably missing action failed packet :D

  • 0
Posted

To know the best possible fix, we must know what have you edited before. But to block hitting npc the check should be made @ L2Playable.

  • 0
Posted

To know the best possible fix, we must know what have you edited before. But to block hitting npc the check should be made @ L2Playable.

 

 

a missing actionfailed packet doesnt lead to npe neither to such stucks, stucks from missing actionfailed are soft

  • 0
Posted

Could you please help me and tell me what to edit to disable casting skills on NPC.

public void callSkill(L2Skill skill, L2Object[] targets)
    {
        try
        {
            // Get the skill handler corresponding to the skill type (PDAM, MDAM, SWEEP...) started in gameserver
            ISkillHandler handler = SkillHandler.getInstance().getSkillHandler(skill.getSkillType());
            Weapon activeWeapon = getActiveWeaponItem();
            
            // Check if the toggle skill effects are already in progress on the L2Character
            if (skill.isToggle() && getFirstEffect(skill.getId()) != null)
                return;
            
            // Initial checks
            for (L2Object trg : targets)
            {
                if (trg instanceof L2Character)
                {
                    // Set some values inside target's instance for later use
                    L2Character target = (L2Character) trg;
                    
                    if (!Config.RAID_DISABLE_CURSE)
                    {
                        // Raidboss curse.
                        L2Character targetsAttackTarget = null;
                        
                        if (target.hasAI())
                            targetsAttackTarget = (L2Character) target.getAI().getTarget();
                        
                        if ((target.isRaid() && getLevel() > target.getLevel() + 8) || (!skill.isOffensive() && targetsAttackTarget != null && targetsAttackTarget.isRaid() && targetsAttackTarget.getAttackByList().contains(target) && getLevel() > targetsAttackTarget.getLevel() + 8))
                        {
                            L2Skill curse = FrequentSkill.RAID_CURSE.getSkill();
                            if (curse != null)
                            {
                                // Send visual and skill effects. Caster is the victim.
                                broadcastPacket(new MagicSkillUse(this, this, curse.getId(), curse.getLevel(), 300, 0));
                                curse.getEffects(this, this);
                            }
                            return;
                        }
                    }
                    
                    // Check if over-hit is possible
                    if (skill.isOverhit())
                    {
                        if (target instanceof L2Attackable)
                            ((L2Attackable) target).overhitEnabled(true);
                    }
                    
                    switch (skill.getSkillType())
                    {
                        case COMMON_CRAFT: // Crafting does not trigger any chance skills.
                        case DWARVEN_CRAFT:
                            break;
                        
                        default: // Launch weapon Special ability skill effect if available
                            if (activeWeapon != null && !target.isDead())
                            {
                                if (this instanceof L2PcInstance && !activeWeapon.getSkillEffects(this, target, skill).isEmpty())
                                    sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_BEEN_ACTIVATED).addSkillName(skill));
                            }
                            
                            // Maybe launch chance skills on us
                            if (_chanceSkills != null)
                                _chanceSkills.onSkillHit(target, false, skill.isMagic(), skill.isOffensive(), skill.getElement());
                            
                            // Maybe launch chance skills on target
                            if (target.getChanceSkills() != null)
                                target.getChanceSkills().onSkillHit(this, true, skill.isMagic(), skill.isOffensive(), skill.getElement());
                    }
                }
            }
            
            // Launch the magic skill and calculate its effects
            if (handler != null)
                handler.useSkill(this, skill, targets);
            else
                skill.useSkill(this, targets);
            
            L2PcInstance player = getActingPlayer();
            if (player != null)
            {
                for (L2Object target : targets)
                {
                    // EVT_ATTACKED and PvPStatus
                    if (target instanceof L2Character)
                    {
                        if (skill.isOffensive())
                        {
                            if (target instanceof L2Playable)
                            {
                                // Signets are a special case, casted on target_self but don't harm self
                                if (skill.getSkillType() != L2SkillType.SIGNET && skill.getSkillType() != L2SkillType.SIGNET_CASTTIME)
                                {
                                    ((L2Character) target).getAI().clientStartAutoAttack();
                                    
                                    // attack of the own pet does not flag player
                                    if (player.getPet() != target)
                                        player.updatePvPStatus((L2Character) target);
                                }
                            }
                            else if (target instanceof L2Attackable)
                            {
                                switch (skill.getId())
                                {
                                    case 51: // Lure
                                    case 511: // Temptation
                                        break;
                                    default:
                                        // add attacker into list
                                        ((L2Character) target).addAttackerToAttackByList(this);
                                }
                            }
                            // notify target AI about the attack
                            if (((L2Character) target).hasAI())
                            {
                                switch (skill.getSkillType())
                                {
                                    case AGGREDUCE:
                                    case AGGREDUCE_CHAR:
                                    case AGGREMOVE:
                                        break;
                                    default:
                                        ((L2Character) target).getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, this);
                                }
                            }
                        }
                        else
                        {
                            if (target instanceof L2PcInstance)
                            {
                                // Casting non offensive skill on player with pvp flag set or with karma
                                if (!(target.equals(this) || target.equals(player)) && (((L2PcInstance) target).getPvpFlag() > 0 || ((L2PcInstance) target).getKarma() > 0))
                                    player.updatePvPStatus();
                            }
                            else if (target instanceof L2Attackable && !((L2Attackable) target).isGuard())
                            {
                                switch (skill.getSkillType())
                                {
                                    case SUMMON:
                                    case BEAST_FEED:
                                    case UNLOCK:
                                    case UNLOCK_SPECIAL:
                                    case DELUXE_KEY_UNLOCK:
                                        break;
                                    default:
                                        player.updatePvPStatus();
                                }
                            }
                        }
                        
                        switch (skill.getTargetType())
                        {
                            case TARGET_CORPSE_MOB:
                            case TARGET_AREA_CORPSE_MOB:
                                if (((L2Character) target).isDead())
                                    ((L2Npc) target).endDecayTask();
                                break;
                        }
                    }
                }
                
                // Mobs in range 1000 see spell
                for (L2Npc npcMob : player.getKnownList().getKnownTypeInRadius(L2Npc.class, 1000))
                {
                    List<Quest> quests = npcMob.getTemplate().getEventQuests(QuestEventType.ON_SKILL_SEE);
                    if (quests != null)
                        for (Quest quest : quests)
                            quest.notifySkillSee(npcMob, player, skill, targets, this instanceof L2Summon);
                }
            }
            
            // Notify AI
            if (skill.isOffensive())
            {
                switch (skill.getSkillType())
                {
                    case AGGREDUCE:
                    case AGGREDUCE_CHAR:
                    case AGGREMOVE:
                        break;
                    default:
                        for (L2Object target : targets)
                        {
                            // notify target AI about the attack
                            if (target instanceof L2Character && ((L2Character) target).hasAI())
                                ((L2Character) target).getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, this);
                        }
                        break;
                }
            }
        }
        catch (Exception e)
        {
            _log.log(Level.WARNING, getClass().getSimpleName() + ": callSkill() failed on skill id: " + skill.getId(), e);
        }
    }

  

  • 0
Posted

your exception gives no info about the npe because its handled and catched from a try catch, probably the code piece you linked above. so your best chance is to remove the try-catch block and keep its content, try again and the npe and all its details will be debugged on your gameserver leading you to the excact line of npe.

 

Thats my npe trace, strategy if it fails then you have to debug it with messages, system.out.prinln("no error on line 1); etc

 

Good luck

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Hi everyone,   I’m currently playing Lineage 2 on the L2Damage server and I’d like to know the current status of botting tools there. With all the server updates and protections, many tools stop working or get detected pretty fast, so I wanted to ask the community:   Is anyone currently using any bot on L2Damage that still works reliably? Have you had any success with tools like Adrenaline, L2Walker, L2Tower, or similar? Any general experience or feedback about what’s still usable on this server?   I know every server has different protections, so any up-to-date info or personal experience would be appreciated.   Thanks in advance.
    • Hey Dexters! Https://lineage2dex.com SKADI server starting TODAY! ✅ On 18:00 (UTC +2) We allow you to login for create character! To restrict your name and transfer ToDs/Starter packs in game. Make it before start! On start, we can have problems with WEB! It is IMPORTANT to prepare everything for starting the game RIGHT NOW, do not postpone for later, during the opening there may be problems with the web part of the project and you simply can not register. ## [ - REGISTRATION AND FILES](https://lineage2dex.com/en/start) ✨ Get a +15% bonus on all TOD orders! The bonus is active until February 1st, 23:00 and also applies to UNION. ✅ What you need to know at the start: ➡️ All Epic Raid Bosses dead on start. Re-spawn time you can check in game ALT+B Raid tab ➡️ All other RBs (for difficult 1 location) alive on server start (including Sub and Nobl RB) ➡️ Max enchant for items +10, this limits will be change with server time ➡️ Difficulty 1 locations are available ➡️ Locations drop Basic and Advanced tier resources, allowing you to craft B and A grade equivalent gear ➡️ School of Dark Arts — PvP zone with x5 drop. Its intance Zone, to enter it you need make TP from GateKeeper. If you will teleport on it by map, you will go on regular zone, not pvp ➡️ Only B-grade equivalent equipment is available for purchase (common, its dont have durability) ➡️ Tier 1 talents are available to learn ➡️ Talent Point Shop is available [ - Roadmap](https://wiki.lineage2dex.com/road-map/en) [ - Basic server description](https://wiki.lineage2dex.com/general-description-skadi-x100/en) Thank you for participating in the beta! All players who spent more than 1 hour on the beta server will receive useful items for autofarming and equipment repair. The rewards will be granted to the first character on the same account that participated in the beta. All items will be placed in the Quest Inventory. Good luck everyone! And have a fun on new Skadi server!
    • ## [1.5.1] - 2026-01-30   ### 🐛 Bug Fixes - **Top Voters**: Top voters list now loads correctly for inactive servers (previously showed "Server not found"). - **View Counter**: Server info page view count now records correctly for inactive servers.   ### 🔄 Improvements - **My Servers – Hide/Active**: The hide/active toggle now works correctly and is only shown when the server is approved (active) by an admin. Owner hide/show is separate from admin status. Toggling no longer causes a full page refresh. - **Accessibility**: Form fields across the site now have proper labels and IDs for screen readers and autofill — server info edit form, add server form, My Servers edit, Admin Panel (Email, Vote System, pricing, filters, logs), and related inputs. ## [1.5.2] - 2026-01-30   ### ✨ New Features - **Server Type**: Replaced the old "Server Options" checkboxes with a single-choice **Server Type** selection: Normal, MultiSkill, GvE, Olympiad, PvP, and Stacksub. Choose one type that best describes your server. - **Server Type in Edit Forms**: You can now change the server type when editing a server — in **My Servers → Edit** and in **Admin Panel → Servers → Edit Server**.   ### 🔄 Improvements - **Sidebar Filters**: Server type filters (MultiSkill, GvE, Olympiad, PvP, Stacksub) are now single-choice — selecting one clears the previous selection. Order updated to: VIP L2 Servers, Low Rate, then the server type options. VIP L2 Servers and Low Rate remain independent toggles. - **Rate Display**: Server rows now show full rate values (e.g. x50000) without truncation. - **My Servers – Edit Modal**: Edit form layout restored with slightly tighter spacing so it fits better on screen.   ### 🗑️ Removed - **International Option**: Removed from the Add Server form; server type options are now simplified.
  • 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..