Jump to content
  • 0

Killable NPC?


Question

Posted

I'm trying to make NPC Flag wich you can capture by killing it. Capturing works fine. If you kill the flag it becomes your factions flag. But... problem is that the flag is imortal. Only way to kill it is by //kill.

I added this code to L2TpFlaginstance.java:

@Override
    public void reduceCurrentHp(double damage, L2Character attacker, L2Skill skill)
    {
        L2PcInstance plajor = null;
        boolean cord = false;
        if (attacker instanceof L2PcInstance)
            plajor = (L2PcInstance) attacker;
        else if (attacker instanceof L2SummonInstance)
            plajor = ((L2SummonInstance) attacker).getOwner();
            
        if (/*plajor.inWorld() == 1 && */plajor.getFactionId() != getFlagFactionId())
            cord = true;            
        if (cord)
            super.reduceCurrentHp(damage, attacker, skill);
    }

But that doesnt seem to do anything. HP of the flag is not decreasing when I hit it.

How can I make it mortal?

 

Working with latesr rev of l2jserver

8 answers to this question

Recommended Posts

  • 0
Posted

mind telling the problemm so people whit a similar/same problemm can fix it alone

@Override

    public boolean isAttackable()

    {

        return true;

    }

 

and setIsInvul(false); for every npc you want to be killable.

 

 

 

Guest
This topic is now closed to further replies.


  • Posts

    • 🧵 [FREE RELEASE] L2Updater + AntiCheat + Build System + Full Website ⚔️ Presentation After a long time of development, testing, and improvements, I decided to release this project for free to the community. This is a complete package for anyone who wants to build a Lineage II server with a professional-level structure. The idea was not just to create a simple tool, but a full ecosystem that covers everything a modern server needs. 🚀 What’s Included This release contains: ✔ Modern Launcher (Windows) ✔ Smart Update System (FULL + PATCH) ✔ AntiCheat protection (client-side DLL) ✔ Build System for generating updates ✔ Complete Website (register + ranking + pages) Everything is integrated to work together. 🧠 Project Concept The goal of this project is simple: Instead of using outdated launchers or fragmented systems, this package provides: ✔ Organization ✔ Performance ✔ Security ✔ Scalability 🔄 Update System The updater is based on a manifest system, where: ✔ The client checks versions automatically ✔ Only changed files are downloaded (patch system) ✔ Full client is downloaded if needed ✔ Files are validated using hash This results in: Faster updates Lower bandwidth usage Better user experience 🛡️ AntiCheat System The AntiCheat included in this package works directly on the client side. It provides: ✔ Protection against modified clients ✔ Basic cheat detection ✔ File integrity validation ✔ Blocking of suspicious environments This helps maintain a fair and controlled gameplay environment. 🏗️ Build System (Patch Creator) A full build system is included to automate updates. Features: ✔ Detect changed files automatically ✔ Generate FULL packages ✔ Generate PATCH updates ✔ Create manifest.json automatically This allows you to manage updates like: 🌐 Website System A complete website is included, featuring: ✔ Account registration ✔ Player ranking (PvP / PK) ✔ News pages ✔ Integration with the server database 🎯 Why Use This? Many servers fail because they lack structure. This package solves that by providing: ✔ A complete environment ✔ Organized update flow ✔ Integrated systems ✔ Ready-to-use base ⚙️ Technical Details ✔ Launcher developed with modern UI concepts ✔ Patch system based on hash validation ✔ Integration between server, launcher, and website ✔ Expandable architecture 📦 Download 👉 (https://mega.nz/file/AusTnYQK#ZhvArkZpDS7FH60TXd2rg5wT2OxSg9v2pJ2GLrJbyiQ / download link here) 💬 Final Words If your server does not have a system like this today: This project is designed to help you reach a higher level.  
  • 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..