Updated AgitDecoInfo packet.

This commit is contained in:
MobiusDevelopment
2022-07-11 12:24:11 +00:00
parent f632005ccd
commit 3617418be1
98 changed files with 4035 additions and 998 deletions

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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())));
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}
}

View File

@@ -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()))

View File

@@ -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),

View File

@@ -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;
}

View File

@@ -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;
}
}

View File

@@ -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())));
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}
}

View File

@@ -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()))

View File

@@ -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),

View File

@@ -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;
}

View File

@@ -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;
}
}

View File

@@ -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 = "[<a action=\"bypass -h npc_%objectId%_manage recovery edit_mp 5\">5%</a>][<a action=\"bypass -h npc_%objectId%_manage recovery edit_mp 15\">15%</a>][<a action=\"bypass -h npc_%objectId%_manage recovery edit_mp 30\">30%</a>][<a action=\"bypass -h npc_%objectId%_manage recovery edit_mp 40\">40%</a>]";
if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP) != null)
{
html.replace("%hp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLvl() + "%</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLease() + "</font>Adena /" + (Config.CH_HPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%hp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLevel() + "%</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLease() + "</font>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() + "%</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLease() + "</font>Adena /" + (Config.CH_EXPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%exp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel() + "%</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLease() + "</font>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() + "%</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLease() + "</font>Adena /" + (Config.CH_MPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%mp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLevel() + "%</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLease() + "</font>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 = "[<a action=\"bypass -h npc_%objectId%_manage other edit_item 1\">Level 1</a>][<a action=\"bypass -h npc_%objectId%_manage other edit_item 2\">Level 2</a>][<a action=\"bypass -h npc_%objectId%_manage other edit_item 3\">Level 3</a>]";
if (getClanHall().getFunction(ClanHall.FUNC_TELEPORT) != null)
{
html.replace("%tele%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLvl() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLease() + "</font>Adena /" + (Config.CH_TELE_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%tele%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLevel() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLease() + "</font>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%", "[<a action=\"bypass -h npc_%objectId%_manage other tele_cancel\">Deactivate</a>]" + 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() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLease() + "</font>Adena /" + (Config.CH_SUPPORT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%support%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLease() + "</font>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() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLease() + "</font>Adena /" + (Config.CH_ITEM_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%item%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLevel() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLease() + "</font>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%", "[<a action=\"bypass -h npc_%objectId%_manage other item_cancel\">Deactivate</a>]" + 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 = "[<a action=\"bypass -h npc_%objectId%_manage deco edit_fixtures 1\">Level 1</a>][<a action=\"bypass -h npc_%objectId%_manage deco edit_fixtures 2\">Level 2</a>]";
if (getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS) != null)
{
html.replace("%curtain%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLvl() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLease() + "</font>Adena /" + (Config.CH_CURTAIN_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%curtain%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLevel() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLease() + "</font>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%", "[<a action=\"bypass -h npc_%objectId%_manage deco curtains_cancel\">Deactivate</a>]" + 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() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLease() + "</font>Adena /" + (Config.CH_FRONT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%fixture%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLevel() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLease() + "</font>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%", "[<a action=\"bypass -h npc_%objectId%_manage deco fixtures_cancel\">Deactivate</a>]" + 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;

View File

@@ -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;

View File

@@ -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);
}
}
}

View File

@@ -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;
}

View File

@@ -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;
}
}

View File

@@ -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 = "[<a action=\"bypass -h npc_%objectId%_manage recovery edit_mp 5\">5%</a>][<a action=\"bypass -h npc_%objectId%_manage recovery edit_mp 15\">15%</a>][<a action=\"bypass -h npc_%objectId%_manage recovery edit_mp 30\">30%</a>][<a action=\"bypass -h npc_%objectId%_manage recovery edit_mp 40\">40%</a>]";
if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP) != null)
{
html.replace("%hp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLvl() + "%</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLease() + "</font>Adena /" + (Config.CH_HPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%hp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLevel() + "%</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLease() + "</font>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() + "%</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLease() + "</font>Adena /" + (Config.CH_EXPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%exp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel() + "%</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLease() + "</font>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() + "%</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLease() + "</font>Adena /" + (Config.CH_MPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%mp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLevel() + "%</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLease() + "</font>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 = "[<a action=\"bypass -h npc_%objectId%_manage other edit_item 1\">Level 1</a>][<a action=\"bypass -h npc_%objectId%_manage other edit_item 2\">Level 2</a>][<a action=\"bypass -h npc_%objectId%_manage other edit_item 3\">Level 3</a>]";
if (getClanHall().getFunction(ClanHall.FUNC_TELEPORT) != null)
{
html.replace("%tele%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLvl() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLease() + "</font>Adena /" + (Config.CH_TELE_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%tele%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLevel() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLease() + "</font>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%", "[<a action=\"bypass -h npc_%objectId%_manage other tele_cancel\">Deactivate</a>]" + 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() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLease() + "</font>Adena /" + (Config.CH_SUPPORT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%support%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLease() + "</font>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() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLease() + "</font>Adena /" + (Config.CH_ITEM_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%item%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLevel() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLease() + "</font>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%", "[<a action=\"bypass -h npc_%objectId%_manage other item_cancel\">Deactivate</a>]" + 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 = "[<a action=\"bypass -h npc_%objectId%_manage deco edit_fixtures 1\">Level 1</a>][<a action=\"bypass -h npc_%objectId%_manage deco edit_fixtures 2\">Level 2</a>]";
if (getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS) != null)
{
html.replace("%curtain%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLvl() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLease() + "</font>Adena /" + (Config.CH_CURTAIN_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%curtain%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLevel() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLease() + "</font>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%", "[<a action=\"bypass -h npc_%objectId%_manage deco curtains_cancel\">Deactivate</a>]" + 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() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLease() + "</font>Adena /" + (Config.CH_FRONT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%fixture%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLevel() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLease() + "</font>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%", "[<a action=\"bypass -h npc_%objectId%_manage deco fixtures_cancel\">Deactivate</a>]" + 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;

View File

@@ -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;

View File

@@ -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);
}
}
}

View File

@@ -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;
}

View File

@@ -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;
}
}

View File

@@ -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 = "[<a action=\"bypass -h npc_%objectId%_manage recovery edit_mp 5\">5%</a>][<a action=\"bypass -h npc_%objectId%_manage recovery edit_mp 15\">15%</a>][<a action=\"bypass -h npc_%objectId%_manage recovery edit_mp 30\">30%</a>][<a action=\"bypass -h npc_%objectId%_manage recovery edit_mp 40\">40%</a>]";
if (getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP) != null)
{
html.replace("%hp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLvl() + "%</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLease() + "</font>Adena /" + (Config.CH_HPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%hp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLevel() + "%</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_HP).getLease() + "</font>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() + "%</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLease() + "</font>Adena /" + (Config.CH_EXPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%exp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLevel() + "%</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_EXP).getLease() + "</font>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() + "%</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLease() + "</font>Adena /" + (Config.CH_MPREG_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%mp_recovery%", getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLevel() + "%</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_RESTORE_MP).getLease() + "</font>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 = "[<a action=\"bypass -h npc_%objectId%_manage other edit_item 1\">Level 1</a>][<a action=\"bypass -h npc_%objectId%_manage other edit_item 2\">Level 2</a>][<a action=\"bypass -h npc_%objectId%_manage other edit_item 3\">Level 3</a>]";
if (getClanHall().getFunction(ClanHall.FUNC_TELEPORT) != null)
{
html.replace("%tele%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLvl() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLease() + "</font>Adena /" + (Config.CH_TELE_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%tele%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLevel() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_TELEPORT).getLease() + "</font>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%", "[<a action=\"bypass -h npc_%objectId%_manage other tele_cancel\">Deactivate</a>]" + 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() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLease() + "</font>Adena /" + (Config.CH_SUPPORT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%support%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLevel() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_SUPPORT).getLease() + "</font>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() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLease() + "</font>Adena /" + (Config.CH_ITEM_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%item%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLevel() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_ITEM_CREATE).getLease() + "</font>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%", "[<a action=\"bypass -h npc_%objectId%_manage other item_cancel\">Deactivate</a>]" + 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 = "[<a action=\"bypass -h npc_%objectId%_manage deco edit_fixtures 1\">Level 1</a>][<a action=\"bypass -h npc_%objectId%_manage deco edit_fixtures 2\">Level 2</a>]";
if (getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS) != null)
{
html.replace("%curtain%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLvl() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLease() + "</font>Adena /" + (Config.CH_CURTAIN_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%curtain%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLevel() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_DECO_CURTAINS).getLease() + "</font>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%", "[<a action=\"bypass -h npc_%objectId%_manage deco curtains_cancel\">Deactivate</a>]" + 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() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLease() + "</font>Adena /" + (Config.CH_FRONT_FEE_RATIO / 1000 / 60 / 60 / 24) + " Day)");
html.replace("%fixture%", "Stage " + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLevel() + "</font> (<font color=\"FFAABB\">" + getClanHall().getFunction(ClanHall.FUNC_DECO_FRONTPLATEFORM).getLease() + "</font>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%", "[<a action=\"bypass -h npc_%objectId%_manage deco fixtures_cancel\">Deactivate</a>]" + 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;

View File

@@ -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;

View File

@@ -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);
}
}
}

View File

@@ -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;
}

View File

@@ -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;
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}

View File

@@ -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<Integer, ResidenceFunction> _functions = new ConcurrentHashMap<>();
private List<SkillLearn> _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;

View File

@@ -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}

View File

@@ -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;
}
}
}