Jump to content

Recommended Posts

Posted

Guys, i made an itemhandler (credits to me so don't start saying c/p and and and), that when you double click on gold dragon(3481), cancel augment window pops up, and the item GETS consumed(not 100%). <<I have tested it so give me feedback. I won't explain how to register an itemhandler or how to register it with configs... there are plenty of guides... (MADE IN L2J INTERLUDE)

 

Here you go: Create a file CancelAugPortable.java in java/net/sf/l2j/gameserver/handler/itemhandlers and paste:

/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package net.sf.l2j.gameserver.handler.itemhandlers;

import net.sf.l2j.gameserver.handler.IItemHandler;
import net.sf.l2j.gameserver.model.L2ItemInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.serverpackets.ExShowVariationMakeWindow;


public class CancelAugPortable implements IItemHandler
{
   private static final int ITEM_IDS[] = 
   {
   	3481
   };

   public void useItem(L2PlayableInstance playable, L2ItemInstance item)
   {
   	if (!(playable instanceof L2PcInstance))
		return;
           L2PcInstance activeChar = (L2PcInstance)playable;                
          if (activeChar.isInCombat())
           	{
           	activeChar.sendMessage("You cant cancel Augment while you are attacking");
           	return;
           	}
           else if (activeChar.isInJail())
           {
           	activeChar.sendMessage("You cant cancel Augment while you are in jail");
           	return;
           }
           else if (activeChar.isInOlympiadMode())
          {
      		activeChar.sendMessage("You cant cancel Augment while you are on olympiad game");
      		return;
          }
           else              
                  activeChar.sendPacket(new ExShowVariationCancelWindow());

       }
   public int[] getItemIds()
   {
       return ITEM_IDS;
   }


}

 

Idea was taken from TheEnd's share with portable augment.

Posted

To be honest, nothing special, just:

 

1. Open Eclipse

 

2. Create new class.

 

3. C/p protections (if/else) from other handler

 

4. Insert new packet.

 

Thats all, but anyway, can be useful for someone.

Posted

To be honest, nothing special, just:

 

1. Open Eclipse

 

2. Create new class.

 

3. C/p protections (if/else) from other handler

 

4. Insert new packet.

 

Thats all, but anyway, can be useful for someone.

pwned

anyway gj

Posted

To be honest, nothing special, just:

 

1. Open Eclipse

 

2. Create new class.

 

3. C/p protections (if/else) from other handler

 

4. Insert new packet.

 

Thats all, but anyway, can be useful for someone.

well, i copied the base code from portable aug., but some changes were needed to work... not only the imports, portable aug was made for gracia final...

Posted

Matim is correct

Well.........

well, i copied the base code from portable aug., but some changes were needed to work... not only the imports, portable aug was made for gracia final...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...