Jump to content
  • 0

Question

Posted (edited)

Hello! I would like to get some help on how to fix some skills like Sonic Buster and Force Burst. If I target myself and press crtl, I can hit myself directly to HP, avoiding CP. With Force Burst Tyrants can use this bug to Pre-zealot in Olympiad. 

 

Im not sure what should be changed and where!

 

Thank you in advance!

 

Edit: I use L2JFrozen 1118

Edited by tiguz

Recommended Posts

  • 0
Posted

doCast(final L2Skill skill) method.

 

 

 

public void doCast(final L2Skill skill)
{
  final L2Character activeChar = this;
 
  if (skill == null)
  {
   getAI().notifyEvent(CtrlEvent.EVT_CANCEL);
   return;
  }
 
  // Check if the skill is a magic spell and if the L2Character is not muted
  if (skill.isMagic() && isMuted() && !skill.isPotion())
  {
   getAI().notifyEvent(CtrlEvent.EVT_CANCEL);
   return;
  }
+  if (this instanceof L2PcInstance) {
+   L2PcInstance pl = (L2PcInstance) this;
+   if (pl.getTarget() instanceof L2PcInstance) {
+    L2PcInstance trgt = (L2PcInstance) pl.getTarget();
+    if (trgt.getName().equals(pl.getName())) //Player targets himself
+    {
+     int skill_id = skill.getId();
+    switch (skill_id) {
+        case 9://Sonic Buster
+       case 17://Force Burst
+      sendPacket(ActionFailed.STATIC_PACKET);
+      return false;
+     default:
+     break;
+     }
+    }
+   }
+  }

  // Check if the skill is psychical and if the L2Character is not psychical_muted
  if (!skill.isMagic() && isPsychicalMuted() && !skill.isPotion())
  {
   getAI().notifyEvent(CtrlEvent.EVT_CANCEL);
   return;
  }

...

...

...

 

 

  • 0
Posted

You can use this code as a temporary fix.

 

checkDoCastConditions(L2Character.java)

 

 

 

if (this instanceof L2PcInstance) {
   L2PcInstance pl = (L2PcInstance) this;
   if (pl.getTarget() instanceof L2PcInstance) {
    L2PcInstance trgt = (L2PcInstance) pl.getTarget();
    if (trgt.getName().equals(pl.getName())) //Player targets himself
    {
     int skill_id = skill.getId();
     switch (skill_id) {
     case 9://Sonic Buster
     case 17://Force Burst
      sendPacket(ActionFailed.STATIC_PACKET);
      return false;
     default:
      break;
     }
    }
   }
  }

 

 

 

After this code is added, they can't use these skills targeting their selves. (Give it a test by yourself first)

  • 0
Posted

You can use this code as a temporary fix.

 

checkDoCastConditions(L2Character.java)

 

 

 

if (this instanceof L2PcInstance) {

   L2PcInstance pl = (L2PcInstance) this;

   if (pl.getTarget() instanceof L2PcInstance) {

    L2PcInstance trgt = (L2PcInstance) pl.getTarget();

    if (trgt.getName().equals(pl.getName())) //Player targets himself

    {

     int skill_id = skill.getId();

     switch (skill_id) {

     case 9://Sonic Buster

     case 17://Force Burst

      sendPacket(ActionFailed.STATIC_PACKET);

      return false;

     default:

      break;

     }

    }

   }

  }

 

 

 

After this code is added, they can't use these skills targeting their selves. (Give it a test by yourself first)

Thank you! I will test it right away!

  • 0
Posted

Solomun where exactly inside Character.java should I add that code?

I dont do coding, I can just add the patch and compile.  :-

  • 0
Posted

Solomun where exactly inside Character.java should I add that code?

I dont do coding, I can just add the patch and compile.  :-

Post me here your L2Character.java and i will try to spot where you should add it...However in High Five there is checkDoCastConditions method, so i guess something similar should take place in your code.

  • 0
Posted

It worked! I just had to change "return false" to "return;" because eclipse accused : void method cannot return a value.

 

But I dont get the message you added to the code: sendPacket(ActionFailed.STATIC_PACKET);

Maybe because I changed that "return false"? The char cant use the skill on itself now, but the system doesnt send any message.

 

Thank you Solomon!

  • 0
Posted

+       case 17://Force Burst

+      pl.sendMessage("Incorrect Target");
+      sendPacket(ActionFailed.STATIC_PACKET);
+      return false;

 

If you want to show a message...

  • 0
Posted

+       case 17://Force Burst

+      pl.sendMessage("Incorrect Target");

+      sendPacket(ActionFailed.STATIC_PACKET);

+      return false;

 

If you want to show a message...

Alright thank you very much for your help! really =D

  • 0
Posted

Alright thank you very much for your help! really =D

No problem...Consider hitting the "Mark Solved" button under my post in order to make it easier-to-find from other people :)

  • 0
Posted

No problem...Consider hitting the "Mark Solved" button under my post in order to make it easier-to-find from other people :)

Done!  ^-^

  • 0
Posted (edited)

Something like that will be more stable 

if (this instanceof L2PcInstance)
{
	L2PcInstance player = (L2PcInstance) this;
	if (player.getTarget() != null && player.getTarget() == player)
	    if (skill.getSkillType() == SkillType.CHARGEDAM)
	    {
	    	player.sendMessage("message");
	    	return;
	    }	
}

but if you just wanted these 2 then take solomun's code its working ;)

Edited by melron
Guest
This topic is now closed to further replies.


  • Posts

    • ============================================================== VIKOS AUTOBOTS — live bots for Lineage 2 servers on Lucera2 Interlude and Classic ============================================================== An empty server loses players. Vikos Autobots fills the world with bots that act like real players: they farm, walk around towns, join clans, fight wars, go to raids, sieges, events and the Olympiad, trade and talk in chat. Installs on top of a Lucera2 build: one .ext.jar + the data/autobots folder + a config. Database tables are created automatically. WHAT THE BOTS DO • Farm zones by level along set routes; they do not steal mobs from players or other bots. Leave town through gatekeepers (custom ones and NPC bypasses too) and come back. • Some bots leave the farm to walk around town while others keep farming, so towns are not empty. They walk, talk to NPCs and sit down to rest (can be turned off for PvP servers). • After a server restart bots carry on where they were: same zone, same route, no mass teleport to town. • Class-based combat AI: fighters, archers, mages, healers, buffers, summoners. Auto parties, healers resurrect the dead. • Real fishing with core skills (cast, Pumping / Reeling, fish fight). Rod by grade, bait and fishing shots are handed out automatically; spots have stands, a bot limit, levels and time. • Gear by class and level, a separate Olympiad set and an "online time" set; custom skills by class and by online time (same idea as time gear). Random enchant, Life Stones, dyes, buffs. Shots, potions, arrows and scrolls restock on their own; bot items never reach the economy. • Clans and alliances with generated crests, clan wars, clan defense, PvP server mode. PvP zones (arena, Coliseum, custom): admin Send or a clock like TvT (14:00;16:00). • Raids and epics (Antharas, Valakas, Baium; more via XML), with a gathering in town or a direct teleport to the boss. Castle sieges, TvT / CTF / DM, Olympiad 1v1 and 3v3, Seven Signs. • Private stores (sell and buy), RU/EN chat, AI chat (Groq or any OpenAI-compatible API), bot replies go through your server chat filter (chatfilters.xml), player PMs forwarded to admin Telegram. • Admin panel: //autobots panel. Online schedule, own AI thread pool built for hundreds of bots online, one commented config and XML files checked at server start. INCLUDED: VIKOS AUTOBOTS CONFIGURATOR (Windows) • A single .exe with Java inside, nothing to install. • Works right on your VPS over SSH/SFTP: edit and save, the files go straight to the server; the old version goes to backup. • World map from server geodata, automatic route building by the core movement rules with checks. • Farm zones, towns, raids, sieges, TvT, PvP zones, fishing spots. • Editors with client icons: equipment (farm / online time / Olympiad), skills (regular and by online time), buffs, Life Stones, supplies, dyes. Finds config mistakes by itself. • Interlude and Classic, RU/EN interface, light and dark theme, F1 help. ============================================================== VIKOS AUTOBOTS — REAL SERVER LOAD Measured ============================================================== Interlude test server on Lucera2, a regular VPS: • 4 vCPU, 8 GB RAM, Debian 13 • Java 17 (Temurin), -Xmx5G • MariaDB -------------------------------------------------------------- RESULTS -------------------------------------------------------------- CPU is a one-minute average for the whole game server process: core, mobs and bots together. 400% = all 4 cores. Bots online Server CPU (of 400%) Share of VPS 1000 ~103% ~26% 1200 ~105% ~26% 1500 ~120-150% ~30-37% • An empty server without bots uses ~40% by itself, so 1000 bots add about one core. • The bot AI itself (all bots together) takes 10-15% of one core for 1000-1500 bots. • Memory is stable, no leaks: - after GC the heap stays at ~2.8-2.9 GB with 800, 1000 and 1200 bots — about the same as the server uses by itself, without bots; - the heap low point does not grow over time: memory does not pile up, it is freed on every garbage collection; - a full night with 1500 bots with no out-of-memory errors (OutOfMemory), the server never crashed; - with -Xmx5G there is more than 2 GB of headroom. • A full night with 1500 bots ran stable. Meanwhile the bots live a full life: farming along routes, walking around towns, fishing, clans, scheduled PvP zones, TvT/CTF, Olympiad and raids. -------------------------------------------------------------- SETTINGS USED FOR THESE NUMBERS -------------------------------------------------------------- • AutobotsIterationDelayMs = 500 A bot thinks twice per second: enough to act like a real player without wasting CPU. • AutobotsMaxBots = 1000-1500 • ai.properties: AiTaskActiveDelay = 500 AggroCheckInterval = 500 Most of the load comes not from the bot code but from the mobs around the bots: bots bring locations to life, and the mobs start checking whom to attack. With these values they check twice per second instead of four times. The load is almost halved, and you can't see the difference: a mob notices its target a fraction of a second later. • MariaDB: innodb_flush_log_at_trx_commit = 2 The database flushes its log to disk once per second instead of after every small query. With 1000+ bots there are many queries, and this removes most of the database load. A standard setting for game servers. • server.properties: AutoDestroyDroppedItemAfter = 120 Drops on the ground disappear after 2 minutes instead of 10. Bots kill a lot, and in 10 minutes tens of thousands of items piled up on the ground: extra memory, extra server work and database deletes. Two minutes is enough for players to pick up their own drops. Rule of thumb: a 4-core VPS handles 1000-1500 bots comfortably. For more, go for 6-8 cores. LICENSE • The license is bound to your VPS IP: the bots run only on the server with that IP. • Send the server IP when you buy. Price: 500$ Contact: Telegram @Vikos177 — https://t.me/Vikos177 Test the bots here: <DOWNLOAD LINK> https://drive.google.com/file/d/1xpOII2X2fsUWekDIJk7POTMWu7ICpHJo/view After purchase you are added to a private Telegram group for clients: news, updates and support. ==============================================================
    • 💻 Supercharge your workflow with Claude Pro & Cursor AI. Clean setups with full warranty included!
    • 📦 Running out of Google Drive space? Upgrade to 5TB + Gemini Pro instantly on your own email.
    • AHAHAHAHAH ? Send it proofs here. I just wanted to sell my stuff, but this crazy Ukrainian just stole my money, and he does this all the time to other people. 
  • 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..