From 2d494ab600d85000f6632a60559999592e2b75a0 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Fri, 10 May 2019 23:22:32 +0000 Subject: [PATCH] Addition of ExElementalSpiritInfo. --- .../gameserver/network/ExIncomingPackets.java | 3 +- .../ExElementalSpiritInfo.java | 50 +++++++++++++++++++ .../network/serverpackets/UserInfo.java | 13 ++--- .../ExElementalSpiritInfo.java | 34 +++++++++++++ .../gameserver/network/ExIncomingPackets.java | 3 +- .../ExElementalSpiritInfo.java | 50 +++++++++++++++++++ .../network/serverpackets/UserInfo.java | 13 ++--- .../ExElementalSpiritInfo.java | 34 +++++++++++++ 8 files changed, 186 insertions(+), 14 deletions(-) create mode 100644 L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/elementalspirits/ExElementalSpiritInfo.java create mode 100644 L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/elementalspirits/ExElementalSpiritInfo.java create mode 100644 L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/elementalspirits/ExElementalSpiritInfo.java create mode 100644 L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/elementalspirits/ExElementalSpiritInfo.java diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index 363ec722c3..43784dd3e6 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -60,6 +60,7 @@ import org.l2jmobius.gameserver.network.clientpackets.crystalization.RequestCrys import org.l2jmobius.gameserver.network.clientpackets.crystalization.RequestCrystallizeItemCancel; import org.l2jmobius.gameserver.network.clientpackets.dailymission.RequestOneDayRewardReceive; import org.l2jmobius.gameserver.network.clientpackets.dailymission.RequestTodoList; +import org.l2jmobius.gameserver.network.clientpackets.elementalspirits.ExElementalSpiritInfo; import org.l2jmobius.gameserver.network.clientpackets.ensoul.RequestItemEnsoul; import org.l2jmobius.gameserver.network.clientpackets.ensoul.RequestTryEnSoulExtraction; import org.l2jmobius.gameserver.network.clientpackets.friend.RequestFriendDetailInfo; @@ -421,7 +422,7 @@ public enum ExIncomingPackets implements IIncomingPackets EX_CREATE_PLEDGE(0x14D, null, ConnectionState.IN_GAME), EX_PLEDGE_ITEM_INFO(0x14E, null, ConnectionState.IN_GAME), EX_PLEDGE_ITEM_BUY(0x14F, null, ConnectionState.IN_GAME), - EX_ELEMENTAL_SPIRIT_INFO(0x150, null, ConnectionState.IN_GAME), + EX_ELEMENTAL_SPIRIT_INFO(0x150, ExElementalSpiritInfo::new, ConnectionState.IN_GAME), EX_ELEMENTAL_SPIRIT_EXTRACT_INFO(0x151, null, ConnectionState.IN_GAME), EX_ELEMENTAL_SPIRIT_EXTRACT(0x152, null, ConnectionState.IN_GAME), EX_ELEMENTAL_SPIRIT_EVOLUTION_INFO(0x153, null, ConnectionState.IN_GAME), diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/elementalspirits/ExElementalSpiritInfo.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/elementalspirits/ExElementalSpiritInfo.java new file mode 100644 index 0000000000..a9347a67c2 --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/elementalspirits/ExElementalSpiritInfo.java @@ -0,0 +1,50 @@ +/* + * 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.elementalspirits; + +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * @author Mobius + */ +public class ExElementalSpiritInfo implements IClientIncomingPacket +{ + @SuppressWarnings("unused") + private int _id; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + _id = packet.readC(); + return true; + } + + @Override + public void run(GameClient client) + { + final PlayerInstance player = client.getPlayer(); + if (player == null) + { + return; + } + + // player.sendPacket(new org.l2jmobius.gameserver.network.serverpackets.elementalspirits.ExElementalSpiritInfo()); + } +} diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java index 7c3470d9ed..7199f724d9 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java @@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.Config; import org.l2jmobius.commons.network.PacketWriter; import org.l2jmobius.gameserver.data.xml.impl.ExperienceData; +import org.l2jmobius.gameserver.enums.AttributeType; import org.l2jmobius.gameserver.enums.UserInfoType; import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager; import org.l2jmobius.gameserver.model.Party; @@ -375,12 +376,12 @@ public class UserInfo extends AbstractMaskPacket if (containsMask(UserInfoType.ATT_SPIRITS)) // 152 { packet.writeH(26); - packet.writeD(-1); - packet.writeD(0x00); - packet.writeD(0x00); - packet.writeD(0x00); - packet.writeD(0x00); - packet.writeD(0x00); + packet.writeD(_player.getAttackElementValue(_player.getAttackElement())); // Attribute Attack Power + packet.writeD(_player.getDefenseElementValue(AttributeType.FIRE)); // Fire defence + packet.writeD(_player.getDefenseElementValue(AttributeType.WATER)); // Water defence + packet.writeD(_player.getDefenseElementValue(AttributeType.WIND)); // Wind defence + packet.writeD(_player.getDefenseElementValue(AttributeType.EARTH)); // Earth defence + packet.writeD(0x00); // Enabled 1 - Disabled 0 // Third class player? } return true; diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/elementalspirits/ExElementalSpiritInfo.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/elementalspirits/ExElementalSpiritInfo.java new file mode 100644 index 0000000000..db788c9675 --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/elementalspirits/ExElementalSpiritInfo.java @@ -0,0 +1,34 @@ +/* + * 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.elementalspirits; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExElementalSpiritInfo implements IClientOutgoingPacket +{ + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_ELEMENTAL_SPIRIT_INFO.writeId(packet); + return true; + } +} diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java index 363ec722c3..43784dd3e6 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -60,6 +60,7 @@ import org.l2jmobius.gameserver.network.clientpackets.crystalization.RequestCrys import org.l2jmobius.gameserver.network.clientpackets.crystalization.RequestCrystallizeItemCancel; import org.l2jmobius.gameserver.network.clientpackets.dailymission.RequestOneDayRewardReceive; import org.l2jmobius.gameserver.network.clientpackets.dailymission.RequestTodoList; +import org.l2jmobius.gameserver.network.clientpackets.elementalspirits.ExElementalSpiritInfo; import org.l2jmobius.gameserver.network.clientpackets.ensoul.RequestItemEnsoul; import org.l2jmobius.gameserver.network.clientpackets.ensoul.RequestTryEnSoulExtraction; import org.l2jmobius.gameserver.network.clientpackets.friend.RequestFriendDetailInfo; @@ -421,7 +422,7 @@ public enum ExIncomingPackets implements IIncomingPackets EX_CREATE_PLEDGE(0x14D, null, ConnectionState.IN_GAME), EX_PLEDGE_ITEM_INFO(0x14E, null, ConnectionState.IN_GAME), EX_PLEDGE_ITEM_BUY(0x14F, null, ConnectionState.IN_GAME), - EX_ELEMENTAL_SPIRIT_INFO(0x150, null, ConnectionState.IN_GAME), + EX_ELEMENTAL_SPIRIT_INFO(0x150, ExElementalSpiritInfo::new, ConnectionState.IN_GAME), EX_ELEMENTAL_SPIRIT_EXTRACT_INFO(0x151, null, ConnectionState.IN_GAME), EX_ELEMENTAL_SPIRIT_EXTRACT(0x152, null, ConnectionState.IN_GAME), EX_ELEMENTAL_SPIRIT_EVOLUTION_INFO(0x153, null, ConnectionState.IN_GAME), diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/elementalspirits/ExElementalSpiritInfo.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/elementalspirits/ExElementalSpiritInfo.java new file mode 100644 index 0000000000..a9347a67c2 --- /dev/null +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/elementalspirits/ExElementalSpiritInfo.java @@ -0,0 +1,50 @@ +/* + * 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.elementalspirits; + +import org.l2jmobius.commons.network.PacketReader; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.network.GameClient; +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; + +/** + * @author Mobius + */ +public class ExElementalSpiritInfo implements IClientIncomingPacket +{ + @SuppressWarnings("unused") + private int _id; + + @Override + public boolean read(GameClient client, PacketReader packet) + { + _id = packet.readC(); + return true; + } + + @Override + public void run(GameClient client) + { + final PlayerInstance player = client.getPlayer(); + if (player == null) + { + return; + } + + // player.sendPacket(new org.l2jmobius.gameserver.network.serverpackets.elementalspirits.ExElementalSpiritInfo()); + } +} diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java index 7c3470d9ed..7199f724d9 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java @@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.Config; import org.l2jmobius.commons.network.PacketWriter; import org.l2jmobius.gameserver.data.xml.impl.ExperienceData; +import org.l2jmobius.gameserver.enums.AttributeType; import org.l2jmobius.gameserver.enums.UserInfoType; import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager; import org.l2jmobius.gameserver.model.Party; @@ -375,12 +376,12 @@ public class UserInfo extends AbstractMaskPacket if (containsMask(UserInfoType.ATT_SPIRITS)) // 152 { packet.writeH(26); - packet.writeD(-1); - packet.writeD(0x00); - packet.writeD(0x00); - packet.writeD(0x00); - packet.writeD(0x00); - packet.writeD(0x00); + packet.writeD(_player.getAttackElementValue(_player.getAttackElement())); // Attribute Attack Power + packet.writeD(_player.getDefenseElementValue(AttributeType.FIRE)); // Fire defence + packet.writeD(_player.getDefenseElementValue(AttributeType.WATER)); // Water defence + packet.writeD(_player.getDefenseElementValue(AttributeType.WIND)); // Wind defence + packet.writeD(_player.getDefenseElementValue(AttributeType.EARTH)); // Earth defence + packet.writeD(0x00); // Enabled 1 - Disabled 0 // Third class player? } return true; diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/elementalspirits/ExElementalSpiritInfo.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/elementalspirits/ExElementalSpiritInfo.java new file mode 100644 index 0000000000..db788c9675 --- /dev/null +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/elementalspirits/ExElementalSpiritInfo.java @@ -0,0 +1,34 @@ +/* + * 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.elementalspirits; + +import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.network.OutgoingPackets; +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Mobius + */ +public class ExElementalSpiritInfo implements IClientOutgoingPacket +{ + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_ELEMENTAL_SPIRIT_INFO.writeId(packet); + return true; + } +}