Exclude items included in DailyTaskManager from extractable consumption.

This commit is contained in:
MobiusDevelopment
2022-03-25 22:24:23 +00:00
parent 1970695d10
commit 8404832faa
42 changed files with 268 additions and 171 deletions

View File

@@ -26,6 +26,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.ItemTable;
import org.l2jmobius.gameserver.handler.IItemHandler;
import org.l2jmobius.gameserver.instancemanager.DailyTaskManager;
import org.l2jmobius.gameserver.model.ExtractableProduct;
import org.l2jmobius.gameserver.model.actor.Playable;
import org.l2jmobius.gameserver.model.actor.Player;
@@ -67,7 +68,7 @@ public class ExtractableItems implements IItemHandler
}
// destroy item
if (!player.destroyItem("Extract", item.getObjectId(), 1, player, true))
if (!DailyTaskManager.RESET_ITEMS.contains(item.getId()) && !player.destroyItem("Extract", item.getObjectId(), 1, player, true))
{
return false;
}

View File

@@ -21,6 +21,8 @@ import java.sql.PreparedStatement;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -56,15 +58,17 @@ public class DailyTaskManager
private static final Logger LOGGER = Logger.getLogger(DailyTaskManager.class.getName());
private static final SimpleDateFormat SDF = new SimpleDateFormat("dd/MM HH:mm");
private static final int[] RESET_SKILLS =
private static final Set<Integer> RESET_SKILLS = new HashSet<>();
static
{
2510, // Wondrous Cubic
22180, // Wondrous Cubic - 1 time use
};
private static final int[] RESET_ITEMS =
RESET_SKILLS.add(2510); // Wondrous Cubic
RESET_SKILLS.add(22180); // Wondrous Cubic - 1 time use
}
public static final Set<Integer> RESET_ITEMS = new HashSet<>();
static
{
49782, // Balthus Knights' Supply Box
};
RESET_ITEMS.add(49782); // Balthus Knights' Supply Box
}
protected DailyTaskManager()
{