From 46a1c6d6818fb3a104264d197c743bdd46f1a5f4 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Fri, 22 Jun 2018 20:16:14 +0000 Subject: [PATCH] Addition of RequestTargetActionMenu packet. --- .../gameserver/network/ExIncomingPackets.java | 1 + .../RequestTargetActionMenu.java | 62 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/network/clientpackets/RequestTargetActionMenu.java diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java index 4a85f53f62..10826c53ec 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -337,6 +337,7 @@ public enum ExIncomingPackets implements IIncomingPackets REQUEST_NEW_ENCHANT_CLOSE(0xF8, RequestNewEnchantClose::new, ConnectionState.IN_GAME), REQUEST_NEW_ENCHANT_TRY(0xF9, RequestNewEnchantTry::new, ConnectionState.IN_GAME), REQUEST_NEW_ENCHANT_RETRY_TO_PUT_ITEMS(0xFA, RequestNewEnchantRetryToPutItems::new, ConnectionState.IN_GAME), + REQUEST_TARGET_ACTION_MENU(0xFE, RequestTargetActionMenu::new, ConnectionState.IN_GAME), EX_SEND_SELECTED_QUEST_ZONE_ID(0xFF, ExSendSelectedQuestZoneID::new, ConnectionState.IN_GAME), REQUEST_ALCHEMY_SKILL_LIST(0x100, RequestAlchemySkillList::new, ConnectionState.IN_GAME), REQUEST_ALCHEMY_TRY_MIX_CUBE(0x101, null, ConnectionState.IN_GAME), diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/network/clientpackets/RequestTargetActionMenu.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/network/clientpackets/RequestTargetActionMenu.java new file mode 100644 index 0000000000..e6850a5a24 --- /dev/null +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/network/clientpackets/RequestTargetActionMenu.java @@ -0,0 +1,62 @@ +/* + * This file is part of the L2J Mobius project. + * + * 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 3 of the License, 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, see . + */ +package com.l2jmobius.gameserver.network.clientpackets; + +import com.l2jmobius.commons.network.PacketReader; +import com.l2jmobius.gameserver.model.L2Object; +import com.l2jmobius.gameserver.model.L2World; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.network.L2GameClient; + +/** + * @author Mobius + */ +public class RequestTargetActionMenu implements IClientIncomingPacket +{ + private int _objectId; + private int _type; + + @Override + public boolean read(L2GameClient client, PacketReader packet) + { + _objectId = packet.readD(); + _type = packet.readH(); // action? + return true; + } + + @Override + public void run(L2GameClient client) + { + final L2PcInstance player = client.getActiveChar(); + if (player == null) + { + return; + } + + if (_type == 1) + { + for (L2Object object : L2World.getInstance().getVisibleObjects(player, L2Object.class)) + { + if (_objectId == object.getObjectId()) + { + player.setTarget(object); + break; + } + } + } + } +}