Thelasthero Posted June 11, 2010 Share Posted June 11, 2010 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. Quote Link to comment Share on other sites More sharing options...
RainWalker Posted June 11, 2010 Share Posted June 11, 2010 cool seems nice clicking on an items for augmentation =] Quote Link to comment Share on other sites More sharing options...
Kama3a Posted June 11, 2010 Share Posted June 11, 2010 not so bad ,its cp script ;) try do smthing harder :) ty for share anyway Quote Link to comment Share on other sites More sharing options...
Matim Posted June 11, 2010 Share Posted June 11, 2010 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. Quote Link to comment Share on other sites More sharing options...
Grim. Posted June 11, 2010 Share Posted June 11, 2010 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 Quote Link to comment Share on other sites More sharing options...
Thelasthero Posted June 11, 2010 Author Share Posted June 11, 2010 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... Quote Link to comment Share on other sites More sharing options...
Jayde Posted June 11, 2010 Share Posted June 11, 2010 GJ. Keep Sharing. Quote Link to comment Share on other sites More sharing options...
|Itachi Posted June 11, 2010 Share Posted June 11, 2010 Matim is correct Quote Link to comment Share on other sites More sharing options...
Thelasthero Posted June 11, 2010 Author Share Posted June 11, 2010 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... Quote Link to comment Share on other sites More sharing options...
Matim Posted June 11, 2010 Share Posted June 11, 2010 Anyway, it was just a note, not any kind of critique :P Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.