{
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));
NpcHtmlMessage html = new NpcHtmlMessage(player, this);
html.setHtml(content);
player.sendPacket(html);
}
else
{
_log.warning("Problem with HTML text " + SevenSigns.SEVEN_SIGNS_HTML_PATH + "signs_17.htm: " + path);
}
break;
case 18: // Exchange Seal Stones for Ancient Adena - SevenSigns 18 xxxx xxxxxx
int convertStoneId = Integer.parseInt(command.substring(14, 18));
long convertCount = 0;
try
{
convertCount = Long.parseLong(command.substring(19).trim());
}
catch(Exception NumberFormatException)
{
player.sendMessage(new CustomMessage("common.IntegerAmount", player));
break;
}
L2ItemInstance convertItem = player.getInventory().getItemByItemId(convertStoneId);
if(convertItem == null)
{
player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2SignsPriestInstance.DontHaveAnySSType", player));
break;
}
long totalCount = convertItem.getCount();
long ancientAdenaReward = 0;
if(convertCount <= totalCount && convertCount > 0)
{
switch(convertStoneId)
{
case SevenSigns.SEAL_STONE_BLUE_ID:
ancientAdenaReward = SevenSigns.calcAncientAdenaReward(convertCount, 0, 0);
break;
case SevenSigns.SEAL_STONE_GREEN_ID:
ancientAdenaReward = SevenSigns.calcAncientAdenaReward(0, convertCount, 0);
break;
case SevenSigns.SEAL_STONE_RED_ID:
ancientAdenaReward = SevenSigns.calcAncientAdenaReward(0, 0, convertCount);
break;
}
L2ItemInstance temp = player.getInventory().getItemByItemId(convertStoneId);
if(temp != null && temp.getCount() >= convertCount)
{
player.getInventory().destroyItemByItemId(convertStoneId, convertCount, true);
ancientAdena = ItemTable.getInstance().createItem(SevenSigns.ANCIENT_ADENA_ID);
ancientAdena.setCount(ancientAdenaReward);
player.getInventory().addItem(ancientAdena);
player.sendPacket(SystemMessage.removeItems(convertStoneId, convertCount), SystemMessage.obtainItems(SevenSigns.ANCIENT_ADENA_ID, ancientAdenaReward, 0));
}
}
else
{
player.sendMessage(new CustomMessage("l2p.gameserver.model.instances.L2SignsPriestInstance.DontHaveSSAmount", player));
}
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)
StringBuffer contentBuffer = new StringBuffer("<html><body><font color=\"LEVEL\">[Seal Status]</font><br>");
for(int i = 1; i < 4; i++)
{
int sealOwner = SevenSigns.getInstance().getSealOwner(i);
if(sealOwner != SevenSigns.CABAL_NULL)
{
contentBuffer.append("[" + SevenSigns.getSealName(i, false) + ": " + SevenSigns.getCabalName(sealOwner) + "]<br>");
}
else
{
contentBuffer.append("[" + SevenSigns.getSealName(i, false) + ": Nothingness]<br>");
}
}
contentBuffer.append("<a action=\"bypass -h npc_" + getObjectId() + "_SevenSigns 3 " + cabal + "\">Go back.</a></body></html>");
NpcHtmlMessage html2 = new NpcHtmlMessage(player, this);
html2.setHtml(contentBuffer.toString());
player.sendPacket(html2);
break;
default:
// 1 = Purchase Record Intro
// 5 = Contrib Seal Stones Intro