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;
@@ -66,7 +67,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

@@ -60,16 +60,18 @@ 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
{
47387, // Balthus Knights Supply Items
60011, // Festival Fairy's Good Luck Bag
};
RESET_ITEMS.add(47387); // Balthus Knights Supply Items
RESET_ITEMS.add(60011); // Festival Fairy's Good Luck Bag
}
protected DailyTaskManager()
{