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

    • My official facebook profile!: https://www.facebook.com/spectrumL2 Specifications: Revamped L2JACIS revision FROM the core Private project!!! Revision that has been receiving corrections for over 3 years!!! Events already installed in the revision: TVT CTF KTB PARTY FARM SPOIL EVENT CRAZY RATES TOURNAMENT TIME ZONE (INSTANCE) All working correctly!!! SIEGE ESSENTIAL FEATURES: Walls fix Gates fix Flags fix 100% functional: OLYMPIADS: Implemented settings Hero receives enchanted Weapons with equal status PvP Weapons Optional /true/false Hero can acquire all Hero Weapons Optional true/false OTHER IMPLEMENTATIONS: Teleport fixed (directly to Giran) Teleport effect classic Vip skins vip collor name Pack NPCs with effect already configured BOSES already configured Mobs already configured CLASS BALANCE SPECIAL SYSTEM We have a SPECIAL system developed for Class Balance with only 1 digit in XML %tage of configurable debuffs Player limitation system in BOSES or PvP zones BS blocking system in FLEG zones or events Among others dozens of improvements made in the review... price: 390 USD !  OBS: WE CAN CHANGE THE BANNER AND NAME OF THE SERVICE TO THE ONE OF YOUR PREFERENCE BUT THE SETTINGS MUST BE KEPT ANY CHANGES REQUIRE ADDITION        
    • Server is Online – 1,000+ Active Players! We’re excited to announce the addition of a Europe Proxy to improve connectivity for our EU players! Clans can now benefit from VIP Access to help you catch up faster. 🎯 If you're a clan leader with at least 9 active members, join our Discord and open a ticket to claim your VIP rewards!  
    • The Telegram team is rolling out a new batch of Stars-only gifts you’ll be able to mint as NFTs. Don’t miss your chance to join the next Telegram trend and earn from it! Buy Telegram Stars cheap and KYC-free 1 Star from $0.0149 (min. 50 Stars, bulk discounts available) Promo code STARS5 — 5 % off Pay any way you like: bank cards · crypto · other popular methods How to purchase: ➡Online Store — Click ➡ Telegram bot — Click Other services: ➡ SMM panel — Click Regular buyers get extra discounts and promo codes. Support: ➡ Telegram: https://t.me/solomon_bog ➡ Telegram channel: https://t.me/accsforyou_shop ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store Use these contacts to discuss wholesale orders, partnerships (current list: https://socnet.bgng.io/partners) or to become a supplier. SocNet — your shop for digital goods and premium subscriptions
    • The Telegram team is rolling out a new batch of Stars-only gifts you’ll be able to mint as NFTs. Don’t miss your chance to join the next Telegram trend and earn from it! Buy Telegram Stars cheap and KYC-free 1 Star from $0.0149 (min. 50 Stars, bulk discounts available) Promo code STARS5 — 5 % off Pay any way you like: bank cards · crypto · other popular methods How to purchase: ➡Online Store — Click ➡ Telegram bot — Click Other services: ➡ SMM panel — Click Regular buyers get extra discounts and promo codes. Support: ➡ Telegram: https://t.me/solomon_bog ➡ Telegram channel: https://t.me/accsforyou_shop ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store Use these contacts to discuss wholesale orders, partnerships (current list: https://socnet.bgng.io/partners) or to become a supplier. SocNet — your shop for digital goods and premium subscriptions
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock