Removed obsolete compound methods.
This commit is contained in:
parent
c0a6ffbb64
commit
bd7da50452
@ -170,8 +170,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
private int _sharedReuseGroup;
|
||||
|
||||
private CommissionItemType _commissionItemType;
|
||||
private int _compoundItem;
|
||||
private float _compoundChance;
|
||||
|
||||
private boolean _isAppearanceable;
|
||||
private boolean _isBlessed;
|
||||
@ -230,8 +228,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
_reuseDelay = set.getInt("reuse_delay", 0);
|
||||
_sharedReuseGroup = set.getInt("shared_reuse_group", 0);
|
||||
_commissionItemType = set.getEnum("commissionItemType", CommissionItemType.class, CommissionItemType.OTHER_ITEM);
|
||||
_compoundItem = set.getInt("compoundItem", 0);
|
||||
_compoundChance = set.getFloat("compoundChance", 0);
|
||||
_common = ((_itemId >= 11605) && (_itemId <= 12361));
|
||||
_heroItem = ((_itemId >= 6611) && (_itemId <= 6621)) || ((_itemId >= 9388) && (_itemId <= 9390)) || (_itemId == 6842);
|
||||
_pvpItem = ((_itemId >= 10667) && (_itemId <= 10835)) || ((_itemId >= 12852) && (_itemId <= 12977)) || ((_itemId >= 14363) && (_itemId <= 14525)) || (_itemId == 14528) || (_itemId == 14529) || (_itemId == 14558) || ((_itemId >= 15913) && (_itemId <= 16024)) || ((_itemId >= 16134) && (_itemId <= 16147)) || (_itemId == 16149) || (_itemId == 16151) || (_itemId == 16153) || (_itemId == 16155) || (_itemId == 16157) || (_itemId == 16159) || ((_itemId >= 16168) && (_itemId <= 16176)) || ((_itemId >= 16179) && (_itemId <= 16220));
|
||||
@ -966,16 +962,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
return _commissionItemType;
|
||||
}
|
||||
|
||||
public int getCompoundItem()
|
||||
{
|
||||
return _compoundItem;
|
||||
}
|
||||
|
||||
public float getCompoundChance()
|
||||
{
|
||||
return _compoundChance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Usable in HTML windows.
|
||||
* @return the icon link in client files
|
||||
|
@ -170,8 +170,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
private int _sharedReuseGroup;
|
||||
|
||||
private CommissionItemType _commissionItemType;
|
||||
private int _compoundItem;
|
||||
private float _compoundChance;
|
||||
|
||||
private boolean _isAppearanceable;
|
||||
private boolean _isBlessed;
|
||||
@ -230,8 +228,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
_reuseDelay = set.getInt("reuse_delay", 0);
|
||||
_sharedReuseGroup = set.getInt("shared_reuse_group", 0);
|
||||
_commissionItemType = set.getEnum("commissionItemType", CommissionItemType.class, CommissionItemType.OTHER_ITEM);
|
||||
_compoundItem = set.getInt("compoundItem", 0);
|
||||
_compoundChance = set.getFloat("compoundChance", 0);
|
||||
_common = ((_itemId >= 11605) && (_itemId <= 12361));
|
||||
_heroItem = ((_itemId >= 6611) && (_itemId <= 6621)) || ((_itemId >= 9388) && (_itemId <= 9390)) || (_itemId == 6842);
|
||||
_pvpItem = ((_itemId >= 10667) && (_itemId <= 10835)) || ((_itemId >= 12852) && (_itemId <= 12977)) || ((_itemId >= 14363) && (_itemId <= 14525)) || (_itemId == 14528) || (_itemId == 14529) || (_itemId == 14558) || ((_itemId >= 15913) && (_itemId <= 16024)) || ((_itemId >= 16134) && (_itemId <= 16147)) || (_itemId == 16149) || (_itemId == 16151) || (_itemId == 16153) || (_itemId == 16155) || (_itemId == 16157) || (_itemId == 16159) || ((_itemId >= 16168) && (_itemId <= 16176)) || ((_itemId >= 16179) && (_itemId <= 16220));
|
||||
@ -966,16 +962,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
return _commissionItemType;
|
||||
}
|
||||
|
||||
public int getCompoundItem()
|
||||
{
|
||||
return _compoundItem;
|
||||
}
|
||||
|
||||
public float getCompoundChance()
|
||||
{
|
||||
return _compoundChance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Usable in HTML windows.
|
||||
* @return the icon link in client files
|
||||
|
@ -54,6 +54,7 @@ import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchant
|
||||
import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantPushTwo;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantRemoveOne;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantRemoveTwo;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantRetryToPutItems;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantTry;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.crystalization.RequestCrystallizeEstimate;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.crystalization.RequestCrystallizeItemCancel;
|
||||
|
@ -1,12 +1,14 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
* Copyright (C) 2004-2016 L2J Unity
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* This file is part of L2J Unity.
|
||||
*
|
||||
* L2J Unity 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,
|
||||
* L2J Unity 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.
|
||||
@ -14,14 +16,17 @@
|
||||
* 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.l2jmobius.gameserver.network.clientpackets;
|
||||
package com.l2jmobius.gameserver.network.clientpackets.compound;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketReader;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.request.CompoundRequest;
|
||||
import com.l2jmobius.gameserver.model.items.combination.CombinationItem;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExEnchantRetryToPutItemFail;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExEnchantRetryToPutItemOk;
|
||||
|
||||
@ -89,14 +94,15 @@ public class RequestNewEnchantRetryToPutItems implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
final CombinationItem combinationItem = CombinationItemsData.getInstance().getItemsBySlots(itemOne.getId(), itemTwo.getId());
|
||||
|
||||
// Not implemented or not able to merge!
|
||||
if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0))
|
||||
if (combinationItem == null)
|
||||
{
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
activeChar.removeRequest(request.getClass());
|
||||
return;
|
||||
}
|
||||
|
||||
client.sendPacket(ExEnchantRetryToPutItemOk.STATIC_PACKET);
|
||||
}
|
||||
}
|
@ -171,8 +171,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
private int _sharedReuseGroup;
|
||||
|
||||
private CommissionItemType _commissionItemType;
|
||||
private int _compoundItem;
|
||||
private float _compoundChance;
|
||||
|
||||
private boolean _isAppearanceable;
|
||||
private boolean _isBlessed;
|
||||
@ -231,8 +229,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
_reuseDelay = set.getInt("reuse_delay", 0);
|
||||
_sharedReuseGroup = set.getInt("shared_reuse_group", 0);
|
||||
_commissionItemType = set.getEnum("commissionItemType", CommissionItemType.class, CommissionItemType.OTHER_ITEM);
|
||||
_compoundItem = set.getInt("compoundItem", 0);
|
||||
_compoundChance = set.getFloat("compoundChance", 0);
|
||||
_common = ((_itemId >= 11605) && (_itemId <= 12361));
|
||||
_heroItem = ((_itemId >= 6611) && (_itemId <= 6621)) || ((_itemId >= 9388) && (_itemId <= 9390)) || (_itemId == 6842);
|
||||
_pvpItem = ((_itemId >= 10667) && (_itemId <= 10835)) || ((_itemId >= 12852) && (_itemId <= 12977)) || ((_itemId >= 14363) && (_itemId <= 14525)) || (_itemId == 14528) || (_itemId == 14529) || (_itemId == 14558) || ((_itemId >= 15913) && (_itemId <= 16024)) || ((_itemId >= 16134) && (_itemId <= 16147)) || (_itemId == 16149) || (_itemId == 16151) || (_itemId == 16153) || (_itemId == 16155) || (_itemId == 16157) || (_itemId == 16159) || ((_itemId >= 16168) && (_itemId <= 16176)) || ((_itemId >= 16179) && (_itemId <= 16220));
|
||||
@ -967,16 +963,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
return _commissionItemType;
|
||||
}
|
||||
|
||||
public int getCompoundItem()
|
||||
{
|
||||
return _compoundItem;
|
||||
}
|
||||
|
||||
public float getCompoundChance()
|
||||
{
|
||||
return _compoundChance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Usable in HTML windows.
|
||||
* @return the icon link in client files
|
||||
|
@ -54,6 +54,7 @@ import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchant
|
||||
import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantPushTwo;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantRemoveOne;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantRemoveTwo;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantRetryToPutItems;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantTry;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.crystalization.RequestCrystallizeEstimate;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.crystalization.RequestCrystallizeItemCancel;
|
||||
|
@ -1,102 +1,108 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketReader;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.request.CompoundRequest;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExEnchantRetryToPutItemFail;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExEnchantRetryToPutItemOk;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public class RequestNewEnchantRetryToPutItems implements IClientIncomingPacket
|
||||
{
|
||||
private int _firstItemObjectId;
|
||||
private int _secondItemObjectId;
|
||||
|
||||
@Override
|
||||
public boolean read(L2GameClient client, PacketReader packet)
|
||||
{
|
||||
_firstItemObjectId = packet.readD();
|
||||
_secondItemObjectId = packet.readD();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(L2GameClient client)
|
||||
{
|
||||
final L2PcInstance activeChar = client.getActiveChar();
|
||||
if (activeChar == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (activeChar.isInStoreMode())
|
||||
{
|
||||
client.sendPacket(SystemMessageId.YOU_CANNOT_DO_THAT_WHILE_IN_A_PRIVATE_STORE_OR_PRIVATE_WORKSHOP);
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
else if (activeChar.isProcessingTransaction() || activeChar.isProcessingRequest())
|
||||
{
|
||||
client.sendPacket(SystemMessageId.YOU_CANNOT_USE_THIS_SYSTEM_DURING_TRADING_PRIVATE_STORE_AND_WORKSHOP_SETUP);
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
final CompoundRequest request = new CompoundRequest(activeChar);
|
||||
if (!activeChar.addRequest(request))
|
||||
{
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure player owns first item.
|
||||
request.setItemOne(_firstItemObjectId);
|
||||
final L2ItemInstance itemOne = request.getItemOne();
|
||||
if (itemOne == null)
|
||||
{
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
activeChar.removeRequest(request.getClass());
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure player owns second item.
|
||||
request.setItemTwo(_secondItemObjectId);
|
||||
final L2ItemInstance itemTwo = request.getItemTwo();
|
||||
if (itemTwo == null)
|
||||
{
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
activeChar.removeRequest(request.getClass());
|
||||
return;
|
||||
}
|
||||
|
||||
// Not implemented or not able to merge!
|
||||
if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0))
|
||||
{
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
activeChar.removeRequest(request.getClass());
|
||||
return;
|
||||
}
|
||||
|
||||
client.sendPacket(ExEnchantRetryToPutItemOk.STATIC_PACKET);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Copyright (C) 2004-2016 L2J Unity
|
||||
*
|
||||
* This file is part of L2J Unity.
|
||||
*
|
||||
* L2J Unity 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.
|
||||
*
|
||||
* L2J Unity 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.l2jmobius.gameserver.network.clientpackets.compound;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketReader;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.request.CompoundRequest;
|
||||
import com.l2jmobius.gameserver.model.items.combination.CombinationItem;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExEnchantRetryToPutItemFail;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExEnchantRetryToPutItemOk;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public class RequestNewEnchantRetryToPutItems implements IClientIncomingPacket
|
||||
{
|
||||
private int _firstItemObjectId;
|
||||
private int _secondItemObjectId;
|
||||
|
||||
@Override
|
||||
public boolean read(L2GameClient client, PacketReader packet)
|
||||
{
|
||||
_firstItemObjectId = packet.readD();
|
||||
_secondItemObjectId = packet.readD();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(L2GameClient client)
|
||||
{
|
||||
final L2PcInstance activeChar = client.getActiveChar();
|
||||
if (activeChar == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (activeChar.isInStoreMode())
|
||||
{
|
||||
client.sendPacket(SystemMessageId.YOU_CANNOT_DO_THAT_WHILE_IN_A_PRIVATE_STORE_OR_PRIVATE_WORKSHOP);
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
else if (activeChar.isProcessingTransaction() || activeChar.isProcessingRequest())
|
||||
{
|
||||
client.sendPacket(SystemMessageId.YOU_CANNOT_USE_THIS_SYSTEM_DURING_TRADING_PRIVATE_STORE_AND_WORKSHOP_SETUP);
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
final CompoundRequest request = new CompoundRequest(activeChar);
|
||||
if (!activeChar.addRequest(request))
|
||||
{
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure player owns first item.
|
||||
request.setItemOne(_firstItemObjectId);
|
||||
final L2ItemInstance itemOne = request.getItemOne();
|
||||
if (itemOne == null)
|
||||
{
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
activeChar.removeRequest(request.getClass());
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure player owns second item.
|
||||
request.setItemTwo(_secondItemObjectId);
|
||||
final L2ItemInstance itemTwo = request.getItemTwo();
|
||||
if (itemTwo == null)
|
||||
{
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
activeChar.removeRequest(request.getClass());
|
||||
return;
|
||||
}
|
||||
|
||||
final CombinationItem combinationItem = CombinationItemsData.getInstance().getItemsBySlots(itemOne.getId(), itemTwo.getId());
|
||||
|
||||
// Not implemented or not able to merge!
|
||||
if (combinationItem == null)
|
||||
{
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
activeChar.removeRequest(request.getClass());
|
||||
return;
|
||||
}
|
||||
client.sendPacket(ExEnchantRetryToPutItemOk.STATIC_PACKET);
|
||||
}
|
||||
}
|
@ -173,8 +173,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
private int _sharedReuseGroup;
|
||||
|
||||
private CommissionItemType _commissionItemType;
|
||||
private int _compoundItem;
|
||||
private float _compoundChance;
|
||||
|
||||
private boolean _isAppearanceable;
|
||||
private boolean _isBlessed;
|
||||
@ -233,8 +231,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
_reuseDelay = set.getInt("reuse_delay", 0);
|
||||
_sharedReuseGroup = set.getInt("shared_reuse_group", 0);
|
||||
_commissionItemType = set.getEnum("commissionItemType", CommissionItemType.class, CommissionItemType.OTHER_ITEM);
|
||||
_compoundItem = set.getInt("compoundItem", 0);
|
||||
_compoundChance = set.getFloat("compoundChance", 0);
|
||||
_common = ((_itemId >= 11605) && (_itemId <= 12361));
|
||||
_heroItem = ((_itemId >= 6611) && (_itemId <= 6621)) || ((_itemId >= 9388) && (_itemId <= 9390)) || (_itemId == 6842);
|
||||
_pvpItem = ((_itemId >= 10667) && (_itemId <= 10835)) || ((_itemId >= 12852) && (_itemId <= 12977)) || ((_itemId >= 14363) && (_itemId <= 14525)) || (_itemId == 14528) || (_itemId == 14529) || (_itemId == 14558) || ((_itemId >= 15913) && (_itemId <= 16024)) || ((_itemId >= 16134) && (_itemId <= 16147)) || (_itemId == 16149) || (_itemId == 16151) || (_itemId == 16153) || (_itemId == 16155) || (_itemId == 16157) || (_itemId == 16159) || ((_itemId >= 16168) && (_itemId <= 16176)) || ((_itemId >= 16179) && (_itemId <= 16220));
|
||||
@ -969,16 +965,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
return _commissionItemType;
|
||||
}
|
||||
|
||||
public int getCompoundItem()
|
||||
{
|
||||
return _compoundItem;
|
||||
}
|
||||
|
||||
public float getCompoundChance()
|
||||
{
|
||||
return _compoundChance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Usable in HTML windows.
|
||||
* @return the icon link in client files
|
||||
|
@ -54,6 +54,7 @@ import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchant
|
||||
import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantPushTwo;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantRemoveOne;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantRemoveTwo;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantRetryToPutItems;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantTry;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.crystalization.RequestCrystallizeEstimate;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.crystalization.RequestCrystallizeItemCancel;
|
||||
|
@ -1,102 +0,0 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketReader;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.request.CompoundRequest;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExEnchantRetryToPutItemFail;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExEnchantRetryToPutItemOk;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public class RequestNewEnchantRetryToPutItems implements IClientIncomingPacket
|
||||
{
|
||||
private int _firstItemObjectId;
|
||||
private int _secondItemObjectId;
|
||||
|
||||
@Override
|
||||
public boolean read(L2GameClient client, PacketReader packet)
|
||||
{
|
||||
_firstItemObjectId = packet.readD();
|
||||
_secondItemObjectId = packet.readD();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(L2GameClient client)
|
||||
{
|
||||
final L2PcInstance activeChar = client.getActiveChar();
|
||||
if (activeChar == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (activeChar.isInStoreMode())
|
||||
{
|
||||
client.sendPacket(SystemMessageId.YOU_CANNOT_DO_THAT_WHILE_IN_A_PRIVATE_STORE_OR_PRIVATE_WORKSHOP);
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
else if (activeChar.isProcessingTransaction() || activeChar.isProcessingRequest())
|
||||
{
|
||||
client.sendPacket(SystemMessageId.YOU_CANNOT_USE_THIS_SYSTEM_DURING_TRADING_PRIVATE_STORE_AND_WORKSHOP_SETUP);
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
final CompoundRequest request = new CompoundRequest(activeChar);
|
||||
if (!activeChar.addRequest(request))
|
||||
{
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure player owns first item.
|
||||
request.setItemOne(_firstItemObjectId);
|
||||
final L2ItemInstance itemOne = request.getItemOne();
|
||||
if (itemOne == null)
|
||||
{
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
activeChar.removeRequest(request.getClass());
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure player owns second item.
|
||||
request.setItemTwo(_secondItemObjectId);
|
||||
final L2ItemInstance itemTwo = request.getItemTwo();
|
||||
if (itemTwo == null)
|
||||
{
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
activeChar.removeRequest(request.getClass());
|
||||
return;
|
||||
}
|
||||
|
||||
// Not implemented or not able to merge!
|
||||
if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0))
|
||||
{
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
activeChar.removeRequest(request.getClass());
|
||||
return;
|
||||
}
|
||||
|
||||
client.sendPacket(ExEnchantRetryToPutItemOk.STATIC_PACKET);
|
||||
}
|
||||
}
|
@ -1,12 +1,14 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
* Copyright (C) 2004-2016 L2J Unity
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* This file is part of L2J Unity.
|
||||
*
|
||||
* L2J Unity 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,
|
||||
* L2J Unity 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.
|
||||
@ -14,14 +16,17 @@
|
||||
* 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.l2jmobius.gameserver.network.clientpackets;
|
||||
package com.l2jmobius.gameserver.network.clientpackets.compound;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketReader;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.request.CompoundRequest;
|
||||
import com.l2jmobius.gameserver.model.items.combination.CombinationItem;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExEnchantRetryToPutItemFail;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExEnchantRetryToPutItemOk;
|
||||
|
||||
@ -89,14 +94,15 @@ public class RequestNewEnchantRetryToPutItems implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
final CombinationItem combinationItem = CombinationItemsData.getInstance().getItemsBySlots(itemOne.getId(), itemTwo.getId());
|
||||
|
||||
// Not implemented or not able to merge!
|
||||
if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0))
|
||||
if (combinationItem == null)
|
||||
{
|
||||
client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET);
|
||||
activeChar.removeRequest(request.getClass());
|
||||
return;
|
||||
}
|
||||
|
||||
client.sendPacket(ExEnchantRetryToPutItemOk.STATIC_PACKET);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user