Castle functions update.

Contributed by quangnguyen.
This commit is contained in:
MobiusDev
2018-03-06 14:14:09 +00:00
parent d7562ce366
commit a0399cb8be
6 changed files with 71 additions and 27 deletions

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<list applyTaxes="false" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/multisell.xsd">
<item>
<ingredient id="29668" count="11" /> <!-- Castle Onwer's Coin -->
<production id="29679" count="1" /> <!-- Castle Earring (10-day) -->
</item>
<item>
<ingredient id="29668" count="15" /> <!-- Castle Onwer's Coin -->
<production id="29681" count="1" /> <!-- Castle Necklace (10-day) -->
</item>
<item>
<ingredient id="29668" count="8" /> <!-- Castle Onwer's Coin -->
<production id="29677" count="1" /> <!-- Castle Ring (10-day) -->
</item>
<item>
<ingredient id="29668" count="4" /> <!-- Castle Onwer's Coin -->
<production id="29670" count="1" /> <!-- Castle XP/SP Scroll - Medium -->
</item>
<item>
<ingredient id="29668" count="3" /> <!-- Castle Onwer's Coin -->
<production id="29669" count="1" /> <!-- Castle XP/SP Scroll - Normal -->
</item>
<item>
<ingredient id="29668" count="3" /> <!-- Castle Onwer's Coin -->
<production id="29672" count="1" /> <!-- Major Quick Castle Healing Potion -->
</item>
<item>
<ingredient id="29668" count="4" /> <!-- Castle Onwer's Coin -->
<production id="29671" count="1" /> <!-- Quick Castle Healing Potion -->
</item>
<item>
<ingredient id="29668" count="1" /> <!-- Castle Onwer's Coin -->
<production id="29673" count="1" /> <!-- Scroll: Castle Berserker Spirit -->
</item>
<item>
<ingredient id="29668" count="3" /> <!-- Castle Onwer's Coin -->
<production id="29674" count="1" /> <!-- Scroll: Castle Death Whisper -->
</item>
<item>
<ingredient id="29668" count="3" /> <!-- Castle Onwer's Coin -->
<production id="29676" count="1" /> <!-- Scroll: Castle Blessing -->
</item>
</list>

View File

@@ -76,16 +76,16 @@ public final class CastleChamberlain extends AbstractNpcAI
35184, 36655, // Giran 35184, 36655, // Giran
35226, 36656, // Oren 35226, 36656, // Oren
35274, 36657, // Aden 35274, 36657, // Aden
35316, 36658, // Innadril // 35316, 36658, // Innadril
35363, 36659, // Goddard // 35363, 36659, // Goddard
35509, 36660, // Rune // 35509, 36660, // Rune
35555, 36661, // Schuttgart // 35555, 36661, // Schuttgart
}; };
//@formatter:on //@formatter:on
// Item // Item
private static final int CROWN = 6841; private static final int CROWN = 6841;
private static final int LORD_CLOAK_OF_LIGHT = 34996; private static final int LORD_CLOAK_OF_LIGHT = 34925;
private static final int LORD_CLOAK_OF_DARK = 34997; private static final int LORD_CLOAK_OF_DARK = 34926;
// Fortress // Fortress
private static final Map<Integer, List<Integer>> FORTRESS = new HashMap<>(); private static final Map<Integer, List<Integer>> FORTRESS = new HashMap<>();
@@ -372,20 +372,20 @@ public final class CastleChamberlain extends AbstractNpcAI
return price; return price;
} }
private final boolean isDomainFortressInContractStatus(int castleId) // private final boolean isDomainFortressInContractStatus(int castleId)
{ // {
final int numFort = ((castleId == 1) || (castleId == 5)) ? 2 : 1; // final int numFort = ((castleId == 1) || (castleId == 5)) ? 2 : 1;
final List<Integer> fortList = FORTRESS.get(castleId); // final List<Integer> fortList = FORTRESS.get(castleId);
for (int i = 0; i < numFort; i++) // for (int i = 0; i < numFort; i++)
{ // {
final Fort fortress = FortManager.getInstance().getFortById(fortList.get(i)); // final Fort fortress = FortManager.getInstance().getFortById(fortList.get(i));
if (fortress.getFortState() == 2) // if (fortress.getFortState() == 2)
{ // {
return true; // return true;
} // }
} // }
return false; // return false;
} // }
private final boolean isOwner(L2PcInstance player, L2Npc npc) private final boolean isOwner(L2PcInstance player, L2Npc npc)
{ {
@@ -463,10 +463,10 @@ public final class CastleChamberlain extends AbstractNpcAI
{ {
htmltext = "chamberlain-08.html"; htmltext = "chamberlain-08.html";
} }
else if (!isDomainFortressInContractStatus(castle.getResidenceId())) // else if (!isDomainFortressInContractStatus(castle.getResidenceId()))
{ // {
htmltext = "chamberlain-27.html"; // htmltext = "chamberlain-27.html";
} // }
else else
{ {
htmltext = "chamberlain-12.html"; htmltext = "chamberlain-12.html";

View File

@@ -8,6 +8,7 @@ Greetings, my lord. How may I serve you today?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest CastleChamberlain list_siege_clans">View castle siege information</Button> <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest CastleChamberlain list_siege_clans">View castle siege information</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest CastleChamberlain manor">Manage manor</Button> <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest CastleChamberlain manor">Manage manor</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest CastleChamberlain products">Items</Button> <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest CastleChamberlain products">Items</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 4039">Buy items for the Castle Owners Coins</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button> <Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</center> </center>
</body></html> </body></html>

View File

@@ -2,7 +2,7 @@
Greetings, Lord <font color="00FFFF">%clanleadername%</font>.<br> Greetings, Lord <font color="00FFFF">%clanleadername%</font>.<br>
Currently, the <font color="00FFFF"><fstring>%castlename%</fstring></font> territory is at peace, under the leadership of the <font color="00FFFF">%clanname%</font> clan. This is entirely due to your wisdom and strength, Lord <font color="00FFFF">%clanleadername%</font>.<br> Currently, the <font color="00FFFF"><fstring>%castlename%</fstring></font> territory is at peace, under the leadership of the <font color="00FFFF">%clanname%</font> clan. This is entirely due to your wisdom and strength, Lord <font color="00FFFF">%clanleadername%</font>.<br>
<center> <center>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest CastleChamberlain fort_status">Check the fortress status</Button> <!--Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest CastleChamberlain fort_status">Check the fortress status</Button-->
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest CastleChamberlain chamberlain-01.html">Back</Button><br> <Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest CastleChamberlain chamberlain-01.html">Back</Button><br>
</center> </center>
</body></html> </body></html>

View File

@@ -1,6 +1,6 @@
<html><body> <html><body>
That is not possible as the Guardian Towers of Life have been destroyed.<br> That is not possible as the Guardian Towers of Life have been destroyed.<br>
Therefore, all of those in the room will be teleported to a position near the castle hall in 8 minutes.<br> Therefore, all of those in the room will be teleported to a position near the castle hall in 3 minutes.<br>
Make yourself comfortable.<br> Make yourself comfortable.<br>
<center> <center>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest CastleTeleporter teleporter-03.html">Teleport</Button> <Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest CastleTeleporter teleporter-03.html">Teleport</Button>

View File

@@ -90,7 +90,7 @@ public final class CastleTeleporter extends AbstractNpcAI
if (npc.isScriptValue(0)) if (npc.isScriptValue(0))
{ {
final Siege siege = npc.getCastle().getSiege(); final Siege siege = npc.getCastle().getSiege();
final int time = (siege.isInProgress() && (siege.getControlTowerCount() == 0)) ? 480000 : 30000; final int time = (siege.isInProgress() && (siege.getControlTowerCount() == 0)) ? 180000 : 30000;
startQuestTimer("MASS_TELEPORT", time, npc, null); startQuestTimer("MASS_TELEPORT", time, npc, null);
npc.setScriptValue(1); npc.setScriptValue(1);
} }