Browse Source

BETA: Removing deprecated client packet and the rest of [5054].

Zoey76 13 years ago
parent
commit
3f102b4060

+ 3 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/L2GamePacketHandler.java

@@ -180,9 +180,11 @@ public final class L2GamePacketHandler implements IPacketHandler<L2GameClient>,
 						break;
 						break;
 					case 0x15:
 					case 0x15:
 						// RequestEquipItem
 						// RequestEquipItem
+						client.handleCheat("Used obsolete RequestEquipItem packet!");
 						break;
 						break;
 					case 0x16:
 					case 0x16:
-						//msg = new RequestUnEquipItem();
+						// RequestUnEquipItem
+						client.handleCheat("Used obsolete RequestUnEquipItem packet!");
 						break;
 						break;
 					case 0x17:
 					case 0x17:
 						msg = new RequestDropItem();
 						msg = new RequestDropItem();

+ 13 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestMagicSkillUse.java

@@ -17,11 +17,15 @@ package com.l2jserver.gameserver.network.clientpackets;
 import java.util.logging.Logger;
 import java.util.logging.Logger;
 
 
 import com.l2jserver.Config;
 import com.l2jserver.Config;
+import com.l2jserver.gameserver.ai.CtrlIntention;
 import com.l2jserver.gameserver.datatables.SkillTable;
 import com.l2jserver.gameserver.datatables.SkillTable;
+import com.l2jserver.gameserver.model.L2CharPosition;
 import com.l2jserver.gameserver.model.L2Skill;
 import com.l2jserver.gameserver.model.L2Skill;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.actor.position.PcPosition;
 import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
 import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
 import com.l2jserver.gameserver.templates.skills.L2SkillType;
 import com.l2jserver.gameserver.templates.skills.L2SkillType;
+import com.l2jserver.gameserver.templates.skills.L2TargetType;
 
 
 /**
 /**
  * This class ...
  * This class ...
@@ -89,8 +93,16 @@ public final class RequestMagicSkillUse extends L2GameClientPacket
 			// players mounted on pets cannot use any toggle skills
 			// players mounted on pets cannot use any toggle skills
 			if (skill.isToggle() && activeChar.isMounted())
 			if (skill.isToggle() && activeChar.isMounted())
 				return;
 				return;
-			// activeChar.stopMove();
+			
 			activeChar.useMagic(skill, _ctrlPressed, _shiftPressed);
 			activeChar.useMagic(skill, _ctrlPressed, _shiftPressed);
+			
+			// Stop if use self-buff.
+			if(skill.getSkillType() == L2SkillType.BUFF && skill.getTargetType() == L2TargetType.TARGET_SELF)
+			{
+				final PcPosition charPos = activeChar.getPosition();
+				final L2CharPosition stopPos = new L2CharPosition(charPos.getX(), charPos.getY(), charPos.getZ(), charPos.getHeading());
+				activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, stopPos);
+			}
 		}
 		}
 		else
 		else
 		{
 		{

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestMakeMacro.java

@@ -96,7 +96,7 @@ public final class RequestMakeMacro extends L2GameClientPacket
 			player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.INVALID_MACRO));
 			player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.INVALID_MACRO));
 			return;
 			return;
 		}
 		}
-		if (player.getMacroses().getAllMacroses().length > 48)
+		if (player.getMacros().getAllMacroses().length > 48)
 		{
 		{
 			//You may create up to 48 macros.
 			//You may create up to 48 macros.
 			player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_MAY_CREATE_UP_TO_48_MACROS));
 			player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_MAY_CREATE_UP_TO_48_MACROS));

+ 0 - 143
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestUnEquipItem.java

@@ -1,143 +0,0 @@
-/*
- * 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 <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.network.clientpackets;
-
-import java.util.logging.Logger;
-
-import com.l2jserver.Config;
-import com.l2jserver.gameserver.model.L2ItemInstance;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.serverpackets.InventoryUpdate;
-import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
-import com.l2jserver.gameserver.templates.item.L2EtcItem;
-import com.l2jserver.gameserver.templates.item.L2Item;
-
-/**
- * This class ...
- * @version $Revision: 1.8.2.3.2.7 $ $Date: 2005/03/27 15:29:30 $
- */
-public class RequestUnEquipItem extends L2GameClientPacket
-{
-	private static final String _C__16_REQUESTUNEQUIPITEM = "[C] 16 RequestUnequipItem";
-	private static Logger _log = Logger.getLogger(RequestUnEquipItem.class.getName());
-	
-	// cd
-	private int _slot;
-	
-	/**
-	 * packet type id 0x11 format: cd
-	 */
-	@Override
-	protected void readImpl()
-	{
-		_slot = readD();
-	}
-	
-	@Override
-	protected void runImpl()
-	{
-		if (Config.DEBUG)
-			_log.fine("request unequip slot " + _slot);
-		
-		L2PcInstance activeChar = getClient().getActiveChar();
-		
-		if (activeChar == null)
-			return;
-		
-		L2ItemInstance item = activeChar.getInventory().getPaperdollItemByL2ItemId(_slot);
-		if (item == null)
-		{
-			// Wear-items are not to be unequipped
-			return;
-		}
-		// Prevent of unequiping a cursed weapon
-		if (_slot == L2Item.SLOT_LR_HAND && (activeChar.isCursedWeaponEquipped() || activeChar.isCombatFlagEquipped()))
-		{
-			// Message ?
-			return;
-		}
-		
-		// arrows and bolts
-		if (_slot == L2Item.SLOT_L_HAND && item.getItem() instanceof L2EtcItem)
-		{
-			// Message ?
-			return;
-		}
-		
-		// Prevent player from unequipping items in special conditions
-		if (activeChar.isStunned() || activeChar.isSleeping() || activeChar.isParalyzed() || activeChar.isAlikeDead())
-		{
-			activeChar.sendMessage("Your status does not allow you to do that.");
-			return;
-		}
-		if (activeChar.isCastingNow() || activeChar.isCastingSimultaneouslyNow())
-			return;
-		
-		if (!activeChar.getInventory().canManipulateWithItemId(item.getItemId()))
-		{
-			activeChar.sendMessage("You cannot use this item.");
-			return;
-		}
-		
-		if (item.isWeapon() && item.getWeaponItem().isForceEquip() && !activeChar.isGM())
-		{
-			activeChar.sendPacket(SystemMessageId.ITEM_CANNOT_BE_TAKEN_OFF);
-			return;
-		}
-		
-		L2ItemInstance[] unequiped = activeChar.getInventory().unEquipItemInBodySlotAndRecord(_slot);
-		
-		// show the update in the inventory
-		InventoryUpdate iu = new InventoryUpdate();
-		
-		for (L2ItemInstance itm : unequiped)
-		{
-			activeChar.checkSShotsMatch(null, itm);
-			
-			iu.addModifiedItem(itm);
-		}
-		
-		activeChar.sendPacket(iu);
-		
-		// On retail you don't stop hitting if unequip something. REOMVED: activeChar.abortAttack();
-		activeChar.broadcastUserInfo();
-		
-		// this can be 0 if the user pressed the right mousebutton twice very fast
-		if (unequiped.length > 0)
-		{
-			
-			SystemMessage sm = null;
-			if (unequiped[0].getEnchantLevel() > 0)
-			{
-				sm = SystemMessage.getSystemMessage(SystemMessageId.EQUIPMENT_S1_S2_REMOVED);
-				sm.addNumber(unequiped[0].getEnchantLevel());
-				sm.addItemName(unequiped[0]);
-			}
-			else
-			{
-				sm = SystemMessage.getSystemMessage(SystemMessageId.S1_DISARMED);
-				sm.addItemName(unequiped[0]);
-			}
-			activeChar.sendPacket(sm);
-		}
-	}
-	
-	@Override
-	public String getType()
-	{
-		return _C__16_REQUESTUNEQUIPITEM;
-	}
-}