Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
/** Weapon Equip Task */
private static class WeaponEquipTask implements Runnable
{
private final L2PcInstance activeChar;
protected WeaponEquipTask(L2PcInstance character)
{
activeChar = character;
}
@Override
public void run()
{
// Check if the item is still on inventory.
final ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId);
if (item == null)
return;
// Equip or unEquip
activeChar.useEquippableItem(item, false);
}
}
if (activeChar.isAttackingNow())
ThreadPool.schedule(() -> {
final ItemInstance itemToTest = activeChar.getInventory().getItemByObjectId(_objectId);
if(itemToTest == null)
return;
activeChar.useEquippableItem(itemToTest, false);
}, activeChar.getAttackEndTime() - System.currentTimeMillis());
else
activeChar.useEquippableItem(item, true);
public static boolean canBypassCheck(final Player player, final NpcInstance npc) {
if (npc == null || player.isDead() || !npc.isInRangeZ(player, npc.getInteractDistance(player)) || player.isTerritoryFlagEquipped()) {
player.sendActionFailed();
return false;
}
return true;
}