diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/db_installer/sql/game/character_purge.sql b/L2J_Mobius_Essence_5.2_FrostLord/dist/db_installer/sql/game/character_purge.sql index c324505a25..d50a902ce1 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/db_installer/sql/game/character_purge.sql +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/db_installer/sql/game/character_purge.sql @@ -4,5 +4,6 @@ CREATE TABLE IF NOT EXISTS `character_purge` ( `category` int(3) UNSIGNED NOT NULL DEFAULT 0, `points` int(10) UNSIGNED NOT NULL DEFAULT 0, `keys` int(10) UNSIGNED NOT NULL DEFAULT 0, + `remainingKeys` int(10) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`charId`,`category`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; \ No newline at end of file diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/CrumaTowerPurge.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/CrumaTowerPurge.java index cb6a9a7bde..9731380f54 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/CrumaTowerPurge.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/CrumaTowerPurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class CrumaTowerPurge extends AbstractNpcAI { private static final int CATEGORY = 1; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class CrumaTowerPurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class CrumaTowerPurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new CrumaTowerPurge(); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/DragonValleyPurge.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/DragonValleyPurge.java index 186d5e143e..ca006b197a 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/DragonValleyPurge.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/DragonValleyPurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class DragonValleyPurge extends AbstractNpcAI { private static final int CATEGORY = 5; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class DragonValleyPurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class DragonValleyPurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new DragonValleyPurge(); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/OrcBarracksPurge.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/OrcBarracksPurge.java index 56dc1a6cd5..50741d0313 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/OrcBarracksPurge.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/OrcBarracksPurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class OrcBarracksPurge extends AbstractNpcAI { private static final int CATEGORY = 7; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class OrcBarracksPurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class OrcBarracksPurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new OrcBarracksPurge(); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/PlainsOfTheLizardmenPurge.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/PlainsOfTheLizardmenPurge.java index 632a84d80d..5b15777cab 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/PlainsOfTheLizardmenPurge.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/PlainsOfTheLizardmenPurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class PlainsOfTheLizardmenPurge extends AbstractNpcAI { private static final int CATEGORY = 3; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class PlainsOfTheLizardmenPurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class PlainsOfTheLizardmenPurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new PlainsOfTheLizardmenPurge(); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/SelMahumBasePurge.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/SelMahumBasePurge.java index d41a85285d..7dbb6761d8 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/SelMahumBasePurge.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/SelMahumBasePurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class SelMahumBasePurge extends AbstractNpcAI { private static final int CATEGORY = 6; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class SelMahumBasePurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class SelMahumBasePurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new SelMahumBasePurge(); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/SilentValleyPurge.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/SilentValleyPurge.java index 4b9b46374c..1c0766369a 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/SilentValleyPurge.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/SilentValleyPurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class SilentValleyPurge extends AbstractNpcAI { private static final int CATEGORY = 2; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class SilentValleyPurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class SilentValleyPurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new SilentValleyPurge(); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/TowerOfInsolencePurge.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/TowerOfInsolencePurge.java index 592d17cdf7..d8647d4dde 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/TowerOfInsolencePurge.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/others/Subjugation/TowerOfInsolencePurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class TowerOfInsolencePurge extends AbstractNpcAI { private static final int CATEGORY = 4; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class TowerOfInsolencePurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class TowerOfInsolencePurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new TowerOfInsolencePurge(); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java index a8a7318bf2..2a95378db9 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java @@ -137,6 +137,7 @@ public class DailyTaskManager resetRecommends(); resetTrainingCamp(); resetTimedHuntingZones(); + resetMorgosMilitaryBase(); resetDailyMissionRewards(); resetAttendanceRewards(); resetVip(); @@ -699,6 +700,32 @@ public class DailyTaskManager LOGGER.info("Daily payment resurrection count for player has been resetted."); } + private void resetMorgosMilitaryBase() + { + // Update data for offline players. + try (Connection con = DatabaseFactory.getConnection()) + { + try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?")) + { + ps.setString(1, "MORGOS_MILITARY_FREE"); + ps.execute(); + } + } + catch (Exception e) + { + LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset MorgosMilitaryBase: " + e); + } + + // Update data for online players. + for (Player player : World.getInstance().getPlayers()) + { + player.getAccountVariables().remove("MORGOS_MILITARY_FREE"); + player.getAccountVariables().storeMe(); + } + + LOGGER.info("MorgosMilitaryBase has been resetted."); + } + public static DailyTaskManager getInstance() { return SingletonHolder.INSTANCE; diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/instancemanager/PurgeRankingManager.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/instancemanager/PurgeRankingManager.java index d25616e102..d6d3f81859 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/instancemanager/PurgeRankingManager.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/instancemanager/PurgeRankingManager.java @@ -150,7 +150,7 @@ public class PurgeRankingManager if (onlinePlayer != null) { onlinePlayer.getPurgePoints().clear(); - onlinePlayer.sendPacket(new ExSubjugationSidebar(category, new PurgePlayerHolder(0, 0))); + onlinePlayer.sendPacket(new ExSubjugationSidebar(null, new PurgePlayerHolder(0, 0, 0))); } counter++; diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Player.java index b4b4e7f166..0d2bbfd131 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -456,7 +456,7 @@ public class Player extends Playable // Purge list: private static final String DELETE_SUBJUGATION = "DELETE FROM character_purge WHERE charId=?"; - private static final String INSERT_SUBJUGATION = "REPLACE INTO character_purge (`charId`, `category`, `points`, `keys`) VALUES (?, ?, ?, ?)"; + private static final String INSERT_SUBJUGATION = "REPLACE INTO character_purge (`charId`, `category`, `points`, `keys`, `remainingKeys`) VALUES (?, ?, ?, ?, ?)"; private static final String RESTORE_SUBJUGATION = "SELECT * FROM character_purge WHERE charId=?"; // Elemental Spirits: @@ -15349,6 +15349,7 @@ public class Player extends Playable st.setInt(2, category); st.setInt(3, data.getPoints()); st.setInt(4, data.getKeys()); + st.setInt(5, data.getMaxPeriodicKeys()); st.addBatch(); } catch (Exception e) @@ -15381,7 +15382,7 @@ public class Player extends Playable { while (rset.next()) { - _purgePoints.put(rset.getInt("category"), new PurgePlayerHolder(rset.getInt("points"), rset.getInt("keys"))); + _purgePoints.put(rset.getInt("category"), new PurgePlayerHolder(rset.getInt("points"), rset.getInt("keys"), rset.getInt("remainingKeys"))); } } @@ -15392,6 +15393,16 @@ public class Player extends Playable } } + public int getPurgeLastCategory() + { + return getVariables().getInt(PlayerVariables.PURGE_LAST_CATEGORY, 1); + } + + public void setPurgeLastCategory(int category) + { + getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, category); + } + public int getClanDonationPoints() { return getVariables().getInt(PlayerVariables.CLAN_DONATION_POINTS, 3); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/holders/PurgePlayerHolder.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/holders/PurgePlayerHolder.java index 7ce8b95ca2..f8feb7e5eb 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/holders/PurgePlayerHolder.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/holders/PurgePlayerHolder.java @@ -17,17 +17,19 @@ package org.l2jmobius.gameserver.model.holders; /** - * Written by Berezkin Nikolay, on 04.05.2021 + * Written by Berezkin Nikolay, Serenitty */ public class PurgePlayerHolder { private final int _points; private final int _keys; + private int _getMaxPeriodicKeys; - public PurgePlayerHolder(int points, int keys) + public PurgePlayerHolder(int points, int keys, int remainingKeys) { _points = points; _keys = keys; + _getMaxPeriodicKeys = remainingKeys; } public int getPoints() @@ -39,4 +41,13 @@ public class PurgePlayerHolder { return _keys; } + + public int getMaxPeriodicKeys() + { + if ((_keys == 0) && (_getMaxPeriodicKeys == 0)) + { + _getMaxPeriodicKeys += 40; + } + return _getMaxPeriodicKeys; + } } diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index fd6430a15d..6fac3c416c 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -80,6 +80,7 @@ public class PlayerVariables extends AbstractVariables public static final String STAT_WIT = "STAT_WIT"; public static final String STAT_MEN = "STAT_MEN"; public static final String RESURRECT_BY_PAYMENT_COUNT = "RESURRECT_BY_PAYMENT_COUNT"; + public static final String PURGE_LAST_CATEGORY = "PURGE_LAST_CATEGORY"; public static final String CLAN_JOIN_TIME = "CLAN_JOIN_TIME"; public static final String CLAN_DONATION_POINTS = "CLAN_DONATION_POINTS"; diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 7c35f0790b..5816f830d2 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -678,7 +678,7 @@ public class EnterWorld implements IClientIncomingPacket player.sendPacket(new ExCollectionInfo(player, category)); } - player.sendPacket(new ExSubjugationSidebar(1, player.getPurgePoints().get(1))); + player.sendPacket(new ExSubjugationSidebar(player, player.getPurgePoints().get(player.getPurgeLastCategory()))); player.sendPacket(new ItemDeletionInfo()); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/subjugation/RequestSubjugationGacha.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/subjugation/RequestSubjugationGacha.java index 2485700109..13178519c7 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/subjugation/RequestSubjugationGacha.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/subjugation/RequestSubjugationGacha.java @@ -61,7 +61,7 @@ public class RequestSubjugationGacha implements IClientIncomingPacket { player.getInventory().reduceAdena("Purge Gacha", 20000L * _amount, player, null); final int curKeys = playerKeys.getKeys() - _amount; - player.getPurgePoints().put(_category, new PurgePlayerHolder(playerKeys.getPoints(), curKeys)); + player.getPurgePoints().put(_category, new PurgePlayerHolder(playerKeys.getPoints(), curKeys, 0)); Map rewards = new HashMap<>(); for (int i = 0; i < _amount; i++) { diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationList.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationList.java index dbf3419109..b9be34cf9e 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationList.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationList.java @@ -27,7 +27,7 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; /** - * Written by Berezkin Nikolay, on 13.04.2021 01 00 00 00 //category 01 00 00 00 1901 00 00 //points 00 00 00 00 4600 00 00 //70 max keys ? + * Written by Berezkin Nikolay, 40 keys max according to retail. */ public class ExSubjugationList implements IClientOutgoingPacket { @@ -48,7 +48,7 @@ public class ExSubjugationList implements IClientOutgoingPacket packet.writeD(integerPurgePlayerHolderEntry.getKey()); packet.writeD(integerPurgePlayerHolderEntry.getValue() != null ? integerPurgePlayerHolderEntry.getValue().getPoints() : 0); packet.writeD(integerPurgePlayerHolderEntry.getValue() != null ? integerPurgePlayerHolderEntry.getValue().getKeys() : 0); - packet.writeD(70); + packet.writeD(integerPurgePlayerHolderEntry.getValue() != null ? integerPurgePlayerHolderEntry.getValue().getMaxPeriodicKeys() : 40); } return true; } diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationSidebar.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationSidebar.java index d923f79a6b..69bc092ec0 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationSidebar.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationSidebar.java @@ -17,21 +17,22 @@ package org.l2jmobius.gameserver.network.serverpackets.subjugation; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.network.OutgoingPackets; import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; /** - * Written by Berezkin Nikolay, on 13.04.2021 01 00 00 00 19 01 00 00 0000 0000 + * Written by Berezkin Nikolay, Serenitty */ public class ExSubjugationSidebar implements IClientOutgoingPacket { + private final Player _player; private final PurgePlayerHolder _purgeData; - private final int _category; - public ExSubjugationSidebar(int category, PurgePlayerHolder purgeData) + public ExSubjugationSidebar(Player player, PurgePlayerHolder purgeData) { - _category = category; + _player = player; _purgeData = purgeData; } @@ -39,9 +40,9 @@ public class ExSubjugationSidebar implements IClientOutgoingPacket public boolean write(PacketWriter packet) { OutgoingPackets.EX_SUBJUGATION_SIDEBAR.writeId(packet); - packet.writeD(_category); // key size - packet.writeD(_purgeData != null ? _purgeData.getPoints() : 0); // 1000000 = 100 percent - packet.writeD(_purgeData != null ? _purgeData.getKeys() : 0); + packet.writeD(_player == null ? 0 : _player.getPurgeLastCategory()); + packet.writeD(_purgeData == null ? 0 : _purgeData.getPoints()); // 1000000 = 100 percent + packet.writeD(_purgeData == null ? 0 : _purgeData.getKeys()); packet.writeD(0); return true; } diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/db_installer/sql/game/character_purge.sql b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/db_installer/sql/game/character_purge.sql index c324505a25..d50a902ce1 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/db_installer/sql/game/character_purge.sql +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/db_installer/sql/game/character_purge.sql @@ -4,5 +4,6 @@ CREATE TABLE IF NOT EXISTS `character_purge` ( `category` int(3) UNSIGNED NOT NULL DEFAULT 0, `points` int(10) UNSIGNED NOT NULL DEFAULT 0, `keys` int(10) UNSIGNED NOT NULL DEFAULT 0, + `remainingKeys` int(10) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`charId`,`category`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/SubjugationData.xml b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/SubjugationData.xml index 6824c1a9dd..d5b9a2d4eb 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/SubjugationData.xml +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/SubjugationData.xml @@ -124,4 +124,19 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/SubjugationGacha.xml b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/SubjugationGacha.xml index 839c8dc606..584e924f48 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/SubjugationGacha.xml +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/SubjugationGacha.xml @@ -55,4 +55,12 @@ + + + + + + + + diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/html/teleporter/18017.htm b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/html/teleporter/18017.htm new file mode 100644 index 0000000000..5ed00926e0 --- /dev/null +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/html/teleporter/18017.htm @@ -0,0 +1,10 @@ +Teleport Device:
+This device was installed by ancient Giants to connect the upper and lower levels of the Giant's Cave. Unfortunately, it was damaged during the war between Giants and gods, and the lower level cannot be accessed from here anymore.
+The Ivory Tower Wizards restored the device, and now it connects several areas on the upper level of the Giant´s Cave.
+This Teleport Device is managed by wizards from the Ivory Tower.
+ + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/CrumaTowerPurge.java b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/CrumaTowerPurge.java index cb6a9a7bde..9731380f54 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/CrumaTowerPurge.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/CrumaTowerPurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class CrumaTowerPurge extends AbstractNpcAI { private static final int CATEGORY = 1; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class CrumaTowerPurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class CrumaTowerPurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new CrumaTowerPurge(); diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/DragonValleyPurge.java b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/DragonValleyPurge.java index 186d5e143e..ca006b197a 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/DragonValleyPurge.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/DragonValleyPurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class DragonValleyPurge extends AbstractNpcAI { private static final int CATEGORY = 5; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class DragonValleyPurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class DragonValleyPurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new DragonValleyPurge(); diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/GiantCavePurge.java b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/GiantCavePurge.java new file mode 100644 index 0000000000..128e11a588 --- /dev/null +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/GiantCavePurge.java @@ -0,0 +1,98 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package ai.others.Subjugation; + +import java.util.Calendar; + +import org.l2jmobius.gameserver.data.xml.SubjugationData; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; +import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; + +import ai.AbstractNpcAI; + +/** + * Written by Berezkin Nikolay, Serenitty + */ +public class GiantCavePurge extends AbstractNpcAI +{ + private static final int CATEGORY = 8; + private static final int MAX_KEYS = 40; + private static final int PURGE_MAX_POINT = 1000000; + private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); + + private GiantCavePurge() + { + addKillId(PURGE_DATA.getNpcs().keySet().stream().mapToInt(it -> it).toArray()); + } + + @Override + public String onKill(Npc npc, Player killer, boolean isSummon) + { + if (killer.getVitalityPoints() > 0) + { + boolean isHotTime = false; + for (int[] it : SubjugationData.getInstance().getSubjugation(CATEGORY).getHottimes()) + { + final int minHour = it[0]; + final int maxHour = it[1]; + final int currentHour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); + if ((currentHour >= minHour) && (maxHour > currentHour)) + { + isHotTime = true; + } + } + final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); + final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); + final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); + checkPurgeComplete(killer); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); + } + return super.onKill(npc, killer, isSummon); + } + + private void checkPurgeComplete(Player player) + { + final int points = player.getPurgePoints().get(CATEGORY).getPoints(); + final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) + { + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); + } + } + + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + + public static void main(String[] args) + { + new GiantCavePurge(); + } +} diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/OrcBarracksPurge.java b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/OrcBarracksPurge.java index 56dc1a6cd5..50741d0313 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/OrcBarracksPurge.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/OrcBarracksPurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class OrcBarracksPurge extends AbstractNpcAI { private static final int CATEGORY = 7; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class OrcBarracksPurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class OrcBarracksPurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new OrcBarracksPurge(); diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/PlainsOfTheLizardmenPurge.java b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/PlainsOfTheLizardmenPurge.java index 632a84d80d..5b15777cab 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/PlainsOfTheLizardmenPurge.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/PlainsOfTheLizardmenPurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class PlainsOfTheLizardmenPurge extends AbstractNpcAI { private static final int CATEGORY = 3; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class PlainsOfTheLizardmenPurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class PlainsOfTheLizardmenPurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new PlainsOfTheLizardmenPurge(); diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/SelMahumBasePurge.java b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/SelMahumBasePurge.java index d41a85285d..7dbb6761d8 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/SelMahumBasePurge.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/SelMahumBasePurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class SelMahumBasePurge extends AbstractNpcAI { private static final int CATEGORY = 6; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class SelMahumBasePurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class SelMahumBasePurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new SelMahumBasePurge(); diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/SilentValleyPurge.java b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/SilentValleyPurge.java index 4b9b46374c..1c0766369a 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/SilentValleyPurge.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/SilentValleyPurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class SilentValleyPurge extends AbstractNpcAI { private static final int CATEGORY = 2; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class SilentValleyPurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class SilentValleyPurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new SilentValleyPurge(); diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/TowerOfInsolencePurge.java b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/TowerOfInsolencePurge.java index 592d17cdf7..d8647d4dde 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/TowerOfInsolencePurge.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/ai/others/Subjugation/TowerOfInsolencePurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class TowerOfInsolencePurge extends AbstractNpcAI { private static final int CATEGORY = 4; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class TowerOfInsolencePurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class TowerOfInsolencePurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new TowerOfInsolencePurge(); diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/spawns/Aden/ForsakenPlains.xml b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/spawns/Aden/ForsakenPlains.xml index 832a0b0cb6..3424644db8 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/spawns/Aden/ForsakenPlains.xml +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/spawns/Aden/ForsakenPlains.xml @@ -52,7 +52,6 @@ - diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/spawns/Aden/GiantCave.xml b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/spawns/Aden/GiantCave.xml new file mode 100644 index 0000000000..8c22556483 --- /dev/null +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/spawns/Aden/GiantCave.xml @@ -0,0 +1,285 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/stats/npcs/18000-18099.xml b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/stats/npcs/18000-18099.xml index 841bf70d26..d6c01074d4 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/stats/npcs/18000-18099.xml +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/stats/npcs/18000-18099.xml @@ -760,7 +760,7 @@ - + ETC ETC diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/teleporters/others/GiantsCave.xml b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/teleporters/others/GiantsCave.xml index 7e54389b71..d5a9006dfc 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/teleporters/others/GiantsCave.xml +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/teleporters/others/GiantsCave.xml @@ -1,8 +1,12 @@ - - - + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java index 8bc0744f2d..f150531bf1 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java @@ -138,6 +138,7 @@ public class DailyTaskManager resetRecommends(); resetTrainingCamp(); resetTimedHuntingZones(); + resetMorgosMilitaryBase(); resetDailyMissionRewards(); resetAttendanceRewards(); resetVip(); @@ -726,6 +727,32 @@ public class DailyTaskManager LOGGER.info("Daily Henna Count has been resetted."); } + private void resetMorgosMilitaryBase() + { + // Update data for offline players. + try (Connection con = DatabaseFactory.getConnection()) + { + try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?")) + { + ps.setString(1, "MORGOS_MILITARY_FREE"); + ps.execute(); + } + } + catch (Exception e) + { + LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset MorgosMilitaryBase: " + e); + } + + // Update data for online players. + for (Player player : World.getInstance().getPlayers()) + { + player.getAccountVariables().remove("MORGOS_MILITARY_FREE"); + player.getAccountVariables().storeMe(); + } + + LOGGER.info("MorgosMilitaryBase has been resetted."); + } + public static DailyTaskManager getInstance() { return SingletonHolder.INSTANCE; diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/instancemanager/PurgeRankingManager.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/instancemanager/PurgeRankingManager.java index d25616e102..61b4af8e53 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/instancemanager/PurgeRankingManager.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/instancemanager/PurgeRankingManager.java @@ -72,7 +72,7 @@ public class PurgeRankingManager if ((Calendar.getInstance().get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) && ((System.currentTimeMillis() - lastPurgeRewards) > (604800000 /* 1 week */ - 600000 /* task delay x2 */))) { GlobalVariablesManager.getInstance().set(GlobalVariablesManager.PURGE_REWARD_TIME, System.currentTimeMillis()); - for (int category = 1; category <= 7; category++) + for (int category = 1; category <= 8; category++) { if (getTop5(category) != null) { @@ -117,7 +117,12 @@ public class PurgeRankingManager } case 7: { - reward = 96456; + reward = 96724; + break; + } + case 8: + { + reward = 97225; break; } default: @@ -150,7 +155,7 @@ public class PurgeRankingManager if (onlinePlayer != null) { onlinePlayer.getPurgePoints().clear(); - onlinePlayer.sendPacket(new ExSubjugationSidebar(category, new PurgePlayerHolder(0, 0))); + onlinePlayer.sendPacket(new ExSubjugationSidebar(null, new PurgePlayerHolder(0, 0, 0))); } counter++; @@ -163,7 +168,7 @@ public class PurgeRankingManager _ranking.clear(); // Restore ranking. - for (int category = 1; category <= 7; category++) + for (int category = 1; category <= 8; category++) { restoreByCategories(category); } diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/Player.java index e7973e4c6f..c75dc07d6a 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -460,7 +460,7 @@ public class Player extends Playable // Purge list: private static final String DELETE_SUBJUGATION = "DELETE FROM character_purge WHERE charId=?"; - private static final String INSERT_SUBJUGATION = "REPLACE INTO character_purge (`charId`, `category`, `points`, `keys`) VALUES (?, ?, ?, ?)"; + private static final String INSERT_SUBJUGATION = "REPLACE INTO character_purge (`charId`, `category`, `points`, `keys`, `remainingKeys`) VALUES (?, ?, ?, ?, ?)"; private static final String RESTORE_SUBJUGATION = "SELECT * FROM character_purge WHERE charId=?"; // Elemental Spirits: @@ -15529,6 +15529,7 @@ public class Player extends Playable st.setInt(2, category); st.setInt(3, data.getPoints()); st.setInt(4, data.getKeys()); + st.setInt(5, data.getMaxPeriodicKeys()); st.addBatch(); } catch (Exception e) @@ -15561,7 +15562,7 @@ public class Player extends Playable { while (rset.next()) { - _purgePoints.put(rset.getInt("category"), new PurgePlayerHolder(rset.getInt("points"), rset.getInt("keys"))); + _purgePoints.put(rset.getInt("category"), new PurgePlayerHolder(rset.getInt("points"), rset.getInt("keys"), rset.getInt("remainingKeys"))); } } @@ -15572,6 +15573,16 @@ public class Player extends Playable } } + public int getPurgeLastCategory() + { + return getVariables().getInt(PlayerVariables.PURGE_LAST_CATEGORY, 1); + } + + public void setPurgeLastCategory(int category) + { + getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, category); + } + public int getClanDonationPoints() { return getVariables().getInt(PlayerVariables.CLAN_DONATION_POINTS, 3); diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/holders/PurgePlayerHolder.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/holders/PurgePlayerHolder.java index 7ce8b95ca2..f8feb7e5eb 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/holders/PurgePlayerHolder.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/holders/PurgePlayerHolder.java @@ -17,17 +17,19 @@ package org.l2jmobius.gameserver.model.holders; /** - * Written by Berezkin Nikolay, on 04.05.2021 + * Written by Berezkin Nikolay, Serenitty */ public class PurgePlayerHolder { private final int _points; private final int _keys; + private int _getMaxPeriodicKeys; - public PurgePlayerHolder(int points, int keys) + public PurgePlayerHolder(int points, int keys, int remainingKeys) { _points = points; _keys = keys; + _getMaxPeriodicKeys = remainingKeys; } public int getPoints() @@ -39,4 +41,13 @@ public class PurgePlayerHolder { return _keys; } + + public int getMaxPeriodicKeys() + { + if ((_keys == 0) && (_getMaxPeriodicKeys == 0)) + { + _getMaxPeriodicKeys += 40; + } + return _getMaxPeriodicKeys; + } } diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index 47930cce74..9e022d608f 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -80,6 +80,7 @@ public class PlayerVariables extends AbstractVariables public static final String STAT_WIT = "STAT_WIT"; public static final String STAT_MEN = "STAT_MEN"; public static final String RESURRECT_BY_PAYMENT_COUNT = "RESURRECT_BY_PAYMENT_COUNT"; + public static final String PURGE_LAST_CATEGORY = "PURGE_LAST_CATEGORY"; public static final String CLAN_JOIN_TIME = "CLAN_JOIN_TIME"; public static final String CLAN_DONATION_POINTS = "CLAN_DONATION_POINTS"; public static final String HENNA1_DURATION = "HENNA1_DURATION"; diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 7846787ee4..7f484a7b99 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -684,7 +684,7 @@ public class EnterWorld implements IClientIncomingPacket player.sendPacket(new ExCollectionInfo(player, category)); } - player.sendPacket(new ExSubjugationSidebar(1, player.getPurgePoints().get(1))); + player.sendPacket(new ExSubjugationSidebar(player, player.getPurgePoints().get(player.getPurgeLastCategory()))); player.sendPacket(new ItemDeletionInfo()); diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/subjugation/RequestSubjugationGacha.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/subjugation/RequestSubjugationGacha.java index 2485700109..13178519c7 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/subjugation/RequestSubjugationGacha.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/subjugation/RequestSubjugationGacha.java @@ -61,7 +61,7 @@ public class RequestSubjugationGacha implements IClientIncomingPacket { player.getInventory().reduceAdena("Purge Gacha", 20000L * _amount, player, null); final int curKeys = playerKeys.getKeys() - _amount; - player.getPurgePoints().put(_category, new PurgePlayerHolder(playerKeys.getPoints(), curKeys)); + player.getPurgePoints().put(_category, new PurgePlayerHolder(playerKeys.getPoints(), curKeys, 0)); Map rewards = new HashMap<>(); for (int i = 0; i < _amount; i++) { diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationList.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationList.java index dbf3419109..b9be34cf9e 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationList.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationList.java @@ -27,7 +27,7 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; /** - * Written by Berezkin Nikolay, on 13.04.2021 01 00 00 00 //category 01 00 00 00 1901 00 00 //points 00 00 00 00 4600 00 00 //70 max keys ? + * Written by Berezkin Nikolay, 40 keys max according to retail. */ public class ExSubjugationList implements IClientOutgoingPacket { @@ -48,7 +48,7 @@ public class ExSubjugationList implements IClientOutgoingPacket packet.writeD(integerPurgePlayerHolderEntry.getKey()); packet.writeD(integerPurgePlayerHolderEntry.getValue() != null ? integerPurgePlayerHolderEntry.getValue().getPoints() : 0); packet.writeD(integerPurgePlayerHolderEntry.getValue() != null ? integerPurgePlayerHolderEntry.getValue().getKeys() : 0); - packet.writeD(70); + packet.writeD(integerPurgePlayerHolderEntry.getValue() != null ? integerPurgePlayerHolderEntry.getValue().getMaxPeriodicKeys() : 40); } return true; } diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationSidebar.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationSidebar.java index d923f79a6b..69bc092ec0 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationSidebar.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationSidebar.java @@ -17,21 +17,22 @@ package org.l2jmobius.gameserver.network.serverpackets.subjugation; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.network.OutgoingPackets; import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; /** - * Written by Berezkin Nikolay, on 13.04.2021 01 00 00 00 19 01 00 00 0000 0000 + * Written by Berezkin Nikolay, Serenitty */ public class ExSubjugationSidebar implements IClientOutgoingPacket { + private final Player _player; private final PurgePlayerHolder _purgeData; - private final int _category; - public ExSubjugationSidebar(int category, PurgePlayerHolder purgeData) + public ExSubjugationSidebar(Player player, PurgePlayerHolder purgeData) { - _category = category; + _player = player; _purgeData = purgeData; } @@ -39,9 +40,9 @@ public class ExSubjugationSidebar implements IClientOutgoingPacket public boolean write(PacketWriter packet) { OutgoingPackets.EX_SUBJUGATION_SIDEBAR.writeId(packet); - packet.writeD(_category); // key size - packet.writeD(_purgeData != null ? _purgeData.getPoints() : 0); // 1000000 = 100 percent - packet.writeD(_purgeData != null ? _purgeData.getKeys() : 0); + packet.writeD(_player == null ? 0 : _player.getPurgeLastCategory()); + packet.writeD(_purgeData == null ? 0 : _purgeData.getPoints()); // 1000000 = 100 percent + packet.writeD(_purgeData == null ? 0 : _purgeData.getKeys()); packet.writeD(0); return true; } diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/db_installer/sql/game/character_purge.sql b/L2J_Mobius_Essence_6.2_Vanguard/dist/db_installer/sql/game/character_purge.sql index c324505a25..d50a902ce1 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/db_installer/sql/game/character_purge.sql +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/db_installer/sql/game/character_purge.sql @@ -4,5 +4,6 @@ CREATE TABLE IF NOT EXISTS `character_purge` ( `category` int(3) UNSIGNED NOT NULL DEFAULT 0, `points` int(10) UNSIGNED NOT NULL DEFAULT 0, `keys` int(10) UNSIGNED NOT NULL DEFAULT 0, + `remainingKeys` int(10) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`charId`,`category`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/SubjugationData.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/SubjugationData.xml index 6824c1a9dd..54a4673fcf 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/SubjugationData.xml +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/SubjugationData.xml @@ -124,4 +124,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/SubjugationGacha.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/SubjugationGacha.xml index 839c8dc606..bb5a140ffd 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/SubjugationGacha.xml +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/SubjugationGacha.xml @@ -55,4 +55,20 @@ + + + + + + + + + + + + + + + + diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/TeleportListData.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/TeleportListData.xml index 4ff3bef3f2..3373a561c5 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/TeleportListData.xml +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/TeleportListData.xml @@ -67,7 +67,7 @@ - + @@ -110,12 +110,12 @@ - + - + - - + + diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/html/teleporter/18017.htm b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/html/teleporter/18017.htm new file mode 100644 index 0000000000..5ed00926e0 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/html/teleporter/18017.htm @@ -0,0 +1,10 @@ +Teleport Device:
+This device was installed by ancient Giants to connect the upper and lower levels of the Giant's Cave. Unfortunately, it was damaged during the war between Giants and gods, and the lower level cannot be accessed from here anymore.
+The Ivory Tower Wizards restored the device, and now it connects several areas on the upper level of the Giant´s Cave.
+This Teleport Device is managed by wizards from the Ivory Tower.
+ + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/html/teleporter/34319.htm b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/html/teleporter/34319.htm new file mode 100644 index 0000000000..8d91787ebd --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/html/teleporter/34319.htm @@ -0,0 +1,10 @@ +Assistant Grill:
+Welcome My name is Grill. I help those traveling to the Hot Springs.
+These Springs are situated an a volcano, so it's warm here all the year round.
+Many people come the Springs to check if the local water is a good as the rumors say.
+But I've been sent here to work, and to tell the truth, I'm quite tired of all this heat. I wish I could go some place cooler... Next time I'll ask to assign me where it's not so hot.
+By the way, keep in mind that if you see a Hot Springs Nepenthes, then a Morgos Hunter is sure to lurk nearby. So be careful!
+ + + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/html/teleporter/34320.htm b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/html/teleporter/34320.htm new file mode 100644 index 0000000000..993efe33b7 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/html/teleporter/34320.htm @@ -0,0 +1,10 @@ +Assistant Muss:
+Hey, how did you get to this remote place? That's quite commendable. My name is Muss. I can help you with traveling to Morgos Military Base...
+I don't want to boast but I'm a decent warrior myself. So you've been sent to this military base, haven't you?..
+Well... Beware of Morgos then. He is quite infamous for gathering miscreants. Recently his forces have really grown in number.
+ + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/html/teleporter/34321.htm b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/html/teleporter/34321.htm new file mode 100644 index 0000000000..0d97b40a91 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/html/teleporter/34321.htm @@ -0,0 +1,10 @@ +Assistant Crigon:
+Wow... At last someone brave has come. My name is Crigon. I can help you with traveling to the Gorde Canyon.
+Welcome to the Gorde Canyon, by the way! Perhaps, you've heard rumors about Gorde ripping eyes of strangers and decorating wall with them.
+Well, I'm here, and I can tell you for sure that nothings wrong here.
+ + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/html/teleporter/34322.htm b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/html/teleporter/34322.htm new file mode 100644 index 0000000000..d8fa512458 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/html/teleporter/34322.htm @@ -0,0 +1,9 @@ +Assistant Ashin:
+Hey, what's up? Do you need help with teleportation? If so, you've come to the right person. My name is Ashin, by the way, nice to meet you...
+My mission here is to watch the Xilenos Fortress garrison. Do you know that they are trying to conquer all the adjacent lands?
+As for teleportation, that is another one of my task. I'll help you want to go inside.
+ + + + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/multisell/90318605.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/multisell/90318605.xml new file mode 100644 index 0000000000..1e190c580c --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/multisell/90318605.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/CrumaTowerPurge.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/CrumaTowerPurge.java index cb6a9a7bde..9731380f54 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/CrumaTowerPurge.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/CrumaTowerPurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class CrumaTowerPurge extends AbstractNpcAI { private static final int CATEGORY = 1; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class CrumaTowerPurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class CrumaTowerPurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new CrumaTowerPurge(); diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/DragonValleyPurge.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/DragonValleyPurge.java index 186d5e143e..ca006b197a 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/DragonValleyPurge.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/DragonValleyPurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class DragonValleyPurge extends AbstractNpcAI { private static final int CATEGORY = 5; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class DragonValleyPurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class DragonValleyPurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new DragonValleyPurge(); diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/GiantCavePurge.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/GiantCavePurge.java new file mode 100644 index 0000000000..128e11a588 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/GiantCavePurge.java @@ -0,0 +1,98 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package ai.others.Subjugation; + +import java.util.Calendar; + +import org.l2jmobius.gameserver.data.xml.SubjugationData; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; +import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; + +import ai.AbstractNpcAI; + +/** + * Written by Berezkin Nikolay, Serenitty + */ +public class GiantCavePurge extends AbstractNpcAI +{ + private static final int CATEGORY = 8; + private static final int MAX_KEYS = 40; + private static final int PURGE_MAX_POINT = 1000000; + private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); + + private GiantCavePurge() + { + addKillId(PURGE_DATA.getNpcs().keySet().stream().mapToInt(it -> it).toArray()); + } + + @Override + public String onKill(Npc npc, Player killer, boolean isSummon) + { + if (killer.getVitalityPoints() > 0) + { + boolean isHotTime = false; + for (int[] it : SubjugationData.getInstance().getSubjugation(CATEGORY).getHottimes()) + { + final int minHour = it[0]; + final int maxHour = it[1]; + final int currentHour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); + if ((currentHour >= minHour) && (maxHour > currentHour)) + { + isHotTime = true; + } + } + final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); + final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); + final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); + checkPurgeComplete(killer); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); + } + return super.onKill(npc, killer, isSummon); + } + + private void checkPurgeComplete(Player player) + { + final int points = player.getPurgePoints().get(CATEGORY).getPoints(); + final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) + { + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); + } + } + + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + + public static void main(String[] args) + { + new GiantCavePurge(); + } +} diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/GoddardTerritoryPurge.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/GoddardTerritoryPurge.java new file mode 100644 index 0000000000..f2c2204e16 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/GoddardTerritoryPurge.java @@ -0,0 +1,98 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package ai.others.Subjugation; + +import java.util.Calendar; + +import org.l2jmobius.gameserver.data.xml.SubjugationData; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; +import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; +import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; + +import ai.AbstractNpcAI; + +/** + * Written by Berezkin Nikolay, Serenitty + */ +public class GoddardTerritoryPurge extends AbstractNpcAI +{ + private static final int CATEGORY = 9; + private static final int MAX_KEYS = 40; + private static final int PURGE_MAX_POINT = 1000000; + private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); + + private GoddardTerritoryPurge() + { + addKillId(PURGE_DATA.getNpcs().keySet().stream().mapToInt(it -> it).toArray()); + } + + @Override + public String onKill(Npc npc, Player killer, boolean isSummon) + { + if (killer.getVitalityPoints() > 0) + { + boolean isHotTime = false; + for (int[] it : SubjugationData.getInstance().getSubjugation(CATEGORY).getHottimes()) + { + final int minHour = it[0]; + final int maxHour = it[1]; + final int currentHour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); + if ((currentHour >= minHour) && (maxHour > currentHour)) + { + isHotTime = true; + } + } + final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); + final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); + final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); + checkPurgeComplete(killer); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); + } + return super.onKill(npc, killer, isSummon); + } + + private void checkPurgeComplete(Player player) + { + final int points = player.getPurgePoints().get(CATEGORY).getPoints(); + final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) + { + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); + } + } + + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + + public static void main(String[] args) + { + new GoddardTerritoryPurge(); + } +} diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/OrcBarracksPurge.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/OrcBarracksPurge.java index 56dc1a6cd5..50741d0313 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/OrcBarracksPurge.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/OrcBarracksPurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class OrcBarracksPurge extends AbstractNpcAI { private static final int CATEGORY = 7; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class OrcBarracksPurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class OrcBarracksPurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new OrcBarracksPurge(); diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/PlainsOfTheLizardmenPurge.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/PlainsOfTheLizardmenPurge.java index 632a84d80d..5b15777cab 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/PlainsOfTheLizardmenPurge.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/PlainsOfTheLizardmenPurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class PlainsOfTheLizardmenPurge extends AbstractNpcAI { private static final int CATEGORY = 3; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class PlainsOfTheLizardmenPurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class PlainsOfTheLizardmenPurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new PlainsOfTheLizardmenPurge(); diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/SelMahumBasePurge.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/SelMahumBasePurge.java index d41a85285d..7dbb6761d8 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/SelMahumBasePurge.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/SelMahumBasePurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class SelMahumBasePurge extends AbstractNpcAI { private static final int CATEGORY = 6; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class SelMahumBasePurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class SelMahumBasePurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new SelMahumBasePurge(); diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/SilentValleyPurge.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/SilentValleyPurge.java index 4b9b46374c..1c0766369a 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/SilentValleyPurge.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/SilentValleyPurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class SilentValleyPurge extends AbstractNpcAI { private static final int CATEGORY = 2; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class SilentValleyPurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class SilentValleyPurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new SilentValleyPurge(); diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/TowerOfInsolencePurge.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/TowerOfInsolencePurge.java index 592d17cdf7..d8647d4dde 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/TowerOfInsolencePurge.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/TowerOfInsolencePurge.java @@ -23,16 +23,18 @@ import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.model.holders.SubjugationHolder; +import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.serverpackets.subjugation.ExSubjugationSidebar; import ai.AbstractNpcAI; /** - * Written by Berezkin Nikolay, on 13.04.2021 + * Written by Berezkin Nikolay, Serenitty */ public class TowerOfInsolencePurge extends AbstractNpcAI { private static final int CATEGORY = 4; + private static final int MAX_KEYS = 40; private static final int PURGE_MAX_POINT = 1000000; private static final SubjugationHolder PURGE_DATA = SubjugationData.getInstance().getSubjugation(CATEGORY); @@ -60,9 +62,11 @@ public class TowerOfInsolencePurge extends AbstractNpcAI final int pointsForMob = isHotTime ? PURGE_DATA.getNpcs().get(npc.getId()) * 2 : PURGE_DATA.getNpcs().get(npc.getId()); final int currentPurgePoints = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getPoints(); final int currentKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getKeys(); - killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys)); + final int remainingKeys = (killer.getPurgePoints().get(CATEGORY) == null) ? 0 : killer.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys(); + killer.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(Math.min(PURGE_MAX_POINT, currentPurgePoints + pointsForMob), currentKeys, remainingKeys)); + lastCategory(killer); checkPurgeComplete(killer); - killer.sendPacket(new ExSubjugationSidebar(CATEGORY, killer.getPurgePoints().get(CATEGORY))); + killer.sendPacket(new ExSubjugationSidebar(killer, killer.getPurgePoints().get(CATEGORY))); } return super.onKill(npc, killer, isSummon); } @@ -71,12 +75,22 @@ public class TowerOfInsolencePurge extends AbstractNpcAI { final int points = player.getPurgePoints().get(CATEGORY).getPoints(); final int keys = player.getPurgePoints().get(CATEGORY).getKeys(); - if ((points >= PURGE_MAX_POINT) && (keys < 70)) + if ((points >= PURGE_MAX_POINT) && (keys < MAX_KEYS)) { - player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1)); + player.getPurgePoints().put(CATEGORY, new PurgePlayerHolder(points - PURGE_MAX_POINT, keys + 1, player.getPurgePoints().get(CATEGORY).getMaxPeriodicKeys() - 1)); } } + private void lastCategory(Player player) + { + if (player.getPurgeLastCategory() == CATEGORY) + { + return; + } + player.getVariables().remove(PlayerVariables.PURGE_LAST_CATEGORY); + player.getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, CATEGORY); + } + public static void main(String[] args) { new TowerOfInsolencePurge(); diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/Yand/34327-01.html b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/Yand/34327-01.html new file mode 100644 index 0000000000..f107da9976 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/Yand/34327-01.html @@ -0,0 +1,4 @@ +Yand:
+Do you Want to enter the base once again? Then you'll need a Scroll of Escape: Morgos Military Base's Central Barracks
+ + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/Yand/34327.html b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/Yand/34327.html new file mode 100644 index 0000000000..8d0a5f7de4 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/Yand/34327.html @@ -0,0 +1,7 @@ +Yand:
+You really have the gust to come here. This place is swarming with Morgo's Warriors. Be extra carefull inside.
+You can enter the base for free only once a day. if you want to do it again, you will have to pay high fee.
+This place is really weird, so gear up carefully beforehand.
+ + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/Yand/Yand.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/Yand/Yand.java new file mode 100644 index 0000000000..ccd264c215 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/others/Subjugation/Yand/Yand.java @@ -0,0 +1,80 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package ai.others.Subjugation.Yand; + +import org.l2jmobius.gameserver.data.xml.MultisellData; +import org.l2jmobius.gameserver.model.Location; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; + +import ai.AbstractNpcAI; + +/** + * @author Serenitty + */ +public class Yand extends AbstractNpcAI +{ + // NPC + private static final int YAND = 34327; + // Item + private static final int MORGOS_MILITARY_SCROLL_MS = 90318605; + // Location + private static final Location TELEPORT_LOC = new Location(146915, -82589, -5128); + + private Yand() + { + addFirstTalkId(YAND); + addTalkId(YAND); + addSpawnId(YAND); + } + + @Override + public String onAdvEvent(String event, Npc npc, Player player) + { + switch (event) + { + case "GoToInsideMorgos": + { + final int military = player.getVariables().getInt("MORGOS_MILITARY_FREE", 1); + if (military == 0) + { + return "34327-01.html"; + } + player.teleToLocation(TELEPORT_LOC); + player.getVariables().set("MORGOS_MILITARY_FREE", 0); + break; + } + case "BuyScrollMorgos": + { + MultisellData.getInstance().separateAndSend(MORGOS_MILITARY_SCROLL_MS, player, null, false); + break; + } + } + return null; + } + + @Override + public String onFirstTalk(Npc npc, Player player) + { + return "34327.html"; + } + + public static void main(String[] args) + { + new Yand(); + } +} diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10311_BestMedicine/34319-01.htm b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10311_BestMedicine/34319-01.htm new file mode 100644 index 0000000000..2212fb24a5 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10311_BestMedicine/34319-01.htm @@ -0,0 +1,5 @@ +Assistant Grill:
+The local baths are great, but now it's too dangerous here.
+I can't let you wander here by yourself, you're too inexperienced.
+ + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10311_BestMedicine/34319-02.htm b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10311_BestMedicine/34319-02.htm new file mode 100644 index 0000000000..9d07982010 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10311_BestMedicine/34319-02.htm @@ -0,0 +1,3 @@ +Assistant Grill:
+ + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10311_BestMedicine/34319-03.html b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10311_BestMedicine/34319-03.html new file mode 100644 index 0000000000..532795e693 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10311_BestMedicine/34319-03.html @@ -0,0 +1,4 @@ +Assistant Grill:
+Have you completed the mission?
+I haven't heard from you for a long time so I've been worried. + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10311_BestMedicine/Q10311_BestMedicine.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10311_BestMedicine/Q10311_BestMedicine.java new file mode 100644 index 0000000000..4b2e3b95f2 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10311_BestMedicine/Q10311_BestMedicine.java @@ -0,0 +1,177 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package quests.Q10311_BestMedicine; + +import java.util.HashSet; +import java.util.Set; + +import org.l2jmobius.gameserver.enums.QuestSound; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.holders.ItemHolder; +import org.l2jmobius.gameserver.model.holders.NpcLogListHolder; +import org.l2jmobius.gameserver.model.quest.Quest; +import org.l2jmobius.gameserver.model.quest.QuestState; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +/** + * @author Serenitty + */ +public class Q10311_BestMedicine extends Quest +{ + // NPC + private static final int GRILL = 34319; + // Monsters + private static final int TAILED_WARRIOR = 22426; + private static final int TAILED_HUNTER = 22427; + private static final int TAILED_BERSERKER = 22428; + private static final int TAILED_WIZARD = 22429; + // Items + private static final ItemHolder SAYHA_COOKIE = new ItemHolder(93274, 20); + private static final ItemHolder SAYHA_STORM = new ItemHolder(91712, 12); + private static final ItemHolder MAGIC_LAMP_CHARGING_POTION = new ItemHolder(91757, 2); + // Misc + private static final int MIN_LEVEL = 85; + private static final String KILL_COUNT_VAR = "KillCount"; + + public Q10311_BestMedicine() + { + super(10311); + addStartNpc(GRILL); + addTalkId(GRILL); + addKillId(TAILED_WARRIOR, TAILED_HUNTER, TAILED_BERSERKER, TAILED_WIZARD); + setQuestNameNpcStringId(NpcStringId.LV_85_BEST_MEDICINE); + } + + @Override + public String onAdvEvent(String event, Npc npc, Player player) + { + final QuestState qs = getQuestState(player, false); + if (qs == null) + { + return null; + } + + String htmltext = null; + switch (event) + { + case "StartBestMedicine": + { + qs.startQuest(); + htmltext = event; + showOnScreenMsg(player, NpcStringId.DEFEAT_THE_MONSTERS_IN_THE_HOT_SPRINGS, ExShowScreenMessage.TOP_CENTER, 10000); + break; + } + case "34319-02.htm": + { + htmltext = event; + break; + } + case "reward": + { + if (qs.isStarted()) + { + addExpAndSp(player, 500000000, 13500000); + giveItems(player, SAYHA_COOKIE); + giveItems(player, SAYHA_STORM); + giveItems(player, MAGIC_LAMP_CHARGING_POTION); + qs.exitQuest(false, true); + } + break; + } + } + return htmltext; + } + + @Override + public String onTalk(Npc npc, Player player) + { + final QuestState qs = getQuestState(player, true); + String htmltext = getNoQuestMsg(player); + if (qs.isCreated() && (player.getLevel() < MIN_LEVEL)) + { + htmltext = "noreq.htm"; + return htmltext; + } + if (qs.isCreated()) + { + htmltext = "34319-01.htm"; + } + else if (qs.isStarted()) + { + if (qs.isCond(1)) + { + htmltext = "34319-03.html"; + } + else if (qs.isCond(2)) + { + htmltext = "34319-02.htm"; + } + } + else if (qs.isCompleted()) + { + htmltext = getAlreadyCompletedMsg(player); + } + return htmltext; + } + + @Override + public String onKill(Npc npc, Player killer, boolean isSummon) + { + final QuestState qs = getQuestState(killer, false); + if ((qs != null) && qs.isCond(1)) + { + final int killCount = qs.getInt(KILL_COUNT_VAR) + 1; + if (killCount < 2000) + { + qs.set(KILL_COUNT_VAR, killCount); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); + sendNpcLogList(killer); + } + else + { + qs.setCond(2, true); + qs.unset(KILL_COUNT_VAR); + showOnScreenMsg(killer, NpcStringId.TALK_TO_ASSISTANT_GRILL, ExShowScreenMessage.TOP_CENTER, 10000); + } + } + return super.onKill(npc, killer, isSummon); + } + + @Override + public Set getNpcLogList(Player player) + { + final QuestState qs = getQuestState(player, false); + if (qs != null) + { + if (qs.isCond(1)) + { + final Set holder = new HashSet<>(); + holder.add(new NpcLogListHolder(NpcStringId.DEFEAT_THE_MONSTERS_IN_THE_HOT_SPRINGS.getId(), true, qs.getInt(KILL_COUNT_VAR))); + return holder; + } + else if (qs.isCond(2)) + { + final Set holder = new HashSet<>(); + holder.add(new NpcLogListHolder(NpcStringId.LV_85_BEST_MEDICINE_COMPLETED.getId(), true, qs.getInt(KILL_COUNT_VAR))); + return holder; + } + } + return super.getNpcLogList(player); + } +} diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10311_BestMedicine/noreq.htm b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10311_BestMedicine/noreq.htm new file mode 100644 index 0000000000..d7d372dc43 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10311_BestMedicine/noreq.htm @@ -0,0 +1,5 @@ +Assistant Grill:
+The local baths are great, but now it's too dangerous here.
+I can't let you wander here by yourself, you're too inexperienced.

+(Quest is only available to 85+ levels). + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10312_GordesLegend/34321-01.htm b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10312_GordesLegend/34321-01.htm new file mode 100644 index 0000000000..acf72391b5 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10312_GordesLegend/34321-01.htm @@ -0,0 +1,7 @@ +Assistant Crigon:
+Wow, your courage gives you credit.
+But we are talking about the infamous Gorde Canyon and spine-chilling rumors surrounding it!
+People traveling there must always be on the look out dangers.
+Come back when you get stronger.
+ + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10312_GordesLegend/34321-02.htm b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10312_GordesLegend/34321-02.htm new file mode 100644 index 0000000000..1aa7d16114 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10312_GordesLegend/34321-02.htm @@ -0,0 +1,3 @@ +Assistant Crigon:
+ + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10312_GordesLegend/34321-03.html b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10312_GordesLegend/34321-03.html new file mode 100644 index 0000000000..a08d489e4d --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10312_GordesLegend/34321-03.html @@ -0,0 +1,4 @@ +Assistant Crigon:
+Have you completed the mission?
+I haven't heard from you for a long time so I've been worried. + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10312_GordesLegend/Q10312_GordesLegend.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10312_GordesLegend/Q10312_GordesLegend.java new file mode 100644 index 0000000000..1fe43ff4eb --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10312_GordesLegend/Q10312_GordesLegend.java @@ -0,0 +1,181 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package quests.Q10312_GordesLegend; + +import java.util.HashSet; +import java.util.Set; + +import org.l2jmobius.gameserver.enums.QuestSound; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.holders.ItemHolder; +import org.l2jmobius.gameserver.model.holders.NpcLogListHolder; +import org.l2jmobius.gameserver.model.quest.Quest; +import org.l2jmobius.gameserver.model.quest.QuestState; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +/** + * @author Serenitty + */ +public class Q10312_GordesLegend extends Quest +{ + // NPC + private static final int CRIGON = 34321; + // Monsters + private static final int GORDE_ANTILOPE = 22434; + private static final int GORDE_BUFFALO = 22436; + private static final int GORDE_BANDERSNATCH = 22435; + private static final int GORDE_GRENEL = 22433; + private static final int GORDE_WARRIOR = 22439; + private static final int GORDE_HUNTER = 22441; + private static final int GORDE_WIZARD = 22442; + private static final int EYE_WACHMAN = 22443; + // Items + private static final ItemHolder SAYHA_COOKIE = new ItemHolder(93274, 20); + private static final ItemHolder SAYHA_STORM = new ItemHolder(91712, 12); + private static final ItemHolder MAGIC_LAMP_CHARGING_POTION = new ItemHolder(91757, 2); + // Misc + private static final int MIN_LEVEL = 87; + private static final String KILL_COUNT_VAR = "KillCount"; + + public Q10312_GordesLegend() + { + super(10312); + addStartNpc(CRIGON); + addTalkId(CRIGON); + addKillId(GORDE_ANTILOPE, GORDE_BUFFALO, GORDE_BANDERSNATCH, GORDE_GRENEL); + addKillId(GORDE_WARRIOR, GORDE_HUNTER, GORDE_WIZARD, EYE_WACHMAN); + setQuestNameNpcStringId(NpcStringId.LV_87_GORDE_S_LEGEND); + } + + @Override + public String onAdvEvent(String event, Npc npc, Player player) + { + final QuestState qs = getQuestState(player, false); + if (qs == null) + { + return null; + } + + String htmltext = null; + switch (event) + { + case "StartGordesLegend": + { + qs.startQuest(); + htmltext = event; + break; + } + case "34321-02.htm": + { + htmltext = event; + break; + } + case "reward": + { + if (qs.isStarted()) + { + addExpAndSp(player, 1000000000, 27000000); + giveItems(player, SAYHA_COOKIE); + giveItems(player, SAYHA_STORM); + giveItems(player, MAGIC_LAMP_CHARGING_POTION); + qs.exitQuest(false, true); + } + break; + } + } + return htmltext; + } + + @Override + public String onTalk(Npc npc, Player player) + { + final QuestState qs = getQuestState(player, true); + String htmltext = getNoQuestMsg(player); + if (qs.isCreated() && (player.getLevel() < MIN_LEVEL)) + { + htmltext = "noreq.htm"; + return htmltext; + } + if (qs.isCreated()) + { + htmltext = "34321-01.htm"; + } + else if (qs.isStarted()) + { + if (qs.isCond(1)) + { + htmltext = "34321-03.html"; + } + else if (qs.isCond(2)) + { + htmltext = "34321-02.htm"; + } + } + else if (qs.isCompleted()) + { + htmltext = getAlreadyCompletedMsg(player); + } + return htmltext; + } + + @Override + public String onKill(Npc npc, Player killer, boolean isSummon) + { + final QuestState qs = getQuestState(killer, false); + if ((qs != null) && qs.isCond(1)) + { + final int killCount = qs.getInt(KILL_COUNT_VAR) + 1; + if (killCount < 2000) + { + qs.set(KILL_COUNT_VAR, killCount); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); + sendNpcLogList(killer); + } + else + { + qs.setCond(2, true); + qs.unset(KILL_COUNT_VAR); + showOnScreenMsg(killer, NpcStringId.TALK_TO_ASSISTANT_CRIGON, ExShowScreenMessage.TOP_CENTER, 10000); + } + } + return super.onKill(npc, killer, isSummon); + } + + @Override + public Set getNpcLogList(Player player) + { + final QuestState qs = getQuestState(player, false); + if (qs != null) + { + if (qs.isCond(1)) + { + final Set holder = new HashSet<>(); + holder.add(new NpcLogListHolder(NpcStringId.DEFEAT_MONSTERS_IN_THE_GORDE_CANYON.getId(), true, qs.getInt(KILL_COUNT_VAR))); + return holder; + } + else if (qs.isCond(2)) + { + final Set holder = new HashSet<>(); + holder.add(new NpcLogListHolder(NpcStringId.LV_87_GORDE_S_LEGEND_COMPLETED.getId(), true, qs.getInt(KILL_COUNT_VAR))); + return holder; + } + } + return super.getNpcLogList(player); + } +} diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10312_GordesLegend/noreq.htm b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10312_GordesLegend/noreq.htm new file mode 100644 index 0000000000..12c029ac72 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10312_GordesLegend/noreq.htm @@ -0,0 +1,7 @@ +Assistant Crigon:
+Wow, your courage gives you credit.
+But we are talking about the infamous Gorde Canyon and spine-chilling rumors surrounding it!
+People traveling there must always be on the look out dangers.
+Come back when you get stronger.

+(Quest is only available to 87+ levels). + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10313_CunningMorgos/34320-01.htm b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10313_CunningMorgos/34320-01.htm new file mode 100644 index 0000000000..6742a79a5b --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10313_CunningMorgos/34320-01.htm @@ -0,0 +1,7 @@ +Assistant Muss:
+Wow, your courage gives you credit.
+But we are talking about the infamous Gorde Canyon and spine-chilling rumors surrounding it!
+People traveling there must always be on the look out dangers.
+Come back when you get stronger.
+ + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10313_CunningMorgos/34320-02.htm b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10313_CunningMorgos/34320-02.htm new file mode 100644 index 0000000000..6be0b4cacf --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10313_CunningMorgos/34320-02.htm @@ -0,0 +1,3 @@ +Assistant Muss:
+ + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10313_CunningMorgos/34320-03.html b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10313_CunningMorgos/34320-03.html new file mode 100644 index 0000000000..514d2b03c3 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10313_CunningMorgos/34320-03.html @@ -0,0 +1,4 @@ +Assistant Muss:
+Have you completed the mission?
+I haven't heard from you for a long time so I've been worried. + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10313_CunningMorgos/Q10313_CunningMorgos.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10313_CunningMorgos/Q10313_CunningMorgos.java new file mode 100644 index 0000000000..390879e1aa --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10313_CunningMorgos/Q10313_CunningMorgos.java @@ -0,0 +1,179 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package quests.Q10313_CunningMorgos; + +import java.util.HashSet; +import java.util.Set; + +import org.l2jmobius.gameserver.enums.QuestSound; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.holders.ItemHolder; +import org.l2jmobius.gameserver.model.holders.NpcLogListHolder; +import org.l2jmobius.gameserver.model.quest.Quest; +import org.l2jmobius.gameserver.model.quest.QuestState; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +/** + * @author Serenitty + */ +public class Q10313_CunningMorgos extends Quest +{ + // NPC + private static final int MUSS = 34320; + // Monsters + private static final int MORGOS_SENTRY = 22462; + private static final int MORGOS_ELITE_GUARD = 22463; + private static final int MORGOS_COMMAND = 22457; + private static final int BLOODHOUND = 22465; + private static final int MORGOS_GUARD = 22453; + private static final int MORGOS_WIZARD = 22456; + // Items + private static final ItemHolder SAYHA_COOKIE = new ItemHolder(93274, 20); + private static final ItemHolder SAYHA_STORM = new ItemHolder(91712, 12); + private static final ItemHolder MAGIC_LAMP_CHARGING_POTION = new ItemHolder(91757, 2); + // Misc + private static final int MIN_LEVEL = 90; + private static final String KILL_COUNT_VAR = "KillCount"; + + public Q10313_CunningMorgos() + { + super(10313); + addStartNpc(MUSS); + addTalkId(MUSS); + addKillId(MORGOS_SENTRY, MORGOS_ELITE_GUARD, MORGOS_COMMAND); + addKillId(BLOODHOUND, MORGOS_GUARD, MORGOS_WIZARD); + setQuestNameNpcStringId(NpcStringId.LV_90_CUNNING_MORGOS); + } + + @Override + public String onAdvEvent(String event, Npc npc, Player player) + { + final QuestState qs = getQuestState(player, false); + if (qs == null) + { + return null; + } + + String htmltext = null; + switch (event) + { + case "StartCunningMorgos": + { + qs.startQuest(); + htmltext = event; + break; + } + case "34320-02.htm": + { + htmltext = event; + break; + } + case "reward": + { + if (qs.isStarted()) + { + addExpAndSp(player, 25000000000L, 675000000); + giveItems(player, SAYHA_COOKIE); + giveItems(player, SAYHA_STORM); + giveItems(player, MAGIC_LAMP_CHARGING_POTION); + qs.exitQuest(false, true); + } + break; + } + } + return htmltext; + } + + @Override + public String onTalk(Npc npc, Player player) + { + final QuestState qs = getQuestState(player, true); + String htmltext = getNoQuestMsg(player); + if (qs.isCreated() && (player.getLevel() < MIN_LEVEL)) + { + htmltext = "noreq.htm"; + return htmltext; + } + if (qs.isCreated()) + { + htmltext = "34320-01.htm"; + } + else if (qs.isStarted()) + { + if (qs.isCond(1)) + { + htmltext = "34320-03.html"; + } + else if (qs.isCond(2)) + { + htmltext = "34320-02.htm"; + } + } + else if (qs.isCompleted()) + { + htmltext = getAlreadyCompletedMsg(player); + } + return htmltext; + } + + @Override + public String onKill(Npc npc, Player killer, boolean isSummon) + { + final QuestState qs = getQuestState(killer, false); + if ((qs != null) && qs.isCond(1)) + { + final int killCount = qs.getInt(KILL_COUNT_VAR) + 1; + if (killCount < 2000) + { + qs.set(KILL_COUNT_VAR, killCount); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); + sendNpcLogList(killer); + } + else + { + qs.setCond(2, true); + qs.unset(KILL_COUNT_VAR); + showOnScreenMsg(killer, NpcStringId.TALK_TO_ASSISTANT_MUSS, ExShowScreenMessage.TOP_CENTER, 10000); + } + } + return super.onKill(npc, killer, isSummon); + } + + @Override + public Set getNpcLogList(Player player) + { + final QuestState qs = getQuestState(player, false); + if (qs != null) + { + if (qs.isCond(1)) + { + final Set holder = new HashSet<>(); + holder.add(new NpcLogListHolder(NpcStringId.KILL_MONSTERS_IN_THE_MORGOS_MILITARY_BASE.getId(), true, qs.getInt(KILL_COUNT_VAR))); + return holder; + } + else if (qs.isCond(2)) + { + final Set holder = new HashSet<>(); + holder.add(new NpcLogListHolder(NpcStringId.LV_90_CUNNING_MORGOS_COMPLETED.getId(), true, qs.getInt(KILL_COUNT_VAR))); + return holder; + } + } + return super.getNpcLogList(player); + } +} diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10313_CunningMorgos/noreq.htm b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10313_CunningMorgos/noreq.htm new file mode 100644 index 0000000000..c0ef79e7fc --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10313_CunningMorgos/noreq.htm @@ -0,0 +1,7 @@ +Assistant Ashin:
+Wow, your courage gives you credit.
+But we are talking about the infamous Gorde Canyon and spine-chilling rumors surrounding it!
+People traveling there must always be on the look out dangers.
+Come back when you get stronger.

+(Quest is only available to 90+ levels). + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10314_MorgosRetributionXilenos/34322-01.htm b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10314_MorgosRetributionXilenos/34322-01.htm new file mode 100644 index 0000000000..aaf2be95d3 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10314_MorgosRetributionXilenos/34322-01.htm @@ -0,0 +1,7 @@ +Assistant Ashin:
+Wow, your courage gives you credit.
+But we are talking about the infamous Gorde Canyon and spine-chilling rumors surrounding it!
+People traveling there must always be on the look out dangers.
+Come back when you get stronger.
+ + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10314_MorgosRetributionXilenos/34322-02.htm b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10314_MorgosRetributionXilenos/34322-02.htm new file mode 100644 index 0000000000..4e3a8f455f --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10314_MorgosRetributionXilenos/34322-02.htm @@ -0,0 +1,3 @@ +Assistant Ashin:
+ + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10314_MorgosRetributionXilenos/34322-03.html b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10314_MorgosRetributionXilenos/34322-03.html new file mode 100644 index 0000000000..9940a08e33 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10314_MorgosRetributionXilenos/34322-03.html @@ -0,0 +1,4 @@ +Assistant Ashin:
+Have you completed the mission?
+I haven't heard from you for a long time so I've been worried. + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10314_MorgosRetributionXilenos/Q10314_MorgosRetributionXilenos.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10314_MorgosRetributionXilenos/Q10314_MorgosRetributionXilenos.java new file mode 100644 index 0000000000..75d0ec5510 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10314_MorgosRetributionXilenos/Q10314_MorgosRetributionXilenos.java @@ -0,0 +1,176 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package quests.Q10314_MorgosRetributionXilenos; + +import java.util.HashSet; +import java.util.Set; + +import org.l2jmobius.gameserver.enums.QuestSound; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.holders.ItemHolder; +import org.l2jmobius.gameserver.model.holders.NpcLogListHolder; +import org.l2jmobius.gameserver.model.quest.Quest; +import org.l2jmobius.gameserver.model.quest.QuestState; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +/** + * @author Serenitty + */ +public class Q10314_MorgosRetributionXilenos extends Quest +{ + // NPC + private static final int ASHIN = 34322; + // Monsters + private static final int XILENOS_WARRIOR = 22479; + private static final int XILENOS_SHOOTER = 22481; + private static final int XILENOS_SCOUT = 22485; + private static final int XILENOS_ELDER = 22483; + // Items + private static final ItemHolder SAYHA_COOKIE = new ItemHolder(93274, 20); + private static final ItemHolder SAYHA_STORM = new ItemHolder(91712, 12); + private static final ItemHolder MAGIC_LAMP_CHARGING_POTION = new ItemHolder(91757, 2); + // Misc + private static final int MIN_LEVEL = 90; + private static final String KILL_COUNT_VAR = "KillCount"; + + public Q10314_MorgosRetributionXilenos() + { + super(10314); + addStartNpc(ASHIN); + addTalkId(ASHIN); + addKillId(XILENOS_WARRIOR, XILENOS_SHOOTER, XILENOS_SCOUT, XILENOS_ELDER); + setQuestNameNpcStringId(NpcStringId.LV_90_MORGOS_RETRIBUTION_XILENOS); + } + + @Override + public String onAdvEvent(String event, Npc npc, Player player) + { + final QuestState qs = getQuestState(player, false); + if (qs == null) + { + return null; + } + + String htmltext = null; + switch (event) + { + case "StartMorgosRetribution": + { + qs.startQuest(); + htmltext = event; + break; + } + case "34322-02.htm": + { + htmltext = event; + break; + } + case "reward": + { + if (qs.isStarted()) + { + addExpAndSp(player, 25000000000L, 675000000); + giveItems(player, SAYHA_COOKIE); + giveItems(player, SAYHA_STORM); + giveItems(player, MAGIC_LAMP_CHARGING_POTION); + qs.exitQuest(false, true); + } + break; + } + } + return htmltext; + } + + @Override + public String onTalk(Npc npc, Player player) + { + final QuestState qs = getQuestState(player, true); + String htmltext = getNoQuestMsg(player); + if (qs.isCreated() && (player.getLevel() < MIN_LEVEL)) + { + htmltext = "noreq.htm"; + return htmltext; + } + if (qs.isCreated()) + { + htmltext = "34322-01.htm"; + } + else if (qs.isStarted()) + { + if (qs.isCond(1)) + { + htmltext = "34322-03.html"; + } + else if (qs.isCond(2)) + { + htmltext = "34322-02.htm"; + } + } + else if (qs.isCompleted()) + { + htmltext = getAlreadyCompletedMsg(player); + } + return htmltext; + } + + @Override + public String onKill(Npc npc, Player killer, boolean isSummon) + { + final QuestState qs = getQuestState(killer, false); + if ((qs != null) && qs.isCond(1)) + { + final int killCount = qs.getInt(KILL_COUNT_VAR) + 1; + if (killCount < 2000) + { + qs.set(KILL_COUNT_VAR, killCount); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); + sendNpcLogList(killer); + } + else + { + qs.setCond(2, true); + qs.unset(KILL_COUNT_VAR); + showOnScreenMsg(killer, NpcStringId.TALK_TO_ASSISTANT_ASHIN, ExShowScreenMessage.TOP_CENTER, 10000); + } + } + return super.onKill(npc, killer, isSummon); + } + + @Override + public Set getNpcLogList(Player player) + { + final QuestState qs = getQuestState(player, false); + if (qs != null) + { + if (qs.isCond(1)) + { + final Set holder = new HashSet<>(); + holder.add(new NpcLogListHolder(NpcStringId.KILL_MONSTERS_IN_THE_XILENOS_FORTRESS.getId(), true, qs.getInt(KILL_COUNT_VAR))); + return holder; + } + else if (qs.isCond(2)) + { + final Set holder = new HashSet<>(); + holder.add(new NpcLogListHolder(NpcStringId.LV_90_MORGOS_RETRIBUTION_XILENOS_COMPLETED.getId(), true, qs.getInt(KILL_COUNT_VAR))); + return holder; + } + } + return super.getNpcLogList(player); + } +} diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10314_MorgosRetributionXilenos/noreq.htm b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10314_MorgosRetributionXilenos/noreq.htm new file mode 100644 index 0000000000..c0ef79e7fc --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/Q10314_MorgosRetributionXilenos/noreq.htm @@ -0,0 +1,7 @@ +Assistant Ashin:
+Wow, your courage gives you credit.
+But we are talking about the infamous Gorde Canyon and spine-chilling rumors surrounding it!
+People traveling there must always be on the look out dangers.
+Come back when you get stronger.

+(Quest is only available to 90+ levels). + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/QuestMasterHandler.java index 2af69a7bca..56d57c275c 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -35,6 +35,10 @@ import quests.Q10298_TracesOfBattle.Q10298_TracesOfBattle; import quests.Q10299_GetIncrediblePower.Q10299_GetIncrediblePower; import quests.Q10300_ExploringTheCrumaTower.Q10300_ExploringTheCrumaTower; import quests.Q10301_NotSoSilentValley.Q10301_NotSoSilentValley; +import quests.Q10311_BestMedicine.Q10311_BestMedicine; +import quests.Q10312_GordesLegend.Q10312_GordesLegend; +import quests.Q10313_CunningMorgos.Q10313_CunningMorgos; +import quests.Q10314_MorgosRetributionXilenos.Q10314_MorgosRetributionXilenos; import quests.Q10673_SagaOfLegend.Q10673_SagaOfLegend; import quests.Q10950_FiercestFlame.Q10950_FiercestFlame; import quests.Q10951_NewFlameOfOrcs.Q10951_NewFlameOfOrcs; @@ -90,6 +94,10 @@ public class QuestMasterHandler Q10299_GetIncrediblePower.class, Q10300_ExploringTheCrumaTower.class, Q10301_NotSoSilentValley.class, + Q10311_BestMedicine.class, + Q10312_GordesLegend.class, + Q10313_CunningMorgos.class, + Q10314_MorgosRetributionXilenos.class, Q10950_FiercestFlame.class, Q10951_NewFlameOfOrcs.class, Q10952_ProtectAtAllCosts.class, diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Aden/ForsakenPlains.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Aden/ForsakenPlains.xml index 832a0b0cb6..3424644db8 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Aden/ForsakenPlains.xml +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Aden/ForsakenPlains.xml @@ -52,7 +52,6 @@ - diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Aden/GiantCave.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Aden/GiantCave.xml new file mode 100644 index 0000000000..8c1a767eba --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Aden/GiantCave.xml @@ -0,0 +1,285 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/GoddardMonsterSpawns.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/GoddardMonsterSpawns.xml deleted file mode 100644 index 772faa7336..0000000000 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/GoddardMonsterSpawns.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/Goddard_24_14.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/Goddard_24_14.xml deleted file mode 100644 index 04aa9241ec..0000000000 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/Goddard_24_14.xml +++ /dev/null @@ -1,396 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/Goddard_24_15.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/Goddard_24_15.xml deleted file mode 100644 index 12df938cc5..0000000000 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/Goddard_24_15.xml +++ /dev/null @@ -1,1155 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/Goddard_24_16.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/Goddard_24_16.xml deleted file mode 100644 index 1d8f053f57..0000000000 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/Goddard_24_16.xml +++ /dev/null @@ -1,1125 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/GordeCanyon.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/GordeCanyon.xml new file mode 100644 index 0000000000..e7a35bcf70 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/GordeCanyon.xml @@ -0,0 +1,676 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/HotSpings.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/HotSpings.xml new file mode 100644 index 0000000000..bc53bfa7f2 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/HotSpings.xml @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/MorgosMilitaryBase.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/MorgosMilitaryBase.xml new file mode 100644 index 0000000000..ad5530fc5b --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/MorgosMilitaryBase.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/TownOfGoddard.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/TownOfGoddard.xml deleted file mode 100644 index 1f02aa6624..0000000000 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/TownOfGoddard.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/VarkaSilenosBarracks.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/VarkaSilenosBarracks.xml deleted file mode 100644 index df42590c44..0000000000 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/VarkaSilenosBarracks.xml +++ /dev/null @@ -1,725 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/WallOfArgos.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/WallOfArgos.xml deleted file mode 100644 index bd260b9251..0000000000 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/WallOfArgos.xml +++ /dev/null @@ -1,906 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/XilenosFortress.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/XilenosFortress.xml new file mode 100644 index 0000000000..f918219211 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/spawns/Goddard/XilenosFortress.xml @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/npcs/18000-18099.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/npcs/18000-18099.xml index 841bf70d26..d6c01074d4 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/npcs/18000-18099.xml +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/npcs/18000-18099.xml @@ -760,7 +760,7 @@ - + ETC ETC diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/npcs/34300-34399.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/npcs/34300-34399.xml index ac18de02c8..5039b42167 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/npcs/34300-34399.xml +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/npcs/34300-34399.xml @@ -378,7 +378,7 @@ - + ETC FEMALE @@ -397,7 +397,7 @@ - + ETC FEMALE @@ -416,7 +416,7 @@ - + ETC FEMALE @@ -435,7 +435,7 @@ - + ETC FEMALE diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/teleporters/others/GiantsCave.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/teleporters/others/GiantsCave.xml index 7e54389b71..d5a9006dfc 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/teleporters/others/GiantsCave.xml +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/teleporters/others/GiantsCave.xml @@ -1,8 +1,12 @@ - - - + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/teleporters/others/Goddard.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/teleporters/others/Goddard.xml new file mode 100644 index 0000000000..52b972e845 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/teleporters/others/Goddard.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java index 8bc0744f2d..f150531bf1 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java @@ -138,6 +138,7 @@ public class DailyTaskManager resetRecommends(); resetTrainingCamp(); resetTimedHuntingZones(); + resetMorgosMilitaryBase(); resetDailyMissionRewards(); resetAttendanceRewards(); resetVip(); @@ -726,6 +727,32 @@ public class DailyTaskManager LOGGER.info("Daily Henna Count has been resetted."); } + private void resetMorgosMilitaryBase() + { + // Update data for offline players. + try (Connection con = DatabaseFactory.getConnection()) + { + try (PreparedStatement ps = con.prepareStatement("DELETE FROM character_variables WHERE var=?")) + { + ps.setString(1, "MORGOS_MILITARY_FREE"); + ps.execute(); + } + } + catch (Exception e) + { + LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset MorgosMilitaryBase: " + e); + } + + // Update data for online players. + for (Player player : World.getInstance().getPlayers()) + { + player.getAccountVariables().remove("MORGOS_MILITARY_FREE"); + player.getAccountVariables().storeMe(); + } + + LOGGER.info("MorgosMilitaryBase has been resetted."); + } + public static DailyTaskManager getInstance() { return SingletonHolder.INSTANCE; diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/instancemanager/PurgeRankingManager.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/instancemanager/PurgeRankingManager.java index d25616e102..cc8ce82914 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/instancemanager/PurgeRankingManager.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/instancemanager/PurgeRankingManager.java @@ -72,7 +72,7 @@ public class PurgeRankingManager if ((Calendar.getInstance().get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) && ((System.currentTimeMillis() - lastPurgeRewards) > (604800000 /* 1 week */ - 600000 /* task delay x2 */))) { GlobalVariablesManager.getInstance().set(GlobalVariablesManager.PURGE_REWARD_TIME, System.currentTimeMillis()); - for (int category = 1; category <= 7; category++) + for (int category = 1; category <= 9; category++) { if (getTop5(category) != null) { @@ -116,6 +116,16 @@ public class PurgeRankingManager break; } case 7: + { + reward = 96724; + break; + } + case 8: + { + reward = 97225; + break; + } + case 9: { reward = 96456; break; @@ -150,7 +160,7 @@ public class PurgeRankingManager if (onlinePlayer != null) { onlinePlayer.getPurgePoints().clear(); - onlinePlayer.sendPacket(new ExSubjugationSidebar(category, new PurgePlayerHolder(0, 0))); + onlinePlayer.sendPacket(new ExSubjugationSidebar(null, new PurgePlayerHolder(0, 0, 0))); } counter++; @@ -163,7 +173,7 @@ public class PurgeRankingManager _ranking.clear(); // Restore ranking. - for (int category = 1; category <= 7; category++) + for (int category = 1; category <= 9; category++) { restoreByCategories(category); } diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/actor/Player.java index 21f077bb4c..f2afd3611c 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -462,7 +462,7 @@ public class Player extends Playable // Purge list: private static final String DELETE_SUBJUGATION = "DELETE FROM character_purge WHERE charId=?"; - private static final String INSERT_SUBJUGATION = "REPLACE INTO character_purge (`charId`, `category`, `points`, `keys`) VALUES (?, ?, ?, ?)"; + private static final String INSERT_SUBJUGATION = "REPLACE INTO character_purge (`charId`, `category`, `points`, `keys`, `remainingKeys`) VALUES (?, ?, ?, ?, ?)"; private static final String RESTORE_SUBJUGATION = "SELECT * FROM character_purge WHERE charId=?"; // Elemental Spirits: @@ -15618,6 +15618,7 @@ public class Player extends Playable st.setInt(2, category); st.setInt(3, data.getPoints()); st.setInt(4, data.getKeys()); + st.setInt(5, data.getMaxPeriodicKeys()); st.addBatch(); } catch (Exception e) @@ -15650,7 +15651,7 @@ public class Player extends Playable { while (rset.next()) { - _purgePoints.put(rset.getInt("category"), new PurgePlayerHolder(rset.getInt("points"), rset.getInt("keys"))); + _purgePoints.put(rset.getInt("category"), new PurgePlayerHolder(rset.getInt("points"), rset.getInt("keys"), rset.getInt("remainingKeys"))); } } @@ -15661,6 +15662,16 @@ public class Player extends Playable } } + public int getPurgeLastCategory() + { + return getVariables().getInt(PlayerVariables.PURGE_LAST_CATEGORY, 1); + } + + public void setPurgeLastCategory(int category) + { + getVariables().set(PlayerVariables.PURGE_LAST_CATEGORY, category); + } + public int getClanDonationPoints() { return getVariables().getInt(PlayerVariables.CLAN_DONATION_POINTS, 3); diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/holders/PurgePlayerHolder.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/holders/PurgePlayerHolder.java index 7ce8b95ca2..f8feb7e5eb 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/holders/PurgePlayerHolder.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/holders/PurgePlayerHolder.java @@ -17,17 +17,19 @@ package org.l2jmobius.gameserver.model.holders; /** - * Written by Berezkin Nikolay, on 04.05.2021 + * Written by Berezkin Nikolay, Serenitty */ public class PurgePlayerHolder { private final int _points; private final int _keys; + private int _getMaxPeriodicKeys; - public PurgePlayerHolder(int points, int keys) + public PurgePlayerHolder(int points, int keys, int remainingKeys) { _points = points; _keys = keys; + _getMaxPeriodicKeys = remainingKeys; } public int getPoints() @@ -39,4 +41,13 @@ public class PurgePlayerHolder { return _keys; } + + public int getMaxPeriodicKeys() + { + if ((_keys == 0) && (_getMaxPeriodicKeys == 0)) + { + _getMaxPeriodicKeys += 40; + } + return _getMaxPeriodicKeys; + } } diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java index 8eea4e5c1d..2272dc152c 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java @@ -81,6 +81,7 @@ public class PlayerVariables extends AbstractVariables public static final String STAT_WIT = "STAT_WIT"; public static final String STAT_MEN = "STAT_MEN"; public static final String RESURRECT_BY_PAYMENT_COUNT = "RESURRECT_BY_PAYMENT_COUNT"; + public static final String PURGE_LAST_CATEGORY = "PURGE_LAST_CATEGORY"; public static final String CLAN_JOIN_TIME = "CLAN_JOIN_TIME"; public static final String CLAN_DONATION_POINTS = "CLAN_DONATION_POINTS"; public static final String HENNA1_DURATION = "HENNA1_DURATION"; diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 71f15b58c7..5b244af3a9 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -693,7 +693,7 @@ public class EnterWorld implements IClientIncomingPacket player.sendPacket(new ExCollectionInfo(player, category)); } - player.sendPacket(new ExSubjugationSidebar(1, player.getPurgePoints().get(1))); + player.sendPacket(new ExSubjugationSidebar(player, player.getPurgePoints().get(player.getPurgeLastCategory()))); player.sendPacket(new ItemDeletionInfo()); diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/subjugation/RequestSubjugationGacha.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/subjugation/RequestSubjugationGacha.java index 2485700109..13178519c7 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/subjugation/RequestSubjugationGacha.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/clientpackets/subjugation/RequestSubjugationGacha.java @@ -61,7 +61,7 @@ public class RequestSubjugationGacha implements IClientIncomingPacket { player.getInventory().reduceAdena("Purge Gacha", 20000L * _amount, player, null); final int curKeys = playerKeys.getKeys() - _amount; - player.getPurgePoints().put(_category, new PurgePlayerHolder(playerKeys.getPoints(), curKeys)); + player.getPurgePoints().put(_category, new PurgePlayerHolder(playerKeys.getPoints(), curKeys, 0)); Map rewards = new HashMap<>(); for (int i = 0; i < _amount; i++) { diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationList.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationList.java index dbf3419109..b9be34cf9e 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationList.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationList.java @@ -27,7 +27,7 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; /** - * Written by Berezkin Nikolay, on 13.04.2021 01 00 00 00 //category 01 00 00 00 1901 00 00 //points 00 00 00 00 4600 00 00 //70 max keys ? + * Written by Berezkin Nikolay, 40 keys max according to retail. */ public class ExSubjugationList implements IClientOutgoingPacket { @@ -48,7 +48,7 @@ public class ExSubjugationList implements IClientOutgoingPacket packet.writeD(integerPurgePlayerHolderEntry.getKey()); packet.writeD(integerPurgePlayerHolderEntry.getValue() != null ? integerPurgePlayerHolderEntry.getValue().getPoints() : 0); packet.writeD(integerPurgePlayerHolderEntry.getValue() != null ? integerPurgePlayerHolderEntry.getValue().getKeys() : 0); - packet.writeD(70); + packet.writeD(integerPurgePlayerHolderEntry.getValue() != null ? integerPurgePlayerHolderEntry.getValue().getMaxPeriodicKeys() : 40); } return true; } diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationSidebar.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationSidebar.java index d923f79a6b..69bc092ec0 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationSidebar.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/subjugation/ExSubjugationSidebar.java @@ -17,21 +17,22 @@ package org.l2jmobius.gameserver.network.serverpackets.subjugation; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.holders.PurgePlayerHolder; import org.l2jmobius.gameserver.network.OutgoingPackets; import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; /** - * Written by Berezkin Nikolay, on 13.04.2021 01 00 00 00 19 01 00 00 0000 0000 + * Written by Berezkin Nikolay, Serenitty */ public class ExSubjugationSidebar implements IClientOutgoingPacket { + private final Player _player; private final PurgePlayerHolder _purgeData; - private final int _category; - public ExSubjugationSidebar(int category, PurgePlayerHolder purgeData) + public ExSubjugationSidebar(Player player, PurgePlayerHolder purgeData) { - _category = category; + _player = player; _purgeData = purgeData; } @@ -39,9 +40,9 @@ public class ExSubjugationSidebar implements IClientOutgoingPacket public boolean write(PacketWriter packet) { OutgoingPackets.EX_SUBJUGATION_SIDEBAR.writeId(packet); - packet.writeD(_category); // key size - packet.writeD(_purgeData != null ? _purgeData.getPoints() : 0); // 1000000 = 100 percent - packet.writeD(_purgeData != null ? _purgeData.getKeys() : 0); + packet.writeD(_player == null ? 0 : _player.getPurgeLastCategory()); + packet.writeD(_purgeData == null ? 0 : _purgeData.getPoints()); // 1000000 = 100 percent + packet.writeD(_purgeData == null ? 0 : _purgeData.getKeys()); packet.writeD(0); return true; }