Jump to content
  • 0

[Help]Problem with Java code


Question

Posted

Hey guys....

I try to put this java code in my server : http://www.maxcheaters.com/forum/index.php?topic=148257.0 and i put it :)

But when i wear S grade armor/weapon and i take out after i cant wear again any armor/weapon/jewel and in gameserver window say:

 

Client: [Character: Lougkraaaaaa[268479809] - Account: manos2864 - IP: 127.0.0.1

] - Failed running: [C] 14 UseItem - L2J Server Version: ${l2j.revision} - DP Re

vision: ${l2jdp.revision} ; null

java.lang.NullPointerException

       at com.l2jserver.gameserver.network.clientpackets.UseItem.runImpl(UseIte

m.java:103)

       at com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket.run

(L2GameClientPacket.java:93)

       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source

)

       at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

       at java.lang.Thread.run(Unknown Source)

 

 

Some guys in greek section told me maybe i make something wrong.... and they try to help me with teamviewer but nothing happen!! Code had problem... Can someone fix this code pls!!! Or give me another code (i want olympiad only with A grade armor/weapons/jewels)

I use l2jserver Epilogue (Compile)

 

Recommended Posts

  • 0
Posted

Index: I:/workspace/L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/UseItem.java

===================================================================

--- I:/workspace/L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/UseItem.java (revision 4167)

+++ I:/workspace/L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/UseItem.java (working copy)

@@ -97,6 +97,14 @@

 

if (activeChar.getActiveTradeList() != null)

activeChar.cancelActiveTrade();

+

+ int weaponGrade = activeChar.getActiveWeaponItem().getCrystalType();

+ int armorGrade = activeChar.getActiveChestArmorItem().getCrystalType();

+ if (activeChar.isInOlympiadMode() && (weaponGrade == L2Item.CRYSTAL_S || armorGrade == L2Item.CRYSTAL_S))

+ {

+ activeChar.sendMessage("You cannot use S grade equipment at the Grand Olympiad games.");

+ return;

+ }

 

// NOTE: disabled due to deadlocks

// synchronized (activeChar.getInventory())

I think in red color is the problem but i am not sure...

  • 0
Posted

Try this:

 

    
       int weaponGrade = activeChar.getActiveWeaponItem().getCrystalType();
       int armorGrade = activeChar.getActiveChestArmorItem().getCrystalType();
-      if (activeChar.isInOlympiadMode() && (weaponGrade == L2Item.CRYSTAL_S || armorGrade == L2Item.CRYSTAL_S))
+   if (activeChar.isInOlympiadMode() && (weaponGrade != null || armorGrade != null)
+   {
+       if (weaponGrade == L2Item.CRYSTAL_S || armorGrade == L2Item.CRYSTAL_S))
       {
         activeChar.sendMessage("You cannot use S grade equipment at the Grand Olympiad games.");
         return;
       }
+   }

  • 0
Posted

UseItem.java:103 / Post here line 103

// synchronized (activeChar.getInventory()) <--- line 103

 

**EDIT**

When i try your code parizaki it say syntax error (x)

  • 0
Posted

// synchronized (activeChar.getInventory()) <--- line 103

 

**EDIT**

When i try your code parizaki it say syntax error (x)

Change this:

if (activeChar.isInOlympiadMode() && (weaponGrade != null || armorGrade != null)

To:

if (activeChar.isInOlympiadMode() && (weaponGrade != null || armorGrade != null))

 

My fault :P

  • 0
Posted

Change this:

if (activeChar.isInOlympiadMode() && (weaponGrade != null || armorGrade != null)

To:

if (activeChar.isInOlympiadMode() && (weaponGrade != null || armorGrade != null))

 

My fault :P

nothing change.... :S again error!!

Noone else can help me????? just tell me other sites with java codes and will go to search!!!!

  • 0
Posted
        int lolz0r = item.getItem().getCrystalType();
        if (activeChar.isInOlympiadMode() && lolz0r == L2Item.CRYSTAL_S)
        {
        	//to do...
        }

  • 0
Posted

       int lolz0r = item.getItem().getCrystalType();
       if (activeChar.isInOlympiadMode() && lolz0r == L2Item.CRYSTAL_S)
       {
       	//to do...
       }

It say---> item cannot be resolved

 

int lolz0r = item.getItem().getCrystalType();

             ^^^

 

  • 0
Posted

It say---> item cannot be resolved

 

int lolz0r = item.getItem().getCrystalType();

             ^^^

 

Add it below this: L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId);

  • 0
Posted

+     

+      L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId);

+      if (activeChar.isInOlympiadMode() && (weaponGrade == L2Item.CRYSTAL_S || armorGrade == L2Item.CRYSTAL_S))

+      {

+        activeChar.sendMessage("You cannot use S grade equipment at the Grand Olympiad games.");

+        return;

+      }

 

Like this?? because i am confused... :S

  • 0
Posted

Put in UseItem :\

       int lolz0r = item.getItem().getCrystalType();
       if (activeChar.isInOlympiadMode() && lolz0r == L2Item.CRYSTAL_S)
       {
             activeChar.sendMessage("You cannot use S grade equipment at the Grand Olympiad games.");
              return;
       }

  • 0
Posted

Put in UseItem :\

       int lolz0r = item.getItem().getCrystalType();
       if (activeChar.isInOlympiadMode() && lolz0r == L2Item.CRYSTAL_S)
       {
             activeChar.sendMessage("You cannot use S grade equipment at the Grand Olympiad games.");
             return;
       }

Yes i do it ... but it say item cannot be resolved...

int lolz0r = item.getItem().getCrystalType();

             ^^^

  • 0
Posted

It's already defined

 

 

protected void runImpl()

{

 

L2PcInstance activeChar = getClient().getActiveChar();

 

if (activeChar == null)

           return;

 

if (activeChar.getPrivateStoreType() != 0)

{

activeChar.sendPacket(new SystemMessage(SystemMessageId.CANNOT_TRADE_DISCARD_DROP_ITEM_WHILE_IN_SHOPMODE));

activeChar.sendPacket(new ActionFailed());

return;

}

 

L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId);

 

  • 0
Posted

It's already defined

 

 

protected void runImpl()

{

 

L2PcInstance activeChar = getClient().getActiveChar();

 

if (activeChar == null)

            return;

 

if (activeChar.getPrivateStoreType() != 0)

{

activeChar.sendPacket(new SystemMessage(SystemMessageId.CANNOT_TRADE_DISCARD_DROP_ITEM_WHILE_IN_SHOPMODE));

activeChar.sendPacket(new ActionFailed());

return;

}

 

L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId);

 

This one is few lines below,thats what i told him.

Guest
This topic is now closed to further replies.



  • Posts

    • Classic move "its not a virus, all antiviruses are just wrong." The moment someone starts yelling "FIND THE MALICIOUS CODE" and mocking heuristic detection, its usually because there is something shady in there… or they have no clue what heuristic detection even is. If your files was clean, you wouldn’t be this defensive or getting personal.   when half the AV vendors are throwing out names like Trojan.Win32.Kasidet, Trj/Chgt.AD, and Gen:Variant.Tedy.537463, maybe it’s not "heuristics", maybe its just a shady-ass .rar. If there is smoke you don't argue with the smoke detector, you check the kitchen. But hey, maybe they all got paid too, right? 🤷‍♂️ the argue comes down to trusting you (a nobody) versus AV vendors   Popular threat label trojan.tedy Threat categories trojan  Family labels tedy   can i call you Teddy from now on? yes i can Teddy               Dont forget it was not something generic or maybe suspicious it just got detected with its specific version. and not only Teddy's Teddy some others too Kaspersky says Kasidet trojan keylogger, spyware, classic nasty stuff. Bitdefender, GData, VIPRE? Tedy variant, an actual known malware family. Panda, QuickHeal, Sophos, Fortinet everyone sees something dirty in there. But sure, they’re all wrong, and you’re the cybersecurity messiah who cracked the code. You really expect people to believe that 10 independent vendors with zero incentive to conspire against your .rar just happened to flag your file as malware… by accident? Maybe try this next time: instead of uploading garbage and calling people “idiots” when they don’t trust it, just don’t upload malware. Problem solved.
    • https://github.com/gawric/Guide-L2Unity/blob/main/Guide/Pakets/Blowfish/General description.md   Perhaps you will find it useful piece of encryption and decryption code from Acis Interlude   I transferred these methods to Unity c# and everything works fine   https://ibb.co/DHhP0JYr   I think the first 2 bytes are the packet size. Third byte packet id And then the information itself   It's all there in l2j servers  
    • Hello, I’m working on decrypting the Init packet that the server sends to the client during login. This packet is treated specially and contains the Blowfish keys used to encrypt and decrypt subsequent packets. Although it isn’t encrypted irreversibly and should be reversible, I haven’t succeeded yet. My goal is to extract the Blowfish key to decrypt certain client packets without disrupting the normal session flow. I can inject a DLL to sniff the packets, and with that I plan to develop a module that extends the client’s functionality. For example, after logging in, this module would capture all the data the client receives (character data, etc.). Additionally, it could listen for real-time server events, enabling integrations with Discord SDKs or other systems, thereby expanding Lineage 2’s capabilities. Init packet(0x00) LoginServer. Currently in the java Cores I checked there is no decode function for this package, only encript.
    • whats password from the archivie ?
    • All that shit are false positives of the vanganth cliext, sources are well and who sell it is a big scammer
  • Topics

×
×
  • Create New...