Essiel Posted July 11, 2010 Posted July 11, 2010 It was already shared but this time include and part for cansel augment. the main author of this code was TheEnd also fakoykas made it better ### Eclipse Workspace Patch 1.0 #P datapack_development Index: data/scripts/handlers/itemhandlers/PortableAug.java =================================================================== --- data/scripts/handlers/itemhandlers/PortableAug.java (revision 0) +++ data/scripts/handlers/itemhandlers/PortableAug.java (revision 0) @@ -0,0 +1,85 @@ +/* + * 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 handlers.itemhandlers; + +import com.l2jserver.gameserver.handler.IItemHandler; +import com.l2jserver.gameserver.model.L2ItemInstance; +import com.l2jserver.gameserver.model.actor.L2Playable; +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; +import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage; + +/** + * @author TheEnd & Fakoykas & KraSh + * + */ +public class PortableAug implements IItemHandler +{ + private static final int ITEM_IDS[] = + { + 8723, 8724, 8725, 8726, 8727, 8728, 8729, 8730, 8731, 8732 ,8733 ,8734 ,8735 ,8736 , + 8737 ,8738 ,8739 ,8740 ,8741 ,8742 ,8743 ,8744 ,8745 ,8746 ,8747 ,8748 ,8749 ,8750 ,8751 , + 8752 ,8753 ,8754 ,8755 ,8756 ,8757 ,8758 ,8759 ,8760 ,8761 ,8762 + }; + + public void useItem(L2Playable playable, L2ItemInstance item) + { + if (!(playable instanceof L2PcInstance)) + return; + + L2PcInstance activeChar = (L2PcInstance)playable; + // these are some custom protections, which are not in RequestRefine since it was never meant to be portably used + // no reason to add more, since they are already there :) + if (activeChar.isInCombat() || activeChar.getPvpFlag() > 0) + { + activeChar.sendMessage("You cannot use the Augmenter while pvping."); + return; + } + if (activeChar.isInOlympiadMode() || activeChar.inObserverMode()) + { + activeChar.sendMessage("You cannot use the Augmenter while being in Olympiad Mode."); + return; + } + if (activeChar.isInFunEvent()) + { + activeChar.sendMessage("You cannot use the Augmenter while being in a Fun Event."); + return; + } + + NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(0); + npcHtmlMessage.setHtml("<html><body>" + + "<title>" + + "L2Crypton" + + "</title> " + + "<img src=\"l2Font-e.mini_logo-e\" width=250 height=90>" + + "<center>" + + "L2Server Custom Augmention System.<br>" + + "What would you like to do?<br><br>" + + "<button value=\"Augment\" action=\"bypass -h augment\" width=101 height=24 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br>" + + "<button value=\"Cancel Augment\" action=\"bypass -h cancel_augment\" width=101 height=24 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br>" + + "Server Team Team 2010®" + + "</center>" + + "</body></html>"); + activeChar.sendPacket(npcHtmlMessage); + } + + public int[] getItemIds() + { + return ITEM_IDS; + } +} Index: java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java =================================================================== --- java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java (revision 4297) +++ java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java (working copy) @@ -34,6 +34,7 @@ import com.l2jserver.gameserver.model.actor.instance.L2ManorManagerInstance; import com.l2jserver.gameserver.model.actor.instance.L2MerchantSummonInstance; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.entity.Hero; import com.l2jserver.gameserver.model.entity.L2Event; import com.l2jserver.gameserver.model.olympiad.Olympiad; @@ -41,6 +42,8 @@ import com.l2jserver.gameserver.network.communityserver.CommunityServerThread; import com.l2jserver.gameserver.network.communityserver.writepackets.RequestShowCommunityBoard; import com.l2jserver.gameserver.network.serverpackets.ActionFailed; +import com.l2jserver.gameserver.network.serverpackets.ExShowVariationCancelWindow; +import com.l2jserver.gameserver.network.serverpackets.ExShowVariationMakeWindow; import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; import com.l2jserver.gameserver.util.GMAudit; @@ -122,6 +125,16 @@ { playerHelp(activeChar, _command.substring(12)); } + else if (_command.equals("augment")) + { + activeChar.sendPacket(new SystemMessage(SystemMessageId.SELECT_THE_ITEM_TO_BE_AUGMENTED)); + activeChar.sendPacket(new ExShowVariationMakeWindow()); + } + else if (_command.equals("cancel_augment")) + { + activeChar.sendPacket(new SystemMessage(SystemMessageId.SELECT_THE_ITEM_FROM_WHICH_YOU_WISH_TO_REMOVE_AUGMENTATION)); + activeChar.sendPacket(new ExShowVariationCancelWindow()); + } else if (_command.startsWith("npc_")) { if(!activeChar.validateBypass(_command)) @@ -141,7 +154,23 @@ L2Event.inscribePlayer(activeChar); else if (object instanceof L2Npc && endOfId > 0 && activeChar.isInsideRadius(object, L2Npc.INTERACTION_DISTANCE, false, false)) ((L2Npc)object).onBypassFeedback(activeChar, _command.substring(endOfId+1)); } activeChar.sendPacket(ActionFailed.STATIC_PACKET); } catch (NumberFormatException nfe) {} @@ -150,6 +179,9 @@ { if(!activeChar.validateBypass(_command)) return; int endOfId = _command.indexOf('_', 8); String id; @@ -232,6 +264,7 @@ { Olympiad.bypassChangeArena(_command, activeChar); } + else if (_command.startsWith("_match")) { L2PcInstance player = getClient().getActiveChar(); @@ -262,6 +295,7 @@ Hero.getInstance().showHeroDiary(player, heroclass, heroid, heropage); } } + else if (_command.startsWith("voice ")) { // only voice commands allowed in bypass Tested And working on l2jserver gracia epilogue , can be used in every client just change the imports if you use it on gracia do not forget to change the handler of the item just go on etc_item table on navicat find the correct items and change the handler to PortableAug Credits : TheEnd + Fakoykas and me for make it better. Quote
DominiQue Posted July 11, 2010 Posted July 11, 2010 What exactly u did ? How you made it BETTER ? Quote
Essiel Posted July 11, 2010 Author Posted July 11, 2010 What exactly u did ? How you made it BETTER ? Com'on dont play the smart guy better to ask fakoykas. Quote
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.
Note: Your post will require moderator approval before it will be visible.