diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/db_installer/sql/game/castle.sql b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/db_installer/sql/game/castle.sql index 0109cb8ab4..c7b5613401 100644 --- a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/db_installer/sql/game/castle.sql +++ b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/db_installer/sql/game/castle.sql @@ -14,12 +14,12 @@ CREATE TABLE IF NOT EXISTS `castle` ( ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT IGNORE INTO `castle` VALUES -(1,'Gludio','NEUTRAL',0,0,'true',0,'false',0), -(2,'Dion','NEUTRAL',0,0,'true',0,'false',0), -(3,'Giran','NEUTRAL',0,0,'true',0,'false',0), -(4,'Oren','NEUTRAL',0,0,'true',0,'false',0), -(5,'Aden','NEUTRAL',0,0,'true',0,'false',0); +-- (1,'Gludio','NEUTRAL',0,0,'true',0,'false',0), +-- (2,'Dion','NEUTRAL',0,0,'true',0,'false',0), + (3,'Giran','NEUTRAL',0,0,'true',0,'false',0), +-- (4,'Oren','NEUTRAL',0,0,'true',0,'false',0), +-- (5,'Aden','NEUTRAL',0,0,'true',0,'false',0), -- (6,'Innadril','NEUTRAL',0,0,'true',0,'false',0), --- (7,'Goddard','NEUTRAL',0,0,'true',0,'false',0), +(7,'Goddard','NEUTRAL',0,0,'true',0,'false',0); -- (8,'Rune','NEUTRAL',0,0,'true',0,'false',0), -- (9,'Schuttgart','NEUTRAL',0,0,'true',0,'false',0); \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/config/SiegeSchedule.xml b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/config/SiegeSchedule.xml index c3458fe821..92304562c4 100644 --- a/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/config/SiegeSchedule.xml +++ b/L2J_Mobius_Essence_6.0_BattleChronicle/dist/game/config/SiegeSchedule.xml @@ -1,8 +1,9 @@ - - - - - + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index d4759225e3..d7cf89d005 100644 --- a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -42,6 +42,7 @@ import org.l2jmobius.gameserver.network.clientpackets.autoplay.ExRequestActivate import org.l2jmobius.gameserver.network.clientpackets.blessing.RequestBlessOptionCancel; import org.l2jmobius.gameserver.network.clientpackets.blessing.RequestBlessOptionEnchant; import org.l2jmobius.gameserver.network.clientpackets.blessing.RequestBlessOptionPutItem; +import org.l2jmobius.gameserver.network.clientpackets.castlewar.ExMCWCastleInfo; import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChange; import org.l2jmobius.gameserver.network.clientpackets.classchange.ExRequestClassChangeVerifying; import org.l2jmobius.gameserver.network.clientpackets.collection.RequestCollectionCloseUI; @@ -558,7 +559,7 @@ public enum ExIncomingPackets implements IIncomingPackets EX_RANKING_CHAR_SPAWN_BUFFZONE_NPC(0x184, null, ConnectionState.IN_GAME), EX_RANKING_CHAR_BUFFZONE_NPC_POSITION(0x185, null, ConnectionState.IN_GAME), EX_PLEDGE_MERCENARY_RECRUIT_INFO_SET(0x186, null, ConnectionState.IN_GAME), - EX_MERCENARY_CASTLEWAR_CASTLE_INFO(0x187, null, ConnectionState.IN_GAME), + EX_MERCENARY_CASTLEWAR_CASTLE_INFO(0x187, ExMCWCastleInfo::new, ConnectionState.IN_GAME), EX_MERCENARY_CASTLEWAR_CASTLE_SIEGE_INFO(0x188, null, ConnectionState.IN_GAME), EX_MERCENARY_CASTLEWAR_CASTLE_SIEGE_ATTACKER_LIST(0x189, null, ConnectionState.IN_GAME), EX_MERCENARY_CASTLEWAR_CASTLE_SIEGE_DEFENDER_LIST(0x18A, null, ConnectionState.IN_GAME), diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/castlewar/ExMCWCastleInfo.java b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/castlewar/ExMCWCastleInfo.java new file mode 100644 index 0000000000..d0663d1866 --- /dev/null +++ b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/castlewar/ExMCWCastleInfo.java @@ -0,0 +1,48 @@ +/* + * 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 org.l2jmobius.gameserver.network.clientpackets.castlewar; + +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.instancemanager.CastleManager; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import org.l2jmobius.gameserver.network.serverpackets.castlewar.ExMercenaryCastleWarCastleInfo; + +/** + * @author Serenitty + */ +public class ExMCWCastleInfo implements IClientIncomingPacket +{ + private int _castleId; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + _castleId = packet.readD(); + return true; + } + + @Override + public void run(GameClient client) + { + final var castle = CastleManager.getInstance().getCastleById(_castleId); + if (castle != null) + { + client.sendPacket(new ExMercenaryCastleWarCastleInfo(castle)); + } + } +} diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/castlewar/ExMercenaryCastleWarCastleInfo.java b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/castlewar/ExMercenaryCastleWarCastleInfo.java new file mode 100644 index 0000000000..9504fa6999 --- /dev/null +++ b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/castlewar/ExMercenaryCastleWarCastleInfo.java @@ -0,0 +1,71 @@ +/* + * 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 org.l2jmobius.gameserver.network.serverpackets.castlewar; + +import java.util.Calendar; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.TaxType; +import org.l2jmobius.gameserver.model.siege.Castle; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Serenitty + */ +public class ExMercenaryCastleWarCastleInfo implements IClientOutgoingPacket +{ + private final Castle _castle; + + public ExMercenaryCastleWarCastleInfo(Castle castle) + { + _castle = castle; + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_MERCENARY_CASTLEWAR_CASTLE_INFO.writeId(packet); + packet.writeD(_castle.getResidenceId()); + + final var clan = _castle.getOwner(); + if (clan != null) + { + packet.writeD(clan.getId()); + packet.writeD(clan.getCrestId()); + packet.writeString(clan.getName()); + packet.writeString(clan.getLeaderName()); + } + else + { + packet.writeD(0); + packet.writeD(0); + packet.writeString(""); + packet.writeString(""); + + } + + packet.writeD(_castle.getTaxPercent(TaxType.BUY)); + packet.writeQ((long) (_castle.getTreasury() * _castle.getTaxRate(TaxType.BUY))); + packet.writeQ((long) (_castle.getTreasury() + (_castle.getTreasury() * _castle.getTaxRate(TaxType.BUY)))); + final Calendar cal = Calendar.getInstance(); + cal.setTimeInMillis(_castle.getSiegeDate().getTimeInMillis()); + packet.writeD((int) (cal.getTimeInMillis() / 1000)); + + return true; + } +} \ No newline at end of file