Explorar o código

Seven Signs AI core support

Charus hai 1 ano
pai
achega
85f117da48

+ 115 - 45
src/main/java/com/l2jserver/gameserver/SevenSigns.java

@@ -109,6 +109,7 @@ public class SevenSigns {
 	public static final int ANAKIM_NPC_ID = 25286;
 	public static final int CREST_OF_DAWN_ID = 31170;
 	public static final int CREST_OF_DUSK_ID = 31171;
+	
 	// Seal Stone Related Constants
 	public static final int SEAL_STONE_BLUE_ID = 6360;
 	public static final int SEAL_STONE_GREEN_ID = 6361;
@@ -145,13 +146,13 @@ public class SevenSigns {
 	private final Map<Integer, Integer> _signsDuskSealTotals = new LinkedHashMap<>();
 	private final Map<Integer, Integer> _signsDawnSealTotals = new LinkedHashMap<>();
 	
-	private static final String LOAD_DATA = "SELECT charId, cabal, seal, red_stones, green_stones, blue_stones, " + "ancient_adena_amount, contribution_score FROM seven_signs";
+	private static final String LOAD_DATA = "SELECT charId, cabal, seal, position, paid_type, red_stones, green_stones, blue_stones, ancient_adena_amount, contribution_score FROM seven_signs";
 	
 	private static final String LOAD_STATUS = "SELECT * FROM seven_signs_status WHERE id=0";
 	
-	private static final String INSERT_PLAYER = "INSERT INTO seven_signs (charId, cabal, seal) VALUES (?,?,?)";
+	private static final String INSERT_PLAYER = "INSERT INTO seven_signs (charId, cabal, seal, position, paid_type) VALUES (?,?,?,?,?)";
 	
-	private static final String UPDATE_PLAYER = "UPDATE seven_signs SET cabal=?, seal=?, red_stones=?, green_stones=?, blue_stones=?, " + "ancient_adena_amount=?, contribution_score=? WHERE charId=?";
+	private static final String UPDATE_PLAYER = "UPDATE seven_signs SET cabal=?, seal=?, position=?, paid_type=?, red_stones=?, green_stones=?, blue_stones=?, ancient_adena_amount=?, contribution_score=? WHERE charId=?";
 	
 	private static final String UPDATE_STATUS = "UPDATE seven_signs_status SET current_cycle=?, active_period=?, previous_winner=?, " + "dawn_stone_score=?, dawn_festival_score=?, dusk_stone_score=?, dusk_festival_score=?, "
 		+ "avarice_owner=?, gnosis_owner=?, strife_owner=?, avarice_dawn_score=?, gnosis_dawn_score=?, " + "strife_dawn_score=?, avarice_dusk_score=?, gnosis_dusk_score=?, strife_dusk_score=?, " + "festival_cycle=?, accumulated_bonus0=?, accumulated_bonus1=?, accumulated_bonus2=?,"
@@ -351,22 +352,6 @@ public class SevenSigns {
 		}
 	}
 	
-	public static long calcContributionScore(long blueCount, long greenCount, long redCount) {
-		long contrib = blueCount * BLUE_CONTRIB_POINTS;
-		contrib += greenCount * GREEN_CONTRIB_POINTS;
-		contrib += redCount * RED_CONTRIB_POINTS;
-		
-		return contrib;
-	}
-	
-	public static long calcAncientAdenaReward(long blueCount, long greenCount, long redCount) {
-		long reward = blueCount * SEAL_STONE_BLUE_VALUE;
-		reward += greenCount * SEAL_STONE_GREEN_VALUE;
-		reward += redCount * SEAL_STONE_RED_VALUE;
-		
-		return reward;
-	}
-	
 	public static String getCabalShortName(int cabal) {
 		return switch (cabal) {
 			case CABAL_DAWN -> "dawn";
@@ -465,6 +450,14 @@ public class SevenSigns {
 		return (_activePeriod == PERIOD_COMP_RESULTS);
 	}
 	
+	public final boolean isInitializationPeriod() {
+		return (_activePeriod == PERIOD_COMP_RECRUITING);
+	}
+	
+	public boolean isJoinableToDawn(L2PcInstance player) {
+		return (player.getClan() != null) && (player.getClan().getCastleId() > 0);
+	}
+	
 	/**
 	 * returns true if the given date is in Seal Validation or in Quest Event Results period
 	 * @param date
@@ -583,6 +576,45 @@ public class SevenSigns {
 		return stoneCount;
 	}
 	
+	public int getDepositedSSQItemCount(L2PcInstance player, int stoneId) {
+		final StatsSet currPlayer = _signsPlayerData.get(player.getObjectId());
+		if (currPlayer == null) {
+			return 0;
+		}
+		
+		return switch (stoneId) {
+			case SEAL_STONE_BLUE_ID -> currPlayer.getInt("blue_stones");
+			case SEAL_STONE_GREEN_ID -> currPlayer.getInt("green_stones");
+			case SEAL_STONE_RED_ID -> currPlayer.getInt("red_stones");
+			default -> 0;
+		};
+	}
+	
+	public int deleteDepositedSSQItemAndGiveRewards(L2PcInstance player, int stoneId, int amount) {
+		StatsSet currPlayer = _signsPlayerData.get(player.getObjectId());
+		
+		int rewardAmount = amount * switch (stoneId) {
+			case SEAL_STONE_BLUE_ID -> SEAL_STONE_BLUE_VALUE;
+			case SEAL_STONE_GREEN_ID -> SEAL_STONE_GREEN_VALUE;
+			case SEAL_STONE_RED_ID -> SEAL_STONE_RED_VALUE;
+			default -> 0;
+		};
+		
+		player.addAncientAdena("SevenSigns", rewardAmount, player, true);
+		
+		currPlayer.set("red_stones", 0);
+		currPlayer.set("green_stones", 0);
+		currPlayer.set("blue_stones", 0);
+		
+		_signsPlayerData.put(player.getObjectId(), currPlayer);
+		if (!sevenSigns().sevenSignsLazyUpdate()) {
+			saveSevenSignsData(player.getObjectId());
+			saveSevenSignsStatus();
+		}
+		
+		return rewardAmount;
+	}
+	
 	public int getPlayerContribScore(int objectId) {
 		final StatsSet currPlayer = _signsPlayerData.get(objectId);
 		if (currPlayer == null) {
@@ -626,6 +658,10 @@ public class SevenSigns {
 		}
 	}
 	
+	public int getSSQPrevWinner() {
+		return _previousWinner;
+	}
+	
 	/**
 	 * Restores all Seven Signs data and settings, usually called at server startup.
 	 */
@@ -639,6 +675,8 @@ public class SevenSigns {
 					sevenDat.set("charId", charObjId);
 					sevenDat.set("cabal", rs.getString("cabal"));
 					sevenDat.set("seal", rs.getInt("seal"));
+					sevenDat.set("position", rs.getInt("position"));
+					sevenDat.set("paid_type", rs.getInt("paid_type"));
 					sevenDat.set("red_stones", rs.getInt("red_stones"));
 					sevenDat.set("green_stones", rs.getInt("green_stones"));
 					sevenDat.set("blue_stones", rs.getInt("blue_stones"));
@@ -690,12 +728,15 @@ public class SevenSigns {
 			for (StatsSet sevenDat : _signsPlayerData.values()) {
 				ps.setString(1, sevenDat.getString("cabal"));
 				ps.setInt(2, sevenDat.getInt("seal"));
-				ps.setInt(3, sevenDat.getInt("red_stones"));
-				ps.setInt(4, sevenDat.getInt("green_stones"));
-				ps.setInt(5, sevenDat.getInt("blue_stones"));
-				ps.setDouble(6, sevenDat.getDouble("ancient_adena_amount"));
-				ps.setDouble(7, sevenDat.getDouble("contribution_score"));
-				ps.setInt(8, sevenDat.getInt("charId"));
+				ps.setInt(3, sevenDat.getInt("position"));
+				ps.setInt(4, sevenDat.getInt("paid_type"));
+				
+				ps.setInt(5, sevenDat.getInt("red_stones"));
+				ps.setInt(6, sevenDat.getInt("green_stones"));
+				ps.setInt(7, sevenDat.getInt("blue_stones"));
+				ps.setDouble(8, sevenDat.getDouble("ancient_adena_amount"));
+				ps.setDouble(9, sevenDat.getDouble("contribution_score"));
+				ps.setInt(10, sevenDat.getInt("charId"));
 				ps.addBatch();
 			}
 			ps.executeBatch();
@@ -714,12 +755,15 @@ public class SevenSigns {
 			var ps = con.prepareStatement(UPDATE_PLAYER)) {
 			ps.setString(1, sevenDat.getString("cabal"));
 			ps.setInt(2, sevenDat.getInt("seal"));
-			ps.setInt(3, sevenDat.getInt("red_stones"));
-			ps.setInt(4, sevenDat.getInt("green_stones"));
-			ps.setInt(5, sevenDat.getInt("blue_stones"));
-			ps.setDouble(6, sevenDat.getDouble("ancient_adena_amount"));
-			ps.setDouble(7, sevenDat.getDouble("contribution_score"));
-			ps.setInt(8, sevenDat.getInt("charId"));
+			ps.setInt(3, sevenDat.getInt("position"));
+			ps.setInt(4, sevenDat.getInt("paid_type"));
+			
+			ps.setInt(5, sevenDat.getInt("red_stones"));
+			ps.setInt(6, sevenDat.getInt("green_stones"));
+			ps.setInt(7, sevenDat.getInt("blue_stones"));
+			ps.setDouble(8, sevenDat.getDouble("ancient_adena_amount"));
+			ps.setDouble(9, sevenDat.getDouble("contribution_score"));
+			ps.setInt(10, sevenDat.getInt("charId"));
 			ps.execute();
 		} catch (SQLException ex) {
 			LOG.error("Unable to save data to database!", ex);
@@ -768,6 +812,8 @@ public class SevenSigns {
 			// Reset the player's cabal and seal information
 			sevenDat.set("cabal", "");
 			sevenDat.set("seal", SEAL_NULL);
+			sevenDat.set("position", 0);
+			sevenDat.set("paid_type", 0);
 			sevenDat.set("contribution_score", 0);
 		}
 	}
@@ -775,40 +821,50 @@ public class SevenSigns {
 	/**
 	 * Used to specify cabal-related details for the specified player.<br>
 	 * This method checks to see if the player has registered before and will update the database if necessary.
-	 * @param objectId
+	 * @param player
 	 * @param chosenCabal
 	 * @param chosenSeal
+	 * @param position
+	 * @param score
+	 * @param paidType
 	 * @return the cabal ID the player has joined.
 	 */
-	public int setPlayerInfo(int objectId, int chosenCabal, int chosenSeal) {
-		StatsSet currPlayerData = _signsPlayerData.get(objectId);
+	public int addSSQMember(L2PcInstance player, int chosenCabal, int chosenSeal, int position, int score, int paidType) {
+		StatsSet currPlayerData = _signsPlayerData.get(player.getObjectId());
 		
 		if (currPlayerData != null) {
 			// If the seal validation period has passed,
 			// cabal information was removed and so "re-register" player
 			currPlayerData.set("cabal", getCabalShortName(chosenCabal));
 			currPlayerData.set("seal", chosenSeal);
+			currPlayerData.set("position", position);
+			currPlayerData.set("paid_type", paidType);
+			currPlayerData.set("contribution_score", score);
 			
-			_signsPlayerData.put(objectId, currPlayerData);
+			_signsPlayerData.put(player.getObjectId(), currPlayerData);
 		} else {
 			currPlayerData = new StatsSet();
-			currPlayerData.set("charId", objectId);
+			currPlayerData.set("charId", player.getObjectId());
 			currPlayerData.set("cabal", getCabalShortName(chosenCabal));
 			currPlayerData.set("seal", chosenSeal);
+			currPlayerData.set("position", position);
+			currPlayerData.set("paid_type", paidType);
 			currPlayerData.set("red_stones", 0);
 			currPlayerData.set("green_stones", 0);
 			currPlayerData.set("blue_stones", 0);
 			currPlayerData.set("ancient_adena_amount", 0);
 			currPlayerData.set("contribution_score", 0);
 			
-			_signsPlayerData.put(objectId, currPlayerData);
+			_signsPlayerData.put(player.getObjectId(), currPlayerData);
 			
 			// Update data in database, as we have a new player signing up.
 			try (var con = ConnectionFactory.getInstance().getConnection();
 				var ps = con.prepareStatement(INSERT_PLAYER)) {
-				ps.setInt(1, objectId);
+				ps.setInt(1, player.getObjectId());
 				ps.setString(2, getCabalShortName(chosenCabal));
 				ps.setInt(3, chosenSeal);
+				ps.setInt(4, position);
+				ps.setInt(5, paidType);
 				ps.execute();
 			} catch (SQLException ex) {
 				LOG.warn("Failed to save data!", ex);
@@ -866,8 +922,8 @@ public class SevenSigns {
 	 * @param redCount
 	 * @return
 	 */
-	public long addPlayerStoneContrib(int objectId, long blueCount, long greenCount, long redCount) {
-		StatsSet currPlayer = _signsPlayerData.get(objectId);
+	public long depositSSQItem(L2PcInstance player, long blueCount, long greenCount, long redCount) {
+		StatsSet currPlayer = _signsPlayerData.get(player.getObjectId());
 		
 		long contribScore = calcContributionScore(blueCount, greenCount, redCount);
 		long totalAncientAdena = currPlayer.getLong("ancient_adena_amount") + calcAncientAdenaReward(blueCount, greenCount, redCount);
@@ -882,21 +938,37 @@ public class SevenSigns {
 		currPlayer.set("blue_stones", currPlayer.getInt("blue_stones") + blueCount);
 		currPlayer.set("ancient_adena_amount", totalAncientAdena);
 		currPlayer.set("contribution_score", totalContribScore);
-		_signsPlayerData.put(objectId, currPlayer);
+		_signsPlayerData.put(player.getObjectId(), currPlayer);
 		
-		switch (getPlayerCabal(objectId)) {
+		switch (getPlayerCabal(player.getObjectId())) {
 			case CABAL_DAWN -> _dawnStoneScore += contribScore;
 			case CABAL_DUSK -> _duskStoneScore += contribScore;
 		}
 		
 		if (!sevenSigns().sevenSignsLazyUpdate()) {
-			saveSevenSignsData(objectId);
+			saveSevenSignsData(player.getObjectId());
 			saveSevenSignsStatus();
 		}
 		
 		return contribScore;
 	}
 	
+	public static long calcContributionScore(long blueCount, long greenCount, long redCount) {
+		long contrib = blueCount * BLUE_CONTRIB_POINTS;
+		contrib += greenCount * GREEN_CONTRIB_POINTS;
+		contrib += redCount * RED_CONTRIB_POINTS;
+		
+		return contrib;
+	}
+	
+	public static long calcAncientAdenaReward(long blueCount, long greenCount, long redCount) {
+		long reward = blueCount * SEAL_STONE_BLUE_VALUE;
+		reward += greenCount * SEAL_STONE_GREEN_VALUE;
+		reward += redCount * SEAL_STONE_RED_VALUE;
+		
+		return reward;
+	}
+	
 	/**
 	 * Adds the specified number of festival points to the specified cabal.<br>
 	 * Remember, the same number of points are <b>deducted from the rival cabal</b> to maintain proportionality.
@@ -1116,13 +1188,11 @@ public class SevenSigns {
 				if (!player.isGM() && player.isIn7sDungeon() && ((currPlayer == null) || !currPlayer.getString("cabal").equals(compWinner))) {
 					player.teleToLocation(TeleportWhereType.TOWN);
 					player.setIsIn7sDungeon(false);
-					player.sendMessage("You have been teleported to the nearest town due to the beginning of the Seal Validation period.");
 				}
 			} else {
 				if (!player.isGM() && player.isIn7sDungeon() && ((currPlayer == null) || !currPlayer.getString("cabal").isEmpty())) {
 					player.teleToLocation(TeleportWhereType.TOWN);
 					player.setIsIn7sDungeon(false);
-					player.sendMessage("You have been teleported to the nearest town because you have not signed for any cabal.");
 				}
 			}
 		}

+ 0 - 3
src/main/java/com/l2jserver/gameserver/enums/InstanceType.java

@@ -81,9 +81,6 @@ public enum InstanceType {
 	L2FortLogisticsInstance(L2MerchantInstance),
 	L2FortManagerInstance(L2MerchantInstance),
 	// Seven Signs
-	L2SignsPriestInstance(L2Npc),
-	L2DawnPriestInstance(L2SignsPriestInstance),
-	L2DuskPriestInstance(L2SignsPriestInstance),
 	L2DungeonGatekeeperInstance(L2Npc),
 	// City NPCs
 	L2AdventurerInstance(L2NpcInstance),

+ 0 - 108
src/main/java/com/l2jserver/gameserver/model/actor/instance/L2DawnPriestInstance.java

@@ -1,108 +0,0 @@
-/*
- * Copyright © 2004-2023 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server 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.
- * 
- * L2J Server 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 <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.model.actor.instance;
-
-import com.l2jserver.gameserver.SevenSigns;
-import com.l2jserver.gameserver.enums.InstanceType;
-import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
-import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
-import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
-
-public class L2DawnPriestInstance extends L2SignsPriestInstance {
-	
-	public L2DawnPriestInstance(L2NpcTemplate template) {
-		super(template);
-		setInstanceType(InstanceType.L2DawnPriestInstance);
-	}
-	
-	@Override
-	public void onBypassFeedback(L2PcInstance player, String command) {
-		if (command.startsWith("Chat")) {
-			showChatWindow(player);
-		} else {
-			super.onBypassFeedback(player, command);
-		}
-	}
-	
-	@Override
-	public void showChatWindow(L2PcInstance player) {
-		player.sendPacket(ActionFailed.STATIC_PACKET);
-		
-		String filename = SevenSigns.SEVEN_SIGNS_HTML_PATH;
-		int sealGnosisOwner = SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_GNOSIS);
-		int playerCabal = SevenSigns.getInstance().getPlayerCabal(player.getObjectId());
-		boolean isSealValidationPeriod = SevenSigns.getInstance().isSealValidationPeriod();
-		boolean isCompResultsPeriod = SevenSigns.getInstance().isCompResultsPeriod();
-		int recruitPeriod = SevenSigns.getInstance().getCurrentPeriod();
-		int compWinner = SevenSigns.getInstance().getCabalHighestScore();
-		
-		switch (playerCabal) {
-			case SevenSigns.CABAL_DAWN:
-				if (isCompResultsPeriod) {
-					filename += "dawn_priest_5.htm";
-				} else if (recruitPeriod == 0) {
-					filename += "dawn_priest_6.htm";
-				} else if (isSealValidationPeriod) {
-					if (compWinner == SevenSigns.CABAL_DAWN) {
-						if (compWinner != sealGnosisOwner) {
-							filename += "dawn_priest_2c.htm";
-						} else {
-							filename += "dawn_priest_2a.htm";
-						}
-					} else if (compWinner == SevenSigns.CABAL_NULL) {
-						filename += "dawn_priest_2d.htm";
-					} else {
-						filename += "dawn_priest_2b.htm";
-					}
-				} else {
-					filename += "dawn_priest_1b.htm";
-				}
-				break;
-			case SevenSigns.CABAL_DUSK:
-				if (isSealValidationPeriod) {
-					filename += "dawn_priest_3a.htm";
-				} else {
-					filename += "dawn_priest_3b.htm";
-				}
-				break;
-			default:
-				if (isCompResultsPeriod) {
-					filename += "dawn_priest_5.htm";
-				} else if (recruitPeriod == 0) {
-					filename += "dawn_priest_6.htm";
-				} else if (isSealValidationPeriod) {
-					if (compWinner == SevenSigns.CABAL_DAWN) {
-						filename += "dawn_priest_4.htm";
-					} else if (compWinner == SevenSigns.CABAL_NULL) {
-						filename += "dawn_priest_2d.htm";
-					} else {
-						filename += "dawn_priest_2b.htm";
-					}
-				} else {
-					filename += "dawn_priest_1a.htm";
-				}
-				break;
-		}
-		
-		final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
-		html.setFile(player.getHtmlPrefix(), filename);
-		html.replace("%objectId%", String.valueOf(getObjectId()));
-		player.sendPacket(html);
-	}
-}

+ 0 - 109
src/main/java/com/l2jserver/gameserver/model/actor/instance/L2DuskPriestInstance.java

@@ -1,109 +0,0 @@
-/*
- * Copyright © 2004-2023 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server 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.
- * 
- * L2J Server 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 <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.model.actor.instance;
-
-import com.l2jserver.gameserver.SevenSigns;
-import com.l2jserver.gameserver.enums.InstanceType;
-import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
-import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
-import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
-
-public class L2DuskPriestInstance extends L2SignsPriestInstance {
-	
-	public L2DuskPriestInstance(L2NpcTemplate template) {
-		super(template);
-		setInstanceType(InstanceType.L2DuskPriestInstance);
-	}
-	
-	@Override
-	public void onBypassFeedback(L2PcInstance player, String command) {
-		if (command.startsWith("Chat")) {
-			showChatWindow(player);
-		} else {
-			super.onBypassFeedback(player, command);
-		}
-	}
-	
-	@Override
-	public void showChatWindow(L2PcInstance player) {
-		player.sendPacket(ActionFailed.STATIC_PACKET);
-		
-		String filename = SevenSigns.SEVEN_SIGNS_HTML_PATH;
-		int sealGnosisOwner = SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_GNOSIS);
-		int playerCabal = SevenSigns.getInstance().getPlayerCabal(player.getObjectId());
-		boolean isSealValidationPeriod = SevenSigns.getInstance().isSealValidationPeriod();
-		boolean isCompResultsPeriod = SevenSigns.getInstance().isCompResultsPeriod();
-		int recruitPeriod = SevenSigns.getInstance().getCurrentPeriod();
-		int compWinner = SevenSigns.getInstance().getCabalHighestScore();
-		
-		switch (playerCabal) {
-			case SevenSigns.CABAL_DUSK:
-				if (isCompResultsPeriod) {
-					filename += "dusk_priest_5.htm";
-				} else if (recruitPeriod == 0) {
-					filename += "dusk_priest_6.htm";
-				} else if (isSealValidationPeriod) {
-					if (compWinner == SevenSigns.CABAL_DUSK) {
-						if (compWinner != sealGnosisOwner) {
-							filename += "dusk_priest_2c.htm";
-						} else {
-							filename += "dusk_priest_2a.htm";
-						}
-					} else if (compWinner == SevenSigns.CABAL_NULL) {
-						filename += "dusk_priest_2d.htm";
-					} else {
-						filename += "dusk_priest_2b.htm";
-					}
-				} else {
-					filename += "dusk_priest_1b.htm";
-				}
-				break;
-			case SevenSigns.CABAL_DAWN:
-				if (isSealValidationPeriod) {
-					filename += "dusk_priest_3a.htm";
-				} else {
-					filename += "dusk_priest_3b.htm";
-				}
-				break;
-			default:
-				if (isCompResultsPeriod) {
-					filename += "dusk_priest_5.htm";
-				} else if (recruitPeriod == 0) {
-					filename += "dusk_priest_6.htm";
-				} else if (isSealValidationPeriod) {
-					if (compWinner == SevenSigns.CABAL_DUSK) {
-						filename += "dusk_priest_4.htm";
-					} else if (compWinner == SevenSigns.CABAL_NULL) {
-						filename += "dusk_priest_2d.htm";
-					} else {
-						filename += "dusk_priest_2b.htm";
-					}
-				} else {
-					filename += "dusk_priest_1a.htm";
-				}
-				break;
-		}
-		
-		final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
-		html.setFile(player.getHtmlPrefix(), filename);
-		html.replace("%objectId%", String.valueOf(getObjectId()));
-		player.sendPacket(html);
-	}
-	
-}

+ 0 - 703
src/main/java/com/l2jserver/gameserver/model/actor/instance/L2SignsPriestInstance.java

@@ -1,703 +0,0 @@
-/*
- * Copyright © 2004-2023 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server 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.
- * 
- * L2J Server 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 <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.model.actor.instance;
-
-import static com.l2jserver.gameserver.config.Configuration.sevenSigns;
-
-import java.util.StringTokenizer;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.l2jserver.gameserver.SevenSigns;
-import com.l2jserver.gameserver.cache.HtmCache;
-import com.l2jserver.gameserver.enums.InstanceType;
-import com.l2jserver.gameserver.model.actor.L2Npc;
-import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
-import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
-import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
-import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
-
-/**
- * Dawn/Dusk Seven Signs Priest Instance
- * @author Tempy
- */
-public class L2SignsPriestInstance extends L2Npc {
-	private static final Logger LOG = LoggerFactory.getLogger(L2SignsPriestInstance.class);
-	
-	public L2SignsPriestInstance(L2NpcTemplate template) {
-		super(template);
-		setInstanceType(InstanceType.L2SignsPriestInstance);
-	}
-	
-	@Override
-	public void onBypassFeedback(L2PcInstance player, String command) {
-		if ((player.getLastFolkNPC() == null) || (player.getLastFolkNPC().getObjectId() != getObjectId())) {
-			return;
-		}
-		
-		if (command.startsWith("SevenSignsDesc")) {
-			int val = Integer.parseInt(command.substring(15));
-			showChatWindow(player, val, null, true);
-		} else if (command.startsWith("SevenSigns")) {
-			SystemMessage sm;
-			
-			String path;
-			
-			int cabal = SevenSigns.CABAL_NULL;
-			int stoneType;
-			
-			int val = Integer.parseInt(command.substring(11, 12).trim());
-			
-			if (command.length() > 12) {
-				val = Integer.parseInt(command.substring(11, 13).trim());
-			}
-			
-			if (command.length() > 13) {
-				try {
-					cabal = Integer.parseInt(command.substring(14, 15).trim());
-				} catch (Exception e) {
-					try {
-						cabal = Integer.parseInt(command.substring(13, 14).trim());
-					} catch (Exception e2) {
-						try {
-							StringTokenizer st = new StringTokenizer(command.trim());
-							st.nextToken();
-							cabal = Integer.parseInt(st.nextToken());
-						} catch (Exception e3) {
-							LOG.warn("Failed to retrieve cabal from bypass command. NpcId: {},  Command: {}", getId(), command);
-						}
-					}
-				}
-			}
-			
-			switch (val) {
-				case 2: // Purchase Record of the Seven Signs
-					if (!player.getInventory().validateCapacity(1)) {
-						player.sendPacket(SystemMessageId.SLOTS_FULL);
-						break;
-					}
-					
-					if (!player.reduceAdena("SevenSigns", SevenSigns.RECORD_SEVEN_SIGNS_COST, this, true)) {
-						player.sendPacket(SystemMessageId.YOU_NOT_ENOUGH_ADENA);
-						break;
-					}
-					player.getInventory().addItem("SevenSigns", SevenSigns.RECORD_SEVEN_SIGNS_ID, 1, player, this);
-					
-					sm = SystemMessage.getSystemMessage(SystemMessageId.EARNED_ITEM_S1);
-					sm.addItemName(SevenSigns.RECORD_SEVEN_SIGNS_ID);
-					player.sendPacket(sm);
-					
-					if (this instanceof L2DawnPriestInstance) {
-						showChatWindow(player, val, "dawn", false);
-					} else {
-						showChatWindow(player, val, "dusk", false);
-					}
-					break;
-				case 33: // "I want to participate" request
-					int oldCabal = SevenSigns.getInstance().getPlayerCabal(player.getObjectId());
-					
-					if (oldCabal != SevenSigns.CABAL_NULL) {
-						if (this instanceof L2DawnPriestInstance) {
-							showChatWindow(player, val, "dawn_member", false);
-						} else {
-							showChatWindow(player, val, "dusk_member", false);
-						}
-						return;
-					} else if (player.getClassId().level() == 0) {
-						if (this instanceof L2DawnPriestInstance) {
-							showChatWindow(player, val, "dawn_firstclass", false);
-						} else {
-							showChatWindow(player, val, "dusk_firstclass", false);
-						}
-						return;
-					} else if ((cabal == SevenSigns.CABAL_DUSK) && sevenSigns().castleForDusk()) // dusk
-					{
-						// castle owners cannot participate with dusk side
-						if ((player.getClan() != null) && (player.getClan().getCastleId() > 0)) {
-							showChatWindow(player, SevenSigns.SEVEN_SIGNS_HTML_PATH + "signs_33_dusk_no.htm");
-							break;
-						}
-					} else if ((cabal == SevenSigns.CABAL_DAWN) && sevenSigns().castleForDawn()) // dawn
-					{
-						// clans without castle need to pay participation fee
-						if ((player.getClan() == null) || (player.getClan().getCastleId() == 0)) {
-							showChatWindow(player, SevenSigns.SEVEN_SIGNS_HTML_PATH + "signs_33_dawn_fee.htm");
-							break;
-						}
-					}
-					
-					if (this instanceof L2DawnPriestInstance) {
-						showChatWindow(player, val, "dawn", false);
-					} else {
-						showChatWindow(player, val, "dusk", false);
-					}
-					break;
-				case 34: // Pay the participation fee request
-					if ((player.getClassId().level() > 0) && ((player.getAdena() >= sevenSigns().getSevenSignsJoinDawnFee()) || (player.getInventory().getInventoryItemCount(sevenSigns().getSevenSignsManorsAgreementId(), -1) > 0))) {
-						showChatWindow(player, SevenSigns.SEVEN_SIGNS_HTML_PATH + "signs_33_dawn.htm");
-					} else {
-						showChatWindow(player, SevenSigns.SEVEN_SIGNS_HTML_PATH + "signs_33_dawn_no.htm");
-					}
-					break;
-				case 3: // Join Cabal Intro 1
-				case 8: // Festival of Darkness Intro - SevenSigns x [0]1
-					showChatWindow(player, val, SevenSigns.getCabalShortName(cabal), false);
-					break;
-				case 4: // Join a Cabal - SevenSigns 4 [0]1 x
-					int newSeal = Integer.parseInt(command.substring(15));
-					
-					if (player.getClassId().level() >= 1) {
-						if ((cabal == SevenSigns.CABAL_DUSK) && sevenSigns().castleForDusk()) {
-							if ((player.getClan() != null) && (player.getClan().getCastleId() > 0)) // even if in htmls is said that ally can have castle too, but its not
-							{
-								showChatWindow(player, SevenSigns.SEVEN_SIGNS_HTML_PATH + "signs_33_dusk_no.htm");
-								return;
-							}
-						}
-						// If the player is trying to join the Lords of Dawn, check if they are carrying a Lord's certificate. If not then try to take the required amount of adena instead.
-						if (sevenSigns().castleForDawn() && (cabal == SevenSigns.CABAL_DAWN)) {
-							boolean allowJoinDawn = false;
-							
-							if ((player.getClan() != null) && (player.getClan().getCastleId() > 0)) {
-								allowJoinDawn = true;
-							} else if (player.destroyItemByItemId("SevenSigns", sevenSigns().getSevenSignsManorsAgreementId(), 1, this, true)) {
-								allowJoinDawn = true;
-							} else if (player.reduceAdena("SevenSigns", sevenSigns().getSevenSignsJoinDawnFee(), this, true)) {
-								allowJoinDawn = true;
-							}
-							
-							if (!allowJoinDawn) {
-								showChatWindow(player, SevenSigns.SEVEN_SIGNS_HTML_PATH + "signs_33_dawn_fee.htm");
-								return;
-							}
-						}
-					}
-					SevenSigns.getInstance().setPlayerInfo(player.getObjectId(), cabal, newSeal);
-					
-					if (cabal == SevenSigns.CABAL_DAWN) {
-						player.sendPacket(SystemMessageId.SEVENSIGNS_PARTECIPATION_DAWN); // Joined Dawn
-					} else {
-						player.sendPacket(SystemMessageId.SEVENSIGNS_PARTECIPATION_DUSK); // Joined Dusk
-					}
-					
-					// Show a confirmation message to the user, indicating which seal they chose.
-					switch (newSeal) {
-						case SevenSigns.SEAL_AVARICE -> player.sendPacket(SystemMessageId.FIGHT_FOR_AVARICE);
-						case SevenSigns.SEAL_GNOSIS -> player.sendPacket(SystemMessageId.FIGHT_FOR_GNOSIS);
-						case SevenSigns.SEAL_STRIFE -> player.sendPacket(SystemMessageId.FIGHT_FOR_STRIFE);
-					}
-					
-					showChatWindow(player, 4, SevenSigns.getCabalShortName(cabal), false);
-					break;
-				case 5:
-					if (this instanceof L2DawnPriestInstance) {
-						if (SevenSigns.getInstance().getPlayerCabal(player.getObjectId()) == SevenSigns.CABAL_NULL) {
-							showChatWindow(player, val, "dawn_no", false);
-						} else {
-							showChatWindow(player, val, "dawn", false);
-						}
-					} else {
-						if (SevenSigns.getInstance().getPlayerCabal(player.getObjectId()) == SevenSigns.CABAL_NULL) {
-							showChatWindow(player, val, "dusk_no", false);
-						} else {
-							showChatWindow(player, val, "dusk", false);
-						}
-					}
-					break;
-				case 21:
-					int contribStoneId = Integer.parseInt(command.substring(14, 18));
-					
-					L2ItemInstance contribBlueStones = player.getInventory().getItemByItemId(SevenSigns.SEAL_STONE_BLUE_ID);
-					L2ItemInstance contribGreenStones = player.getInventory().getItemByItemId(SevenSigns.SEAL_STONE_GREEN_ID);
-					L2ItemInstance contribRedStones = player.getInventory().getItemByItemId(SevenSigns.SEAL_STONE_RED_ID);
-					
-					long contribBlueStoneCount = contribBlueStones == null ? 0 : contribBlueStones.getCount();
-					long contribGreenStoneCount = contribGreenStones == null ? 0 : contribGreenStones.getCount();
-					long contribRedStoneCount = contribRedStones == null ? 0 : contribRedStones.getCount();
-					
-					long score = SevenSigns.getInstance().getPlayerContribScore(player.getObjectId());
-					long contributionCount;
-					
-					boolean contribStonesFound = false;
-					
-					long redContrib = 0;
-					long greenContrib = 0;
-					long blueContrib = 0;
-					
-					try {
-						contributionCount = Long.parseLong(command.substring(19).trim());
-					} catch (Exception NumberFormatException) {
-						if (this instanceof L2DawnPriestInstance) {
-							showChatWindow(player, 6, "dawn_failure", false);
-						} else {
-							showChatWindow(player, 6, "dusk_failure", false);
-						}
-						break;
-					}
-					
-					switch (contribStoneId) {
-						case SevenSigns.SEAL_STONE_BLUE_ID -> {
-							blueContrib = (sevenSigns().getMaxPlayerContrib() - score) / SevenSigns.BLUE_CONTRIB_POINTS;
-							if (blueContrib > contribBlueStoneCount) {
-								blueContrib = contributionCount;
-							}
-						}
-						case SevenSigns.SEAL_STONE_GREEN_ID -> {
-							greenContrib = (sevenSigns().getMaxPlayerContrib() - score) / SevenSigns.GREEN_CONTRIB_POINTS;
-							if (greenContrib > contribGreenStoneCount) {
-								greenContrib = contributionCount;
-							}
-						}
-						case SevenSigns.SEAL_STONE_RED_ID -> {
-							redContrib = (sevenSigns().getMaxPlayerContrib() - score) / SevenSigns.RED_CONTRIB_POINTS;
-							if (redContrib > contribRedStoneCount) {
-								redContrib = contributionCount;
-							}
-						}
-					}
-					
-					if (redContrib > 0) {
-						if (player.destroyItemByItemId("SevenSigns", SevenSigns.SEAL_STONE_RED_ID, redContrib, this, false)) {
-							contribStonesFound = true;
-							SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.S2_S1_DISAPPEARED);
-							msg.addItemName(SevenSigns.SEAL_STONE_RED_ID);
-							msg.addLong(redContrib);
-							player.sendPacket(msg);
-						}
-					}
-					if (greenContrib > 0) {
-						if (player.destroyItemByItemId("SevenSigns", SevenSigns.SEAL_STONE_GREEN_ID, greenContrib, this, false)) {
-							contribStonesFound = true;
-							SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.S2_S1_DISAPPEARED);
-							msg.addItemName(SevenSigns.SEAL_STONE_GREEN_ID);
-							msg.addLong(greenContrib);
-							player.sendPacket(msg);
-						}
-					}
-					if (blueContrib > 0) {
-						if (player.destroyItemByItemId("SevenSigns", SevenSigns.SEAL_STONE_BLUE_ID, blueContrib, this, false)) {
-							contribStonesFound = true;
-							SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.S2_S1_DISAPPEARED);
-							msg.addItemName(SevenSigns.SEAL_STONE_BLUE_ID);
-							msg.addLong(blueContrib);
-							player.sendPacket(msg);
-						}
-					}
-					
-					if (!contribStonesFound) {
-						if (this instanceof L2DawnPriestInstance) {
-							showChatWindow(player, 6, "dawn_low_stones", false);
-						} else {
-							showChatWindow(player, 6, "dusk_low_stones", false);
-						}
-					} else {
-						score = SevenSigns.getInstance().addPlayerStoneContrib(player.getObjectId(), blueContrib, greenContrib, redContrib);
-						sm = SystemMessage.getSystemMessage(SystemMessageId.CONTRIB_SCORE_INCREASED_S1);
-						sm.addLong(score);
-						player.sendPacket(sm);
-						
-						if (this instanceof L2DawnPriestInstance) {
-							showChatWindow(player, 6, "dawn", false);
-						} else {
-							showChatWindow(player, 6, "dusk", false);
-						}
-					}
-					break;
-				case 6: // Contribute Seal Stones - SevenSigns 6 x
-					stoneType = Integer.parseInt(command.substring(13));
-					
-					L2ItemInstance blueStones = player.getInventory().getItemByItemId(SevenSigns.SEAL_STONE_BLUE_ID);
-					L2ItemInstance greenStones = player.getInventory().getItemByItemId(SevenSigns.SEAL_STONE_GREEN_ID);
-					L2ItemInstance redStones = player.getInventory().getItemByItemId(SevenSigns.SEAL_STONE_RED_ID);
-					
-					long blueStoneCount = blueStones == null ? 0 : blueStones.getCount();
-					long greenStoneCount = greenStones == null ? 0 : greenStones.getCount();
-					long redStoneCount = redStones == null ? 0 : redStones.getCount();
-					
-					long contribScore = SevenSigns.getInstance().getPlayerContribScore(player.getObjectId());
-					boolean stonesFound = false;
-					
-					if (contribScore == sevenSigns().getMaxPlayerContrib()) {
-						player.sendPacket(SystemMessageId.CONTRIB_SCORE_EXCEEDED);
-					} else {
-						long redContribCount;
-						long greenContribCount;
-						long blueContribCount;
-						
-						String contribStoneColor = null;
-						String stoneColorContr = null;
-						
-						long stoneCountContr = 0;
-						int stoneIdContr = 0;
-						
-						switch (stoneType) {
-							case 1 -> {
-								contribStoneColor = "Blue";
-								stoneColorContr = "blue";
-								stoneIdContr = SevenSigns.SEAL_STONE_BLUE_ID;
-								stoneCountContr = blueStoneCount;
-							}
-							case 2 -> {
-								contribStoneColor = "Green";
-								stoneColorContr = "green";
-								stoneIdContr = SevenSigns.SEAL_STONE_GREEN_ID;
-								stoneCountContr = greenStoneCount;
-							}
-							case 3 -> {
-								contribStoneColor = "Red";
-								stoneColorContr = "red";
-								stoneIdContr = SevenSigns.SEAL_STONE_RED_ID;
-								stoneCountContr = redStoneCount;
-							}
-							case 4 -> {
-								long tempContribScore = contribScore;
-								redContribCount = (sevenSigns().getMaxPlayerContrib() - tempContribScore) / SevenSigns.RED_CONTRIB_POINTS;
-								if (redContribCount > redStoneCount) {
-									redContribCount = redStoneCount;
-								}
-								tempContribScore += redContribCount * SevenSigns.RED_CONTRIB_POINTS;
-								greenContribCount = (sevenSigns().getMaxPlayerContrib() - tempContribScore) / SevenSigns.GREEN_CONTRIB_POINTS;
-								if (greenContribCount > greenStoneCount) {
-									greenContribCount = greenStoneCount;
-								}
-								tempContribScore += greenContribCount * SevenSigns.GREEN_CONTRIB_POINTS;
-								blueContribCount = (sevenSigns().getMaxPlayerContrib() - tempContribScore) / SevenSigns.BLUE_CONTRIB_POINTS;
-								if (blueContribCount > blueStoneCount) {
-									blueContribCount = blueStoneCount;
-								}
-								if (redContribCount > 0) {
-									if (player.destroyItemByItemId("SevenSigns", SevenSigns.SEAL_STONE_RED_ID, redContribCount, this, false)) {
-										stonesFound = true;
-										SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.S2_S1_DISAPPEARED);
-										msg.addItemName(SevenSigns.SEAL_STONE_RED_ID);
-										msg.addLong(redContribCount);
-										player.sendPacket(msg);
-									}
-								}
-								if (greenContribCount > 0) {
-									if (player.destroyItemByItemId("SevenSigns", SevenSigns.SEAL_STONE_GREEN_ID, greenContribCount, this, false)) {
-										stonesFound = true;
-										SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.S2_S1_DISAPPEARED);
-										msg.addItemName(SevenSigns.SEAL_STONE_GREEN_ID);
-										msg.addLong(greenContribCount);
-										player.sendPacket(msg);
-									}
-								}
-								if (blueContribCount > 0) {
-									if (player.destroyItemByItemId("SevenSigns", SevenSigns.SEAL_STONE_BLUE_ID, blueContribCount, this, false)) {
-										stonesFound = true;
-										SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.S2_S1_DISAPPEARED);
-										msg.addItemName(SevenSigns.SEAL_STONE_BLUE_ID);
-										msg.addLong(blueContribCount);
-										player.sendPacket(msg);
-									}
-								}
-								if (!stonesFound) {
-									if (this instanceof L2DawnPriestInstance) {
-										showChatWindow(player, val, "dawn_no_stones", false);
-									} else {
-										showChatWindow(player, val, "dusk_no_stones", false);
-									}
-								} else {
-									contribScore = SevenSigns.getInstance().addPlayerStoneContrib(player.getObjectId(), blueContribCount, greenContribCount, redContribCount);
-									sm = SystemMessage.getSystemMessage(SystemMessageId.CONTRIB_SCORE_INCREASED_S1);
-									sm.addLong(contribScore);
-									player.sendPacket(sm);
-									
-									if (this instanceof L2DawnPriestInstance) {
-										showChatWindow(player, 6, "dawn", false);
-									} else {
-										showChatWindow(player, 6, "dusk", false);
-									}
-								}
-								return;
-							}
-						}
-						
-						if (this instanceof L2DawnPriestInstance) {
-							path = SevenSigns.SEVEN_SIGNS_HTML_PATH + "signs_6_dawn_contribute.htm";
-						} else {
-							path = SevenSigns.SEVEN_SIGNS_HTML_PATH + "signs_6_dusk_contribute.htm";
-						}
-						
-						String contentContr = HtmCache.getInstance().getHtm(player.getHtmlPrefix(), path);
-						
-						if (contentContr != null) {
-							contentContr = contentContr.replaceAll("%contribStoneColor%", contribStoneColor);
-							contentContr = contentContr.replaceAll("%stoneColor%", stoneColorContr);
-							contentContr = contentContr.replaceAll("%stoneCount%", String.valueOf(stoneCountContr));
-							contentContr = contentContr.replaceAll("%stoneItemId%", String.valueOf(stoneIdContr));
-							contentContr = contentContr.replaceAll("%objectId%", String.valueOf(getObjectId()));
-							
-							final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
-							html.setHtml(contentContr);
-							player.sendPacket(html);
-						} else {
-							LOG.warn("Problem with HTML text {}", path);
-						}
-					}
-					break;
-				case 9: // Receive Contribution Rewards
-					int playerCabal = SevenSigns.getInstance().getPlayerCabal(player.getObjectId());
-					int winningCabal = SevenSigns.getInstance().getCabalHighestScore();
-					
-					if (SevenSigns.getInstance().isSealValidationPeriod() && (playerCabal == winningCabal)) {
-						int ancientAdenaReward = SevenSigns.getInstance().getAncientAdenaReward(player.getObjectId(), true);
-						
-						if (ancientAdenaReward < 3) {
-							if (this instanceof L2DawnPriestInstance) {
-								showChatWindow(player, 9, "dawn_b", false);
-							} else {
-								showChatWindow(player, 9, "dusk_b", false);
-							}
-							break;
-						}
-						
-						player.addAncientAdena("SevenSigns", ancientAdenaReward, this, true);
-						
-						if (this instanceof L2DawnPriestInstance) {
-							showChatWindow(player, 9, "dawn_a", false);
-						} else {
-							showChatWindow(player, 9, "dusk_a", false);
-						}
-					}
-					break;
-				case 11: // Teleport to Hunting Grounds
-					try {
-						String portInfo = command.substring(14).trim();
-						StringTokenizer st = new StringTokenizer(portInfo);
-						
-						int x = Integer.parseInt(st.nextToken());
-						int y = Integer.parseInt(st.nextToken());
-						int z = Integer.parseInt(st.nextToken());
-						
-						long ancientAdenaCost = Long.parseLong(st.nextToken());
-						
-						if (ancientAdenaCost > 0) {
-							if (!player.reduceAncientAdena("SevenSigns", ancientAdenaCost, this, true)) {
-								break;
-							}
-						}
-						
-						player.teleToLocation(x, y, z);
-					} catch (Exception ex) {
-						LOG.warn("Error occurred while teleporting player!", ex);
-					}
-					break;
-				case 16:
-					if (this instanceof L2DawnPriestInstance) {
-						showChatWindow(player, val, "dawn", false);
-					} else {
-						showChatWindow(player, val, "dusk", false);
-					}
-					break;
-				case 17: // Exchange Seal Stones for Ancient Adena (Type Choice) - SevenSigns 17 x
-					stoneType = Integer.parseInt(command.substring(14));
-					
-					int stoneId = 0;
-					long stoneCount = 0;
-					int stoneValue = 0;
-					
-					String stoneColor = null;
-					
-					switch (stoneType) {
-						case 1 -> {
-							stoneColor = "blue";
-							stoneId = SevenSigns.SEAL_STONE_BLUE_ID;
-							stoneValue = SevenSigns.SEAL_STONE_BLUE_VALUE;
-						}
-						case 2 -> {
-							stoneColor = "green";
-							stoneId = SevenSigns.SEAL_STONE_GREEN_ID;
-							stoneValue = SevenSigns.SEAL_STONE_GREEN_VALUE;
-						}
-						case 3 -> {
-							stoneColor = "red";
-							stoneId = SevenSigns.SEAL_STONE_RED_ID;
-							stoneValue = SevenSigns.SEAL_STONE_RED_VALUE;
-						}
-						case 4 -> {
-							L2ItemInstance blueStonesAll = player.getInventory().getItemByItemId(SevenSigns.SEAL_STONE_BLUE_ID);
-							L2ItemInstance greenStonesAll = player.getInventory().getItemByItemId(SevenSigns.SEAL_STONE_GREEN_ID);
-							L2ItemInstance redStonesAll = player.getInventory().getItemByItemId(SevenSigns.SEAL_STONE_RED_ID);
-							long blueStoneCountAll = blueStonesAll == null ? 0 : blueStonesAll.getCount();
-							long greenStoneCountAll = greenStonesAll == null ? 0 : greenStonesAll.getCount();
-							long redStoneCountAll = redStonesAll == null ? 0 : redStonesAll.getCount();
-							long ancientAdenaRewardAll;
-							ancientAdenaRewardAll = SevenSigns.calcAncientAdenaReward(blueStoneCountAll, greenStoneCountAll, redStoneCountAll);
-							if (ancientAdenaRewardAll == 0) {
-								if (this instanceof L2DawnPriestInstance) {
-									showChatWindow(player, 18, "dawn_no_stones", false);
-								} else {
-									showChatWindow(player, 18, "dusk_no_stones", false);
-								}
-								return;
-							}
-							if (blueStoneCountAll > 0) {
-								player.destroyItemByItemId("SevenSigns", SevenSigns.SEAL_STONE_BLUE_ID, blueStoneCountAll, this, true);
-							}
-							if (greenStoneCountAll > 0) {
-								player.destroyItemByItemId("SevenSigns", SevenSigns.SEAL_STONE_GREEN_ID, greenStoneCountAll, this, true);
-							}
-							if (redStoneCountAll > 0) {
-								player.destroyItemByItemId("SevenSigns", SevenSigns.SEAL_STONE_RED_ID, redStoneCountAll, this, true);
-							}
-							player.addAncientAdena("SevenSigns", ancientAdenaRewardAll, this, true);
-							if (this instanceof L2DawnPriestInstance) {
-								showChatWindow(player, 18, "dawn", false);
-							} else {
-								showChatWindow(player, 18, "dusk", false);
-							}
-							return;
-						}
-					}
-					
-					L2ItemInstance stoneInstance = player.getInventory().getItemByItemId(stoneId);
-					
-					if (stoneInstance != null) {
-						stoneCount = stoneInstance.getCount();
-					}
-					
-					if (this instanceof L2DawnPriestInstance) {
-						path = SevenSigns.SEVEN_SIGNS_HTML_PATH + "signs_17_dawn.htm";
-					} else {
-						path = SevenSigns.SEVEN_SIGNS_HTML_PATH + "signs_17_dusk.htm";
-					}
-					
-					String content = HtmCache.getInstance().getHtm(player.getHtmlPrefix(), path);
-					
-					if (content != null) {
-						content = content.replaceAll("%stoneColor%", stoneColor);
-						content = content.replaceAll("%stoneValue%", String.valueOf(stoneValue));
-						content = content.replaceAll("%stoneCount%", String.valueOf(stoneCount));
-						content = content.replaceAll("%stoneItemId%", String.valueOf(stoneId));
-						content = content.replaceAll("%objectId%", String.valueOf(getObjectId()));
-						
-						final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
-						html.setHtml(content);
-						player.sendPacket(html);
-					} else {
-						LOG.warn("Problem with HTML text {} signs_17.htm: {}", SevenSigns.SEVEN_SIGNS_HTML_PATH, path);
-					}
-					break;
-				case 18: // Exchange Seal Stones for Ancient Adena - SevenSigns 18 xxxx xxxxxx
-					int convertStoneId = Integer.parseInt(command.substring(14, 18));
-					long convertCount;
-					
-					try {
-						convertCount = Long.parseLong(command.substring(19).trim());
-					} catch (Exception NumberFormatException) {
-						if (this instanceof L2DawnPriestInstance) {
-							showChatWindow(player, 18, "dawn_failed", false);
-						} else {
-							showChatWindow(player, 18, "dusk_failed", false);
-						}
-						break;
-					}
-					
-					L2ItemInstance convertItem = player.getInventory().getItemByItemId(convertStoneId);
-					
-					if (convertItem != null) {
-						long ancientAdenaReward = 0;
-						long totalCount = convertItem.getCount();
-						
-						if ((convertCount <= totalCount) && (convertCount > 0)) {
-							switch (convertStoneId) {
-								case SevenSigns.SEAL_STONE_BLUE_ID -> ancientAdenaReward = SevenSigns.calcAncientAdenaReward(convertCount, 0, 0);
-								case SevenSigns.SEAL_STONE_GREEN_ID -> ancientAdenaReward = SevenSigns.calcAncientAdenaReward(0, convertCount, 0);
-								case SevenSigns.SEAL_STONE_RED_ID -> ancientAdenaReward = SevenSigns.calcAncientAdenaReward(0, 0, convertCount);
-							}
-							
-							if (player.destroyItemByItemId("SevenSigns", convertStoneId, convertCount, this, true)) {
-								player.addAncientAdena("SevenSigns", ancientAdenaReward, this, true);
-								
-								if (this instanceof L2DawnPriestInstance) {
-									showChatWindow(player, 18, "dawn", false);
-								} else {
-									showChatWindow(player, 18, "dusk", false);
-								}
-							}
-						} else {
-							if (this instanceof L2DawnPriestInstance) {
-								showChatWindow(player, 18, "dawn_low_stones", false);
-							} else {
-								showChatWindow(player, 18, "dusk_low_stones", false);
-							}
-							break;
-						}
-					} else {
-						if (this instanceof L2DawnPriestInstance) {
-							showChatWindow(player, 18, "dawn_no_stones", false);
-						} else {
-							showChatWindow(player, 18, "dusk_no_stones", false);
-						}
-						break;
-					}
-					break;
-				case 19: // Seal Information (for when joining a cabal)
-					int chosenSeal = Integer.parseInt(command.substring(16));
-					
-					String fileSuffix = SevenSigns.getSealName(chosenSeal, true) + "_" + SevenSigns.getCabalShortName(cabal);
-					
-					showChatWindow(player, val, fileSuffix, false);
-					break;
-				case 20: // Seal Status (for when joining a cabal)
-					StringBuilder contentBuffer = new StringBuilder();
-					if (this instanceof L2DawnPriestInstance) {
-						contentBuffer.append("<html><body>Priest of Dawn:<br><font color=\"LEVEL\">[ Seal Status ]</font><br>");
-					} else {
-						contentBuffer.append("<html><body>Dusk Priestess:<br><font color=\"LEVEL\">[ Status of the Seals ]</font><br>");
-					}
-					
-					for (int i = 1; i < 4; i++) {
-						int sealOwner = SevenSigns.getInstance().getSealOwner(i);
-						
-						if (sealOwner != SevenSigns.CABAL_NULL) {
-							contentBuffer.append("[").append(SevenSigns.getSealName(i, false)).append(": ").append(SevenSigns.getCabalName(sealOwner)).append("]<br>");
-						} else {
-							contentBuffer.append("[").append(SevenSigns.getSealName(i, false)).append(": Nothingness]<br>");
-						}
-					}
-					
-					contentBuffer.append("<a action=\"bypass -h npc_").append(getObjectId()).append("_Chat 0\">Go back.</a></body></html>");
-					
-					final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
-					html.setHtml(contentBuffer.toString());
-					player.sendPacket(html);
-					break;
-				default:
-					showChatWindow(player, val, null, false);
-					break;
-			}
-		} else {
-			super.onBypassFeedback(player, command);
-		}
-	}
-	
-	private void showChatWindow(L2PcInstance player, int val, String suffix, boolean isDescription) {
-		String filename = SevenSigns.SEVEN_SIGNS_HTML_PATH;
-		
-		filename += (isDescription) ? "desc_" + val : "signs_" + val;
-		filename += (suffix != null) ? "_" + suffix + ".htm" : ".htm";
-		
-		showChatWindow(player, filename);
-	}
-}