Jump to content
  • 0

Correct 2 Lines Of Code Cant Find The Mistake -.-


Question

Posted (edited)

Hello can someone correct for me those 2 lines? 

I am try to create a item dialog but i do somthing wrong check out ..

(this is just the neccesery fix part of code)

import com.l2jfrozen.gameserver.network.serverpackets.ExShowVariationMakeWindow;
import com.l2jfrozen.gameserver.network.SystemMessageId;

 public void useItem(final L2PlayableInstance playable, final L2ItemInstance item)
 {

if (itemId == 8762)
{
activechar.sendPacket(new SystemMessage(SystemMessageId.SELECT_THE_ITEM_TO_BE_AUGMENTED));
activechar.sendPacket(new ExShowVariationMakeWindow());
}
Edited by L2LostWard

5 answers to this question

Recommended Posts

  • 0
Posted (edited)

 

Hello can someone correct for me those 2 lines? 

I am try to create a item dialog but i do somthing wrong check out ..

(this is just the neccesery fix part of code)

import com.l2jfrozen.gameserver.network.serverpackets.ExShowVariationMakeWindow;
import com.l2jfrozen.gameserver.network.SystemMessageId;

 public void useItem(final L2PlayableInstance playable, final L2ItemInstance item)
 {

if (itemId == 8762)
{
activechar.sendPacket(new SystemMessage(SystemMessageId.SELECT_THE_ITEM_TO_BE_AUGMENTED));
activechar.sendPacket(new ExShowVariationMakeWindow());
}

 

Just cause im in good mood, i'l hlep you

 

If UseItem is ordinary method that isnt made by you and if it's getting neccesary data(playble, item)

then

 public void useItem(final L2PlayableInstance playable, final L2ItemInstance item)
 {

 if (Item.itemId == 8762)
 {
activechar.sendPacket(new SystemMessage(SystemMessageId.SELECT_THE_ITEM_TO_BE_AUGMENTED));
activechar.sendPacket(new ExShowVariationMakeWindow());
 }
}

But something tells me that you cant have access to activechar through there, it might need to use L2PlayableInstance instead of activeChar,  but either way there is lack of info you giving so good luck, mb thats solve it.

Edited by LightFusion
  • 0
Posted

in the same void (useitem) here is onother code from the java file 

		if (itemId == 7064)
		{
			activeChar.sendPacket(new ShowMiniMap(1665));
			activeChar.sendPacket(new RadarControl(0, 1, 51995, -51265, -3104));
		}

and this works ok 

  • 0
Posted

You don't have an activechar variable.

Test the L2PlayableInstance if it's instance of L2PcInstance and if it is, assign it to this activechar variable.

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
×
×
  • 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..