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

    • 寒冷的冬天 — 火热的折扣。使用促销代码 WINTER 即可在我们商店的所有购买中获得 10% 折扣! 有效链接: 数字商品商店(网站): 前往 其他服务和产品: 商店 Telegram 机器人: 前往 – 通过 Telegram 信使方便访问商店。 虚拟号码服务: 前往 用于购买 Telegram Stars 的 Telegram 机器人: 前往 – 在 Telegram 中快速且优惠地购买 Stars。 SMM 面板: 前往 – 推广您的社交媒体账户。 我们想向您展示当前的 促销和特别优惠列表 ,用于购买我们服务的产品和服务: 1. 您可以在首次购买时使用促销代码:SOCNET(15% 折扣) 2. 获取 $1 商店余额或 10–20% 折扣——只需在我们的网站注册后按以下模板填写您的用户名:"SEND ME BONUS, MY USERNAME IS..." ——您需要在我们的论坛主题中发布! 3. SMM 面板首次试用可获得 $1:只需在我们的网站(Support)提交主题为 “Get Trial Bonus” 的工单。 4. 我们的 Telegram 频道和 Stars 购买机器人中每周都会赠送 Telegram Stars! 新闻: ➡ Telegram 频道: https://t.me/accsforyou_shop ➡ WhatsApp 频道: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器: https://discord.gg/y9AStFFsrh 联系方式和支持: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Cold winter — hot discounts. Use promo code WINTER and get 10% off on all purchases in our store! Active links: Digital goods store (Website): Go to Other services and products: Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just write your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." – you need to post this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Cold winter — hot discounts. Use promo code WINTER and get 10% off on all purchases in our store! Active links: Digital goods store (Website): Go to Other services and products: Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just write your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." – you need to post this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Telegram Stars — a new digital currency inside Telegram. And right now, the best opportunities are opening for profitable purchases and participation in exclusive events. And you can purchase Telegram Stars safely and at the best price in our bot. Active links: Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. Other services and products: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just write your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." — you need to post this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Telegram Stars — a new digital currency inside Telegram. And right now, the best opportunities are opening for profitable purchases and participation in exclusive events. And you can purchase Telegram Stars safely and at the best price in our bot. Active links: Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. Other services and products: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just write your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." — you need to post this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • 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