Additions for Throne of Heroes instances.
Contributed by CostyKiller.
This commit is contained in:
@@ -19,7 +19,9 @@ package org.l2jmobius.gameserver.instancemanager;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
@@ -67,6 +69,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
||||
resetRecommends();
|
||||
resetWorldChatPoints();
|
||||
resetTrainingCamp();
|
||||
resetThroneOfHeroes();
|
||||
}
|
||||
|
||||
@ScheduleTarget
|
||||
@@ -252,6 +255,41 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
||||
DailyMissionData.getInstance().getDailyMissionData().forEach(DailyMissionDataHolder::reset);
|
||||
}
|
||||
|
||||
public void resetThroneOfHeroes()
|
||||
{
|
||||
// Update data for offline players.
|
||||
try (Connection con = DatabaseFactory.getConnection())
|
||||
{
|
||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM clan_variables WHERE var=?"))
|
||||
{
|
||||
ps.setString(1, "TOH_DONE");
|
||||
ps.execute();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Throne of Heroes Reenter: " + e);
|
||||
}
|
||||
|
||||
// Update data for online players.
|
||||
final Set<Clan> clans = new HashSet<>();
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final Clan clan = player.getClan();
|
||||
if (clan != null)
|
||||
{
|
||||
clans.add(clan);
|
||||
}
|
||||
}
|
||||
for (Clan clan : clans)
|
||||
{
|
||||
clan.getVariables().remove("TOH_DONE");
|
||||
clan.getVariables().storeMe();
|
||||
}
|
||||
|
||||
LOGGER.info("Throne of Heroes Entry has been resetted.");
|
||||
}
|
||||
|
||||
public static DailyTaskManager getInstance()
|
||||
{
|
||||
return SingletonHolder.INSTANCE;
|
||||
|
@@ -38717,7 +38717,7 @@ public class NpcStringId
|
||||
public static NpcStringId ANTHARAS_HAS_SUFFERED_CRITICAL_INJURIES;
|
||||
|
||||
@ClientString(id = 1803449, message = "Zaken! Your time has come! Kill them all!")
|
||||
public static NpcStringId MARY_REED_SUMMONS_ZAKEN;
|
||||
public static NpcStringId ZAKEN_YOUR_TIME_HAS_COME;
|
||||
|
||||
@ClientString(id = 1803450, message = "Mary Reed reveals her true power.")
|
||||
public static NpcStringId MARY_REED_REVEALS_HER_TRUE_POWER;
|
||||
@@ -39082,8 +39082,8 @@ public class NpcStringId
|
||||
@ClientString(id = 1803599, message = "The fourth challenge begins.")
|
||||
public static NpcStringId THE_FOURTH_CHALLENGE_BEGINS;
|
||||
|
||||
@ClientString(id = 1803600, message = "The fourth challenge has been completed successfully.")
|
||||
public static NpcStringId THE_FOURTH_CHALLENGE_HAS_BEEN_COMPLETED_SUCCESSFULLY;
|
||||
@ClientString(id = 1803600, message = "Mary Reed summons Zaken.\nZaken will be here very soon.")
|
||||
public static NpcStringId MARY_REED_SUMMONS_ZAKEN;
|
||||
|
||||
@ClientString(id = 1803601, message = "Ekimus summons his minions.")
|
||||
public static NpcStringId EKIMUS_SUMMONS_HIS_MINIONS;
|
||||
|
Reference in New Issue
Block a user