From aadd8f6eb254f8530b0f793a73b1432fde37c58f Mon Sep 17 00:00:00 2001 From: St3eT <St3eT@users.noreply.github.com> Date: Wed, 5 Mar 2014 20:23:15 +0000 Subject: [PATCH] BETA: Reworking '''!CastleSiegeManager''' from core to DP. * Reviewed by: Nos, !UnAfraid, Zoey76, xban1x --- .../dist/game/data/html/siege/35104-busy.htm | 2 - .../dist/game/data/html/siege/35146-busy.htm | 2 - .../dist/game/data/html/siege/35188-busy.htm | 2 - .../dist/game/data/html/siege/35232-busy.htm | 2 - .../dist/game/data/html/siege/35278-busy.htm | 2 - .../dist/game/data/html/siege/35320-busy.htm | 2 - .../dist/game/data/html/siege/35367-busy.htm | 2 - .../dist/game/data/html/siege/35420-busy.htm | 2 - .../dist/game/data/html/siege/35513-busy.htm | 2 - .../dist/game/data/html/siege/35559-busy.htm | 2 - .../dist/game/data/html/siege/35639-busy.htm | 2 - L2J_DataPack_BETA/dist/game/data/scripts.cfg | 1 + .../CastleSiegeManager-01.html | 4 + .../CastleSiegeManager-02.html | 4 + .../CastleSiegeManager.html | 3 + .../CastleSiegeManager.java | 104 ++++++++++++++++++ .../dist/game/data/stats/npcs/35100-35200.xml | 6 +- .../dist/game/data/stats/npcs/35200-35300.xml | 4 +- .../dist/game/data/stats/npcs/35300-35400.xml | 4 +- .../dist/game/data/stats/npcs/35400-35500.xml | 2 +- .../dist/game/data/stats/npcs/35500-35600.xml | 4 +- .../dist/game/data/stats/npcs/35600-35700.xml | 2 +- 22 files changed, 127 insertions(+), 33 deletions(-) delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/siege/35104-busy.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/siege/35146-busy.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/siege/35188-busy.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/siege/35232-busy.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/siege/35278-busy.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/siege/35320-busy.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/siege/35367-busy.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/siege/35420-busy.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/siege/35513-busy.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/siege/35559-busy.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/siege/35639-busy.htm create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/CastleSiegeManager/CastleSiegeManager-01.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/CastleSiegeManager/CastleSiegeManager-02.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/CastleSiegeManager/CastleSiegeManager.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/CastleSiegeManager/CastleSiegeManager.java diff --git a/L2J_DataPack_BETA/dist/game/data/html/siege/35104-busy.htm b/L2J_DataPack_BETA/dist/game/data/html/siege/35104-busy.htm deleted file mode 100644 index 8dfc1d2b63..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/siege/35104-busy.htm +++ /dev/null @@ -1,2 +0,0 @@ -<html><body>Oh! Our castle is being attacked and I can't do anything for you right now. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/siege/35146-busy.htm b/L2J_DataPack_BETA/dist/game/data/html/siege/35146-busy.htm deleted file mode 100644 index 8dfc1d2b63..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/siege/35146-busy.htm +++ /dev/null @@ -1,2 +0,0 @@ -<html><body>Oh! Our castle is being attacked and I can't do anything for you right now. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/siege/35188-busy.htm b/L2J_DataPack_BETA/dist/game/data/html/siege/35188-busy.htm deleted file mode 100644 index 8dfc1d2b63..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/siege/35188-busy.htm +++ /dev/null @@ -1,2 +0,0 @@ -<html><body>Oh! Our castle is being attacked and I can't do anything for you right now. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/siege/35232-busy.htm b/L2J_DataPack_BETA/dist/game/data/html/siege/35232-busy.htm deleted file mode 100644 index 8dfc1d2b63..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/siege/35232-busy.htm +++ /dev/null @@ -1,2 +0,0 @@ -<html><body>Oh! Our castle is being attacked and I can't do anything for you right now. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/siege/35278-busy.htm b/L2J_DataPack_BETA/dist/game/data/html/siege/35278-busy.htm deleted file mode 100644 index 8dfc1d2b63..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/siege/35278-busy.htm +++ /dev/null @@ -1,2 +0,0 @@ -<html><body>Oh! Our castle is being attacked and I can't do anything for you right now. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/siege/35320-busy.htm b/L2J_DataPack_BETA/dist/game/data/html/siege/35320-busy.htm deleted file mode 100644 index 8dfc1d2b63..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/siege/35320-busy.htm +++ /dev/null @@ -1,2 +0,0 @@ -<html><body>Oh! Our castle is being attacked and I can't do anything for you right now. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/siege/35367-busy.htm b/L2J_DataPack_BETA/dist/game/data/html/siege/35367-busy.htm deleted file mode 100644 index 8dfc1d2b63..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/siege/35367-busy.htm +++ /dev/null @@ -1,2 +0,0 @@ -<html><body>Oh! Our castle is being attacked and I can't do anything for you right now. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/siege/35420-busy.htm b/L2J_DataPack_BETA/dist/game/data/html/siege/35420-busy.htm deleted file mode 100644 index 8dfc1d2b63..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/siege/35420-busy.htm +++ /dev/null @@ -1,2 +0,0 @@ -<html><body>Oh! Our castle is being attacked and I can't do anything for you right now. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/siege/35513-busy.htm b/L2J_DataPack_BETA/dist/game/data/html/siege/35513-busy.htm deleted file mode 100644 index 8dfc1d2b63..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/siege/35513-busy.htm +++ /dev/null @@ -1,2 +0,0 @@ -<html><body>Oh! Our castle is being attacked and I can't do anything for you right now. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/siege/35559-busy.htm b/L2J_DataPack_BETA/dist/game/data/html/siege/35559-busy.htm deleted file mode 100644 index 8dfc1d2b63..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/siege/35559-busy.htm +++ /dev/null @@ -1,2 +0,0 @@ -<html><body>Oh! Our castle is being attacked and I can't do anything for you right now. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/siege/35639-busy.htm b/L2J_DataPack_BETA/dist/game/data/html/siege/35639-busy.htm deleted file mode 100644 index 8dfc1d2b63..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/siege/35639-busy.htm +++ /dev/null @@ -1,2 +0,0 @@ -<html><body>Oh! Our castle is being attacked and I can't do anything for you right now. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts.cfg b/L2J_DataPack_BETA/dist/game/data/scripts.cfg index 0c4ccdb577..ef18ba8866 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts.cfg +++ b/L2J_DataPack_BETA/dist/game/data/scripts.cfg @@ -22,6 +22,7 @@ ai/npc/CastleBlacksmith/CastleBlacksmith.java ai/npc/CastleCourtMagician/CastleCourtMagician.java ai/npc/CastleChamberlain/CastleChamberlain.java ai/npc/CastleMercenaryManager/CastleMercenaryManager.java +ai/npc/CastleSiegeManager/CastleSiegeManager.java ai/npc/CastleTeleporter/CastleTeleporter.java ai/npc/CastleWarehouse/CastleWarehouse.java ai/npc/ClanTrader/ClanTrader.java diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/CastleSiegeManager/CastleSiegeManager-01.html b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/CastleSiegeManager/CastleSiegeManager-01.html new file mode 100644 index 0000000000..5b20af79c9 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/CastleSiegeManager/CastleSiegeManager-01.html @@ -0,0 +1,4 @@ +<html><body> +My Lord!<br> +This area is secure, sir!<br> +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/CastleSiegeManager/CastleSiegeManager-02.html b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/CastleSiegeManager/CastleSiegeManager-02.html new file mode 100644 index 0000000000..018ea282a8 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/CastleSiegeManager/CastleSiegeManager-02.html @@ -0,0 +1,4 @@ +<html><body> +How dare our foolish enemies attack our castle!<br> +I shall go now and strangle them all with my bare hands! +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/CastleSiegeManager/CastleSiegeManager.html b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/CastleSiegeManager/CastleSiegeManager.html new file mode 100644 index 0000000000..c0a4caea88 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/CastleSiegeManager/CastleSiegeManager.html @@ -0,0 +1,3 @@ +<html><body> +Lord, please let us show them our full force! +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/CastleSiegeManager/CastleSiegeManager.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/CastleSiegeManager/CastleSiegeManager.java new file mode 100644 index 0000000000..a3d1e2db89 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/CastleSiegeManager/CastleSiegeManager.java @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2004-2014 L2J DataPack + * + * This file is part of L2J DataPack. + * + * L2J DataPack 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 DataPack 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 ai.npc.CastleSiegeManager; + +import ai.npc.AbstractNpcAI; + +import com.l2jserver.gameserver.model.actor.L2Npc; +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; + +/** + * Castle Siege Manager AI. + * @author St3eT + */ +public final class CastleSiegeManager extends AbstractNpcAI +{ + // NPCs + private static final int[] SIEGE_MANAGER = + { + 35104, // Gludio Castle + 35146, // Dion Castle + 35188, // Giran Castle + 35232, // Oren Castle + 35278, // Aden Castle + 35320, // Innadril Castle + 35367, // Goddard Castle + 35513, // Rune Castle + 35559, // Schuttgard Castle + 35639, // Fortress of the Dead + 35420, // Devastated Castle + }; + + private CastleSiegeManager() + { + super(CastleSiegeManager.class.getSimpleName(), "ai/npc"); + addFirstTalkId(SIEGE_MANAGER); + } + + @Override + public String onFirstTalk(L2Npc npc, L2PcInstance player) + { + String htmltext = null; + if (player.isClanLeader() && (player.getClanId() == npc.getCastle().getOwnerId())) + { + if (isInSiege(npc)) + { + htmltext = "CastleSiegeManager.html"; + } + else + { + htmltext = "CastleSiegeManager-01.html"; + } + } + else if (isInSiege(npc)) + { + htmltext = "CastleSiegeManager-02.html"; + } + else + { + if (npc.getConquerableHall() != null) + { + npc.getConquerableHall().showSiegeInfo(player); + } + else + { + npc.getCastle().getSiege().listRegisterClan(player); + } + } + return htmltext; + } + + private boolean isInSiege(L2Npc npc) + { + if ((npc.getConquerableHall() != null) && npc.getConquerableHall().isInSiege()) + { + return true; + } + else if (npc.getCastle().getSiege().getIsInProgress()) + { + return true; + } + return false; + } + + public static void main(String[] args) + { + new CastleSiegeManager(); + } +} \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/stats/npcs/35100-35200.xml b/L2J_DataPack_BETA/dist/game/data/stats/npcs/35100-35200.xml index 37065c7a4d..246fa1b431 100644 --- a/L2J_DataPack_BETA/dist/game/data/stats/npcs/35100-35200.xml +++ b/L2J_DataPack_BETA/dist/game/data/stats/npcs/35100-35200.xml @@ -178,7 +178,7 @@ <height normal="22.5" /> </collision> </npc> - <npc id="35104" level="75" type="L2SiegeNpc" name="Tyron" title="Sir"> + <npc id="35104" level="75" type="L2Npc" name="Tyron" title="Sir"> <!-- Confirmed CT2.5 --> <parameters> <param name="MoveAroundSocial" value="0" /> @@ -2101,7 +2101,7 @@ <height normal="22.5" /> </collision> </npc> - <npc id="35146" level="75" type="L2SiegeNpc" name="Gibbson" title="Herald"> + <npc id="35146" level="75" type="L2Npc" name="Gibbson" title="Herald"> <!-- Confirmed CT2.5 --> <parameters> <param name="MoveAroundSocial" value="0" /> @@ -4025,7 +4025,7 @@ <height normal="22.5" /> </collision> </npc> - <npc id="35188" level="75" type="L2SiegeNpc" name="Holmes" title="Sir"> + <npc id="35188" level="75" type="L2Npc" name="Holmes" title="Sir"> <!-- Confirmed CT2.5 --> <parameters> <param name="MoveAroundSocial" value="0" /> diff --git a/L2J_DataPack_BETA/dist/game/data/stats/npcs/35200-35300.xml b/L2J_DataPack_BETA/dist/game/data/stats/npcs/35200-35300.xml index f040967e3b..c6faecd0b1 100644 --- a/L2J_DataPack_BETA/dist/game/data/stats/npcs/35200-35300.xml +++ b/L2J_DataPack_BETA/dist/game/data/stats/npcs/35200-35300.xml @@ -1478,7 +1478,7 @@ <height normal="23" /> </collision> </npc> - <npc id="35232" level="75" type="L2SiegeNpc" name="Sherwood" title="Messenger"> + <npc id="35232" level="75" type="L2Npc" name="Sherwood" title="Messenger"> <!-- Confirmed CT2.5 --> <parameters> <param name="MoveAroundSocial" value="0" /> @@ -3708,7 +3708,7 @@ <height normal="22.5" /> </collision> </npc> - <npc id="35278" level="75" type="L2SiegeNpc" name="Messenger Ruford" title="Messenger"> + <npc id="35278" level="75" type="L2Npc" name="Messenger Ruford" title="Messenger"> <!-- Confirmed CT2.5 --> <parameters> <param name="MoveAroundSocial" value="0" /> diff --git a/L2J_DataPack_BETA/dist/game/data/stats/npcs/35300-35400.xml b/L2J_DataPack_BETA/dist/game/data/stats/npcs/35300-35400.xml index 85ba57dc0f..09a9ce128f 100644 --- a/L2J_DataPack_BETA/dist/game/data/stats/npcs/35300-35400.xml +++ b/L2J_DataPack_BETA/dist/game/data/stats/npcs/35300-35400.xml @@ -945,7 +945,7 @@ <height normal="22.5" /> </collision> </npc> - <npc id="35320" level="75" type="L2SiegeNpc" name="Raybell" title="Sir"> + <npc id="35320" level="75" type="L2Npc" name="Raybell" title="Sir"> <!-- Confirmed CT2.5 --> <parameters> <param name="MoveAroundSocial" value="0" /> @@ -3041,7 +3041,7 @@ <height normal="22.5" /> </collision> </npc> - <npc id="35367" level="75" type="L2SiegeNpc" name="Daven" title="Messenger"> + <npc id="35367" level="75" type="L2Npc" name="Daven" title="Messenger"> <!-- Confirmed CT2.5 --> <parameters> <param name="MoveAroundSocial" value="0" /> diff --git a/L2J_DataPack_BETA/dist/game/data/stats/npcs/35400-35500.xml b/L2J_DataPack_BETA/dist/game/data/stats/npcs/35400-35500.xml index e084777193..38245108e7 100644 --- a/L2J_DataPack_BETA/dist/game/data/stats/npcs/35400-35500.xml +++ b/L2J_DataPack_BETA/dist/game/data/stats/npcs/35400-35500.xml @@ -977,7 +977,7 @@ <height normal="22" /> </collision> </npc> - <npc id="35420" level="75" type="L2SiegeNpc" name="Loken" title="Messenger"> + <npc id="35420" level="75" type="L2Npc" name="Loken" title="Messenger"> <!-- Confirmed CT2.5 --> <parameters> <param name="MoveAroundSocial" value="0" /> diff --git a/L2J_DataPack_BETA/dist/game/data/stats/npcs/35500-35600.xml b/L2J_DataPack_BETA/dist/game/data/stats/npcs/35500-35600.xml index 24fe31d352..63001dd3cf 100644 --- a/L2J_DataPack_BETA/dist/game/data/stats/npcs/35500-35600.xml +++ b/L2J_DataPack_BETA/dist/game/data/stats/npcs/35500-35600.xml @@ -644,7 +644,7 @@ <height normal="22.5" /> </collision> </npc> - <npc id="35513" level="75" type="L2SiegeNpc" name="Sherman" title="Messenger"> + <npc id="35513" level="75" type="L2Npc" name="Sherman" title="Messenger"> <!-- Confirmed CT2.5 --> <parameters> <param name="MoveAroundSocial" value="0" /> @@ -2708,7 +2708,7 @@ <height normal="22.5" /> </collision> </npc> - <npc id="35559" level="75" type="L2SiegeNpc" name="Daguerre" title="Messenger"> + <npc id="35559" level="75" type="L2Npc" name="Daguerre" title="Messenger"> <!-- Confirmed CT2.5 --> <parameters> <param name="MoveAroundSocial" value="0" /> diff --git a/L2J_DataPack_BETA/dist/game/data/stats/npcs/35600-35700.xml b/L2J_DataPack_BETA/dist/game/data/stats/npcs/35600-35700.xml index 1203909af9..734d64a8fb 100644 --- a/L2J_DataPack_BETA/dist/game/data/stats/npcs/35600-35700.xml +++ b/L2J_DataPack_BETA/dist/game/data/stats/npcs/35600-35700.xml @@ -1793,7 +1793,7 @@ <height normal="23.5" grown="29" /> </collision> </npc> - <npc id="35639" level="75" type="L2SiegeNpc" name="Jacquard" title="Messenger"> + <npc id="35639" level="75" type="L2Npc" name="Jacquard" title="Messenger"> <!-- Confirmed CT2.5 --> <parameters> <param name="MoveAroundSocial" value="0" /> -- GitLab