Jump to content

Recommended Posts

Posted

Hello everyone 

How are you all doing?

I'd like to share with the community an open-source project I've been working on intensely: the **L2 Phantom AI Manager**.

Tired of those static bots that just stand still in the city or sink into the map because of Geodata? Me too! That's why I developed a modular Phantom system with real Artificial Intelligence, initially designed for **L2J Mobius Essence (RoseVain)**, but which can be adapted to other chronicles.

Main Features

Modular architecture: the system is split into focused files such as PhantomAI, PhantomEngine, PhantomFactory, PhantomEquipment, PhantomHuntingSpots, PhantomGeo, PhantomMenu, and more.

  • Automatic creation: create 10 or 50 phantoms from the menu or commands.
  • XML persistence: automatically created phantoms are saved into PhantomPlayers.xml, so they keep loading after server restarts.
  • Batch startup: .pstart and Start 10 load only 10 phantoms at a time.
  • Batch disconnect: disconnect 10 active phantoms without shutting down the whole system.
  • Origin towns: new phantoms spawn using PlayerTemplate.getCreationPoint(), respecting race and class.
  • Geodata-safe spawning: spawn points use NPC-like coordinate validation to avoid under-map or floating characters.
  • Real datapack spots: reads data/stats/npcs and data/spawns to build level-based hunting locations.
  • Bad target filtering: ignores Training Dummy, tutorial objects, chests, and fake farm targets.
  • Smart relocation: if a phantom cannot find useful mobs, it relocates to another spot for its level.
  • Level goals: phantoms receive leveling goals, return to town, recover resources, and go back to farming.
  • Mage MP rest mode: mages rest until MP is recovered; in PvP they try to escape when out of mana.
  • Skills and buffs: phantoms try to use offensive skills and self buffs such as Might, Shield, Focus, Haste, Empower, Acumen, Wind Walk, Chant, Song, and Dance.
  • Varied gear packs: gear packs by grade for mages and fighters, with multiple variants to avoid visual clones.
  • Automatic shots: randomized Soulshot and Spiritshot restocking by class and grade.
  • Inventory cleanup: unnecessary items are removed automatically while preserving Adena, shots, and equipped gear.
  • PvP and PK behavior: some phantoms are aggressive, may become PK, and attacked phantoms try to defend themselves.
  • Optional AI chat: optional Google Gemini integration for short social replies.
  • TXT logs: the menu displays log state and can enable/disable logging.

GM Menu

Use .pmenu to open the control panel.

Current options:

  • Start 10
  • Disconnect 10
  • Create 10
  • Create 50
  • Reload XML
  • Stop All
  • Enable Log / Disable Log

The menu also shows:

  • active phantom count;
  • XML ID count;
  • current TXT log state.

Commands

  • .pmenu - opens the control panel.
  • .pstart - starts 10 phantoms from XML.
  • .pstop - removes all active phantoms.
  • .pstop10 - disconnects 10 active phantoms.
  • .pload - reloads PhantomPlayers.xml.
  • .pcreate 10 - creates, starts, and saves 10 phantoms to XML.
  • .pcreate 50 - creates, starts, and saves 50 phantoms to XML.
  • .pm Name Message - sends a private message to a phantom.
  • .pdebug - toggles TXT logging.

Logs

Logs are created in the GameServer log/ folder:

  • log/PhantomManager.txt - global historical log.
  • log/PhantomManager-yyyyMMdd-HHmmss.txt - separate log for each session.

Useful logged events include:

  • new level goals;
  • travel to hunting spots;
  • town rest;
  • mob attacks;
  • PvP defense;
  • shot restocking;
  • inventory cleanup;
  • AI exceptions with stacktrace.

Main Files

  • PhantomManager.java - commands, logs, and bootstrap.
  • PhantomEngine.java - start, stop, spawn, respawn, batches, and AI loop.
  • PhantomAI.java - farm, PvP, PK, rest, targeting, and movement decisions.
  • PhantomConfig.java - routes, gear, shots, and XML persistence.
  • PhantomFactory.java - automatic character creation.
  • PhantomEquipment.java - buffs, progression, shots, and inventory cleanup.
  • PhantomHuntingSpots.java - real datapack NPC/spawn loader.
  • PhantomGeo.java - geodata-safe coordinate handling.
  • PhantomState.java - temporary phantom memory.
  • PhantomMenu.java - GM HTML panel.
  • PhantomBypass.java - menu button handling.
  • PhantomChat.java - messages and optional Gemini integration.
  1. Copy custom/PhantomManager into: dist/game/data/scripts/custom/PhantomManager/
  2. Place PhantomPlayers.xml in: game/config/Custom/PhantomPlayers.xml
  3. Compile scripts or restart the GameServer.
  4. Use .pmenu to create, start, and manage phantoms.
  5. https://github.com/miacodeweb/L2-Phantom-AI

Shot00049.jpg

Posted
20 hours ago, Heroic9614 said:

I tried it, very neat work.

Just keep improving it, there's potential.

Thank you for your feedback. To help me improve the system, please leave your comments or report any bugs. I will try to release weekly updates. 

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

    • 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
    • Thank you for your feedback. To help me improve the system, please leave your comments or report any bugs. I will try to release weekly updates. 
    • Thank you for your feedback, SkyLord — even the negative kind.   Let me give you some context on who we actually are, since you asked. L2-Scripts has been around for nearly 20 years. Over that time, we've worked with a large number of developers — I've personally seen probably half of every serious (and not-so-serious) developer in this scene. The most significant figure in our studio's history was Bonux. Together with a small team of assistants, he was essentially the backbone of our old codebase, and we were the ones who brought virtually every chronicle to the community — Essence, Classic, Main — all of it came through us.   Back then, we worked at scale. That era is over. Today, L2-Scripts is no longer a studio in the traditional sense. It's more of a developer collective. I work alongside the best developers I've encountered in 20 years. Bonux is still with us on Classic. A new developer named Den has joined — in just 3 years he became one of the top Essence developers in the world. Every one of us works independently, but we're united by long-standing friendships and shared projects.   We no longer chase every chronicle or every client. For the past several years, we've been focused exclusively on specific long-term projects where we're paid a proper salary — and when you focus like that, with 20 years of experience behind you, the quality of what you produce is on a completely different level. Our code is currently running on nearly all top Essence and Classic servers. We're now bringing Main (Last Protocol) up to that same standard.   You mentioned Nexvil. Yes, he worked with us. That was a difficult period — the lead developer at the time was not up to the standard we hold ourselves to. It was a short period, and it's long behind us.   As for the prices — I'd ask you not to judge a product by whether you personally can afford it. That's not a fair measure of value. The people running top-tier servers understand what they're paying for. If our pricing doesn't fit your budget, that's completely fine — but downvoting a service simply because it feels expensive to you doesn't reflect well, and it certainly doesn't make the product worse.   A special thank you to eMommy and Zenith for the honest and fair words — it genuinely means a lot. It's good to know there are people in this community who judge things as they are.
    • Just because someone does professional sales doesn’t mean everything is overpriced. If the products he provides are stable and good quality, then I see nothing wrong with it, and those prices aren’t even bad. Remember, we’re living in 2026, not 10 years in the past. Your mindset is probably stuck on buying the cheapest products because maybe you can’t afford better ones. And of course, there’s always someone who likes blaming others. I think you should mind your own business instead of blaming someone for how they run theirs. If you really think his prices are too expensive, then do better than him.
  • 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..