Prevent flood from using items with enchant options.
This commit is contained in:
@@ -92,6 +92,15 @@ public class EnchantItemOptionsData implements IXmlReader
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _data.size() + " items and " + counter + " options.");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId
|
||||
* @return if specified item id has available enchant effects.
|
||||
*/
|
||||
public boolean hasOptions(int itemId)
|
||||
{
|
||||
return _data.containsKey(itemId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId
|
||||
* @param enchantLevel
|
||||
|
@@ -41,6 +41,7 @@ import org.l2jmobius.gameserver.data.ItemTable;
|
||||
import org.l2jmobius.gameserver.data.xml.AgathionData;
|
||||
import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
|
||||
import org.l2jmobius.gameserver.data.xml.ArmorSetData;
|
||||
import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData;
|
||||
import org.l2jmobius.gameserver.enums.ItemLocation;
|
||||
import org.l2jmobius.gameserver.enums.ItemSkillType;
|
||||
import org.l2jmobius.gameserver.enums.PlayerCondOverride;
|
||||
@@ -1438,7 +1439,7 @@ public abstract class Inventory extends ItemContainer
|
||||
if (old != null)
|
||||
{
|
||||
// Prevent flood from using items with skills.
|
||||
if (old.getTemplate().hasSkills())
|
||||
if (old.getTemplate().hasSkills() || EnchantItemOptionsData.getInstance().hasOptions(old.getId()))
|
||||
{
|
||||
checkEquipTask();
|
||||
}
|
||||
@@ -1503,7 +1504,7 @@ public abstract class Inventory extends ItemContainer
|
||||
if (item != null)
|
||||
{
|
||||
// Prevent flood from using items with skills.
|
||||
if (item.getTemplate().hasSkills())
|
||||
if (item.getTemplate().hasSkills() || EnchantItemOptionsData.getInstance().hasOptions(item.getId()))
|
||||
{
|
||||
checkEquipTask();
|
||||
}
|
||||
@@ -1601,7 +1602,7 @@ public abstract class Inventory extends ItemContainer
|
||||
getOwner().updateAbnormalVisualEffects();
|
||||
getOwner().getActingPlayer().sendSkillList();
|
||||
_skillItemTask = null;
|
||||
}, 100);
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -229,7 +229,7 @@ public class GameClient extends ChannelInboundHandler<GameClient>
|
||||
|
||||
if (_player != null)
|
||||
{
|
||||
// Avoid flood from class change or using items with skills.
|
||||
// Prevent flood from class change or using items with skills.
|
||||
if ((_player.isChangingClass() || _player.isUsingSkillItem()) && ((packet instanceof SkillList) || (packet instanceof AcquireSkillList) || (packet instanceof ExUserInfoAbnormalVisualEffect) || (packet instanceof AbnormalStatusUpdate) || (packet instanceof ExAbnormalStatusUpdateFromTarget)))
|
||||
{
|
||||
return;
|
||||
|
Reference in New Issue
Block a user