From 3617418be1027f57ee4c9787bc70c8b5433858f0 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Mon, 11 Jul 2022 12:24:11 +0000 Subject: [PATCH] Updated AgitDecoInfo packet. --- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/actor/instance/ClanHallManager.java | 36 ++-- .../gameserver/model/residences/ClanHall.java | 36 ++-- .../gameserver/model/skill/Formulas.java | 4 +- .../model/zone/type/ClanHallZone.java | 4 +- .../gameserver/network/OutgoingPackets.java | 2 +- .../clientpackets/RequestRestartPoint.java | 2 +- ...nHallDecoration.java => AgitDecoInfo.java} | 65 ++++--- .../model/actor/instance/ClanHallManager.java | 36 ++-- .../gameserver/model/residences/ClanHall.java | 36 ++-- .../gameserver/model/skill/Formulas.java | 4 +- .../model/zone/type/ClanHallZone.java | 4 +- .../gameserver/network/OutgoingPackets.java | 2 +- .../clientpackets/RequestRestartPoint.java | 2 +- ...nHallDecoration.java => AgitDecoInfo.java} | 65 ++++--- .../model/actor/instance/ClanHallManager.java | 50 +++--- .../gameserver/model/residences/ClanHall.java | 24 +-- .../gameserver/model/stats/Formulas.java | 4 +- .../clientpackets/RequestRestartPoint.java | 2 +- .../network/serverpackets/AgitDecoInfo.java | 80 ++++----- .../model/actor/instance/ClanHallManager.java | 50 +++--- .../gameserver/model/residences/ClanHall.java | 24 +-- .../gameserver/model/stats/Formulas.java | 4 +- .../clientpackets/RequestRestartPoint.java | 2 +- .../network/serverpackets/AgitDecoInfo.java | 80 ++++----- .../model/actor/instance/ClanHallManager.java | 50 +++--- .../gameserver/model/residences/ClanHall.java | 24 +-- .../gameserver/model/stats/Formulas.java | 4 +- .../clientpackets/RequestRestartPoint.java | 2 +- .../network/serverpackets/AgitDecoInfo.java | 80 ++++----- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- .../model/residences/AbstractResidence.java | 14 +- .../gameserver/model/residences/ClanHall.java | 10 -- .../network/serverpackets/AgitDecoInfo.java | 161 ++++++++++++++++-- 98 files changed, 4035 insertions(+), 998 deletions(-) rename L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/{ClanHallDecoration.java => AgitDecoInfo.java} (54%) rename L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/{ClanHallDecoration.java => AgitDecoInfo.java} (54%) diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 8a10069517..b94ad26aa1 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 8a10069517..b94ad26aa1 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 8a10069517..b94ad26aa1 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 8a10069517..b94ad26aa1 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 8a10069517..b94ad26aa1 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 8a10069517..b94ad26aa1 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 8a10069517..b94ad26aa1 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 8a10069517..b94ad26aa1 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 8a10069517..b94ad26aa1 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 8a10069517..b94ad26aa1 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index a596f81eca..cbc07190dc 100644 --- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index a596f81eca..cbc07190dc 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java index 4b418ff544..b48f36b85e 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java @@ -36,7 +36,7 @@ import org.l2jmobius.gameserver.model.skill.SkillType; import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.BuyList; -import org.l2jmobius.gameserver.network.serverpackets.ClanHallDecoration; +import org.l2jmobius.gameserver.network.serverpackets.AgitDecoInfo; import org.l2jmobius.gameserver.network.serverpackets.MyTargetSelected; import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation; @@ -169,7 +169,7 @@ public class ClanHallManager extends Folk } else { - html.setFile("data/html/clanHallManager/tele" + getClanHall().getLocation() + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLvl() + ".htm"); + html.setFile("data/html/clanHallManager/tele" + getClanHall().getLocation() + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLevel() + ".htm"); } sendHtmlMessage(player, html); } @@ -186,7 +186,7 @@ public class ClanHallManager extends Folk { return; } - final int valbuy = Integer.parseInt(st.nextToken()) + (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLvl() * 100000); + final int valbuy = Integer.parseInt(st.nextToken()) + (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLevel() * 100000); showBuyWindow(player, valbuy); } else if (val.equalsIgnoreCase("support")) @@ -198,7 +198,7 @@ public class ClanHallManager extends Folk } else { - html.setFile("data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() + ".htm"); + html.setFile("data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() + ".htm"); html.replace("%mp%", String.valueOf(getCurrentMp())); } sendHtmlMessage(player, html); @@ -213,7 +213,7 @@ public class ClanHallManager extends Folk html.setFile("data/html/clanHallManager/functions.htm"); if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP) != null) { - html.replace("%xp_regen%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl() + "%"); + html.replace("%xp_regen%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel() + "%"); } else { @@ -221,7 +221,7 @@ public class ClanHallManager extends Folk } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP) != null) { - html.replace("%hp_regen%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLvl() + "%"); + html.replace("%hp_regen%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLevel() + "%"); } else { @@ -229,7 +229,7 @@ public class ClanHallManager extends Folk } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP) != null) { - html.replace("%mp_regen%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLvl() + "%"); + html.replace("%mp_regen%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLevel() + "%"); } else { @@ -457,7 +457,7 @@ public class ClanHallManager extends Folk html.setFile("data/html/clanHallManager/edit_recovery" + getClanHall().getGrade() + ".htm"); if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP) != null) { - html.replace("%hp%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLvl() + "%"); + html.replace("%hp%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLevel() + "%"); html.replace("%hpPrice%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLease())); html.replace("%hpDate%", format.format(getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getEndTime())); html.replace("%hpRate%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getRate() / 86400000)); @@ -471,7 +471,7 @@ public class ClanHallManager extends Folk } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP) != null) { - html.replace("%exp%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl() + "%"); + html.replace("%exp%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel() + "%"); html.replace("%expPrice%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLease())); html.replace("%expDate%", format.format(getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getEndTime())); html.replace("%expRate%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getRate() / 86400000)); @@ -485,7 +485,7 @@ public class ClanHallManager extends Folk } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP) != null) { - html.replace("%mp%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLvl() + "%"); + html.replace("%mp%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLevel() + "%"); html.replace("%mpPrice%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLease())); html.replace("%mpDate%", format.format(getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getEndTime())); html.replace("%mpRate%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getRate() / 86400000)); @@ -659,7 +659,7 @@ public class ClanHallManager extends Folk html.setFile("data/html/clanHallManager/edit_other" + getClanHall().getGrade() + ".htm"); if (getClanHall().getFunction(ClanHall.FUNC_TELEPORT) != null) { - html.replace("%tele%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLvl())); + html.replace("%tele%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLevel())); html.replace("%telePrice%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLease())); html.replace("%teleDate%", format.format(getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getEndTime())); html.replace("%teleRate%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getRate() / 86400000)); @@ -673,7 +673,7 @@ public class ClanHallManager extends Folk } if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT) != null) { - html.replace("%support%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl())); + html.replace("%support%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel())); html.replace("%supportPrice%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLease())); html.replace("%supportDate%", format.format(getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getEndTime())); html.replace("%supportRate%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getRate() / 86400000)); @@ -687,7 +687,7 @@ public class ClanHallManager extends Folk } if (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE) != null) { - html.replace("%item%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLvl())); + html.replace("%item%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLevel())); html.replace("%itemPrice%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLease())); html.replace("%itemDate%", format.format(getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getEndTime())); html.replace("%itemRate%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getRate() / 86400000)); @@ -786,7 +786,7 @@ public class ClanHallManager extends Folk html.setFile("data/html/clanHallManager/deco.htm"); if (getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS) != null) { - html.replace("%curtain%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLvl())); + html.replace("%curtain%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLevel())); html.replace("%curtainPrice%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLease())); html.replace("%curtainDate%", format.format(getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getEndTime())); html.replace("%curtainRate%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getRate() / 86400000)); @@ -800,7 +800,7 @@ public class ClanHallManager extends Folk } if (getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM) != null) { - html.replace("%porch%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLvl())); + html.replace("%porch%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLevel())); html.replace("%porchPrice%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLease())); html.replace("%porchDate%", format.format(getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getEndTime())); html.replace("%porchRate%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getRate() / 86400000)); @@ -868,11 +868,11 @@ public class ClanHallManager extends Folk return; } final NpcHtmlMessage html = new NpcHtmlMessage(1); - if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() == 0) + if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() == 0) { return; } - html.setFile("data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() + ".htm"); + html.setFile("data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() + ".htm"); html.replace("%mp%", String.valueOf(getCurrentMp())); sendHtmlMessage(player, html); } @@ -1106,6 +1106,6 @@ public class ClanHallManager extends Folk */ private void revalidateDeco(Player player) { - player.sendPacket(new ClanHallDecoration(ClanHallTable.getInstance().getClanHallByOwner(player.getClan()))); + player.sendPacket(new AgitDecoInfo(ClanHallTable.getInstance().getClanHallByOwner(player.getClan()))); } } diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 5d3cdbb7d0..4b4537ee6b 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -73,7 +73,7 @@ public class ClanHall public class ClanHallFunction { final int _type; - private int _lvl; + private int _level; protected int _fee; protected int _tempFee; final long _rate; @@ -92,7 +92,7 @@ public class ClanHall public ClanHallFunction(int type, int lvl, int lease, int tempLease, long rate, long time) { _type = type; - _lvl = lvl; + _level = lvl; _fee = lease; _tempFee = tempLease; _rate = rate; @@ -110,12 +110,12 @@ public class ClanHall } /** - * Gets the lvl. - * @return the lvl + * Gets the level. + * @return the level */ - public int getLvl() + public int getLevel() { - return _lvl; + return _level; } /** @@ -146,12 +146,12 @@ public class ClanHall } /** - * Sets the lvl. - * @param lvl the new lvl + * Sets the level. + * @param level the new level */ - public void setLvl(int lvl) + public void setLevel(int level) { - _lvl = lvl; + _level = level; } /** @@ -256,7 +256,7 @@ public class ClanHall statement = con.prepareStatement("INSERT INTO clanhall_functions (hall_id, type, lvl, lease, rate, endTime) VALUES (?,?,?,?,?,?)"); statement.setInt(1, _clanHallId); statement.setInt(2, _type); - statement.setInt(3, _lvl); + statement.setInt(3, _level); statement.setInt(4, _fee); statement.setLong(5, _rate); statement.setLong(6, _endDate); @@ -264,7 +264,7 @@ public class ClanHall else { statement = con.prepareStatement("UPDATE clanhall_functions SET lvl=?, lease=?, endTime=? WHERE hall_id=? AND type=?"); - statement.setInt(1, _lvl); + statement.setInt(1, _level); statement.setInt(2, _fee); statement.setLong(3, _endDate); statement.setInt(4, _clanHallId); @@ -676,13 +676,13 @@ public class ClanHall /** * Update Function. * @param type the type - * @param lvl the lvl + * @param level the level * @param lease the lease * @param rate the rate * @param addNew the add new * @return true, if successful */ - public boolean updateFunctions(int type, int lvl, int lease, long rate, boolean addNew) + public boolean updateFunctions(int type, int level, int lease, long rate, boolean addNew) { if (addNew) { @@ -690,9 +690,9 @@ public class ClanHall { return false; } - _functions.put(type, new ClanHallFunction(type, lvl, lease, 0, rate, 0)); + _functions.put(type, new ClanHallFunction(type, level, lease, 0, rate, 0)); } - else if ((lvl == 0) && (lease == 0)) + else if ((level == 0) && (lease == 0)) { removeFunction(type); } @@ -707,12 +707,12 @@ public class ClanHall } _functions.remove(type); - _functions.put(type, new ClanHallFunction(type, lvl, lease, diffLease, rate, -1)); + _functions.put(type, new ClanHallFunction(type, level, lease, diffLease, rate, -1)); } else { _functions.get(type).setLease(lease); - _functions.get(type).setLvl(lvl); + _functions.get(type).setLevel(level); _functions.get(type).dbSave(false); } } diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/skill/Formulas.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/skill/Formulas.java index 277283c9df..c43f2c159c 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/skill/Formulas.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/skill/Formulas.java @@ -1008,7 +1008,7 @@ public class Formulas final ClanHall clansHall = ClanHallTable.getInstance().getClanHallById(clanHallIndex); if ((clansHall != null) && (clansHall.getFunction(ClanHall.FUNC_RESTORE_HP) != null)) { - hpRegenMultiplier *= 1 + (clansHall.getFunction(ClanHall.FUNC_RESTORE_HP).getLvl() / 100); + hpRegenMultiplier *= 1 + (clansHall.getFunction(ClanHall.FUNC_RESTORE_HP).getLevel() / 100); } } } @@ -1082,7 +1082,7 @@ public class Formulas final ClanHall clansHall = ClanHallTable.getInstance().getClanHallById(clanHallIndex); if ((clansHall != null) && (clansHall.getFunction(ClanHall.FUNC_RESTORE_MP) != null)) { - mpRegenMultiplier *= 1 + (clansHall.getFunction(ClanHall.FUNC_RESTORE_MP).getLvl() / 100); + mpRegenMultiplier *= 1 + (clansHall.getFunction(ClanHall.FUNC_RESTORE_MP).getLevel() / 100); } } } diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/zone/type/ClanHallZone.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/zone/type/ClanHallZone.java index f5d0a3022c..88ee2ca7e6 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/zone/type/ClanHallZone.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/zone/type/ClanHallZone.java @@ -23,7 +23,7 @@ import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.residences.ClanHall; import org.l2jmobius.gameserver.model.zone.ZoneId; import org.l2jmobius.gameserver.model.zone.ZoneRespawn; -import org.l2jmobius.gameserver.network.serverpackets.ClanHallDecoration; +import org.l2jmobius.gameserver.network.serverpackets.AgitDecoInfo; /** * A clan hall zone @@ -77,7 +77,7 @@ public class ClanHallZone extends ZoneRespawn } // Send decoration packet - ((Player) creature).sendPacket(new ClanHallDecoration(clanHall)); + ((Player) creature).sendPacket(new AgitDecoInfo(clanHall)); // Send a message if ((clanHall.getOwnerId() != 0) && (clanHall.getOwnerId() == ((Player) creature).getClanId())) diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/OutgoingPackets.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/OutgoingPackets.java index 410663b645..96ed5a713b 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/OutgoingPackets.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/OutgoingPackets.java @@ -207,7 +207,7 @@ public enum OutgoingPackets ETC_STATUS_UPDATE(0xF3), SHORT_BUFF_STATUS_UPDATE(0xF4), SSQ_STATUS(0xF5), - CLAN_HALL_DECORATION(0xF7), + AGIT_DECO_INFO(0xF7), SIGNS_SKY(0xF8), GAME_GUARD_QUERY(0xF9), FRIEND_LIST(0xFA), diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java index 46a39293ab..5948da4731 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java @@ -153,7 +153,7 @@ public class RequestRestartPoint implements IClientIncomingPacket loc = MapRegionData.getInstance().getTeleToLocation(_player, TeleportWhereType.CLANHALL); if ((ClanHallTable.getInstance().getClanHallByOwner(_player.getClan()) != null) && (ClanHallTable.getInstance().getClanHallByOwner(_player.getClan()).getFunction(ClanHall.FUNC_RESTORE_EXP) != null)) { - _player.restoreExp(ClanHallTable.getInstance().getClanHallByOwner(_player.getClan()).getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl()); + _player.restoreExp(ClanHallTable.getInstance().getClanHallByOwner(_player.getClan()).getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel()); } break; } diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/ClanHallDecoration.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java similarity index 54% rename from L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/ClanHallDecoration.java rename to L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 743b7da925..cb7c2118a5 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/ClanHallDecoration.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -24,11 +24,11 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; /** * @author Steuf */ -public class ClanHallDecoration implements IClientOutgoingPacket +public class AgitDecoInfo implements IClientOutgoingPacket { private final ClanHall _clanHall; - public ClanHallDecoration(ClanHall clanHall) + public AgitDecoInfo(ClanHall clanHall) { _clanHall = clanHall; } @@ -36,15 +36,15 @@ public class ClanHallDecoration implements IClientOutgoingPacket @Override public boolean write(PacketWriter packet) { - OutgoingPackets.CLAN_HALL_DECORATION.writeId(packet); - packet.writeD(_clanHall.getId()); // clanhall id - // FUNC_RESTORE_HP + OutgoingPackets.AGIT_DECO_INFO.writeId(packet); + packet.writeD(_clanHall.getId()); + // Fireplace ClanHallFunction function = _clanHall.getFunction(ClanHall.FUNC_RESTORE_HP); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 220)) || ((_clanHall.getGrade() == 1) && (function.getLvl() < 160)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 260)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 300))) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 220)) || ((_clanHall.getGrade() == 1) && (function.getLevel() < 160)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 260)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 300))) { packet.writeC(1); } @@ -52,14 +52,14 @@ public class ClanHallDecoration implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_RESTORE_MP + // Carpet - Statue function = _clanHall.getFunction(ClanHall.FUNC_RESTORE_MP); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); packet.writeC(0); } - else if ((((_clanHall.getGrade() == 0) || (_clanHall.getGrade() == 1)) && (function.getLvl() < 25)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 30)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 40))) + else if ((((_clanHall.getGrade() == 0) || (_clanHall.getGrade() == 1)) && (function.getLevel() < 25)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 30)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 40))) { packet.writeC(1); packet.writeC(1); @@ -69,13 +69,13 @@ public class ClanHallDecoration implements IClientOutgoingPacket packet.writeC(2); packet.writeC(2); } - // FUNC_RESTORE_EXP + // Chandelier function = _clanHall.getFunction(ClanHall.FUNC_RESTORE_EXP); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 25)) || ((_clanHall.getGrade() == 1) && (function.getLvl() < 30)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 40)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 50))) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 25)) || ((_clanHall.getGrade() == 1) && (function.getLevel() < 30)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 40)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 50))) { packet.writeC(1); } @@ -83,13 +83,13 @@ public class ClanHallDecoration implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_TELEPORT + // Mirror function = _clanHall.getFunction(ClanHall.FUNC_TELEPORT); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (function.getLvl() < 2) + else if (function.getLevel() < 2) { packet.writeC(1); } @@ -97,14 +97,15 @@ public class ClanHallDecoration implements IClientOutgoingPacket { packet.writeC(2); } + // Crystal packet.writeC(0); - // CURTAINS + // Curtain function = _clanHall.getFunction(ClanHall.FUNC_DECO_CURTAINS); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (function.getLvl() <= 1) + else if (function.getLevel() <= 1) { packet.writeC(1); } @@ -112,13 +113,13 @@ public class ClanHallDecoration implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_ITEM_CREATE + // Magic Curtain function = _clanHall.getFunction(ClanHall.FUNC_ITEM_CREATE); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 2)) || (function.getLvl() < 3)) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 2)) || (function.getLevel() < 3)) { packet.writeC(1); } @@ -126,14 +127,14 @@ public class ClanHallDecoration implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_SUPPORT + // Support? - Flag function = _clanHall.getFunction(ClanHall.FUNC_SUPPORT); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 2)) || ((_clanHall.getGrade() == 1) && (function.getLvl() < 4)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 5)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 8))) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 2)) || ((_clanHall.getGrade() == 1) && (function.getLevel() < 4)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 5)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 8))) { packet.writeC(1); packet.writeC(1); @@ -143,13 +144,13 @@ public class ClanHallDecoration implements IClientOutgoingPacket packet.writeC(2); packet.writeC(2); } - // Front Plateform + // Front platform function = _clanHall.getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (function.getLvl() <= 1) + else if (function.getLevel() <= 1) { packet.writeC(1); } @@ -157,13 +158,13 @@ public class ClanHallDecoration implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_ITEM_CREATE + // Item create? function = _clanHall.getFunction(ClanHall.FUNC_ITEM_CREATE); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 2)) || (function.getLvl() < 3)) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 2)) || (function.getLevel() < 3)) { packet.writeC(1); } @@ -171,8 +172,6 @@ public class ClanHallDecoration implements IClientOutgoingPacket { packet.writeC(2); } - packet.writeD(0); - packet.writeD(0); return true; } } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java index 4b418ff544..b48f36b85e 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java @@ -36,7 +36,7 @@ import org.l2jmobius.gameserver.model.skill.SkillType; import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.BuyList; -import org.l2jmobius.gameserver.network.serverpackets.ClanHallDecoration; +import org.l2jmobius.gameserver.network.serverpackets.AgitDecoInfo; import org.l2jmobius.gameserver.network.serverpackets.MyTargetSelected; import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation; @@ -169,7 +169,7 @@ public class ClanHallManager extends Folk } else { - html.setFile("data/html/clanHallManager/tele" + getClanHall().getLocation() + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLvl() + ".htm"); + html.setFile("data/html/clanHallManager/tele" + getClanHall().getLocation() + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLevel() + ".htm"); } sendHtmlMessage(player, html); } @@ -186,7 +186,7 @@ public class ClanHallManager extends Folk { return; } - final int valbuy = Integer.parseInt(st.nextToken()) + (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLvl() * 100000); + final int valbuy = Integer.parseInt(st.nextToken()) + (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLevel() * 100000); showBuyWindow(player, valbuy); } else if (val.equalsIgnoreCase("support")) @@ -198,7 +198,7 @@ public class ClanHallManager extends Folk } else { - html.setFile("data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() + ".htm"); + html.setFile("data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() + ".htm"); html.replace("%mp%", String.valueOf(getCurrentMp())); } sendHtmlMessage(player, html); @@ -213,7 +213,7 @@ public class ClanHallManager extends Folk html.setFile("data/html/clanHallManager/functions.htm"); if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP) != null) { - html.replace("%xp_regen%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl() + "%"); + html.replace("%xp_regen%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel() + "%"); } else { @@ -221,7 +221,7 @@ public class ClanHallManager extends Folk } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP) != null) { - html.replace("%hp_regen%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLvl() + "%"); + html.replace("%hp_regen%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLevel() + "%"); } else { @@ -229,7 +229,7 @@ public class ClanHallManager extends Folk } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP) != null) { - html.replace("%mp_regen%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLvl() + "%"); + html.replace("%mp_regen%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLevel() + "%"); } else { @@ -457,7 +457,7 @@ public class ClanHallManager extends Folk html.setFile("data/html/clanHallManager/edit_recovery" + getClanHall().getGrade() + ".htm"); if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP) != null) { - html.replace("%hp%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLvl() + "%"); + html.replace("%hp%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLevel() + "%"); html.replace("%hpPrice%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLease())); html.replace("%hpDate%", format.format(getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getEndTime())); html.replace("%hpRate%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getRate() / 86400000)); @@ -471,7 +471,7 @@ public class ClanHallManager extends Folk } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP) != null) { - html.replace("%exp%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl() + "%"); + html.replace("%exp%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel() + "%"); html.replace("%expPrice%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLease())); html.replace("%expDate%", format.format(getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getEndTime())); html.replace("%expRate%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getRate() / 86400000)); @@ -485,7 +485,7 @@ public class ClanHallManager extends Folk } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP) != null) { - html.replace("%mp%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLvl() + "%"); + html.replace("%mp%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLevel() + "%"); html.replace("%mpPrice%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLease())); html.replace("%mpDate%", format.format(getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getEndTime())); html.replace("%mpRate%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getRate() / 86400000)); @@ -659,7 +659,7 @@ public class ClanHallManager extends Folk html.setFile("data/html/clanHallManager/edit_other" + getClanHall().getGrade() + ".htm"); if (getClanHall().getFunction(ClanHall.FUNC_TELEPORT) != null) { - html.replace("%tele%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLvl())); + html.replace("%tele%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLevel())); html.replace("%telePrice%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLease())); html.replace("%teleDate%", format.format(getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getEndTime())); html.replace("%teleRate%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getRate() / 86400000)); @@ -673,7 +673,7 @@ public class ClanHallManager extends Folk } if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT) != null) { - html.replace("%support%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl())); + html.replace("%support%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel())); html.replace("%supportPrice%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLease())); html.replace("%supportDate%", format.format(getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getEndTime())); html.replace("%supportRate%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getRate() / 86400000)); @@ -687,7 +687,7 @@ public class ClanHallManager extends Folk } if (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE) != null) { - html.replace("%item%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLvl())); + html.replace("%item%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLevel())); html.replace("%itemPrice%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLease())); html.replace("%itemDate%", format.format(getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getEndTime())); html.replace("%itemRate%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getRate() / 86400000)); @@ -786,7 +786,7 @@ public class ClanHallManager extends Folk html.setFile("data/html/clanHallManager/deco.htm"); if (getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS) != null) { - html.replace("%curtain%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLvl())); + html.replace("%curtain%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLevel())); html.replace("%curtainPrice%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLease())); html.replace("%curtainDate%", format.format(getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getEndTime())); html.replace("%curtainRate%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getRate() / 86400000)); @@ -800,7 +800,7 @@ public class ClanHallManager extends Folk } if (getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM) != null) { - html.replace("%porch%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLvl())); + html.replace("%porch%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLevel())); html.replace("%porchPrice%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLease())); html.replace("%porchDate%", format.format(getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getEndTime())); html.replace("%porchRate%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getRate() / 86400000)); @@ -868,11 +868,11 @@ public class ClanHallManager extends Folk return; } final NpcHtmlMessage html = new NpcHtmlMessage(1); - if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() == 0) + if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() == 0) { return; } - html.setFile("data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() + ".htm"); + html.setFile("data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() + ".htm"); html.replace("%mp%", String.valueOf(getCurrentMp())); sendHtmlMessage(player, html); } @@ -1106,6 +1106,6 @@ public class ClanHallManager extends Folk */ private void revalidateDeco(Player player) { - player.sendPacket(new ClanHallDecoration(ClanHallTable.getInstance().getClanHallByOwner(player.getClan()))); + player.sendPacket(new AgitDecoInfo(ClanHallTable.getInstance().getClanHallByOwner(player.getClan()))); } } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 5d3cdbb7d0..4b4537ee6b 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -73,7 +73,7 @@ public class ClanHall public class ClanHallFunction { final int _type; - private int _lvl; + private int _level; protected int _fee; protected int _tempFee; final long _rate; @@ -92,7 +92,7 @@ public class ClanHall public ClanHallFunction(int type, int lvl, int lease, int tempLease, long rate, long time) { _type = type; - _lvl = lvl; + _level = lvl; _fee = lease; _tempFee = tempLease; _rate = rate; @@ -110,12 +110,12 @@ public class ClanHall } /** - * Gets the lvl. - * @return the lvl + * Gets the level. + * @return the level */ - public int getLvl() + public int getLevel() { - return _lvl; + return _level; } /** @@ -146,12 +146,12 @@ public class ClanHall } /** - * Sets the lvl. - * @param lvl the new lvl + * Sets the level. + * @param level the new level */ - public void setLvl(int lvl) + public void setLevel(int level) { - _lvl = lvl; + _level = level; } /** @@ -256,7 +256,7 @@ public class ClanHall statement = con.prepareStatement("INSERT INTO clanhall_functions (hall_id, type, lvl, lease, rate, endTime) VALUES (?,?,?,?,?,?)"); statement.setInt(1, _clanHallId); statement.setInt(2, _type); - statement.setInt(3, _lvl); + statement.setInt(3, _level); statement.setInt(4, _fee); statement.setLong(5, _rate); statement.setLong(6, _endDate); @@ -264,7 +264,7 @@ public class ClanHall else { statement = con.prepareStatement("UPDATE clanhall_functions SET lvl=?, lease=?, endTime=? WHERE hall_id=? AND type=?"); - statement.setInt(1, _lvl); + statement.setInt(1, _level); statement.setInt(2, _fee); statement.setLong(3, _endDate); statement.setInt(4, _clanHallId); @@ -676,13 +676,13 @@ public class ClanHall /** * Update Function. * @param type the type - * @param lvl the lvl + * @param level the level * @param lease the lease * @param rate the rate * @param addNew the add new * @return true, if successful */ - public boolean updateFunctions(int type, int lvl, int lease, long rate, boolean addNew) + public boolean updateFunctions(int type, int level, int lease, long rate, boolean addNew) { if (addNew) { @@ -690,9 +690,9 @@ public class ClanHall { return false; } - _functions.put(type, new ClanHallFunction(type, lvl, lease, 0, rate, 0)); + _functions.put(type, new ClanHallFunction(type, level, lease, 0, rate, 0)); } - else if ((lvl == 0) && (lease == 0)) + else if ((level == 0) && (lease == 0)) { removeFunction(type); } @@ -707,12 +707,12 @@ public class ClanHall } _functions.remove(type); - _functions.put(type, new ClanHallFunction(type, lvl, lease, diffLease, rate, -1)); + _functions.put(type, new ClanHallFunction(type, level, lease, diffLease, rate, -1)); } else { _functions.get(type).setLease(lease); - _functions.get(type).setLvl(lvl); + _functions.get(type).setLevel(level); _functions.get(type).dbSave(false); } } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/skill/Formulas.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/skill/Formulas.java index 277283c9df..c43f2c159c 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/skill/Formulas.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/skill/Formulas.java @@ -1008,7 +1008,7 @@ public class Formulas final ClanHall clansHall = ClanHallTable.getInstance().getClanHallById(clanHallIndex); if ((clansHall != null) && (clansHall.getFunction(ClanHall.FUNC_RESTORE_HP) != null)) { - hpRegenMultiplier *= 1 + (clansHall.getFunction(ClanHall.FUNC_RESTORE_HP).getLvl() / 100); + hpRegenMultiplier *= 1 + (clansHall.getFunction(ClanHall.FUNC_RESTORE_HP).getLevel() / 100); } } } @@ -1082,7 +1082,7 @@ public class Formulas final ClanHall clansHall = ClanHallTable.getInstance().getClanHallById(clanHallIndex); if ((clansHall != null) && (clansHall.getFunction(ClanHall.FUNC_RESTORE_MP) != null)) { - mpRegenMultiplier *= 1 + (clansHall.getFunction(ClanHall.FUNC_RESTORE_MP).getLvl() / 100); + mpRegenMultiplier *= 1 + (clansHall.getFunction(ClanHall.FUNC_RESTORE_MP).getLevel() / 100); } } } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/zone/type/ClanHallZone.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/zone/type/ClanHallZone.java index f5d0a3022c..88ee2ca7e6 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/zone/type/ClanHallZone.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/zone/type/ClanHallZone.java @@ -23,7 +23,7 @@ import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.residences.ClanHall; import org.l2jmobius.gameserver.model.zone.ZoneId; import org.l2jmobius.gameserver.model.zone.ZoneRespawn; -import org.l2jmobius.gameserver.network.serverpackets.ClanHallDecoration; +import org.l2jmobius.gameserver.network.serverpackets.AgitDecoInfo; /** * A clan hall zone @@ -77,7 +77,7 @@ public class ClanHallZone extends ZoneRespawn } // Send decoration packet - ((Player) creature).sendPacket(new ClanHallDecoration(clanHall)); + ((Player) creature).sendPacket(new AgitDecoInfo(clanHall)); // Send a message if ((clanHall.getOwnerId() != 0) && (clanHall.getOwnerId() == ((Player) creature).getClanId())) diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/OutgoingPackets.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/OutgoingPackets.java index 410663b645..96ed5a713b 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/OutgoingPackets.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/OutgoingPackets.java @@ -207,7 +207,7 @@ public enum OutgoingPackets ETC_STATUS_UPDATE(0xF3), SHORT_BUFF_STATUS_UPDATE(0xF4), SSQ_STATUS(0xF5), - CLAN_HALL_DECORATION(0xF7), + AGIT_DECO_INFO(0xF7), SIGNS_SKY(0xF8), GAME_GUARD_QUERY(0xF9), FRIEND_LIST(0xFA), diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java index 46a39293ab..5948da4731 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java @@ -153,7 +153,7 @@ public class RequestRestartPoint implements IClientIncomingPacket loc = MapRegionData.getInstance().getTeleToLocation(_player, TeleportWhereType.CLANHALL); if ((ClanHallTable.getInstance().getClanHallByOwner(_player.getClan()) != null) && (ClanHallTable.getInstance().getClanHallByOwner(_player.getClan()).getFunction(ClanHall.FUNC_RESTORE_EXP) != null)) { - _player.restoreExp(ClanHallTable.getInstance().getClanHallByOwner(_player.getClan()).getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl()); + _player.restoreExp(ClanHallTable.getInstance().getClanHallByOwner(_player.getClan()).getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel()); } break; } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/ClanHallDecoration.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java similarity index 54% rename from L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/ClanHallDecoration.java rename to L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 743b7da925..cb7c2118a5 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/ClanHallDecoration.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -24,11 +24,11 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; /** * @author Steuf */ -public class ClanHallDecoration implements IClientOutgoingPacket +public class AgitDecoInfo implements IClientOutgoingPacket { private final ClanHall _clanHall; - public ClanHallDecoration(ClanHall clanHall) + public AgitDecoInfo(ClanHall clanHall) { _clanHall = clanHall; } @@ -36,15 +36,15 @@ public class ClanHallDecoration implements IClientOutgoingPacket @Override public boolean write(PacketWriter packet) { - OutgoingPackets.CLAN_HALL_DECORATION.writeId(packet); - packet.writeD(_clanHall.getId()); // clanhall id - // FUNC_RESTORE_HP + OutgoingPackets.AGIT_DECO_INFO.writeId(packet); + packet.writeD(_clanHall.getId()); + // Fireplace ClanHallFunction function = _clanHall.getFunction(ClanHall.FUNC_RESTORE_HP); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 220)) || ((_clanHall.getGrade() == 1) && (function.getLvl() < 160)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 260)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 300))) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 220)) || ((_clanHall.getGrade() == 1) && (function.getLevel() < 160)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 260)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 300))) { packet.writeC(1); } @@ -52,14 +52,14 @@ public class ClanHallDecoration implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_RESTORE_MP + // Carpet - Statue function = _clanHall.getFunction(ClanHall.FUNC_RESTORE_MP); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); packet.writeC(0); } - else if ((((_clanHall.getGrade() == 0) || (_clanHall.getGrade() == 1)) && (function.getLvl() < 25)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 30)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 40))) + else if ((((_clanHall.getGrade() == 0) || (_clanHall.getGrade() == 1)) && (function.getLevel() < 25)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 30)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 40))) { packet.writeC(1); packet.writeC(1); @@ -69,13 +69,13 @@ public class ClanHallDecoration implements IClientOutgoingPacket packet.writeC(2); packet.writeC(2); } - // FUNC_RESTORE_EXP + // Chandelier function = _clanHall.getFunction(ClanHall.FUNC_RESTORE_EXP); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 25)) || ((_clanHall.getGrade() == 1) && (function.getLvl() < 30)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 40)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 50))) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 25)) || ((_clanHall.getGrade() == 1) && (function.getLevel() < 30)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 40)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 50))) { packet.writeC(1); } @@ -83,13 +83,13 @@ public class ClanHallDecoration implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_TELEPORT + // Mirror function = _clanHall.getFunction(ClanHall.FUNC_TELEPORT); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (function.getLvl() < 2) + else if (function.getLevel() < 2) { packet.writeC(1); } @@ -97,14 +97,15 @@ public class ClanHallDecoration implements IClientOutgoingPacket { packet.writeC(2); } + // Crystal packet.writeC(0); - // CURTAINS + // Curtain function = _clanHall.getFunction(ClanHall.FUNC_DECO_CURTAINS); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (function.getLvl() <= 1) + else if (function.getLevel() <= 1) { packet.writeC(1); } @@ -112,13 +113,13 @@ public class ClanHallDecoration implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_ITEM_CREATE + // Magic Curtain function = _clanHall.getFunction(ClanHall.FUNC_ITEM_CREATE); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 2)) || (function.getLvl() < 3)) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 2)) || (function.getLevel() < 3)) { packet.writeC(1); } @@ -126,14 +127,14 @@ public class ClanHallDecoration implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_SUPPORT + // Support? - Flag function = _clanHall.getFunction(ClanHall.FUNC_SUPPORT); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 2)) || ((_clanHall.getGrade() == 1) && (function.getLvl() < 4)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 5)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 8))) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 2)) || ((_clanHall.getGrade() == 1) && (function.getLevel() < 4)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 5)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 8))) { packet.writeC(1); packet.writeC(1); @@ -143,13 +144,13 @@ public class ClanHallDecoration implements IClientOutgoingPacket packet.writeC(2); packet.writeC(2); } - // Front Plateform + // Front platform function = _clanHall.getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (function.getLvl() <= 1) + else if (function.getLevel() <= 1) { packet.writeC(1); } @@ -157,13 +158,13 @@ public class ClanHallDecoration implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_ITEM_CREATE + // Item create? function = _clanHall.getFunction(ClanHall.FUNC_ITEM_CREATE); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 2)) || (function.getLvl() < 3)) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 2)) || (function.getLevel() < 3)) { packet.writeC(1); } @@ -171,8 +172,6 @@ public class ClanHallDecoration implements IClientOutgoingPacket { packet.writeC(2); } - packet.writeD(0); - packet.writeD(0); return true; } } diff --git a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java index 75f4238da7..ef04e8034d 100644 --- a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java +++ b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java @@ -174,7 +174,7 @@ public class ClanHallManager extends Merchant } else { - html.setFile(player, "data/html/clanHallManager/tele" + getClanHall().getLocation() + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLvl() + ".htm"); + html.setFile(player, "data/html/clanHallManager/tele" + getClanHall().getLocation() + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLevel() + ".htm"); } sendHtmlMessage(player, html); } @@ -191,7 +191,7 @@ public class ClanHallManager extends Merchant { return; } - final int valbuy = Integer.parseInt(st.nextToken()) + (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLvl() * 100000); + final int valbuy = Integer.parseInt(st.nextToken()) + (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLevel() * 100000); showBuyWindow(player, valbuy); } else if (val.equalsIgnoreCase("support")) @@ -203,7 +203,7 @@ public class ClanHallManager extends Merchant } else { - html.setFile(player, "data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() + ".htm"); + html.setFile(player, "data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() + ".htm"); html.replace("%mp%", String.valueOf((int) getCurrentMp())); } sendHtmlMessage(player, html); @@ -218,7 +218,7 @@ public class ClanHallManager extends Merchant html.setFile(player, "data/html/clanHallManager/functions.htm"); if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP) != null) { - html.replace("%xp_regen%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl())); + html.replace("%xp_regen%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel())); } else { @@ -226,7 +226,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP) != null) { - html.replace("%hp_regen%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLvl())); + html.replace("%hp_regen%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLevel())); } else { @@ -234,7 +234,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP) != null) { - html.replace("%mp_regen%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLvl())); + html.replace("%mp_regen%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLevel())); } else { @@ -467,7 +467,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP) != null) && (getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP) != null) && (getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", val + "%"); @@ -570,7 +570,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP) != null) && (getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP) != null) && (getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", val + "%"); @@ -633,7 +633,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP) != null) && (getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP) != null) && (getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", val + "%"); @@ -715,7 +715,7 @@ public class ClanHallManager extends Merchant final String mp_grade3 = "[5%][15%][30%][40%]"; if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP) != null) { - html.replace("%hp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLvl() + "% (" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLease() + "Adena /" + (Config.CH_HPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%hp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLevel() + "% (" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLease() + "Adena /" + (Config.CH_HPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%hp_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getEndTime())); final int grade = getClanHall().getGrade(); switch (grade) @@ -773,7 +773,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP) != null) { - html.replace("%exp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl() + "% (" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLease() + "Adena /" + (Config.CH_EXPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%exp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel() + "% (" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLease() + "Adena /" + (Config.CH_EXPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%exp_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getEndTime())); final int grade = getClanHall().getGrade(); switch (grade) @@ -831,7 +831,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP) != null) { - html.replace("%mp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLvl() + "% (" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLease() + "Adena /" + (Config.CH_MPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%mp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLevel() + "% (" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLease() + "Adena /" + (Config.CH_MPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%mp_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getEndTime())); final int grade = getClanHall().getGrade(); switch (grade) @@ -1051,7 +1051,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE) != null) && (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE) != null) && (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", "Stage " + val); @@ -1105,7 +1105,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_TELEPORT) != null) && (getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_TELEPORT) != null) && (getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", "Stage " + val); @@ -1153,7 +1153,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_SUPPORT) != null) && (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_SUPPORT) != null) && (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", "Stage " + val); @@ -1234,7 +1234,7 @@ public class ClanHallManager extends Merchant final String item = "[Level 1][Level 2][Level 3]"; if (getClanHall().getFunction(ClanHall.FUNC_TELEPORT) != null) { - html.replace("%tele%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLvl() + " (" + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLease() + "Adena /" + (Config.CH_TELE_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%tele%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLevel() + " (" + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLease() + "Adena /" + (Config.CH_TELE_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%tele_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getEndTime())); html.replace("%change_tele%", "[Deactivate]" + tele); } @@ -1246,7 +1246,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT) != null) { - html.replace("%support%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() + " (" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLease() + "Adena /" + (Config.CH_SUPPORT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%support%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() + " (" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLease() + "Adena /" + (Config.CH_SUPPORT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%support_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getEndTime())); final int grade = getClanHall().getGrade(); switch (grade) @@ -1304,7 +1304,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE) != null) { - html.replace("%item%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLvl() + " (" + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLease() + "Adena /" + (Config.CH_ITEM_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%item%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLevel() + " (" + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLease() + "Adena /" + (Config.CH_ITEM_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%item_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getEndTime())); html.replace("%change_item%", "[Deactivate]" + item); } @@ -1404,7 +1404,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS) != null) && (getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS) != null) && (getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", "Stage " + val); @@ -1452,7 +1452,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM) != null) && (getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM) != null) && (getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", "Stage " + val); @@ -1499,7 +1499,7 @@ public class ClanHallManager extends Merchant final String fixtures = "[Level 1][Level 2]"; if (getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS) != null) { - html.replace("%curtain%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLvl() + " (" + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLease() + "Adena /" + (Config.CH_CURTAIN_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%curtain%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLevel() + " (" + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLease() + "Adena /" + (Config.CH_CURTAIN_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%curtain_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getEndTime())); html.replace("%change_curtain%", "[Deactivate]" + curtains); } @@ -1511,7 +1511,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM) != null) { - html.replace("%fixture%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLvl() + " (" + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLease() + "Adena /" + (Config.CH_FRONT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%fixture%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLevel() + " (" + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLease() + "Adena /" + (Config.CH_FRONT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%fixture_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getEndTime())); html.replace("%change_fixture%", "[Deactivate]" + fixtures); } @@ -1594,7 +1594,7 @@ public class ClanHallManager extends Merchant return; } final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); - if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() == 0) + if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() == 0) { return; } @@ -1630,11 +1630,11 @@ public class ClanHallManager extends Merchant else if (actualCommand.equalsIgnoreCase("support_back")) { final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); - if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() == 0) + if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() == 0) { return; } - html.setFile(player, "data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() + ".htm"); + html.setFile(player, "data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() + ".htm"); html.replace("%mp%", String.valueOf((int) getStatus().getCurrentMp())); sendHtmlMessage(player, html); return; diff --git a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index fbe941c379..350b370196 100644 --- a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -64,7 +64,7 @@ public abstract class ClanHall public class ClanHallFunction { final int _type; - private int _lvl; + private int _level; protected int _fee; protected int _tempFee; final long _rate; @@ -75,7 +75,7 @@ public abstract class ClanHall public ClanHallFunction(int type, int lvl, int lease, int tempLease, long rate, long time, boolean cwh) { _type = type; - _lvl = lvl; + _level = lvl; _fee = lease; _tempFee = tempLease; _rate = rate; @@ -88,9 +88,9 @@ public abstract class ClanHall return _type; } - public int getLvl() + public int getLevel() { - return _lvl; + return _level; } public int getLease() @@ -108,9 +108,9 @@ public abstract class ClanHall return _endDate; } - public void setLvl(int lvl) + public void setLevel(int level) { - _lvl = lvl; + _level = level; } public void setLease(int lease) @@ -186,7 +186,7 @@ public abstract class ClanHall { ps.setInt(1, _clanHallId); ps.setInt(2, _type); - ps.setInt(3, _lvl); + ps.setInt(3, _level); ps.setInt(4, _fee); ps.setLong(5, _rate); ps.setLong(6, _endDate); @@ -478,7 +478,7 @@ public abstract class ClanHall } } - public boolean updateFunctions(Player player, int type, int lvl, int lease, long rate, boolean addNew) + public boolean updateFunctions(Player player, int type, int level, int lease, long rate, boolean addNew) { if ((player == null) || ((lease > 0) && !player.destroyItemByItemId("Consume", Inventory.ADENA_ID, lease, null, true))) { @@ -486,21 +486,21 @@ public abstract class ClanHall } if (addNew) { - _functions.put(type, new ClanHallFunction(type, lvl, lease, 0, rate, 0, false)); + _functions.put(type, new ClanHallFunction(type, level, lease, 0, rate, 0, false)); } - else if ((lvl == 0) && (lease == 0)) + else if ((level == 0) && (lease == 0)) { removeFunction(type); } else if ((lease - _functions.get(type).getLease()) > 0) { _functions.remove(type); - _functions.put(type, new ClanHallFunction(type, lvl, lease, 0, rate, -1, false)); + _functions.put(type, new ClanHallFunction(type, level, lease, 0, rate, -1, false)); } else { _functions.get(type).setLease(lease); - _functions.get(type).setLvl(lvl); + _functions.get(type).setLevel(level); _functions.get(type).dbSave(); } return true; diff --git a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 4dac40d243..0bdd9b6695 100644 --- a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -281,7 +281,7 @@ public class Formulas final ClanHall clansHall = ClanHallTable.getInstance().getClanHallById(clanHallIndex); if ((clansHall != null) && (clansHall.getFunction(ClanHall.FUNC_RESTORE_HP) != null)) { - hpRegenMultiplier *= 1 + ((double) clansHall.getFunction(ClanHall.FUNC_RESTORE_HP).getLvl() / 100); + hpRegenMultiplier *= 1 + ((double) clansHall.getFunction(ClanHall.FUNC_RESTORE_HP).getLevel() / 100); } } } @@ -373,7 +373,7 @@ public class Formulas final ClanHall clansHall = ClanHallTable.getInstance().getClanHallById(clanHallIndex); if ((clansHall != null) && (clansHall.getFunction(ClanHall.FUNC_RESTORE_MP) != null)) { - mpRegenMultiplier *= 1 + ((double) clansHall.getFunction(ClanHall.FUNC_RESTORE_MP).getLvl() / 100); + mpRegenMultiplier *= 1 + ((double) clansHall.getFunction(ClanHall.FUNC_RESTORE_MP).getLevel() / 100); } } } diff --git a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java index 9c096e5c7f..6a282801d4 100644 --- a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java +++ b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java @@ -146,7 +146,7 @@ public class RequestRestartPoint implements IClientIncomingPacket loc = MapRegionManager.getInstance().getTeleToLocation(player, TeleportWhereType.CLANHALL); if ((ClanHallTable.getInstance().getClanHallByOwner(player.getClan()) != null) && (ClanHallTable.getInstance().getClanHallByOwner(player.getClan()).getFunction(ClanHall.FUNC_RESTORE_EXP) != null)) { - player.restoreExp(ClanHallTable.getInstance().getClanHallByOwner(player.getClan()).getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl()); + player.restoreExp(ClanHallTable.getInstance().getClanHallByOwner(player.getClan()).getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel()); } break; } diff --git a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index ef0a3e5259..b12d882308 100644 --- a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -34,39 +34,18 @@ public class AgitDecoInfo implements IClientOutgoingPacket _clanHall = clanHall; } - //@formatter:off - /* - * Packet send, must be confirmed - packet.writeC(0xf7); - packet.writeD(0); // clanhall id - packet.writeC(0); // FUNC_RESTORE_HP (Fireplace) - packet.writeC(0); // FUNC_RESTORE_MP (Carpet) - packet.writeC(0); // FUNC_RESTORE_MP (Statue) - packet.writeC(0); // FUNC_RESTORE_EXP (Chandelier) - packet.writeC(0); // FUNC_TELEPORT (Mirror) - packet.writeC(0); // Crytal - packet.writeC(0); // Curtain - packet.writeC(0); // FUNC_ITEM_CREATE (Magic Curtain) - packet.writeC(0); // FUNC_SUPPORT - packet.writeC(0); // FUNC_SUPPORT (Flag) - packet.writeC(0); // Front Platform - packet.writeC(0); // FUNC_ITEM_CREATE - packet.writeD(0); - packet.writeD(0); - */ - //@formatter:on @Override public boolean write(PacketWriter packet) { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); - packet.writeD(_clanHall.getId()); // clanhall id - // FUNC_RESTORE_HP + packet.writeD(_clanHall.getId()); + // Fireplace ClanHallFunction function = _clanHall.getFunction(ClanHall.FUNC_RESTORE_HP); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 220)) || ((_clanHall.getGrade() == 1) && (function.getLvl() < 160)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 260)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 300))) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 220)) || ((_clanHall.getGrade() == 1) && (function.getLevel() < 160)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 260)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 300))) { packet.writeC(1); } @@ -74,14 +53,14 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_RESTORE_MP + // Carpet - Statue function = _clanHall.getFunction(ClanHall.FUNC_RESTORE_MP); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); packet.writeC(0); } - else if ((((_clanHall.getGrade() == 0) || (_clanHall.getGrade() == 1)) && (function.getLvl() < 25)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 30)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 40))) + else if ((((_clanHall.getGrade() == 0) || (_clanHall.getGrade() == 1)) && (function.getLevel() < 25)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 30)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 40))) { packet.writeC(1); packet.writeC(1); @@ -91,13 +70,13 @@ public class AgitDecoInfo implements IClientOutgoingPacket packet.writeC(2); packet.writeC(2); } - // FUNC_RESTORE_EXP + // Chandelier function = _clanHall.getFunction(ClanHall.FUNC_RESTORE_EXP); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 25)) || ((_clanHall.getGrade() == 1) && (function.getLvl() < 30)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 40)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 50))) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 25)) || ((_clanHall.getGrade() == 1) && (function.getLevel() < 30)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 40)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 50))) { packet.writeC(1); } @@ -105,13 +84,13 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_TELEPORT + // Mirror function = _clanHall.getFunction(ClanHall.FUNC_TELEPORT); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (function.getLvl() < 2) + else if (function.getLevel() < 2) { packet.writeC(1); } @@ -119,14 +98,15 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } + // Crystal packet.writeC(0); - // CURTAINS + // Curtain function = _clanHall.getFunction(ClanHall.FUNC_DECO_CURTAINS); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (function.getLvl() <= 1) + else if (function.getLevel() <= 1) { packet.writeC(1); } @@ -134,13 +114,13 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_ITEM_CREATE + // Magic Curtain function = _clanHall.getFunction(ClanHall.FUNC_ITEM_CREATE); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 2)) || (function.getLvl() < 3)) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 2)) || (function.getLevel() < 3)) { packet.writeC(1); } @@ -148,14 +128,14 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_SUPPORT + // Support? - Flag function = _clanHall.getFunction(ClanHall.FUNC_SUPPORT); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 2)) || ((_clanHall.getGrade() == 1) && (function.getLvl() < 4)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 5)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 8))) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 2)) || ((_clanHall.getGrade() == 1) && (function.getLevel() < 4)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 5)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 8))) { packet.writeC(1); packet.writeC(1); @@ -165,13 +145,13 @@ public class AgitDecoInfo implements IClientOutgoingPacket packet.writeC(2); packet.writeC(2); } - // Front Plateform + // Front platform function = _clanHall.getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (function.getLvl() <= 1) + else if (function.getLevel() <= 1) { packet.writeC(1); } @@ -179,13 +159,13 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_ITEM_CREATE + // Item create? function = _clanHall.getFunction(ClanHall.FUNC_ITEM_CREATE); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 2)) || (function.getLvl() < 3)) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 2)) || (function.getLevel() < 3)) { packet.writeC(1); } @@ -193,8 +173,6 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } - packet.writeD(0); - packet.writeD(0); return true; } } diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java index 1d2c049290..fef17846e6 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java @@ -175,7 +175,7 @@ public class ClanHallManager extends Merchant } else { - html.setFile(player, "data/html/clanHallManager/tele" + getClanHall().getLocation() + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLvl() + ".htm"); + html.setFile(player, "data/html/clanHallManager/tele" + getClanHall().getLocation() + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLevel() + ".htm"); } sendHtmlMessage(player, html); } @@ -192,7 +192,7 @@ public class ClanHallManager extends Merchant { return; } - final int valbuy = Integer.parseInt(st.nextToken()) + (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLvl() * 100000); + final int valbuy = Integer.parseInt(st.nextToken()) + (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLevel() * 100000); showBuyWindow(player, valbuy); } else if (val.equalsIgnoreCase("support")) @@ -204,7 +204,7 @@ public class ClanHallManager extends Merchant } else { - html.setFile(player, "data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() + ".htm"); + html.setFile(player, "data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() + ".htm"); html.replace("%mp%", String.valueOf((int) getCurrentMp())); } sendHtmlMessage(player, html); @@ -219,7 +219,7 @@ public class ClanHallManager extends Merchant html.setFile(player, "data/html/clanHallManager/functions.htm"); if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP) != null) { - html.replace("%xp_regen%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl())); + html.replace("%xp_regen%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel())); } else { @@ -227,7 +227,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP) != null) { - html.replace("%hp_regen%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLvl())); + html.replace("%hp_regen%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLevel())); } else { @@ -235,7 +235,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP) != null) { - html.replace("%mp_regen%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLvl())); + html.replace("%mp_regen%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLevel())); } else { @@ -468,7 +468,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP) != null) && (getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP) != null) && (getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", val + "%"); @@ -571,7 +571,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP) != null) && (getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP) != null) && (getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", val + "%"); @@ -634,7 +634,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP) != null) && (getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP) != null) && (getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", val + "%"); @@ -716,7 +716,7 @@ public class ClanHallManager extends Merchant final String mp_grade3 = "[5%][15%][30%][40%]"; if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP) != null) { - html.replace("%hp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLvl() + "% (" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLease() + "Adena /" + (Config.CH_HPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%hp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLevel() + "% (" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLease() + "Adena /" + (Config.CH_HPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%hp_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getEndTime())); final int grade = getClanHall().getGrade(); switch (grade) @@ -774,7 +774,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP) != null) { - html.replace("%exp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl() + "% (" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLease() + "Adena /" + (Config.CH_EXPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%exp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel() + "% (" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLease() + "Adena /" + (Config.CH_EXPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%exp_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getEndTime())); final int grade = getClanHall().getGrade(); switch (grade) @@ -832,7 +832,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP) != null) { - html.replace("%mp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLvl() + "% (" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLease() + "Adena /" + (Config.CH_MPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%mp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLevel() + "% (" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLease() + "Adena /" + (Config.CH_MPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%mp_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getEndTime())); final int grade = getClanHall().getGrade(); switch (grade) @@ -1052,7 +1052,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE) != null) && (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE) != null) && (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", "Stage " + val); @@ -1106,7 +1106,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_TELEPORT) != null) && (getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_TELEPORT) != null) && (getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", "Stage " + val); @@ -1154,7 +1154,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_SUPPORT) != null) && (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_SUPPORT) != null) && (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", "Stage " + val); @@ -1235,7 +1235,7 @@ public class ClanHallManager extends Merchant final String item = "[Level 1][Level 2][Level 3]"; if (getClanHall().getFunction(ClanHall.FUNC_TELEPORT) != null) { - html.replace("%tele%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLvl() + " (" + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLease() + "Adena /" + (Config.CH_TELE_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%tele%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLevel() + " (" + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLease() + "Adena /" + (Config.CH_TELE_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%tele_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getEndTime())); html.replace("%change_tele%", "[Deactivate]" + tele); } @@ -1247,7 +1247,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT) != null) { - html.replace("%support%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() + " (" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLease() + "Adena /" + (Config.CH_SUPPORT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%support%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() + " (" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLease() + "Adena /" + (Config.CH_SUPPORT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%support_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getEndTime())); final int grade = getClanHall().getGrade(); switch (grade) @@ -1305,7 +1305,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE) != null) { - html.replace("%item%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLvl() + " (" + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLease() + "Adena /" + (Config.CH_ITEM_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%item%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLevel() + " (" + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLease() + "Adena /" + (Config.CH_ITEM_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%item_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getEndTime())); html.replace("%change_item%", "[Deactivate]" + item); } @@ -1405,7 +1405,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS) != null) && (getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS) != null) && (getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", "Stage " + val); @@ -1453,7 +1453,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM) != null) && (getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM) != null) && (getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", "Stage " + val); @@ -1500,7 +1500,7 @@ public class ClanHallManager extends Merchant final String fixtures = "[Level 1][Level 2]"; if (getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS) != null) { - html.replace("%curtain%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLvl() + " (" + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLease() + "Adena /" + (Config.CH_CURTAIN_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%curtain%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLevel() + " (" + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLease() + "Adena /" + (Config.CH_CURTAIN_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%curtain_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getEndTime())); html.replace("%change_curtain%", "[Deactivate]" + curtains); } @@ -1512,7 +1512,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM) != null) { - html.replace("%fixture%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLvl() + " (" + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLease() + "Adena /" + (Config.CH_FRONT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%fixture%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLevel() + " (" + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLease() + "Adena /" + (Config.CH_FRONT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%fixture_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getEndTime())); html.replace("%change_fixture%", "[Deactivate]" + fixtures); } @@ -1595,7 +1595,7 @@ public class ClanHallManager extends Merchant return; } final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); - if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() == 0) + if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() == 0) { return; } @@ -1631,11 +1631,11 @@ public class ClanHallManager extends Merchant else if (actualCommand.equalsIgnoreCase("support_back")) { final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); - if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() == 0) + if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() == 0) { return; } - html.setFile(player, "data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() + ".htm"); + html.setFile(player, "data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() + ".htm"); html.replace("%mp%", String.valueOf((int) getStatus().getCurrentMp())); sendHtmlMessage(player, html); return; diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index fbe941c379..350b370196 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -64,7 +64,7 @@ public abstract class ClanHall public class ClanHallFunction { final int _type; - private int _lvl; + private int _level; protected int _fee; protected int _tempFee; final long _rate; @@ -75,7 +75,7 @@ public abstract class ClanHall public ClanHallFunction(int type, int lvl, int lease, int tempLease, long rate, long time, boolean cwh) { _type = type; - _lvl = lvl; + _level = lvl; _fee = lease; _tempFee = tempLease; _rate = rate; @@ -88,9 +88,9 @@ public abstract class ClanHall return _type; } - public int getLvl() + public int getLevel() { - return _lvl; + return _level; } public int getLease() @@ -108,9 +108,9 @@ public abstract class ClanHall return _endDate; } - public void setLvl(int lvl) + public void setLevel(int level) { - _lvl = lvl; + _level = level; } public void setLease(int lease) @@ -186,7 +186,7 @@ public abstract class ClanHall { ps.setInt(1, _clanHallId); ps.setInt(2, _type); - ps.setInt(3, _lvl); + ps.setInt(3, _level); ps.setInt(4, _fee); ps.setLong(5, _rate); ps.setLong(6, _endDate); @@ -478,7 +478,7 @@ public abstract class ClanHall } } - public boolean updateFunctions(Player player, int type, int lvl, int lease, long rate, boolean addNew) + public boolean updateFunctions(Player player, int type, int level, int lease, long rate, boolean addNew) { if ((player == null) || ((lease > 0) && !player.destroyItemByItemId("Consume", Inventory.ADENA_ID, lease, null, true))) { @@ -486,21 +486,21 @@ public abstract class ClanHall } if (addNew) { - _functions.put(type, new ClanHallFunction(type, lvl, lease, 0, rate, 0, false)); + _functions.put(type, new ClanHallFunction(type, level, lease, 0, rate, 0, false)); } - else if ((lvl == 0) && (lease == 0)) + else if ((level == 0) && (lease == 0)) { removeFunction(type); } else if ((lease - _functions.get(type).getLease()) > 0) { _functions.remove(type); - _functions.put(type, new ClanHallFunction(type, lvl, lease, 0, rate, -1, false)); + _functions.put(type, new ClanHallFunction(type, level, lease, 0, rate, -1, false)); } else { _functions.get(type).setLease(lease); - _functions.get(type).setLvl(lvl); + _functions.get(type).setLevel(level); _functions.get(type).dbSave(); } return true; diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 77779805ea..a20630c641 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -284,7 +284,7 @@ public class Formulas final ClanHall clansHall = ClanHallTable.getInstance().getClanHallById(clanHallIndex); if ((clansHall != null) && (clansHall.getFunction(ClanHall.FUNC_RESTORE_HP) != null)) { - hpRegenMultiplier *= 1 + ((double) clansHall.getFunction(ClanHall.FUNC_RESTORE_HP).getLvl() / 100); + hpRegenMultiplier *= 1 + ((double) clansHall.getFunction(ClanHall.FUNC_RESTORE_HP).getLevel() / 100); } } } @@ -391,7 +391,7 @@ public class Formulas final ClanHall clansHall = ClanHallTable.getInstance().getClanHallById(clanHallIndex); if ((clansHall != null) && (clansHall.getFunction(ClanHall.FUNC_RESTORE_MP) != null)) { - mpRegenMultiplier *= 1 + ((double) clansHall.getFunction(ClanHall.FUNC_RESTORE_MP).getLvl() / 100); + mpRegenMultiplier *= 1 + ((double) clansHall.getFunction(ClanHall.FUNC_RESTORE_MP).getLevel() / 100); } } } diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java index 850bb90d3c..64d6fc3003 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java @@ -152,7 +152,7 @@ public class RequestRestartPoint implements IClientIncomingPacket loc = MapRegionManager.getInstance().getTeleToLocation(player, TeleportWhereType.CLANHALL); if ((ClanHallTable.getInstance().getClanHallByOwner(player.getClan()) != null) && (ClanHallTable.getInstance().getClanHallByOwner(player.getClan()).getFunction(ClanHall.FUNC_RESTORE_EXP) != null)) { - player.restoreExp(ClanHallTable.getInstance().getClanHallByOwner(player.getClan()).getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl()); + player.restoreExp(ClanHallTable.getInstance().getClanHallByOwner(player.getClan()).getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel()); } break; } diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index ef0a3e5259..b12d882308 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -34,39 +34,18 @@ public class AgitDecoInfo implements IClientOutgoingPacket _clanHall = clanHall; } - //@formatter:off - /* - * Packet send, must be confirmed - packet.writeC(0xf7); - packet.writeD(0); // clanhall id - packet.writeC(0); // FUNC_RESTORE_HP (Fireplace) - packet.writeC(0); // FUNC_RESTORE_MP (Carpet) - packet.writeC(0); // FUNC_RESTORE_MP (Statue) - packet.writeC(0); // FUNC_RESTORE_EXP (Chandelier) - packet.writeC(0); // FUNC_TELEPORT (Mirror) - packet.writeC(0); // Crytal - packet.writeC(0); // Curtain - packet.writeC(0); // FUNC_ITEM_CREATE (Magic Curtain) - packet.writeC(0); // FUNC_SUPPORT - packet.writeC(0); // FUNC_SUPPORT (Flag) - packet.writeC(0); // Front Platform - packet.writeC(0); // FUNC_ITEM_CREATE - packet.writeD(0); - packet.writeD(0); - */ - //@formatter:on @Override public boolean write(PacketWriter packet) { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); - packet.writeD(_clanHall.getId()); // clanhall id - // FUNC_RESTORE_HP + packet.writeD(_clanHall.getId()); + // Fireplace ClanHallFunction function = _clanHall.getFunction(ClanHall.FUNC_RESTORE_HP); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 220)) || ((_clanHall.getGrade() == 1) && (function.getLvl() < 160)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 260)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 300))) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 220)) || ((_clanHall.getGrade() == 1) && (function.getLevel() < 160)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 260)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 300))) { packet.writeC(1); } @@ -74,14 +53,14 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_RESTORE_MP + // Carpet - Statue function = _clanHall.getFunction(ClanHall.FUNC_RESTORE_MP); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); packet.writeC(0); } - else if ((((_clanHall.getGrade() == 0) || (_clanHall.getGrade() == 1)) && (function.getLvl() < 25)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 30)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 40))) + else if ((((_clanHall.getGrade() == 0) || (_clanHall.getGrade() == 1)) && (function.getLevel() < 25)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 30)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 40))) { packet.writeC(1); packet.writeC(1); @@ -91,13 +70,13 @@ public class AgitDecoInfo implements IClientOutgoingPacket packet.writeC(2); packet.writeC(2); } - // FUNC_RESTORE_EXP + // Chandelier function = _clanHall.getFunction(ClanHall.FUNC_RESTORE_EXP); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 25)) || ((_clanHall.getGrade() == 1) && (function.getLvl() < 30)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 40)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 50))) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 25)) || ((_clanHall.getGrade() == 1) && (function.getLevel() < 30)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 40)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 50))) { packet.writeC(1); } @@ -105,13 +84,13 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_TELEPORT + // Mirror function = _clanHall.getFunction(ClanHall.FUNC_TELEPORT); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (function.getLvl() < 2) + else if (function.getLevel() < 2) { packet.writeC(1); } @@ -119,14 +98,15 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } + // Crystal packet.writeC(0); - // CURTAINS + // Curtain function = _clanHall.getFunction(ClanHall.FUNC_DECO_CURTAINS); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (function.getLvl() <= 1) + else if (function.getLevel() <= 1) { packet.writeC(1); } @@ -134,13 +114,13 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_ITEM_CREATE + // Magic Curtain function = _clanHall.getFunction(ClanHall.FUNC_ITEM_CREATE); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 2)) || (function.getLvl() < 3)) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 2)) || (function.getLevel() < 3)) { packet.writeC(1); } @@ -148,14 +128,14 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_SUPPORT + // Support? - Flag function = _clanHall.getFunction(ClanHall.FUNC_SUPPORT); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 2)) || ((_clanHall.getGrade() == 1) && (function.getLvl() < 4)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 5)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 8))) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 2)) || ((_clanHall.getGrade() == 1) && (function.getLevel() < 4)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 5)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 8))) { packet.writeC(1); packet.writeC(1); @@ -165,13 +145,13 @@ public class AgitDecoInfo implements IClientOutgoingPacket packet.writeC(2); packet.writeC(2); } - // Front Plateform + // Front platform function = _clanHall.getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (function.getLvl() <= 1) + else if (function.getLevel() <= 1) { packet.writeC(1); } @@ -179,13 +159,13 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_ITEM_CREATE + // Item create? function = _clanHall.getFunction(ClanHall.FUNC_ITEM_CREATE); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 2)) || (function.getLvl() < 3)) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 2)) || (function.getLevel() < 3)) { packet.writeC(1); } @@ -193,8 +173,6 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } - packet.writeD(0); - packet.writeD(0); return true; } } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java index 1d2c049290..fef17846e6 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/instance/ClanHallManager.java @@ -175,7 +175,7 @@ public class ClanHallManager extends Merchant } else { - html.setFile(player, "data/html/clanHallManager/tele" + getClanHall().getLocation() + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLvl() + ".htm"); + html.setFile(player, "data/html/clanHallManager/tele" + getClanHall().getLocation() + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLevel() + ".htm"); } sendHtmlMessage(player, html); } @@ -192,7 +192,7 @@ public class ClanHallManager extends Merchant { return; } - final int valbuy = Integer.parseInt(st.nextToken()) + (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLvl() * 100000); + final int valbuy = Integer.parseInt(st.nextToken()) + (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLevel() * 100000); showBuyWindow(player, valbuy); } else if (val.equalsIgnoreCase("support")) @@ -204,7 +204,7 @@ public class ClanHallManager extends Merchant } else { - html.setFile(player, "data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() + ".htm"); + html.setFile(player, "data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() + ".htm"); html.replace("%mp%", String.valueOf((int) getCurrentMp())); } sendHtmlMessage(player, html); @@ -219,7 +219,7 @@ public class ClanHallManager extends Merchant html.setFile(player, "data/html/clanHallManager/functions.htm"); if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP) != null) { - html.replace("%xp_regen%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl())); + html.replace("%xp_regen%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel())); } else { @@ -227,7 +227,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP) != null) { - html.replace("%hp_regen%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLvl())); + html.replace("%hp_regen%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLevel())); } else { @@ -235,7 +235,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP) != null) { - html.replace("%mp_regen%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLvl())); + html.replace("%mp_regen%", String.valueOf(getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLevel())); } else { @@ -468,7 +468,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP) != null) && (getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP) != null) && (getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", val + "%"); @@ -571,7 +571,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP) != null) && (getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP) != null) && (getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", val + "%"); @@ -634,7 +634,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP) != null) && (getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP) != null) && (getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", val + "%"); @@ -716,7 +716,7 @@ public class ClanHallManager extends Merchant final String mp_grade3 = "[5%][15%][30%][40%]"; if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP) != null) { - html.replace("%hp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLvl() + "% (" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLease() + "Adena /" + (Config.CH_HPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%hp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLevel() + "% (" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLease() + "Adena /" + (Config.CH_HPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%hp_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getEndTime())); final int grade = getClanHall().getGrade(); switch (grade) @@ -774,7 +774,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP) != null) { - html.replace("%exp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl() + "% (" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLease() + "Adena /" + (Config.CH_EXPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%exp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel() + "% (" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLease() + "Adena /" + (Config.CH_EXPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%exp_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getEndTime())); final int grade = getClanHall().getGrade(); switch (grade) @@ -832,7 +832,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP) != null) { - html.replace("%mp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLvl() + "% (" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLease() + "Adena /" + (Config.CH_MPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%mp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLevel() + "% (" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLease() + "Adena /" + (Config.CH_MPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%mp_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getEndTime())); final int grade = getClanHall().getGrade(); switch (grade) @@ -1052,7 +1052,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE) != null) && (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE) != null) && (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", "Stage " + val); @@ -1106,7 +1106,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_TELEPORT) != null) && (getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_TELEPORT) != null) && (getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", "Stage " + val); @@ -1154,7 +1154,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_SUPPORT) != null) && (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_SUPPORT) != null) && (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", "Stage " + val); @@ -1235,7 +1235,7 @@ public class ClanHallManager extends Merchant final String item = "[Level 1][Level 2][Level 3]"; if (getClanHall().getFunction(ClanHall.FUNC_TELEPORT) != null) { - html.replace("%tele%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLvl() + " (" + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLease() + "Adena /" + (Config.CH_TELE_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%tele%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLevel() + " (" + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLease() + "Adena /" + (Config.CH_TELE_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%tele_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getEndTime())); html.replace("%change_tele%", "[Deactivate]" + tele); } @@ -1247,7 +1247,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT) != null) { - html.replace("%support%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() + " (" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLease() + "Adena /" + (Config.CH_SUPPORT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%support%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() + " (" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLease() + "Adena /" + (Config.CH_SUPPORT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%support_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getEndTime())); final int grade = getClanHall().getGrade(); switch (grade) @@ -1305,7 +1305,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE) != null) { - html.replace("%item%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLvl() + " (" + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLease() + "Adena /" + (Config.CH_ITEM_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%item%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLevel() + " (" + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLease() + "Adena /" + (Config.CH_ITEM_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%item_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getEndTime())); html.replace("%change_item%", "[Deactivate]" + item); } @@ -1405,7 +1405,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS) != null) && (getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS) != null) && (getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", "Stage " + val); @@ -1453,7 +1453,7 @@ public class ClanHallManager extends Merchant val = st.nextToken(); final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player, "data/html/clanHallManager/functions-apply_confirmed.htm"); - if ((getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM) != null) && (getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLvl() == Integer.parseInt(val))) + if ((getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM) != null) && (getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLevel() == Integer.parseInt(val))) { html.setFile(player, "data/html/clanHallManager/functions-used.htm"); html.replace("%val%", "Stage " + val); @@ -1500,7 +1500,7 @@ public class ClanHallManager extends Merchant final String fixtures = "[Level 1][Level 2]"; if (getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS) != null) { - html.replace("%curtain%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLvl() + " (" + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLease() + "Adena /" + (Config.CH_CURTAIN_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%curtain%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLevel() + " (" + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLease() + "Adena /" + (Config.CH_CURTAIN_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%curtain_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getEndTime())); html.replace("%change_curtain%", "[Deactivate]" + curtains); } @@ -1512,7 +1512,7 @@ public class ClanHallManager extends Merchant } if (getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM) != null) { - html.replace("%fixture%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLvl() + " (" + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLease() + "Adena /" + (Config.CH_FRONT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); + html.replace("%fixture%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLevel() + " (" + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLease() + "Adena /" + (Config.CH_FRONT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)"); html.replace("%fixture_period%", "Withdraw the fee for the next time at " + format.format(getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getEndTime())); html.replace("%change_fixture%", "[Deactivate]" + fixtures); } @@ -1595,7 +1595,7 @@ public class ClanHallManager extends Merchant return; } final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); - if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() == 0) + if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() == 0) { return; } @@ -1631,11 +1631,11 @@ public class ClanHallManager extends Merchant else if (actualCommand.equalsIgnoreCase("support_back")) { final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); - if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() == 0) + if (getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() == 0) { return; } - html.setFile(player, "data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLvl() + ".htm"); + html.setFile(player, "data/html/clanHallManager/support" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() + ".htm"); html.replace("%mp%", String.valueOf((int) getStatus().getCurrentMp())); sendHtmlMessage(player, html); return; diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index fbe941c379..350b370196 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -64,7 +64,7 @@ public abstract class ClanHall public class ClanHallFunction { final int _type; - private int _lvl; + private int _level; protected int _fee; protected int _tempFee; final long _rate; @@ -75,7 +75,7 @@ public abstract class ClanHall public ClanHallFunction(int type, int lvl, int lease, int tempLease, long rate, long time, boolean cwh) { _type = type; - _lvl = lvl; + _level = lvl; _fee = lease; _tempFee = tempLease; _rate = rate; @@ -88,9 +88,9 @@ public abstract class ClanHall return _type; } - public int getLvl() + public int getLevel() { - return _lvl; + return _level; } public int getLease() @@ -108,9 +108,9 @@ public abstract class ClanHall return _endDate; } - public void setLvl(int lvl) + public void setLevel(int level) { - _lvl = lvl; + _level = level; } public void setLease(int lease) @@ -186,7 +186,7 @@ public abstract class ClanHall { ps.setInt(1, _clanHallId); ps.setInt(2, _type); - ps.setInt(3, _lvl); + ps.setInt(3, _level); ps.setInt(4, _fee); ps.setLong(5, _rate); ps.setLong(6, _endDate); @@ -478,7 +478,7 @@ public abstract class ClanHall } } - public boolean updateFunctions(Player player, int type, int lvl, int lease, long rate, boolean addNew) + public boolean updateFunctions(Player player, int type, int level, int lease, long rate, boolean addNew) { if ((player == null) || ((lease > 0) && !player.destroyItemByItemId("Consume", Inventory.ADENA_ID, lease, null, true))) { @@ -486,21 +486,21 @@ public abstract class ClanHall } if (addNew) { - _functions.put(type, new ClanHallFunction(type, lvl, lease, 0, rate, 0, false)); + _functions.put(type, new ClanHallFunction(type, level, lease, 0, rate, 0, false)); } - else if ((lvl == 0) && (lease == 0)) + else if ((level == 0) && (lease == 0)) { removeFunction(type); } else if ((lease - _functions.get(type).getLease()) > 0) { _functions.remove(type); - _functions.put(type, new ClanHallFunction(type, lvl, lease, 0, rate, -1, false)); + _functions.put(type, new ClanHallFunction(type, level, lease, 0, rate, -1, false)); } else { _functions.get(type).setLease(lease); - _functions.get(type).setLvl(lvl); + _functions.get(type).setLevel(level); _functions.get(type).dbSave(); } return true; diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 5feafee00b..a93d545227 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -284,7 +284,7 @@ public class Formulas final ClanHall clansHall = ClanHallTable.getInstance().getClanHallById(clanHallIndex); if ((clansHall != null) && (clansHall.getFunction(ClanHall.FUNC_RESTORE_HP) != null)) { - hpRegenMultiplier *= 1 + ((double) clansHall.getFunction(ClanHall.FUNC_RESTORE_HP).getLvl() / 100); + hpRegenMultiplier *= 1 + ((double) clansHall.getFunction(ClanHall.FUNC_RESTORE_HP).getLevel() / 100); } } } @@ -391,7 +391,7 @@ public class Formulas final ClanHall clansHall = ClanHallTable.getInstance().getClanHallById(clanHallIndex); if ((clansHall != null) && (clansHall.getFunction(ClanHall.FUNC_RESTORE_MP) != null)) { - mpRegenMultiplier *= 1 + ((double) clansHall.getFunction(ClanHall.FUNC_RESTORE_MP).getLvl() / 100); + mpRegenMultiplier *= 1 + ((double) clansHall.getFunction(ClanHall.FUNC_RESTORE_MP).getLevel() / 100); } } } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java index 850bb90d3c..64d6fc3003 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/RequestRestartPoint.java @@ -152,7 +152,7 @@ public class RequestRestartPoint implements IClientIncomingPacket loc = MapRegionManager.getInstance().getTeleToLocation(player, TeleportWhereType.CLANHALL); if ((ClanHallTable.getInstance().getClanHallByOwner(player.getClan()) != null) && (ClanHallTable.getInstance().getClanHallByOwner(player.getClan()).getFunction(ClanHall.FUNC_RESTORE_EXP) != null)) { - player.restoreExp(ClanHallTable.getInstance().getClanHallByOwner(player.getClan()).getFunction(ClanHall.FUNC_RESTORE_EXP).getLvl()); + player.restoreExp(ClanHallTable.getInstance().getClanHallByOwner(player.getClan()).getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel()); } break; } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index ef0a3e5259..b12d882308 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -34,39 +34,18 @@ public class AgitDecoInfo implements IClientOutgoingPacket _clanHall = clanHall; } - //@formatter:off - /* - * Packet send, must be confirmed - packet.writeC(0xf7); - packet.writeD(0); // clanhall id - packet.writeC(0); // FUNC_RESTORE_HP (Fireplace) - packet.writeC(0); // FUNC_RESTORE_MP (Carpet) - packet.writeC(0); // FUNC_RESTORE_MP (Statue) - packet.writeC(0); // FUNC_RESTORE_EXP (Chandelier) - packet.writeC(0); // FUNC_TELEPORT (Mirror) - packet.writeC(0); // Crytal - packet.writeC(0); // Curtain - packet.writeC(0); // FUNC_ITEM_CREATE (Magic Curtain) - packet.writeC(0); // FUNC_SUPPORT - packet.writeC(0); // FUNC_SUPPORT (Flag) - packet.writeC(0); // Front Platform - packet.writeC(0); // FUNC_ITEM_CREATE - packet.writeD(0); - packet.writeD(0); - */ - //@formatter:on @Override public boolean write(PacketWriter packet) { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); - packet.writeD(_clanHall.getId()); // clanhall id - // FUNC_RESTORE_HP + packet.writeD(_clanHall.getId()); + // Fireplace ClanHallFunction function = _clanHall.getFunction(ClanHall.FUNC_RESTORE_HP); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 220)) || ((_clanHall.getGrade() == 1) && (function.getLvl() < 160)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 260)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 300))) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 220)) || ((_clanHall.getGrade() == 1) && (function.getLevel() < 160)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 260)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 300))) { packet.writeC(1); } @@ -74,14 +53,14 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_RESTORE_MP + // Carpet - Statue function = _clanHall.getFunction(ClanHall.FUNC_RESTORE_MP); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); packet.writeC(0); } - else if ((((_clanHall.getGrade() == 0) || (_clanHall.getGrade() == 1)) && (function.getLvl() < 25)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 30)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 40))) + else if ((((_clanHall.getGrade() == 0) || (_clanHall.getGrade() == 1)) && (function.getLevel() < 25)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 30)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 40))) { packet.writeC(1); packet.writeC(1); @@ -91,13 +70,13 @@ public class AgitDecoInfo implements IClientOutgoingPacket packet.writeC(2); packet.writeC(2); } - // FUNC_RESTORE_EXP + // Chandelier function = _clanHall.getFunction(ClanHall.FUNC_RESTORE_EXP); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 25)) || ((_clanHall.getGrade() == 1) && (function.getLvl() < 30)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 40)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 50))) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 25)) || ((_clanHall.getGrade() == 1) && (function.getLevel() < 30)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 40)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 50))) { packet.writeC(1); } @@ -105,13 +84,13 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_TELEPORT + // Mirror function = _clanHall.getFunction(ClanHall.FUNC_TELEPORT); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (function.getLvl() < 2) + else if (function.getLevel() < 2) { packet.writeC(1); } @@ -119,14 +98,15 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } + // Crystal packet.writeC(0); - // CURTAINS + // Curtain function = _clanHall.getFunction(ClanHall.FUNC_DECO_CURTAINS); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (function.getLvl() <= 1) + else if (function.getLevel() <= 1) { packet.writeC(1); } @@ -134,13 +114,13 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_ITEM_CREATE + // Magic Curtain function = _clanHall.getFunction(ClanHall.FUNC_ITEM_CREATE); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 2)) || (function.getLvl() < 3)) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 2)) || (function.getLevel() < 3)) { packet.writeC(1); } @@ -148,14 +128,14 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_SUPPORT + // Support? - Flag function = _clanHall.getFunction(ClanHall.FUNC_SUPPORT); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 2)) || ((_clanHall.getGrade() == 1) && (function.getLvl() < 4)) || ((_clanHall.getGrade() == 2) && (function.getLvl() < 5)) || ((_clanHall.getGrade() == 3) && (function.getLvl() < 8))) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 2)) || ((_clanHall.getGrade() == 1) && (function.getLevel() < 4)) || ((_clanHall.getGrade() == 2) && (function.getLevel() < 5)) || ((_clanHall.getGrade() == 3) && (function.getLevel() < 8))) { packet.writeC(1); packet.writeC(1); @@ -165,13 +145,13 @@ public class AgitDecoInfo implements IClientOutgoingPacket packet.writeC(2); packet.writeC(2); } - // Front Plateform + // Front platform function = _clanHall.getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (function.getLvl() <= 1) + else if (function.getLevel() <= 1) { packet.writeC(1); } @@ -179,13 +159,13 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } - // FUNC_ITEM_CREATE + // Item create? function = _clanHall.getFunction(ClanHall.FUNC_ITEM_CREATE); - if ((function == null) || (function.getLvl() == 0)) + if ((function == null) || (function.getLevel() == 0)) { packet.writeC(0); } - else if (((_clanHall.getGrade() == 0) && (function.getLvl() < 2)) || (function.getLvl() < 3)) + else if (((_clanHall.getGrade() == 0) && (function.getLevel() < 2)) || (function.getLevel() < 3)) { packet.writeC(1); } @@ -193,8 +173,6 @@ public class AgitDecoInfo implements IClientOutgoingPacket { packet.writeC(2); } - packet.writeD(0); - packet.writeD(0); return true; } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 8a10069517..b94ad26aa1 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 8a10069517..b94ad26aa1 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 8a10069517..b94ad26aa1 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 8a10069517..b94ad26aa1 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 8a10069517..b94ad26aa1 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 8a10069517..b94ad26aa1 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 8a10069517..b94ad26aa1 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index 8a10069517..b94ad26aa1 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index a596f81eca..cbc07190dc 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index a596f81eca..cbc07190dc 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java index f588616491..0c7c6cf985 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/residences/AbstractResidence.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.xml.SkillData; import org.l2jmobius.gameserver.data.xml.SkillTreeData; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.enums.SocialClass; import org.l2jmobius.gameserver.model.SkillLearn; import org.l2jmobius.gameserver.model.actor.Player; @@ -43,9 +44,11 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone; public abstract class AbstractResidence extends ListenersContainer implements INamable { private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName()); + + protected ClanHallGrade _grade = ClanHallGrade.GRADE_NONE; + private final int _residenceId; private String _name; - private ResidenceZone _zone = null; private final Map _functions = new ConcurrentHashMap<>(); private List _residentialSkills = new ArrayList<>(); @@ -67,6 +70,15 @@ public abstract class AbstractResidence extends ListenersContainer implements IN _residentialSkills = SkillTreeData.getInstance().getAvailableResidentialSkills(getResidenceId()); } + /** + * Gets the grade of clan hall. + * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. + */ + public ClanHallGrade getGrade() + { + return _grade; + } + public int getResidenceId() { return _residenceId; diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/residences/ClanHall.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/residences/ClanHall.java index a596f81eca..cbc07190dc 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/residences/ClanHall.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/residences/ClanHall.java @@ -57,7 +57,6 @@ public class ClanHall extends AbstractResidence private static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName()); // Static parameters - private final ClanHallGrade _grade; private final ClanHallType _type; private final int _minBid; final int _lease; @@ -196,15 +195,6 @@ public class ClanHall extends AbstractResidence _doors.forEach(door -> door.openCloseMe(open)); } - /** - * Gets the grade of clan hall. - * @return grade of this {@link ClanHall} in {@link ClanHallGrade} enum. - */ - public ClanHallGrade getGrade() - { - return _grade; - } - /** * Gets all {@link Door} related to this {@link ClanHall}. * @return all {@link Door} related to this {@link ClanHall} diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java index 30ce58da60..6919f6913e 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/network/serverpackets/AgitDecoInfo.java @@ -17,12 +17,14 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.commons.network.PacketWriter; +import org.l2jmobius.gameserver.enums.ClanHallGrade; import org.l2jmobius.gameserver.model.residences.AbstractResidence; +import org.l2jmobius.gameserver.model.residences.ResidenceFunction; import org.l2jmobius.gameserver.model.residences.ResidenceFunctionType; import org.l2jmobius.gameserver.network.OutgoingPackets; /** - * @author Steuf, UnAfraid + * @author Steuf */ public class AgitDecoInfo implements IClientOutgoingPacket { @@ -38,20 +40,151 @@ public class AgitDecoInfo implements IClientOutgoingPacket { OutgoingPackets.AGIT_DECO_INFO.writeId(packet); packet.writeD(_residense.getResidenceId()); - for (ResidenceFunctionType type : ResidenceFunctionType.values()) + // Fireplace + ResidenceFunction function = _residense.getFunction(ResidenceFunctionType.HP_REGEN); + if ((function == null) || (function.getLevel() == 0)) { - if (type == ResidenceFunctionType.NONE) - { - continue; - } - packet.writeC(_residense.hasFunction(type) ? 1 : 0); + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 5))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Carpet - Statue + function = _residense.getFunction(ResidenceFunctionType.MP_REGEN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + packet.writeC(0); + } + else if ((((_residense.getGrade() == ClanHallGrade.GRADE_NONE) || (_residense.getGrade() == ClanHallGrade.GRADE_D)) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 3)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 4))) + { + packet.writeC(1); + packet.writeC(1); + } + else + { + packet.writeC(2); + packet.writeC(2); + } + // Chandelier + function = _residense.getFunction(ResidenceFunctionType.EXP_RESTORE); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Mirror + function = _residense.getFunction(ResidenceFunctionType.TELEPORT); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Crystal + packet.writeC(0); + // Curtain + function = _residense.getFunction(ResidenceFunctionType.CURTAIN); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Magic Curtain + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Support + function = _residense.getFunction(ResidenceFunctionType.BUFF); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || ((_residense.getGrade() == ClanHallGrade.GRADE_D) && (function.getLevel() < 4)) || ((_residense.getGrade() == ClanHallGrade.GRADE_C) && (function.getLevel() < 5)) || ((_residense.getGrade() == ClanHallGrade.GRADE_B) && (function.getLevel() < 8))) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Flag + function = _residense.getFunction(ResidenceFunctionType.OUTERFLAG); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Front platform + function = _residense.getFunction(ResidenceFunctionType.PLATFORM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (function.getLevel() < 2) + { + packet.writeC(1); + } + else + { + packet.writeC(2); + } + // Item create? + function = _residense.getFunction(ResidenceFunctionType.ITEM); + if ((function == null) || (function.getLevel() == 0)) + { + packet.writeC(0); + } + else if (((_residense.getGrade() == ClanHallGrade.GRADE_NONE) && (function.getLevel() < 2)) || (function.getLevel() < 3)) + { + packet.writeC(1); + } + else + { + packet.writeC(2); } - // Unknown - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! - packet.writeD(0); // TODO: Find me! return true; } -} +} \ No newline at end of file