Updated Throne of Heroes to weekly reset.
Contributed by CostyKiller.
This commit is contained in:
@@ -67,7 +67,7 @@ public class Roiental extends AbstractNpcAI
|
||||
{
|
||||
htmltext = "Roiental-03a.html";
|
||||
}
|
||||
else if (player.getClan().getVariables().hasVariable("TOH_DONE"))
|
||||
else if (player.getClan().getVariables().hasVariable("TOH_GOLDBERG_DONE"))
|
||||
{
|
||||
htmltext = "Roiental-AlreadyDone.html";
|
||||
}
|
||||
@@ -94,7 +94,7 @@ public class Roiental extends AbstractNpcAI
|
||||
{
|
||||
htmltext = "Roiental-03b.html";
|
||||
}
|
||||
else if (player.getClan().getVariables().hasVariable("TOH_DONE"))
|
||||
else if (player.getClan().getVariables().hasVariable("TOH_MARYREED_DONE"))
|
||||
{
|
||||
htmltext = "Roiental-AlreadyDone.html";
|
||||
}
|
||||
@@ -121,7 +121,7 @@ public class Roiental extends AbstractNpcAI
|
||||
{
|
||||
htmltext = "Roiental-03c.html";
|
||||
}
|
||||
else if (player.getClan().getVariables().hasVariable("TOH_DONE"))
|
||||
else if (player.getClan().getVariables().hasVariable("TOH_TAUTI_DONE"))
|
||||
{
|
||||
htmltext = "Roiental-AlreadyDone.html";
|
||||
}
|
||||
|
@@ -228,7 +228,7 @@ public class ThroneOfHeroesGoldberg extends AbstractInstance
|
||||
if (!killer.isGM())
|
||||
{
|
||||
// Set clan variable
|
||||
killer.getClan().getVariables().set("TOH_DONE", System.currentTimeMillis());
|
||||
killer.getClan().getVariables().set("TOH_GOLDBERG_DONE", System.currentTimeMillis());
|
||||
killer.getClan().getVariables().storeMe();
|
||||
}
|
||||
}
|
||||
|
@@ -244,7 +244,7 @@ public class ThroneOfHeroesMaryReed extends AbstractInstance
|
||||
if (!killer.isGM())
|
||||
{
|
||||
// Set clan variable
|
||||
killer.getClan().getVariables().set("TOH_DONE", System.currentTimeMillis());
|
||||
killer.getClan().getVariables().set("TOH_MARYREED_DONE", System.currentTimeMillis());
|
||||
killer.getClan().getVariables().storeMe();
|
||||
}
|
||||
}
|
||||
|
@@ -212,7 +212,7 @@ public class ThroneOfHeroesTauti extends AbstractInstance
|
||||
if (!killer.isGM())
|
||||
{
|
||||
// Set clan variable
|
||||
killer.getClan().getVariables().set("TOH_DONE", System.currentTimeMillis());
|
||||
killer.getClan().getVariables().set("TOH_TAUTI_DONE", System.currentTimeMillis());
|
||||
killer.getClan().getVariables().storeMe();
|
||||
}
|
||||
}
|
||||
|
@@ -71,6 +71,13 @@ public class DailyTaskManager
|
||||
RESET_ITEMS.add(47387); // Balthus Knights Supply Items
|
||||
RESET_ITEMS.add(60011); // Festival Fairy's Good Luck Bag
|
||||
}
|
||||
public static final Set<String> RESET_CLAN_INSTANCES = new HashSet<>();
|
||||
static
|
||||
{
|
||||
RESET_CLAN_INSTANCES.add("TOH_GOLDBERG_DONE"); // Goldberg Instance
|
||||
RESET_CLAN_INSTANCES.add("TOH_MARYREED_DONE"); // MaryReed Instance
|
||||
RESET_CLAN_INSTANCES.add("TOH_TAUTI_DONE"); // Tauti Instance
|
||||
}
|
||||
|
||||
protected DailyTaskManager()
|
||||
{
|
||||
@@ -118,6 +125,7 @@ public class DailyTaskManager
|
||||
resetDailyMissionRewards();
|
||||
resetTimedHuntingZonesWeekly();
|
||||
resetVitalityWeekly();
|
||||
resetThroneOfHeroesWeekly();
|
||||
}
|
||||
else // All days, except Wednesday.
|
||||
{
|
||||
@@ -133,7 +141,6 @@ public class DailyTaskManager
|
||||
resetHomunculusResetPoints();
|
||||
resetRecommends();
|
||||
resetTimedHuntingZones();
|
||||
resetThroneOfHeroes();
|
||||
resetTrainingCamp();
|
||||
resetWorldChatPoints();
|
||||
}
|
||||
@@ -478,15 +485,18 @@ public class DailyTaskManager
|
||||
LOGGER.info("Clan contributions has been resetted.");
|
||||
}
|
||||
|
||||
private void resetThroneOfHeroes()
|
||||
private void resetThroneOfHeroesWeekly()
|
||||
{
|
||||
// Update data for offline players.
|
||||
try (Connection con = DatabaseFactory.getConnection())
|
||||
{
|
||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM clan_variables WHERE var=?"))
|
||||
for (String clanInstances : RESET_CLAN_INSTANCES)
|
||||
{
|
||||
ps.setString(1, "TOH_DONE");
|
||||
ps.execute();
|
||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM clan_variables WHERE var=?"))
|
||||
{
|
||||
ps.setString(1, clanInstances);
|
||||
ps.execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -506,7 +516,9 @@ public class DailyTaskManager
|
||||
}
|
||||
for (Clan clan : clans)
|
||||
{
|
||||
clan.getVariables().remove("TOH_DONE");
|
||||
clan.getVariables().remove("TOH_GOLDBERG_DONE");
|
||||
clan.getVariables().remove("TOH_MARYREED_DONE");
|
||||
clan.getVariables().remove("TOH_TAUTI_DONE");
|
||||
clan.getVariables().storeMe();
|
||||
}
|
||||
|
||||
|
@@ -67,7 +67,7 @@ public class Roiental extends AbstractNpcAI
|
||||
{
|
||||
htmltext = "Roiental-03a.html";
|
||||
}
|
||||
else if (player.getClan().getVariables().hasVariable("TOH_DONE"))
|
||||
else if (player.getClan().getVariables().hasVariable("TOH_GOLDBERG_DONE"))
|
||||
{
|
||||
htmltext = "Roiental-AlreadyDone.html";
|
||||
}
|
||||
@@ -94,7 +94,7 @@ public class Roiental extends AbstractNpcAI
|
||||
{
|
||||
htmltext = "Roiental-03b.html";
|
||||
}
|
||||
else if (player.getClan().getVariables().hasVariable("TOH_DONE"))
|
||||
else if (player.getClan().getVariables().hasVariable("TOH_MARYREED_DONE"))
|
||||
{
|
||||
htmltext = "Roiental-AlreadyDone.html";
|
||||
}
|
||||
@@ -121,7 +121,7 @@ public class Roiental extends AbstractNpcAI
|
||||
{
|
||||
htmltext = "Roiental-03c.html";
|
||||
}
|
||||
else if (player.getClan().getVariables().hasVariable("TOH_DONE"))
|
||||
else if (player.getClan().getVariables().hasVariable("TOH_TAUTI_DONE"))
|
||||
{
|
||||
htmltext = "Roiental-AlreadyDone.html";
|
||||
}
|
||||
|
@@ -228,7 +228,7 @@ public class ThroneOfHeroesGoldberg extends AbstractInstance
|
||||
if (!killer.isGM())
|
||||
{
|
||||
// Set clan variable
|
||||
killer.getClan().getVariables().set("TOH_DONE", System.currentTimeMillis());
|
||||
killer.getClan().getVariables().set("TOH_GOLDBERG_DONE", System.currentTimeMillis());
|
||||
killer.getClan().getVariables().storeMe();
|
||||
}
|
||||
}
|
||||
|
@@ -244,7 +244,7 @@ public class ThroneOfHeroesMaryReed extends AbstractInstance
|
||||
if (!killer.isGM())
|
||||
{
|
||||
// Set clan variable
|
||||
killer.getClan().getVariables().set("TOH_DONE", System.currentTimeMillis());
|
||||
killer.getClan().getVariables().set("TOH_MARYREED_DONE", System.currentTimeMillis());
|
||||
killer.getClan().getVariables().storeMe();
|
||||
}
|
||||
}
|
||||
|
@@ -212,7 +212,7 @@ public class ThroneOfHeroesTauti extends AbstractInstance
|
||||
if (!killer.isGM())
|
||||
{
|
||||
// Set clan variable
|
||||
killer.getClan().getVariables().set("TOH_DONE", System.currentTimeMillis());
|
||||
killer.getClan().getVariables().set("TOH_TAUTI_DONE", System.currentTimeMillis());
|
||||
killer.getClan().getVariables().storeMe();
|
||||
}
|
||||
}
|
||||
|
@@ -71,6 +71,13 @@ public class DailyTaskManager
|
||||
RESET_ITEMS.add(47387); // Balthus Knights Supply Items
|
||||
RESET_ITEMS.add(60011); // Festival Fairy's Good Luck Bag
|
||||
}
|
||||
public static final Set<String> RESET_CLAN_INSTANCES = new HashSet<>();
|
||||
static
|
||||
{
|
||||
RESET_CLAN_INSTANCES.add("TOH_GOLDBERG_DONE"); // Goldberg Instance
|
||||
RESET_CLAN_INSTANCES.add("TOH_MARYREED_DONE"); // MaryReed Instance
|
||||
RESET_CLAN_INSTANCES.add("TOH_TAUTI_DONE"); // Tauti Instance
|
||||
}
|
||||
|
||||
protected DailyTaskManager()
|
||||
{
|
||||
@@ -118,6 +125,7 @@ public class DailyTaskManager
|
||||
resetDailyMissionRewards();
|
||||
resetTimedHuntingZonesWeekly();
|
||||
resetVitalityWeekly();
|
||||
resetThroneOfHeroesWeekly();
|
||||
}
|
||||
else // All days, except Wednesday.
|
||||
{
|
||||
@@ -133,7 +141,6 @@ public class DailyTaskManager
|
||||
resetHomunculusResetPoints();
|
||||
resetRecommends();
|
||||
resetTimedHuntingZones();
|
||||
resetThroneOfHeroes();
|
||||
resetTrainingCamp();
|
||||
resetWorldChatPoints();
|
||||
}
|
||||
@@ -483,15 +490,18 @@ public class DailyTaskManager
|
||||
LOGGER.info("Clan contributions has been resetted.");
|
||||
}
|
||||
|
||||
private void resetThroneOfHeroes()
|
||||
private void resetThroneOfHeroesWeekly()
|
||||
{
|
||||
// Update data for offline players.
|
||||
try (Connection con = DatabaseFactory.getConnection())
|
||||
{
|
||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM clan_variables WHERE var=?"))
|
||||
for (String clanInstances : RESET_CLAN_INSTANCES)
|
||||
{
|
||||
ps.setString(1, "TOH_DONE");
|
||||
ps.execute();
|
||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM clan_variables WHERE var=?"))
|
||||
{
|
||||
ps.setString(1, clanInstances);
|
||||
ps.execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -511,7 +521,9 @@ public class DailyTaskManager
|
||||
}
|
||||
for (Clan clan : clans)
|
||||
{
|
||||
clan.getVariables().remove("TOH_DONE");
|
||||
clan.getVariables().remove("TOH_GOLDBERG_DONE");
|
||||
clan.getVariables().remove("TOH_MARYREED_DONE");
|
||||
clan.getVariables().remove("TOH_TAUTI_DONE");
|
||||
clan.getVariables().storeMe();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user