Replaced unnecessary hexadecimal values with decimals and cleanup.

This commit is contained in:
MobiusDevelopment
2021-12-20 07:28:35 +00:00
parent ec58360479
commit 6959aa53a8
10366 changed files with 15725 additions and 36368 deletions

View File

@@ -529,7 +529,7 @@ public class Lindvior extends AbstractNpcAI
for (Location loc : CONTROL_GENERATOR_SPAWNS) for (Location loc : CONTROL_GENERATOR_SPAWNS)
{ {
guard = (FriendlyNpc) addSpawn(NPC_GENERATOR, loc, true); guard = (FriendlyNpc) addSpawn(NPC_GENERATOR, loc, true);
guard.setDisplayEffect(0x01); guard.setDisplayEffect(1);
guard.setScriptValue(i++); guard.setScriptValue(i++);
_generatorSpawn.add(guard); _generatorSpawn.add(guard);
} }
@@ -685,7 +685,7 @@ public class Lindvior extends AbstractNpcAI
if (!hasFlag(_activeMask, 1 << index)) if (!hasFlag(_activeMask, 1 << index))
{ {
_activeMask |= 1 << index; _activeMask |= 1 << index;
npc.setDisplayEffect(0x02); npc.setDisplayEffect(2);
sendEventTrigger(true, GENERATOR_TRIGERS[index]); sendEventTrigger(true, GENERATOR_TRIGERS[index]);
_zoneLair.getPlayersInside().stream().forEach(p -> p.broadcastPacket(new Earthquake(p.getX(), p.getY(), p.getZ(), 20, 10))); _zoneLair.getPlayersInside().stream().forEach(p -> p.broadcastPacket(new Earthquake(p.getX(), p.getY(), p.getZ(), 20, 10)));
if (hasFlag(_activeMask, 0xf)) if (hasFlag(_activeMask, 0xf))

View File

@@ -73,7 +73,7 @@ public abstract class BaseRecievePacket
try try
{ {
result = new String(_decrypt, _off, _decrypt.length - _off, StandardCharsets.UTF_16LE); result = new String(_decrypt, _off, _decrypt.length - _off, StandardCharsets.UTF_16LE);
result = result.substring(0, result.indexOf(0x00)); result = result.substring(0, result.indexOf(0));
_off += (result.length() * 2) + 2; _off += (result.length() * 2) + 2;
} }
catch (Exception e) catch (Exception e)

View File

@@ -117,16 +117,16 @@ public abstract class BaseSendablePacket
public byte[] getBytes() public byte[] getBytes()
{ {
// if (this instanceof Init) // if (this instanceof Init)
// writeD(0x00); // reserve for XOR initial key // writeD(0); // reserve for XOR initial key
writeD(0x00); // reserve for checksum writeD(0); // reserve for checksum
final int padding = _bao.size() % 8; final int padding = _bao.size() % 8;
if (padding != 0) if (padding != 0)
{ {
for (int i = padding; i < 8; i++) for (int i = padding; i < 8; i++)
{ {
writeC(0x00); writeC(0);
} }
} }

View File

@@ -21,10 +21,10 @@ package org.l2jmobius.gameserver.enums;
*/ */
public enum AttackType public enum AttackType
{ {
MISSED(0x01), MISSED(1),
BLOCKED(0x02), BLOCKED(2),
CRITICAL(0x04), CRITICAL(4),
SHOT_USED(0x08); SHOT_USED(8);
private final int _mask; private final int _mask;

View File

@@ -23,9 +23,9 @@ import org.l2jmobius.gameserver.model.interfaces.IUpdateTypeComponent;
*/ */
public enum GroupType implements IUpdateTypeComponent public enum GroupType implements IUpdateTypeComponent
{ {
NONE(0x01), NONE(1),
PARTY(0x02), PARTY(2),
COMMAND_CHANNEL(0x04); COMMAND_CHANNEL(4);
private int _mask; private int _mask;

View File

@@ -23,11 +23,11 @@ import org.l2jmobius.gameserver.model.interfaces.IUpdateTypeComponent;
*/ */
public enum ItemListType implements IUpdateTypeComponent public enum ItemListType implements IUpdateTypeComponent
{ {
AUGMENT_BONUS(0x01), AUGMENT_BONUS(1),
ELEMENTAL_ATTRIBUTE(0x02), ELEMENTAL_ATTRIBUTE(2),
ENCHANT_EFFECT(0x04), ENCHANT_EFFECT(4),
VISUAL_ID(0x08), VISUAL_ID(8),
SOUL_CRYSTAL(0x10); SOUL_CRYSTAL(16);
private final int _mask; private final int _mask;

View File

@@ -21,10 +21,10 @@ package org.l2jmobius.gameserver.enums;
*/ */
public enum MacroUpdateType public enum MacroUpdateType
{ {
ADD(0x01), ADD(1),
LIST(0x01), LIST(1),
MODIFY(0x02), MODIFY(2),
DELETE(0x00); DELETE(0);
private final int _id; private final int _id;

View File

@@ -23,16 +23,16 @@ import org.l2jmobius.gameserver.model.interfaces.IUpdateTypeComponent;
*/ */
public enum PartySmallWindowUpdateType implements IUpdateTypeComponent public enum PartySmallWindowUpdateType implements IUpdateTypeComponent
{ {
CURRENT_CP(0x01), CURRENT_CP(1),
MAX_CP(0x02), MAX_CP(2),
CURRENT_HP(0x04), CURRENT_HP(4),
MAX_HP(0x08), MAX_HP(8),
CURRENT_MP(0x10), CURRENT_MP(16),
MAX_MP(0x20), MAX_MP(32),
LEVEL(0x40), LEVEL(64),
CLASS_ID(0x80), CLASS_ID(128),
PARTY_SUBSTITUTE(0x100), PARTY_SUBSTITUTE(256),
VITALITY_POINTS(0x200); VITALITY_POINTS(512);
private final int _mask; private final int _mask;

View File

@@ -29,7 +29,7 @@ import org.l2jmobius.gameserver.util.Broadcast;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
/** /**
* Fromat:(ch) dddddc * Format:(ch) dddddc
* @author -Wooden- * @author -Wooden-
*/ */
public class RequestExMagicSkillUseGround implements IClientIncomingPacket public class RequestExMagicSkillUseGround implements IClientIncomingPacket

View File

@@ -39,7 +39,6 @@ public class AbnormalStatusUpdate implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.ABNORMAL_STATUS_UPDATE.writeId(packet); OutgoingPackets.ABNORMAL_STATUS_UPDATE.writeId(packet);
packet.writeH(_effects.size()); packet.writeH(_effects.size());
for (BuffInfo info : _effects) for (BuffInfo info : _effects)
{ {

View File

@@ -44,7 +44,6 @@ public abstract class AbstractHtmlPacket implements IClientOutgoingPacket
{ {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
_npcObjId = npcObjId; _npcObjId = npcObjId;
} }
@@ -60,7 +59,6 @@ public abstract class AbstractHtmlPacket implements IClientOutgoingPacket
{ {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
_npcObjId = npcObjId; _npcObjId = npcObjId;
setHtml(html); setHtml(html);
} }
@@ -77,13 +75,11 @@ public abstract class AbstractHtmlPacket implements IClientOutgoingPacket
PacketLogger.warning(getClass().getSimpleName() + ": Html is too long! this will crash the client!"); PacketLogger.warning(getClass().getSimpleName() + ": Html is too long! this will crash the client!");
_html = html.substring(0, 17200); _html = html.substring(0, 17200);
} }
if (!html.contains("<html") && !html.startsWith("..\\L2")) if (!html.contains("<html") && !html.startsWith("..\\L2"))
{ {
_html = "<html><body>" + html + "</body></html>"; _html = "<html><body>" + html + "</body></html>";
return; return;
} }
_html = html; _html = html;
} }
@@ -96,7 +92,6 @@ public abstract class AbstractHtmlPacket implements IClientOutgoingPacket
PacketLogger.warning(getClass().getSimpleName() + ": Missing html page " + path); PacketLogger.warning(getClass().getSimpleName() + ": Missing html page " + path);
return false; return false;
} }
setHtml(content); setHtml(content);
return true; return true;
} }
@@ -138,12 +133,10 @@ public abstract class AbstractHtmlPacket implements IClientOutgoingPacket
{ {
player.clearHtmlActions(getScope()); player.clearHtmlActions(getScope());
} }
if (_disabledValidation) if (_disabledValidation)
{ {
return; return;
} }
if (player != null) if (player != null)
{ {
Util.buildHtmlActionCache(player, getScope(), _npcObjId, _html); Util.buildHtmlActionCache(player, getScope(), _npcObjId, _html);

View File

@@ -72,7 +72,7 @@ public abstract class AbstractItemPacket extends AbstractMaskPacket<ItemListType
packet.writeC(item.getCustomType1()); // Filler (always 0) packet.writeC(item.getCustomType1()); // Filler (always 0)
packet.writeQ(item.getItem().getBodyPart()); // Slot : 0006-lr.ear, 0008-neck, 0030-lr.finger, 0040-head, 0100-l.hand, 0200-gloves, 0400-chest, 0800-pants, 1000-feet, 4000-r.hand, 8000-r.hand packet.writeQ(item.getItem().getBodyPart()); // Slot : 0006-lr.ear, 0008-neck, 0030-lr.finger, 0040-head, 0100-l.hand, 0200-gloves, 0400-chest, 0800-pants, 1000-feet, 4000-r.hand, 8000-r.hand
packet.writeH(item.getEnchant()); // Enchant level (pet level shown in control item) packet.writeH(item.getEnchant()); // Enchant level (pet level shown in control item)
packet.writeH(0x00); // Equipped : 00-No, 01-yes packet.writeH(0); // Equipped : 00-No, 01-yes
packet.writeH(item.getCustomType2()); packet.writeH(item.getCustomType2());
writeItemElementalAndEnchant(packet, new ItemInfo(item)); writeItemElementalAndEnchant(packet, new ItemInfo(item));
} }
@@ -120,12 +120,10 @@ public abstract class AbstractItemPacket extends AbstractMaskPacket<ItemListType
{ {
mask |= ItemListType.AUGMENT_BONUS.getMask(); mask |= ItemListType.AUGMENT_BONUS.getMask();
} }
if ((item.getAttackElementType() >= 0) || (item.getAttributeDefence(AttributeType.FIRE) > 0) || (item.getAttributeDefence(AttributeType.WATER) > 0) || (item.getAttributeDefence(AttributeType.WIND) > 0) || (item.getAttributeDefence(AttributeType.EARTH) > 0) || (item.getAttributeDefence(AttributeType.HOLY) > 0) || (item.getAttributeDefence(AttributeType.DARK) > 0)) if ((item.getAttackElementType() >= 0) || (item.getAttributeDefence(AttributeType.FIRE) > 0) || (item.getAttributeDefence(AttributeType.WATER) > 0) || (item.getAttributeDefence(AttributeType.WIND) > 0) || (item.getAttributeDefence(AttributeType.EARTH) > 0) || (item.getAttributeDefence(AttributeType.HOLY) > 0) || (item.getAttributeDefence(AttributeType.DARK) > 0))
{ {
mask |= ItemListType.ELEMENTAL_ATTRIBUTE.getMask(); mask |= ItemListType.ELEMENTAL_ATTRIBUTE.getMask();
} }
if (item.getEnchantOptions() != null) if (item.getEnchantOptions() != null)
{ {
for (int id : item.getEnchantOptions()) for (int id : item.getEnchantOptions())
@@ -137,7 +135,6 @@ public abstract class AbstractItemPacket extends AbstractMaskPacket<ItemListType
} }
} }
} }
if (item.getVisualId() > 0) if (item.getVisualId() > 0)
{ {
mask |= ItemListType.VISUAL_ID.getMask(); mask |= ItemListType.VISUAL_ID.getMask();
@@ -213,7 +210,7 @@ public abstract class AbstractItemPacket extends AbstractMaskPacket<ItemListType
} }
else else
{ {
packet.writeH(0x00); packet.writeH(0);
} }
} }

View File

@@ -113,7 +113,6 @@ public class AcquireSkillInfo implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.ACQUIRE_SKILL_INFO.writeId(packet); OutgoingPackets.ACQUIRE_SKILL_INFO.writeId(packet);
packet.writeD(_id); packet.writeD(_id);
packet.writeD(_level); packet.writeD(_level);
packet.writeQ(_spCost); packet.writeQ(_spCost);

View File

@@ -55,7 +55,6 @@ public class AcquireSkillList implements IClientOutgoingPacket
} }
OutgoingPackets.ACQUIRE_SKILL_LIST.writeId(packet); OutgoingPackets.ACQUIRE_SKILL_LIST.writeId(packet);
packet.writeH(_learnable.size()); packet.writeH(_learnable.size());
for (SkillLearn skill : _learnable) for (SkillLearn skill : _learnable)
{ {
@@ -70,7 +69,6 @@ public class AcquireSkillList implements IClientOutgoingPacket
packet.writeD(item.getId()); packet.writeD(item.getId());
packet.writeQ(item.getCount()); packet.writeQ(item.getCount());
} }
final Collection<Skill> skillRem = skill.getRemoveSkills().stream().map(_player::getKnownSkill).filter(Objects::nonNull).collect(Collectors.toList()); final Collection<Skill> skillRem = skill.getRemoveSkills().stream().map(_player::getKnownSkill).filter(Objects::nonNull).collect(Collectors.toList());
packet.writeC(skillRem.size()); packet.writeC(skillRem.size());
for (Skill skillRemove : skillRem) for (Skill skillRemove : skillRem)

View File

@@ -26,8 +26,8 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class ActionFailed implements IClientOutgoingPacket public class ActionFailed implements IClientOutgoingPacket
{ {
public static final ActionFailed STATIC_PACKET = new ActionFailed(); public static final ActionFailed STATIC_PACKET = new ActionFailed();
private static final Map<SkillCastingType, ActionFailed> STATIC_PACKET_BY_CASTING_TYPE = new EnumMap<>(SkillCastingType.class);
private static final Map<SkillCastingType, ActionFailed> STATIC_PACKET_BY_CASTING_TYPE = new EnumMap<>(SkillCastingType.class);
static static
{ {
for (SkillCastingType castingType : SkillCastingType.values()) for (SkillCastingType castingType : SkillCastingType.values())
@@ -57,7 +57,6 @@ public class ActionFailed implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.ACTION_FAIL.writeId(packet); OutgoingPackets.ACTION_FAIL.writeId(packet);
packet.writeD(_castingType); // MagicSkillUse castingType packet.writeD(_castingType); // MagicSkillUse castingType
return true; return true;
} }

View File

@@ -44,9 +44,8 @@ public class AgitDecoInfo implements IClientOutgoingPacket
{ {
continue; continue;
} }
packet.writeC(_residense.hasFunction(type) ? 0x01 : 0x00); packet.writeC(_residense.hasFunction(type) ? 1 : 0);
} }
// Unknown // 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!

View File

@@ -44,7 +44,6 @@ public class AllianceInfo implements IClientOutgoingPacket
_name = leader.getAllyName(); _name = leader.getAllyName();
_leaderC = leader.getName(); _leaderC = leader.getName();
_leaderP = leader.getLeaderName(); _leaderP = leader.getLeaderName();
final Collection<Clan> allies = ClanTable.getInstance().getClanAllies(allianceId); final Collection<Clan> allies = ClanTable.getInstance().getClanAllies(allianceId);
_allies = new ClanInfo[allies.size()]; _allies = new ClanInfo[allies.size()];
int idx = 0; int idx = 0;
@@ -57,7 +56,6 @@ public class AllianceInfo implements IClientOutgoingPacket
total += ci.getTotal(); total += ci.getTotal();
online += ci.getOnline(); online += ci.getOnline();
} }
_total = total; _total = total;
_online = online; _online = online;
} }
@@ -66,18 +64,16 @@ public class AllianceInfo implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.ALLIANCE_INFO.writeId(packet); OutgoingPackets.ALLIANCE_INFO.writeId(packet);
packet.writeS(_name); packet.writeS(_name);
packet.writeD(_total); packet.writeD(_total);
packet.writeD(_online); packet.writeD(_online);
packet.writeS(_leaderC); packet.writeS(_leaderC);
packet.writeS(_leaderP); packet.writeS(_leaderP);
packet.writeD(_allies.length); packet.writeD(_allies.length);
for (ClanInfo aci : _allies) for (ClanInfo aci : _allies)
{ {
packet.writeS(aci.getClan().getName()); packet.writeS(aci.getClan().getName());
packet.writeD(0x00); packet.writeD(0);
packet.writeD(aci.getClan().getLevel()); packet.writeD(aci.getClan().getLevel());
packet.writeS(aci.getClan().getLeaderName()); packet.writeS(aci.getClan().getLeaderName());
packet.writeD(aci.getTotal()); packet.writeD(aci.getTotal());

View File

@@ -44,7 +44,6 @@ public class AllyCrest implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.ALLIANCE_CREST.writeId(packet); OutgoingPackets.ALLIANCE_CREST.writeId(packet);
packet.writeD(Config.SERVER_ID); packet.writeD(Config.SERVER_ID);
packet.writeD(_crestId); packet.writeD(_crestId);
if (_data != null) if (_data != null)

View File

@@ -38,7 +38,6 @@ public class AskJoinAlly implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.ASK_JOIN_ALLIANCE.writeId(packet); OutgoingPackets.ASK_JOIN_ALLIANCE.writeId(packet);
packet.writeD(_requestorObjId); packet.writeD(_requestorObjId);
packet.writeS(null); // Ally Name ? packet.writeS(null); // Ally Name ?
packet.writeS(null); // TODO: Find me! packet.writeS(null); // TODO: Find me!

View File

@@ -39,7 +39,6 @@ public class AskJoinParty implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.ASK_JOIN_PARTY.writeId(packet); OutgoingPackets.ASK_JOIN_PARTY.writeId(packet);
packet.writeS(_requestorName); packet.writeS(_requestorName);
packet.writeD(_partyDistributionType.getId()); packet.writeD(_partyDistributionType.getId());
return true; return true;

View File

@@ -45,7 +45,6 @@ public class Attack implements IClientOutgoingPacket
_attackerObjId = attacker.getObjectId(); _attackerObjId = attacker.getObjectId();
_attackerLoc = new Location(attacker); _attackerLoc = new Location(attacker);
_targetLoc = new Location(target); _targetLoc = new Location(target);
final Player player = attacker.getActingPlayer(); final Player player = attacker.getActingPlayer();
if (player == null) if (player == null)
{ {
@@ -111,7 +110,6 @@ public class Attack implements IClientOutgoingPacket
final Iterator<Hit> it = _hits.iterator(); final Iterator<Hit> it = _hits.iterator();
final Hit firstHit = it.next(); final Hit firstHit = it.next();
OutgoingPackets.ATTACK.writeId(packet); OutgoingPackets.ATTACK.writeId(packet);
packet.writeD(_attackerObjId); packet.writeD(_attackerObjId);
packet.writeD(firstHit.getTargetId()); packet.writeD(firstHit.getTargetId());
packet.writeD(_soulshotVisualSubstitute); // Ertheia packet.writeD(_soulshotVisualSubstitute); // Ertheia
@@ -121,13 +119,11 @@ public class Attack implements IClientOutgoingPacket
packet.writeD(_attackerLoc.getX()); packet.writeD(_attackerLoc.getX());
packet.writeD(_attackerLoc.getY()); packet.writeD(_attackerLoc.getY());
packet.writeD(_attackerLoc.getZ()); packet.writeD(_attackerLoc.getZ());
packet.writeH(_hits.size() - 1); packet.writeH(_hits.size() - 1);
while (it.hasNext()) while (it.hasNext())
{ {
writeHit(packet, it.next()); writeHit(packet, it.next());
} }
packet.writeD(_targetLoc.getX()); packet.writeD(_targetLoc.getX());
packet.writeD(_targetLoc.getY()); packet.writeD(_targetLoc.getY());
packet.writeD(_targetLoc.getZ()); packet.writeD(_targetLoc.getZ());

View File

@@ -35,7 +35,6 @@ public class AutoAttackStart implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.AUTO_ATTACK_START.writeId(packet); OutgoingPackets.AUTO_ATTACK_START.writeId(packet);
packet.writeD(_targetObjId); packet.writeD(_targetObjId);
return true; return true;
} }

View File

@@ -35,7 +35,6 @@ public class AutoAttackStop implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.AUTO_ATTACK_STOP.writeId(packet); OutgoingPackets.AUTO_ATTACK_STOP.writeId(packet);
packet.writeD(_targetObjId); packet.writeD(_targetObjId);
return true; return true;
} }

View File

@@ -38,7 +38,6 @@ public class BlockListPacket implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.BLOCK_LIST.writeId(packet); OutgoingPackets.BLOCK_LIST.writeId(packet);
packet.writeD(_playersId.size()); packet.writeD(_playersId.size());
for (int playerId : _playersId) for (int playerId : _playersId)
{ {

View File

@@ -45,8 +45,7 @@ public class BuyList extends AbstractItemPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_BUY_SELL_LIST.writeId(packet); OutgoingPackets.EX_BUY_SELL_LIST.writeId(packet);
packet.writeD(0); // Type BUY
packet.writeD(0x00); // Type BUY
packet.writeQ(_money); // current money packet.writeQ(_money); // current money
packet.writeD(_listId); packet.writeD(_listId);
packet.writeD(_inventorySlots); packet.writeD(_inventorySlots);

View File

@@ -50,36 +50,34 @@ public class BuyListSeed implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.BUY_LIST_SEED.writeId(packet); OutgoingPackets.BUY_LIST_SEED.writeId(packet);
packet.writeQ(_money); // current money packet.writeQ(_money); // current money
packet.writeD(0x00); // TODO: Find me! packet.writeD(0); // TODO: Find me!
packet.writeD(_manorId); // manor id packet.writeD(_manorId); // manor id
if (!_list.isEmpty()) if (!_list.isEmpty())
{ {
packet.writeH(_list.size()); // list length packet.writeH(_list.size()); // list length
for (SeedProduction s : _list) for (SeedProduction s : _list)
{ {
packet.writeC(0x00); // mask item 0 to print minimal item information packet.writeC(0); // mask item 0 to print minimal item information
packet.writeD(s.getId()); // ObjectId packet.writeD(s.getId()); // ObjectId
packet.writeD(s.getId()); // ItemId packet.writeD(s.getId()); // ItemId
packet.writeC(0xFF); // T1 packet.writeC(0xFF); // T1
packet.writeQ(s.getAmount()); // Quantity packet.writeQ(s.getAmount()); // Quantity
packet.writeC(0x05); // Item Type 2 : 00-weapon, 01-shield/armor, 02-ring/earring/necklace, 03-questitem, 04-adena, 05-item packet.writeC(5); // Item Type 2 : 00-weapon, 01-shield/armor, 02-ring/earring/necklace, 03-questitem, 04-adena, 05-item
packet.writeC(0x00); // Filler (always 0) packet.writeC(0); // Filler (always 0)
packet.writeH(0x00); // Equipped : 00-No, 01-yes packet.writeH(0); // Equipped : 00-No, 01-yes
packet.writeQ(0x00); // Slot : 0006-lr.ear, 0008-neck, 0030-lr.finger, 0040-head, 0100-l.hand, 0200-gloves, 0400-chest, 0800-pants, 1000-feet, 4000-r.hand, 8000-r.hand packet.writeQ(0); // Slot : 0006-lr.ear, 0008-neck, 0030-lr.finger, 0040-head, 0100-l.hand, 0200-gloves, 0400-chest, 0800-pants, 1000-feet, 4000-r.hand, 8000-r.hand
packet.writeH(0x00); // Enchant level (pet level shown in control item) packet.writeH(0); // Enchant level (pet level shown in control item)
packet.writeD(-1); packet.writeD(-1);
packet.writeD(-9999); packet.writeD(-9999);
packet.writeC(0x01); // GOD Item enabled = 1 disabled (red) = 0 packet.writeC(1); // GOD Item enabled = 1 disabled (red) = 0
packet.writeQ(s.getPrice()); // price packet.writeQ(s.getPrice()); // price
} }
_list.clear(); _list.clear();
} }
else else
{ {
packet.writeH(0x00); packet.writeH(0);
} }
return true; return true;
} }

View File

@@ -32,8 +32,7 @@ public class CSShowComBoard implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.SHOW_BOARD.writeId(packet); OutgoingPackets.SHOW_BOARD.writeId(packet);
packet.writeC(1); // c4 1 to show community 00 to hide
packet.writeC(0x01); // c4 1 to show community 00 to hide
packet.writeB(_html); packet.writeB(_html);
return true; return true;
} }

View File

@@ -36,7 +36,6 @@ public class CameraMode implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.CAMERA_MODE.writeId(packet); OutgoingPackets.CAMERA_MODE.writeId(packet);
packet.writeD(_mode); packet.writeD(_mode);
return true; return true;
} }

View File

@@ -39,7 +39,6 @@ public class ChairSit implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.CHAIR_SIT.writeId(packet); OutgoingPackets.CHAIR_SIT.writeId(packet);
packet.writeD(_player.getObjectId()); packet.writeD(_player.getObjectId());
packet.writeD(_staticObjectId); packet.writeD(_staticObjectId);
return true; return true;

View File

@@ -38,7 +38,6 @@ public class ChangeMoveType implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.CHANGE_MOVE_TYPE.writeId(packet); OutgoingPackets.CHANGE_MOVE_TYPE.writeId(packet);
packet.writeD(_objectId); packet.writeD(_objectId);
packet.writeD(_running ? RUN : WALK); packet.writeD(_running ? RUN : WALK);
packet.writeD(0); // c2 packet.writeD(0); // c2

View File

@@ -22,17 +22,17 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class ChangeWaitType implements IClientOutgoingPacket public class ChangeWaitType implements IClientOutgoingPacket
{ {
public static final int WT_SITTING = 0;
public static final int WT_STANDING = 1;
public static final int WT_START_FAKEDEATH = 2;
public static final int WT_STOP_FAKEDEATH = 3;
private final int _objectId; private final int _objectId;
private final int _moveType; private final int _moveType;
private final int _x; private final int _x;
private final int _y; private final int _y;
private final int _z; private final int _z;
public static final int WT_SITTING = 0;
public static final int WT_STANDING = 1;
public static final int WT_START_FAKEDEATH = 2;
public static final int WT_STOP_FAKEDEATH = 3;
public ChangeWaitType(Creature creature, int newMoveType) public ChangeWaitType(Creature creature, int newMoveType)
{ {
_objectId = creature.getObjectId(); _objectId = creature.getObjectId();
@@ -46,7 +46,6 @@ public class ChangeWaitType implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.CHANGE_WAIT_TYPE.writeId(packet); OutgoingPackets.CHANGE_WAIT_TYPE.writeId(packet);
packet.writeD(_objectId); packet.writeD(_objectId);
packet.writeD(_moveType); packet.writeD(_moveType);
packet.writeD(_x); packet.writeD(_x);

View File

@@ -30,7 +30,6 @@ public class CharCreateFail implements IClientOutgoingPacket
public static final int REASON_CREATE_NOT_ALLOWED = 0x05; // "Characters cannot be created from this server." public static final int REASON_CREATE_NOT_ALLOWED = 0x05; // "Characters cannot be created from this server."
public static final int REASON_CHOOSE_ANOTHER_SVR = 0x06; // "Unable to create character. You are unable to create a new character on the selected server. A restriction is in place which restricts users from creating characters on different servers where no previous character exists. Please public static final int REASON_CHOOSE_ANOTHER_SVR = 0x06; // "Unable to create character. You are unable to create a new character on the selected server. A restriction is in place which restricts users from creating characters on different servers where no previous character exists. Please
// choose another server." // choose another server."
private final int _error; private final int _error;
public CharCreateFail(int errorCode) public CharCreateFail(int errorCode)
@@ -42,7 +41,6 @@ public class CharCreateFail implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.CHARACTER_CREATE_FAIL.writeId(packet); OutgoingPackets.CHARACTER_CREATE_FAIL.writeId(packet);
packet.writeD(_error); packet.writeD(_error);
return true; return true;
} }

View File

@@ -31,8 +31,7 @@ public class CharCreateOk implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.CHARACTER_CREATE_SUCCESS.writeId(packet); OutgoingPackets.CHARACTER_CREATE_SUCCESS.writeId(packet);
packet.writeD(1);
packet.writeD(0x01);
return true; return true;
} }
} }

View File

@@ -33,7 +33,6 @@ public class CharDeleteFail implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.CHARACTER_DELETE_FAIL.writeId(packet); OutgoingPackets.CHARACTER_DELETE_FAIL.writeId(packet);
packet.writeD(_error); packet.writeD(_error);
return true; return true;
} }

View File

@@ -33,6 +33,22 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class CharInfo implements IClientOutgoingPacket public class CharInfo implements IClientOutgoingPacket
{ {
private static final int[] PAPERDOLL_ORDER = new int[]
{
Inventory.PAPERDOLL_UNDER,
Inventory.PAPERDOLL_HEAD,
Inventory.PAPERDOLL_RHAND,
Inventory.PAPERDOLL_LHAND,
Inventory.PAPERDOLL_GLOVES,
Inventory.PAPERDOLL_CHEST,
Inventory.PAPERDOLL_LEGS,
Inventory.PAPERDOLL_FEET,
Inventory.PAPERDOLL_CLOAK,
Inventory.PAPERDOLL_RHAND,
Inventory.PAPERDOLL_HAIR,
Inventory.PAPERDOLL_HAIR2
};
private final Player _player; private final Player _player;
private final Clan _clan; private final Clan _clan;
private int _objId; private int _objId;
@@ -55,22 +71,6 @@ public class CharInfo implements IClientOutgoingPacket
private int _vehicleId = 0; private int _vehicleId = 0;
private final boolean _gmSeeInvis; private final boolean _gmSeeInvis;
private static final int[] PAPERDOLL_ORDER = new int[]
{
Inventory.PAPERDOLL_UNDER,
Inventory.PAPERDOLL_HEAD,
Inventory.PAPERDOLL_RHAND,
Inventory.PAPERDOLL_LHAND,
Inventory.PAPERDOLL_GLOVES,
Inventory.PAPERDOLL_CHEST,
Inventory.PAPERDOLL_LEGS,
Inventory.PAPERDOLL_FEET,
Inventory.PAPERDOLL_CLOAK,
Inventory.PAPERDOLL_RHAND,
Inventory.PAPERDOLL_HAIR,
Inventory.PAPERDOLL_HAIR2
};
public CharInfo(Player player, boolean gmSeeInvis) public CharInfo(Player player, boolean gmSeeInvis)
{ {
_player = player; _player = player;
@@ -125,9 +125,8 @@ public class CharInfo implements IClientOutgoingPacket
packet.writeD(_vehicleId); // Confirmed packet.writeD(_vehicleId); // Confirmed
packet.writeD(_objId); // Confirmed packet.writeD(_objId); // Confirmed
packet.writeS(_player.getAppearance().getVisibleName()); // Confirmed packet.writeS(_player.getAppearance().getVisibleName()); // Confirmed
packet.writeH(_player.getRace().ordinal()); // Confirmed packet.writeH(_player.getRace().ordinal()); // Confirmed
packet.writeC(_player.getAppearance().isFemale() ? 0x01 : 0x00); // Confirmed packet.writeC(_player.getAppearance().isFemale() ? 1 : 0); // Confirmed
packet.writeD(_player.getBaseTemplate().getClassId().getRootClassId().getId()); packet.writeD(_player.getBaseTemplate().getClassId().getRootClassId().getId());
for (int slot : getPaperdollOrder()) for (int slot : getPaperdollOrder())
@@ -152,10 +151,8 @@ public class CharInfo implements IClientOutgoingPacket
packet.writeC(_player.getPvpFlag()); packet.writeC(_player.getPvpFlag());
packet.writeD(_player.getReputation()); packet.writeD(_player.getReputation());
packet.writeD(_mAtkSpd); packet.writeD(_mAtkSpd);
packet.writeD(_pAtkSpd); packet.writeD(_pAtkSpd);
packet.writeH(_runSpd); packet.writeH(_runSpd);
packet.writeH(_walkSpd); packet.writeH(_walkSpd);
packet.writeH(_swimRunSpd); packet.writeH(_swimRunSpd);
@@ -166,53 +163,40 @@ public class CharInfo implements IClientOutgoingPacket
packet.writeH(_flyWalkSpd); packet.writeH(_flyWalkSpd);
packet.writeF(_moveMultiplier); packet.writeF(_moveMultiplier);
packet.writeF(_attackSpeedMultiplier); packet.writeF(_attackSpeedMultiplier);
packet.writeF(_player.getCollisionRadius()); packet.writeF(_player.getCollisionRadius());
packet.writeF(_player.getCollisionHeight()); packet.writeF(_player.getCollisionHeight());
packet.writeD(_player.getVisualHair()); packet.writeD(_player.getVisualHair());
packet.writeD(_player.getVisualHairColor()); packet.writeD(_player.getVisualHairColor());
packet.writeD(_player.getVisualFace()); packet.writeD(_player.getVisualFace());
packet.writeS(_gmSeeInvis ? "Invisible" : _player.getAppearance().getVisibleTitle()); packet.writeS(_gmSeeInvis ? "Invisible" : _player.getAppearance().getVisibleTitle());
packet.writeD(_player.getAppearance().getVisibleClanId()); packet.writeD(_player.getAppearance().getVisibleClanId());
packet.writeD(_player.getAppearance().getVisibleClanCrestId()); packet.writeD(_player.getAppearance().getVisibleClanCrestId());
packet.writeD(_player.getAppearance().getVisibleAllyId()); packet.writeD(_player.getAppearance().getVisibleAllyId());
packet.writeD(_player.getAppearance().getVisibleAllyCrestId()); packet.writeD(_player.getAppearance().getVisibleAllyCrestId());
packet.writeC(_player.isSitting() ? 0 : 1); // Confirmed
packet.writeC(_player.isSitting() ? 0x00 : 0x01); // Confirmed packet.writeC(_player.isRunning() ? 1 : 0); // Confirmed
packet.writeC(_player.isRunning() ? 0x01 : 0x00); // Confirmed packet.writeC(_player.isInCombat() ? 1 : 0); // Confirmed
packet.writeC(_player.isInCombat() ? 0x01 : 0x00); // Confirmed packet.writeC(!_player.isInOlympiadMode() && _player.isAlikeDead() ? 1 : 0); // Confirmed
packet.writeC(_player.isInvisible() ? 1 : 0);
packet.writeC(!_player.isInOlympiadMode() && _player.isAlikeDead() ? 0x01 : 0x00); // Confirmed
packet.writeC(_player.isInvisible() ? 0x01 : 0x00);
packet.writeC(_player.getMountType().ordinal()); // 1-on Strider, 2-on Wyvern, 3-on Great Wolf, 0-no mount packet.writeC(_player.getMountType().ordinal()); // 1-on Strider, 2-on Wyvern, 3-on Great Wolf, 0-no mount
packet.writeC(_player.getPrivateStoreType().getId()); // Confirmed packet.writeC(_player.getPrivateStoreType().getId()); // Confirmed
packet.writeH(_player.getCubics().size()); // Confirmed packet.writeH(_player.getCubics().size()); // Confirmed
_player.getCubics().keySet().forEach(packet::writeH); _player.getCubics().keySet().forEach(packet::writeH);
packet.writeC(_player.isInMatchingRoom() ? 0x01 : 0x00); // Confirmed packet.writeC(_player.isInMatchingRoom() ? 1 : 0); // Confirmed
packet.writeC(_player.isInsideZone(ZoneId.WATER) ? 1 : _player.isFlyingMounted() ? 2 : 0); packet.writeC(_player.isInsideZone(ZoneId.WATER) ? 1 : _player.isFlyingMounted() ? 2 : 0);
packet.writeH(_player.getRecomHave()); // Confirmed packet.writeH(_player.getRecomHave()); // Confirmed
packet.writeD(_player.getMountNpcId() == 0 ? 0 : _player.getMountNpcId() + 1000000); packet.writeD(_player.getMountNpcId() == 0 ? 0 : _player.getMountNpcId() + 1000000);
packet.writeD(_player.getClassId().getId()); // Confirmed packet.writeD(_player.getClassId().getId()); // Confirmed
packet.writeD(0x00); // TODO: Find me! packet.writeD(0); // TODO: Find me!
packet.writeC(_player.isMounted() ? 0 : _enchantLevel); // Confirmed packet.writeC(_player.isMounted() ? 0 : _enchantLevel); // Confirmed
packet.writeC(_player.getTeam().getId()); // Confirmed packet.writeC(_player.getTeam().getId()); // Confirmed
packet.writeD(_player.getClanCrestLargeId()); packet.writeD(_player.getClanCrestLargeId());
packet.writeC(_player.isNoble() ? 1 : 0); // Confirmed packet.writeC(_player.isNoble() ? 1 : 0); // Confirmed
packet.writeC(_player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 1 : 0); // Confirmed packet.writeC(_player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 1 : 0); // Confirmed
packet.writeC(_player.isFishing() ? 1 : 0); // Confirmed packet.writeC(_player.isFishing() ? 1 : 0); // Confirmed
final ILocational baitLocation = _player.getFishing().getBaitLocation(); final ILocational baitLocation = _player.getFishing().getBaitLocation();
if (baitLocation != null) if (baitLocation != null)
{ {
@@ -228,29 +212,21 @@ public class CharInfo implements IClientOutgoingPacket
} }
packet.writeD(_player.getAppearance().getNameColor()); // Confirmed packet.writeD(_player.getAppearance().getNameColor()); // Confirmed
packet.writeD(_heading); // Confirmed packet.writeD(_heading); // Confirmed
packet.writeC(_player.getPledgeClass()); packet.writeC(_player.getPledgeClass());
packet.writeH(_player.getPledgeType()); packet.writeH(_player.getPledgeType());
packet.writeD(_player.getAppearance().getTitleColor()); // Confirmed packet.writeD(_player.getAppearance().getTitleColor()); // Confirmed
packet.writeC(_player.isCursedWeaponEquipped() ? CursedWeaponsManager.getInstance().getLevel(_player.getCursedWeaponEquippedId()) : 0); packet.writeC(_player.isCursedWeaponEquipped() ? CursedWeaponsManager.getInstance().getLevel(_player.getCursedWeaponEquippedId()) : 0);
packet.writeD(_clan != null ? _clan.getReputationScore() : 0); packet.writeD(_clan != null ? _clan.getReputationScore() : 0);
packet.writeD(_player.getTransformationDisplayId()); // Confirmed packet.writeD(_player.getTransformationDisplayId()); // Confirmed
packet.writeD(_player.getAgathionId()); // Confirmed packet.writeD(_player.getAgathionId()); // Confirmed
packet.writeC(0); // nPvPRestrainStatus
packet.writeC(0x00); // nPvPRestrainStatus
packet.writeD((int) Math.round(_player.getCurrentCp())); // Confirmed packet.writeD((int) Math.round(_player.getCurrentCp())); // Confirmed
packet.writeD(_player.getMaxHp()); // Confirmed packet.writeD(_player.getMaxHp()); // Confirmed
packet.writeD((int) Math.round(_player.getCurrentHp())); // Confirmed packet.writeD((int) Math.round(_player.getCurrentHp())); // Confirmed
packet.writeD(_player.getMaxMp()); // Confirmed packet.writeD(_player.getMaxMp()); // Confirmed
packet.writeD((int) Math.round(_player.getCurrentMp())); // Confirmed packet.writeD((int) Math.round(_player.getCurrentMp())); // Confirmed
packet.writeC(0); // cBRLectureMark
packet.writeC(0x00); // cBRLectureMark
final Set<AbnormalVisualEffect> abnormalVisualEffects = _player.getEffectList().getCurrentAbnormalVisualEffects(); final Set<AbnormalVisualEffect> abnormalVisualEffects = _player.getEffectList().getCurrentAbnormalVisualEffects();
packet.writeD(abnormalVisualEffects.size() + (_gmSeeInvis ? 1 : 0)); // Confirmed packet.writeD(abnormalVisualEffects.size() + (_gmSeeInvis ? 1 : 0)); // Confirmed
@@ -262,8 +238,9 @@ public class CharInfo implements IClientOutgoingPacket
{ {
packet.writeH(AbnormalVisualEffect.STEALTH.getClientId()); packet.writeH(AbnormalVisualEffect.STEALTH.getClientId());
} }
packet.writeC(_player.isTrueHero() ? 100 : 0); packet.writeC(_player.isTrueHero() ? 100 : 0);
packet.writeC(_player.isHairAccessoryEnabled() ? 0x01 : 0x00); // Hair accessory packet.writeC(_player.isHairAccessoryEnabled() ? 1 : 0); // Hair accessory
packet.writeC(_player.getAbilityPointsUsed()); // Used Ability Points packet.writeC(_player.getAbilityPointsUsed()); // Used Ability Points
return true; return true;
} }

View File

@@ -40,17 +40,16 @@ public class CharSelected implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.CHARACTER_SELECTED.writeId(packet); OutgoingPackets.CHARACTER_SELECTED.writeId(packet);
packet.writeS(_player.getName()); packet.writeS(_player.getName());
packet.writeD(_player.getObjectId()); packet.writeD(_player.getObjectId());
packet.writeS(_player.getTitle()); packet.writeS(_player.getTitle());
packet.writeD(_sessionId); packet.writeD(_sessionId);
packet.writeD(_player.getClanId()); packet.writeD(_player.getClanId());
packet.writeD(0x00); // ?? packet.writeD(0); // ??
packet.writeD(_player.getAppearance().isFemale() ? 1 : 0); packet.writeD(_player.getAppearance().isFemale() ? 1 : 0);
packet.writeD(_player.getRace().ordinal()); packet.writeD(_player.getRace().ordinal());
packet.writeD(_player.getClassId().getId()); packet.writeD(_player.getClassId().getId());
packet.writeD(0x01); // active ?? packet.writeD(1); // active ??
packet.writeD(_player.getX()); packet.writeD(_player.getX());
packet.writeD(_player.getY()); packet.writeD(_player.getY());
packet.writeD(_player.getZ()); packet.writeD(_player.getZ());
@@ -62,25 +61,20 @@ public class CharSelected implements IClientOutgoingPacket
packet.writeD(_player.getReputation()); packet.writeD(_player.getReputation());
packet.writeD(_player.getPkKills()); packet.writeD(_player.getPkKills());
packet.writeD(GameTimeTaskManager.getInstance().getGameTime() % (24 * 60)); // "reset" on 24th hour packet.writeD(GameTimeTaskManager.getInstance().getGameTime() % (24 * 60)); // "reset" on 24th hour
packet.writeD(0x00); packet.writeD(0);
packet.writeD(_player.getClassId().getId()); packet.writeD(_player.getClassId().getId());
packet.writeB(new byte[16]); packet.writeB(new byte[16]);
packet.writeD(0);
packet.writeD(0x00); packet.writeD(0);
packet.writeD(0x00); packet.writeD(0);
packet.writeD(0x00); packet.writeD(0);
packet.writeD(0x00); packet.writeD(0);
packet.writeD(0);
packet.writeD(0x00); packet.writeD(0);
packet.writeD(0);
packet.writeD(0x00); packet.writeD(0);
packet.writeD(0x00);
packet.writeD(0x00);
packet.writeD(0x00);
packet.writeB(new byte[28]); packet.writeB(new byte[28]);
packet.writeD(0x00); packet.writeD(0);
return true; return true;
} }
} }

View File

@@ -44,10 +44,6 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class CharSelectionInfo implements IClientOutgoingPacket public class CharSelectionInfo implements IClientOutgoingPacket
{ {
private static final Logger LOGGER = Logger.getLogger(CharSelectionInfo.class.getName()); private static final Logger LOGGER = Logger.getLogger(CharSelectionInfo.class.getName());
private final String _loginName;
private final int _sessionId;
private int _activeId;
private final List<CharSelectInfoPackage> _characterPackages;
private static final int[] PAPERDOLL_ORDER_VISUAL_ID = new int[] private static final int[] PAPERDOLL_ORDER_VISUAL_ID = new int[]
{ {
@@ -62,6 +58,11 @@ public class CharSelectionInfo implements IClientOutgoingPacket
Inventory.PAPERDOLL_HAIR2, Inventory.PAPERDOLL_HAIR2,
}; };
private final String _loginName;
private final int _sessionId;
private int _activeId;
private final List<CharSelectInfoPackage> _characterPackages;
/** /**
* Constructor for CharSelectionInfo. * Constructor for CharSelectionInfo.
* @param loginName * @param loginName
@@ -92,16 +93,13 @@ public class CharSelectionInfo implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.CHARACTER_SELECTION_INFO.writeId(packet); OutgoingPackets.CHARACTER_SELECTION_INFO.writeId(packet);
final int size = _characterPackages.size(); final int size = _characterPackages.size();
packet.writeD(size); // Created character count packet.writeD(size); // Created character count
packet.writeD(Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT); // Can prevent players from creating new characters (if 0); (if 1, the client will ask if chars may be created (0x13) Response: (0x0D) ) packet.writeD(Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT); // Can prevent players from creating new characters (if 0); (if 1, the client will ask if chars may be created (0x13) Response: (0x0D) )
packet.writeC(size == Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT ? 0x01 : 0x00); // if 1 can't create new char packet.writeC(size == Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT ? 1 : 0); // if 1 can't create new char
packet.writeC(0x01); // 0=can't play, 1=can play free until level 85, 2=100% free play packet.writeC(1); // 0=can't play, 1=can play free until level 85, 2=100% free play
packet.writeD(0x02); // if 1, Korean client packet.writeD(2); // if 1, Korean client
packet.writeC(0x00); // If 1 suggests premium account packet.writeC(0); // If 1 suggests premium account
long lastAccess = 0; long lastAccess = 0;
if (_activeId == -1) if (_activeId == -1)
{ {
@@ -114,7 +112,6 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
} }
} }
for (int i = 0; i < size; i++) for (int i = 0; i < size; i++)
{ {
final CharSelectInfoPackage charInfoPackage = _characterPackages.get(i); final CharSelectInfoPackage charInfoPackage = _characterPackages.get(i);
@@ -122,91 +119,74 @@ public class CharSelectionInfo implements IClientOutgoingPacket
packet.writeD(charInfoPackage.getObjectId()); // Character ID packet.writeD(charInfoPackage.getObjectId()); // Character ID
packet.writeS(_loginName); // Account name packet.writeS(_loginName); // Account name
packet.writeD(_sessionId); // Account ID packet.writeD(_sessionId); // Account ID
packet.writeD(0x00); // Clan ID packet.writeD(0); // Clan ID
packet.writeD(0x00); // Builder level packet.writeD(0); // Builder level
packet.writeD(charInfoPackage.getSex()); // Sex packet.writeD(charInfoPackage.getSex()); // Sex
packet.writeD(charInfoPackage.getRace()); // Race packet.writeD(charInfoPackage.getRace()); // Race
packet.writeD(charInfoPackage.getBaseClassId()); packet.writeD(charInfoPackage.getBaseClassId());
packet.writeD(1); // GameServerName
packet.writeD(0x01); // GameServerName
packet.writeD(charInfoPackage.getX()); packet.writeD(charInfoPackage.getX());
packet.writeD(charInfoPackage.getY()); packet.writeD(charInfoPackage.getY());
packet.writeD(charInfoPackage.getZ()); packet.writeD(charInfoPackage.getZ());
packet.writeF(charInfoPackage.getCurrentHp()); packet.writeF(charInfoPackage.getCurrentHp());
packet.writeF(charInfoPackage.getCurrentMp()); packet.writeF(charInfoPackage.getCurrentMp());
packet.writeQ(charInfoPackage.getSp()); packet.writeQ(charInfoPackage.getSp());
packet.writeQ(charInfoPackage.getExp()); packet.writeQ(charInfoPackage.getExp());
packet.writeF((float) (charInfoPackage.getExp() - ExperienceData.getInstance().getExpForLevel(charInfoPackage.getLevel())) / (ExperienceData.getInstance().getExpForLevel(charInfoPackage.getLevel() + 1) - ExperienceData.getInstance().getExpForLevel(charInfoPackage.getLevel()))); // High packet.writeF((float) (charInfoPackage.getExp() - ExperienceData.getInstance().getExpForLevel(charInfoPackage.getLevel())) / (ExperienceData.getInstance().getExpForLevel(charInfoPackage.getLevel() + 1) - ExperienceData.getInstance().getExpForLevel(charInfoPackage.getLevel()))); // High
// Five // Five
packet.writeD(charInfoPackage.getLevel()); packet.writeD(charInfoPackage.getLevel());
packet.writeD(charInfoPackage.getReputation()); packet.writeD(charInfoPackage.getReputation());
packet.writeD(charInfoPackage.getPkKills()); packet.writeD(charInfoPackage.getPkKills());
packet.writeD(charInfoPackage.getPvPKills()); packet.writeD(charInfoPackage.getPvPKills());
packet.writeD(0);
packet.writeD(0x00); packet.writeD(0);
packet.writeD(0x00); packet.writeD(0);
packet.writeD(0x00); packet.writeD(0);
packet.writeD(0x00); packet.writeD(0);
packet.writeD(0x00); packet.writeD(0);
packet.writeD(0x00); packet.writeD(0);
packet.writeD(0x00); packet.writeD(0); // Ertheia
packet.writeD(0); // Ertheia
packet.writeD(0x00); // Ertheia
packet.writeD(0x00); // Ertheia
for (int slot : getPaperdollOrder()) for (int slot : getPaperdollOrder())
{ {
packet.writeD(charInfoPackage.getPaperdollItemId(slot)); packet.writeD(charInfoPackage.getPaperdollItemId(slot));
} }
for (int slot : getPaperdollOrderVisualId()) for (int slot : getPaperdollOrderVisualId())
{ {
packet.writeD(charInfoPackage.getPaperdollItemVisualId(slot)); packet.writeD(charInfoPackage.getPaperdollItemVisualId(slot));
} }
packet.writeH(charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_CHEST)); // Upper Body enchant level packet.writeH(charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_CHEST)); // Upper Body enchant level
packet.writeH(charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_LEGS)); // Lower Body enchant level packet.writeH(charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_LEGS)); // Lower Body enchant level
packet.writeH(charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_HEAD)); // Headgear enchant level packet.writeH(charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_HEAD)); // Headgear enchant level
packet.writeH(charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_GLOVES)); // Gloves enchant level packet.writeH(charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_GLOVES)); // Gloves enchant level
packet.writeH(charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_FEET)); // Boots enchant level packet.writeH(charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_FEET)); // Boots enchant level
packet.writeD(charInfoPackage.getHairStyle()); packet.writeD(charInfoPackage.getHairStyle());
packet.writeD(charInfoPackage.getHairColor()); packet.writeD(charInfoPackage.getHairColor());
packet.writeD(charInfoPackage.getFace()); packet.writeD(charInfoPackage.getFace());
packet.writeF(charInfoPackage.getMaxHp()); // Maximum HP packet.writeF(charInfoPackage.getMaxHp()); // Maximum HP
packet.writeF(charInfoPackage.getMaxMp()); // Maximum MP packet.writeF(charInfoPackage.getMaxMp()); // Maximum MP
packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - Chronos.currentTimeMillis()) / 1000) : 0); packet.writeD(charInfoPackage.getDeleteTimer() > 0 ? (int) ((charInfoPackage.getDeleteTimer() - Chronos.currentTimeMillis()) / 1000) : 0);
packet.writeD(charInfoPackage.getClassId()); packet.writeD(charInfoPackage.getClassId());
packet.writeD(i == _activeId ? 1 : 0); packet.writeD(i == _activeId ? 1 : 0);
packet.writeC(charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_RHAND) > 127 ? 127 : charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_RHAND)); packet.writeC(charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_RHAND) > 127 ? 127 : charInfoPackage.getEnchantEffect(Inventory.PAPERDOLL_RHAND));
packet.writeD(charInfoPackage.getAugmentation() != null ? charInfoPackage.getAugmentation().getOption1Id() : 0); packet.writeD(charInfoPackage.getAugmentation() != null ? charInfoPackage.getAugmentation().getOption1Id() : 0);
// Mobius: Maybe use 2x writeH? // Mobius: Maybe use 2x writeH?
// packet.writeD(charInfoPackage.getAugmentation() != null ? charInfoPackage.getAugmentation().getOption2Id() : 0); // packet.writeD(charInfoPackage.getAugmentation() != null ? charInfoPackage.getAugmentation().getOption2Id() : 0);
// packet.writeD(charInfoPackage.getTransformId()); // Used to display Transformations // packet.writeD(charInfoPackage.getTransformId()); // Used to display Transformations
packet.writeD(0x00); // Currently on retail when you are on character select you don't see your transformation. packet.writeD(0); // Currently on retail when you are on character select you don't see your transformation.
packet.writeD(0); // Pet NpcId
packet.writeD(0x00); // Pet NpcId packet.writeD(0); // Pet level
packet.writeD(0x00); // Pet level packet.writeD(0); // Pet Food
packet.writeD(0x00); // Pet Food packet.writeD(0); // Pet Food Level
packet.writeD(0x00); // Pet Food Level packet.writeF(0); // Current pet HP
packet.writeF(0x00); // Current pet HP packet.writeF(0); // Current pet MP
packet.writeF(0x00); // Current pet MP
packet.writeD(charInfoPackage.getVitalityPoints()); // Vitality packet.writeD(charInfoPackage.getVitalityPoints()); // Vitality
packet.writeD((int) Config.RATE_VITALITY_EXP_MULTIPLIER * 100); // Vitality Percent packet.writeD((int) Config.RATE_VITALITY_EXP_MULTIPLIER * 100); // Vitality Percent
packet.writeD(charInfoPackage.getVitalityItemsUsed()); // Remaining vitality item uses packet.writeD(charInfoPackage.getVitalityItemsUsed()); // Remaining vitality item uses
packet.writeD(charInfoPackage.getAccessLevel() == -100 ? 0x00 : 0x01); // Char is active or not packet.writeD(charInfoPackage.getAccessLevel() == -100 ? 0 : 1); // Char is active or not
packet.writeC(charInfoPackage.isNoble() ? 0x01 : 0x00); packet.writeC(charInfoPackage.isNoble() ? 1 : 0);
packet.writeC(Hero.getInstance().isHero(charInfoPackage.getObjectId()) ? 0x01 : 0x00); // Hero glow packet.writeC(Hero.getInstance().isHero(charInfoPackage.getObjectId()) ? 1 : 0); // Hero glow
packet.writeC(charInfoPackage.isHairAccessoryEnabled() ? 0x01 : 0x00); // Show hair accessory if enabled packet.writeC(charInfoPackage.isHairAccessoryEnabled() ? 1 : 0); // Show hair accessory if enabled
} }
return true; return true;
} }
@@ -215,7 +195,6 @@ public class CharSelectionInfo implements IClientOutgoingPacket
{ {
CharSelectInfoPackage charInfopackage; CharSelectInfoPackage charInfopackage;
final List<CharSelectInfoPackage> characterList = new LinkedList<>(); final List<CharSelectInfoPackage> characterList = new LinkedList<>();
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
PreparedStatement statement = con.prepareStatement("SELECT * FROM characters WHERE account_name=? ORDER BY createDate")) PreparedStatement statement = con.prepareStatement("SELECT * FROM characters WHERE account_name=? ORDER BY createDate"))
{ {
@@ -228,7 +207,6 @@ public class CharSelectionInfo implements IClientOutgoingPacket
if (charInfopackage != null) if (charInfopackage != null)
{ {
characterList.add(charInfopackage); characterList.add(charInfopackage);
final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId()); final Player player = World.getInstance().getPlayer(charInfopackage.getObjectId());
if (player != null) if (player != null)
{ {
@@ -242,7 +220,6 @@ public class CharSelectionInfo implements IClientOutgoingPacket
{ {
LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
} }
return characterList; return characterList;
} }
@@ -284,7 +261,6 @@ public class CharSelectionInfo implements IClientOutgoingPacket
{ {
clan.removeClanMember(objectId, 0); clan.removeClanMember(objectId, 0);
} }
GameClient.deleteCharByObjId(objectId); GameClient.deleteCharByObjId(objectId);
return null; return null;
} }
@@ -303,20 +279,16 @@ public class CharSelectionInfo implements IClientOutgoingPacket
charInfopackage.setHairStyle(chardata.getInt("hairstyle")); charInfopackage.setHairStyle(chardata.getInt("hairstyle"));
charInfopackage.setHairColor(chardata.getInt("haircolor")); charInfopackage.setHairColor(chardata.getInt("haircolor"));
charInfopackage.setSex(chardata.getInt("sex")); charInfopackage.setSex(chardata.getInt("sex"));
charInfopackage.setExp(chardata.getLong("exp")); charInfopackage.setExp(chardata.getLong("exp"));
charInfopackage.setSp(chardata.getLong("sp")); charInfopackage.setSp(chardata.getLong("sp"));
charInfopackage.setVitalityPoints(chardata.getInt("vitality_points")); charInfopackage.setVitalityPoints(chardata.getInt("vitality_points"));
charInfopackage.setClanId(chardata.getInt("clanid")); charInfopackage.setClanId(chardata.getInt("clanid"));
charInfopackage.setRace(chardata.getInt("race")); charInfopackage.setRace(chardata.getInt("race"));
final int baseClassId = chardata.getInt("base_class"); final int baseClassId = chardata.getInt("base_class");
final int activeClassId = chardata.getInt("classid"); final int activeClassId = chardata.getInt("classid");
charInfopackage.setX(chardata.getInt("x")); charInfopackage.setX(chardata.getInt("x"));
charInfopackage.setY(chardata.getInt("y")); charInfopackage.setY(chardata.getInt("y"));
charInfopackage.setZ(chardata.getInt("z")); charInfopackage.setZ(chardata.getInt("z"));
final int faction = chardata.getInt("faction"); final int faction = chardata.getInt("faction");
if (faction == 1) if (faction == 1)
{ {
@@ -326,7 +298,6 @@ public class CharSelectionInfo implements IClientOutgoingPacket
{ {
charInfopackage.setEvil(); charInfopackage.setEvil();
} }
if (Config.MULTILANG_ENABLE) if (Config.MULTILANG_ENABLE)
{ {
String lang = chardata.getString("language"); String lang = chardata.getString("language");
@@ -336,22 +307,18 @@ public class CharSelectionInfo implements IClientOutgoingPacket
} }
charInfopackage.setHtmlPrefix("data/lang/" + lang + "/"); charInfopackage.setHtmlPrefix("data/lang/" + lang + "/");
} }
// if is in subclass, load subclass exp, sp, level info // if is in subclass, load subclass exp, sp, level info
if (baseClassId != activeClassId) if (baseClassId != activeClassId)
{ {
loadCharacterSubclassInfo(charInfopackage, objectId, activeClassId); loadCharacterSubclassInfo(charInfopackage, objectId, activeClassId);
} }
charInfopackage.setClassId(activeClassId); charInfopackage.setClassId(activeClassId);
// Get the augmentation id for equipped weapon // Get the augmentation id for equipped weapon
int weaponObjId = charInfopackage.getPaperdollObjectId(Inventory.PAPERDOLL_RHAND); int weaponObjId = charInfopackage.getPaperdollObjectId(Inventory.PAPERDOLL_RHAND);
if (weaponObjId < 1) if (weaponObjId < 1)
{ {
weaponObjId = charInfopackage.getPaperdollObjectId(Inventory.PAPERDOLL_RHAND); weaponObjId = charInfopackage.getPaperdollObjectId(Inventory.PAPERDOLL_RHAND);
} }
if (weaponObjId > 0) if (weaponObjId > 0)
{ {
try (Connection con = DatabaseFactory.getConnection(); try (Connection con = DatabaseFactory.getConnection();
@@ -377,7 +344,6 @@ public class CharSelectionInfo implements IClientOutgoingPacket
LOGGER.log(Level.WARNING, "Could not restore augmentation info: " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not restore augmentation info: " + e.getMessage(), e);
} }
} }
// Check if the base class is set to zero and also doesn't match with the current active class, otherwise send the base class ID. This prevents chars created before base class was introduced from being displayed incorrectly. // Check if the base class is set to zero and also doesn't match with the current active class, otherwise send the base class ID. This prevents chars created before base class was introduced from being displayed incorrectly.
if ((baseClassId == 0) && (activeClassId > 0)) if ((baseClassId == 0) && (activeClassId > 0))
{ {
@@ -387,7 +353,6 @@ public class CharSelectionInfo implements IClientOutgoingPacket
{ {
charInfopackage.setBaseClassId(baseClassId); charInfopackage.setBaseClassId(baseClassId);
} }
charInfopackage.setDeleteTimer(deletetime); charInfopackage.setDeleteTimer(deletetime);
charInfopackage.setLastAccess(chardata.getLong("lastAccess")); charInfopackage.setLastAccess(chardata.getLong("lastAccess"));
charInfopackage.setNoble(chardata.getInt("nobless") == 1); charInfopackage.setNoble(chardata.getInt("nobless") == 1);

View File

@@ -32,7 +32,6 @@ public class ChooseInventoryItem implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.CHOOSE_INVENTORY_ITEM.writeId(packet); OutgoingPackets.CHOOSE_INVENTORY_ITEM.writeId(packet);
packet.writeD(_itemId); packet.writeD(_itemId);
return true; return true;
} }

View File

@@ -32,7 +32,6 @@ public class ClientSetTime implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.CLIENT_SET_TIME.writeId(packet); OutgoingPackets.CLIENT_SET_TIME.writeId(packet);
packet.writeD(GameTimeTaskManager.getInstance().getGameTime()); // time in client minutes packet.writeD(GameTimeTaskManager.getInstance().getGameTime()); // time in client minutes
packet.writeD(6); // constant to match the server time( this determines the speed of the client clock) packet.writeD(6); // constant to match the server time( this determines the speed of the client clock)
return true; return true;

View File

@@ -68,7 +68,6 @@ public class ConfirmDlg implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.CONFIRM_DLG.writeId(packet); OutgoingPackets.CONFIRM_DLG.writeId(packet);
final SMParam[] params = _systemMessage.getParams(); final SMParam[] params = _systemMessage.getParams();
packet.writeD(_systemMessage.getId()); packet.writeD(_systemMessage.getId());
packet.writeD(params.length); packet.writeD(params.length);
@@ -129,7 +128,6 @@ public class ConfirmDlg implements IClientOutgoingPacket
} }
} }
} }
packet.writeD(_time); packet.writeD(_time);
packet.writeD(_requesterId); packet.writeD(_requesterId);
return true; return true;

View File

@@ -71,7 +71,6 @@ public class CreatureSay implements IClientOutgoingPacket
_mask |= 0x08; _mask |= 0x08;
} }
} }
// Does not shows level // Does not shows level
if (sender.isGM()) if (sender.isGM())
{ {
@@ -123,7 +122,6 @@ public class CreatureSay implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.SAY2.writeId(packet); OutgoingPackets.SAY2.writeId(packet);
packet.writeD(_sender == null ? 0 : _sender.getObjectId()); packet.writeD(_sender == null ? 0 : _sender.getObjectId());
packet.writeD(_chatType.getClientId()); packet.writeD(_chatType.getClientId());
if (_senderName != null) if (_senderName != null)

View File

@@ -38,9 +38,8 @@ public class DeleteObject implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.DELETE_OBJECT.writeId(packet); OutgoingPackets.DELETE_OBJECT.writeId(packet);
packet.writeD(_objectId); packet.writeD(_objectId);
packet.writeC(0x00); // c2 packet.writeC(0); // c2
return true; return true;
} }
} }

View File

@@ -50,7 +50,6 @@ public class Dice implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.DICE.writeId(packet); OutgoingPackets.DICE.writeId(packet);
packet.writeD(_objectId); // object id of player packet.writeD(_objectId); // object id of player
packet.writeD(_itemId); // item id of dice (spade) 4625,4626,4627,4628 packet.writeD(_itemId); // item id of dice (spade) 4625,4626,4627,4628
packet.writeD(_number); // number rolled packet.writeD(_number); // number rolled

View File

@@ -68,7 +68,6 @@ public class Die implements IClientOutgoingPacket
siegeClan = fort.getSiege().getAttackerClan(clan); siegeClan = fort.getSiege().getAttackerClan(clan);
isInFortDefense = (siegeClan == null) && fort.getSiege().checkIsDefender(clan); isInFortDefense = (siegeClan == null) && fort.getSiege().checkIsDefender(clan);
} }
_toVillage = creature.canRevive() && !creature.isPendingRevive(); _toVillage = creature.canRevive() && !creature.isPendingRevive();
_toClanHall = (clan != null) && (clan.getHideoutId() > 0); _toClanHall = (clan != null) && (clan.getHideoutId() > 0);
_toCastle = ((clan != null) && (clan.getCastleId() > 0)) || isInCastleDefense; _toCastle = ((clan != null) && (clan.getCastleId() > 0)) || isInCastleDefense;
@@ -76,7 +75,6 @@ public class Die implements IClientOutgoingPacket
_useFeather = creature.getAccessLevel().allowFixedRes() || creature.getInventory().haveItemForSelfResurrection(); _useFeather = creature.getAccessLevel().allowFixedRes() || creature.getInventory().haveItemForSelfResurrection();
_toFortress = ((clan != null) && (clan.getFortId() > 0)) || isInFortDefense; _toFortress = ((clan != null) && (clan.getFortId() > 0)) || isInFortDefense;
} }
_isSweepable = creature.isAttackable() && creature.isSweepActive(); _isSweepable = creature.isAttackable() && creature.isSweepActive();
} }
@@ -91,7 +89,6 @@ public class Die implements IClientOutgoingPacket
{ {
_items = new ArrayList<>(8); _items = new ArrayList<>(8);
} }
if (_items.size() < 8) if (_items.size() < 8)
{ {
_items.add(itemId); _items.add(itemId);
@@ -116,20 +113,18 @@ public class Die implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.DIE.writeId(packet); OutgoingPackets.DIE.writeId(packet);
packet.writeD(_objectId); packet.writeD(_objectId);
packet.writeD(_toVillage ? 0x01 : 0x00); packet.writeD(_toVillage ? 1 : 0);
packet.writeD(_toClanHall ? 0x01 : 0x00); packet.writeD(_toClanHall ? 1 : 0);
packet.writeD(_toCastle ? 0x01 : 0x00); packet.writeD(_toCastle ? 1 : 0);
packet.writeD(_toOutpost ? 0x01 : 0x00); packet.writeD(_toOutpost ? 1 : 0);
packet.writeD(_isSweepable ? 0x01 : 0x00); packet.writeD(_isSweepable ? 1 : 0);
packet.writeD(_useFeather ? 0x01 : 0x00); packet.writeD(_useFeather ? 1 : 0);
packet.writeD(_toFortress ? 0x01 : 0x00); packet.writeD(_toFortress ? 1 : 0);
packet.writeD(0x00); // Disables use Feather button for X seconds packet.writeD(0); // Disables use Feather button for X seconds
packet.writeD(0x00); // Adventure's Song packet.writeD(0); // Adventure's Song
packet.writeC(_hideAnimation ? 0x01 : 0x00); packet.writeC(_hideAnimation ? 1 : 0);
packet.writeD(_itemsEnabled ? 1 : 0);
packet.writeD(_itemsEnabled ? 0x01 : 0x00);
packet.writeD(getItems().size()); packet.writeD(getItems().size());
getItems().forEach(packet::writeD); getItems().forEach(packet::writeD);
return true; return true;

View File

@@ -33,7 +33,6 @@ public class DoorInfo implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.DOOR_INFO.writeId(packet); OutgoingPackets.DOOR_INFO.writeId(packet);
packet.writeD(_door.getObjectId()); packet.writeD(_door.getObjectId());
packet.writeD(_door.getId()); packet.writeD(_door.getId());
return true; return true;

View File

@@ -33,7 +33,6 @@ public class DoorStatusUpdate implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.DOOR_STATUS_UPDATE.writeId(packet); OutgoingPackets.DOOR_STATUS_UPDATE.writeId(packet);
packet.writeD(_door.getObjectId()); packet.writeD(_door.getObjectId());
packet.writeD(_door.isOpen() ? 0 : 1); packet.writeD(_door.isOpen() ? 0 : 1);
packet.writeD(_door.getDamage()); packet.writeD(_door.getDamage());

View File

@@ -40,20 +40,17 @@ public class DropItem implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.DROP_ITEM.writeId(packet); OutgoingPackets.DROP_ITEM.writeId(packet);
packet.writeD(_objectId); packet.writeD(_objectId);
packet.writeD(_item.getObjectId()); packet.writeD(_item.getObjectId());
packet.writeD(_item.getDisplayId()); packet.writeD(_item.getDisplayId());
packet.writeD(_item.getX()); packet.writeD(_item.getX());
packet.writeD(_item.getY()); packet.writeD(_item.getY());
packet.writeD(_item.getZ()); packet.writeD(_item.getZ());
// only show item count if it is a stackable item // only show item count if it is a stackable item
packet.writeC(_item.isStackable() ? 0x01 : 0x00); packet.writeC(_item.isStackable() ? 1 : 0);
packet.writeQ(_item.getCount()); packet.writeQ(_item.getCount());
packet.writeC(0);
packet.writeC(0x00); // packet.writeD(1); if above C == true (1) then packet.readD()
// packet.writeD(0x01); if above C == true (1) then packet.readD()
return true; return true;
} }
} }

View File

@@ -62,13 +62,12 @@ public class Earthquake implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EARTHQUAKE.writeId(packet); OutgoingPackets.EARTHQUAKE.writeId(packet);
packet.writeD(_x); packet.writeD(_x);
packet.writeD(_y); packet.writeD(_y);
packet.writeD(_z); packet.writeD(_z);
packet.writeD(_intensity); packet.writeD(_intensity);
packet.writeD(_duration); packet.writeD(_duration);
packet.writeD(0x00); // Unknown packet.writeD(0); // Unknown
return true; return true;
} }
} }

View File

@@ -58,7 +58,6 @@ public class EnchantResult implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.ENCHANT_RESULT.writeId(packet); OutgoingPackets.ENCHANT_RESULT.writeId(packet);
packet.writeD(_result); packet.writeD(_result);
packet.writeD(_crystal); packet.writeD(_crystal);
packet.writeQ(_count); packet.writeQ(_count);

View File

@@ -41,7 +41,6 @@ public class EtcStatusUpdate implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.ETC_STATUS_UPDATE.writeId(packet); OutgoingPackets.ETC_STATUS_UPDATE.writeId(packet);
packet.writeC(_player.getCharges()); // 1-7 increase force, level packet.writeC(_player.getCharges()); // 1-7 increase force, level
packet.writeD(_player.getWeightPenalty()); // 1-4 weight penalty, level (1=50%, 2=66.6%, 3=80%, 4=100%) packet.writeD(_player.getWeightPenalty()); // 1-4 weight penalty, level (1=50%, 2=66.6%, 3=80%, 4=100%)
packet.writeC(_player.getExpertiseWeaponPenalty()); // Weapon Grade Penalty [1-4] packet.writeC(_player.getExpertiseWeaponPenalty()); // Weapon Grade Penalty [1-4]

View File

@@ -24,13 +24,13 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
*/ */
public class Ex2ndPasswordAck implements IClientOutgoingPacket public class Ex2ndPasswordAck implements IClientOutgoingPacket
{ {
// TODO: Enum
public static final int SUCCESS = 0;
public static final int WRONG_PATTERN = 1;
private final int _status; private final int _status;
private final int _response; private final int _response;
// TODO: Enum
public static final int SUCCESS = 0x00;
public static final int WRONG_PATTERN = 0x01;
public Ex2ndPasswordAck(int status, int response) public Ex2ndPasswordAck(int status, int response)
{ {
_status = status; _status = status;
@@ -41,10 +41,9 @@ public class Ex2ndPasswordAck implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_2ND_PASSWORD_ACK.writeId(packet); OutgoingPackets.EX_2ND_PASSWORD_ACK.writeId(packet);
packet.writeC(_status); packet.writeC(_status);
packet.writeD(_response == WRONG_PATTERN ? 0x01 : 0x00); packet.writeD(_response == WRONG_PATTERN ? 1 : 0);
packet.writeD(0x00); packet.writeD(0);
return true; return true;
} }
} }

View File

@@ -25,9 +25,9 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class Ex2ndPasswordCheck implements IClientOutgoingPacket public class Ex2ndPasswordCheck implements IClientOutgoingPacket
{ {
// TODO: Enum // TODO: Enum
public static final int PASSWORD_NEW = 0x00; public static final int PASSWORD_NEW = 0;
public static final int PASSWORD_PROMPT = 0x01; public static final int PASSWORD_PROMPT = 1;
public static final int PASSWORD_OK = 0x02; public static final int PASSWORD_OK = 2;
private final int _windowType; private final int _windowType;
@@ -40,9 +40,8 @@ public class Ex2ndPasswordCheck implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_2ND_PASSWORD_CHECK.writeId(packet); OutgoingPackets.EX_2ND_PASSWORD_CHECK.writeId(packet);
packet.writeD(_windowType); packet.writeD(_windowType);
packet.writeD(0x00); packet.writeD(0);
return true; return true;
} }
} }

View File

@@ -25,9 +25,9 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class Ex2ndPasswordVerify implements IClientOutgoingPacket public class Ex2ndPasswordVerify implements IClientOutgoingPacket
{ {
// TODO: Enum // TODO: Enum
public static final int PASSWORD_OK = 0x00; public static final int PASSWORD_OK = 0;
public static final int PASSWORD_WRONG = 0x01; public static final int PASSWORD_WRONG = 1;
public static final int PASSWORD_BAN = 0x02; public static final int PASSWORD_BAN = 2;
private final int _wrongTentatives; private final int _wrongTentatives;
private final int _mode; private final int _mode;
@@ -42,7 +42,6 @@ public class Ex2ndPasswordVerify implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_2ND_PASSWORD_VERIFY.writeId(packet); OutgoingPackets.EX_2ND_PASSWORD_VERIFY.writeId(packet);
packet.writeD(_mode); packet.writeD(_mode);
packet.writeD(_wrongTentatives); packet.writeD(_wrongTentatives);
return true; return true;

View File

@@ -45,10 +45,8 @@ public class ExAbnormalStatusUpdateFromTarget implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_ABNORMAL_STATUS_UPDATE_FROM_TARGET.writeId(packet); OutgoingPackets.EX_ABNORMAL_STATUS_UPDATE_FROM_TARGET.writeId(packet);
packet.writeD(_creature.getObjectId()); packet.writeD(_creature.getObjectId());
packet.writeH(_effects.size()); packet.writeH(_effects.size());
for (BuffInfo info : _effects) for (BuffInfo info : _effects)
{ {
packet.writeD(info.getSkill().getDisplayId()); packet.writeD(info.getSkill().getDisplayId());

View File

@@ -41,7 +41,6 @@ public class ExAcquirableSkillListByClass implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_ACQUIRABLE_SKILL_LIST_BY_CLASS.writeId(packet); OutgoingPackets.EX_ACQUIRABLE_SKILL_LIST_BY_CLASS.writeId(packet);
packet.writeH(_type.getId()); packet.writeH(_type.getId());
packet.writeH(_learnable.size()); packet.writeH(_learnable.size());
for (SkillLearn skill : _learnable) for (SkillLearn skill : _learnable)
@@ -54,7 +53,7 @@ public class ExAcquirableSkillListByClass implements IClientOutgoingPacket
packet.writeC(skill.getRequiredItems().size()); packet.writeC(skill.getRequiredItems().size());
if (_type == AcquireSkillType.SUBPLEDGE) if (_type == AcquireSkillType.SUBPLEDGE)
{ {
packet.writeH(0x00); packet.writeH(0);
} }
} }
return true; return true;

View File

@@ -61,7 +61,6 @@ public class ExAcquireSkillInfo implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_ACQUIRE_SKILL_INFO.writeId(packet); OutgoingPackets.EX_ACQUIRE_SKILL_INFO.writeId(packet);
packet.writeD(_id); packet.writeD(_id);
packet.writeD(_level); packet.writeD(_level);
packet.writeQ(_spCost); packet.writeQ(_spCost);
@@ -73,7 +72,6 @@ public class ExAcquireSkillInfo implements IClientOutgoingPacket
packet.writeD(holder.getId()); packet.writeD(holder.getId());
packet.writeQ(holder.getCount()); packet.writeQ(holder.getCount());
} }
packet.writeD(_skillRem.size()); packet.writeD(_skillRem.size());
for (Skill skill : _skillRem) for (Skill skill : _skillRem)
{ {

View File

@@ -36,7 +36,6 @@ public class ExAdenaInvenCount implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_ADENA_INVEN_COUNT.writeId(packet); OutgoingPackets.EX_ADENA_INVEN_COUNT.writeId(packet);
packet.writeQ(_player.getAdena()); packet.writeQ(_player.getAdena());
packet.writeH(_player.getInventory().getSize()); packet.writeH(_player.getInventory().getSize());
return true; return true;

View File

@@ -50,13 +50,11 @@ public class ExAirShipInfo implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_AIR_SHIP_INFO.writeId(packet); OutgoingPackets.EX_AIR_SHIP_INFO.writeId(packet);
packet.writeD(_ship.getObjectId()); packet.writeD(_ship.getObjectId());
packet.writeD(_x); packet.writeD(_x);
packet.writeD(_y); packet.writeD(_y);
packet.writeD(_z); packet.writeD(_z);
packet.writeD(_heading); packet.writeD(_heading);
packet.writeD(_captain); packet.writeD(_captain);
packet.writeD(_moveSpeed); packet.writeD(_moveSpeed);
packet.writeD(_rotationSpeed); packet.writeD(_rotationSpeed);
@@ -73,14 +71,13 @@ public class ExAirShipInfo implements IClientOutgoingPacket
} }
else else
{ {
packet.writeD(0x00); packet.writeD(0);
packet.writeD(0x00); packet.writeD(0);
packet.writeD(0x00); packet.writeD(0);
packet.writeD(0x00); packet.writeD(0);
packet.writeD(0x00); packet.writeD(0);
packet.writeD(0x00); packet.writeD(0);
} }
packet.writeD(_ship.getFuel()); packet.writeD(_ship.getFuel());
packet.writeD(_ship.getMaxFuel()); packet.writeD(_ship.getMaxFuel());
return true; return true;

View File

@@ -42,7 +42,6 @@ public class ExAirShipStopMove implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_MOVE_TO_LOCATION_AIR_SHIP.writeId(packet); OutgoingPackets.EX_MOVE_TO_LOCATION_AIR_SHIP.writeId(packet);
packet.writeD(_airShipId); packet.writeD(_airShipId);
packet.writeD(_playerId); packet.writeD(_playerId);
packet.writeD(_x); packet.writeD(_x);

View File

@@ -37,12 +37,10 @@ public class ExAirShipTeleportList implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_AIR_SHIP_TELEPORT_LIST.writeId(packet); OutgoingPackets.EX_AIR_SHIP_TELEPORT_LIST.writeId(packet);
packet.writeD(_dockId); packet.writeD(_dockId);
if (_teleports != null) if (_teleports != null)
{ {
packet.writeD(_teleports.length); packet.writeD(_teleports.length);
for (int i = 0; i < _teleports.length; i++) for (int i = 0; i < _teleports.length; i++)
{ {
packet.writeD(i - 1); packet.writeD(i - 1);

View File

@@ -50,13 +50,12 @@ public class ExAlchemySkillList implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_ALCHEMY_SKILL_LIST.writeId(packet); OutgoingPackets.EX_ALCHEMY_SKILL_LIST.writeId(packet);
packet.writeD(_skills.size()); packet.writeD(_skills.size());
for (Skill skill : _skills) for (Skill skill : _skills)
{ {
packet.writeD(skill.getId()); packet.writeD(skill.getId());
packet.writeD(skill.getLevel()); packet.writeD(skill.getLevel());
packet.writeQ(0x00); // Always 0 on Naia, SP i guess? packet.writeQ(0); // Always 0 on Naia, SP i guess?
packet.writeC(skill.getId() == CommonSkill.ALCHEMY_CUBE.getId() ? 0 : 1); // This is type in flash, visible or not packet.writeC(skill.getId() == CommonSkill.ALCHEMY_CUBE.getId() ? 0 : 1); // This is type in flash, visible or not
} }
return true; return true;

View File

@@ -47,12 +47,10 @@ public class ExAlterSkillRequest implements IClientOutgoingPacket
{ {
return true; return true;
} }
OutgoingPackets.EX_ALTER_SKILL_REQUEST.writeId(packet); OutgoingPackets.EX_ALTER_SKILL_REQUEST.writeId(packet);
packet.writeD(_nextSkillId); packet.writeD(_nextSkillId);
packet.writeD(_currentSkillId); packet.writeD(_currentSkillId);
packet.writeD(_alterTime); packet.writeD(_alterTime);
if (_alterTime > 0) if (_alterTime > 0)
{ {
_player.setAlterSkillActive(true); _player.setAlterSkillActive(true);
@@ -62,7 +60,6 @@ public class ExAlterSkillRequest implements IClientOutgoingPacket
_player.setAlterSkillActive(false); _player.setAlterSkillActive(false);
}, _alterTime * 1000); }, _alterTime * 1000);
} }
return true; return true;
} }
} }

View File

@@ -37,7 +37,6 @@ public class ExAskCoupleAction implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_ASK_COUPLE_ACTION.writeId(packet); OutgoingPackets.EX_ASK_COUPLE_ACTION.writeId(packet);
packet.writeD(_actionId); packet.writeD(_actionId);
packet.writeD(_objectId); packet.writeD(_objectId);
return true; return true;

View File

@@ -39,9 +39,8 @@ public class ExAskJoinMPCC implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_ASK_JOIN_MPCC.writeId(packet); OutgoingPackets.EX_ASK_JOIN_MPCC.writeId(packet);
packet.writeS(_requestorName); // name of CCLeader packet.writeS(_requestorName); // name of CCLeader
packet.writeD(0x00); // TODO: Find me packet.writeD(0); // TODO: Find me
return true; return true;
} }
} }

View File

@@ -38,7 +38,6 @@ public class ExAskJoinPartyRoom implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_ASK_JOIN_PARTY_ROOM.writeId(packet); OutgoingPackets.EX_ASK_JOIN_PARTY_ROOM.writeId(packet);
packet.writeS(_charName); packet.writeS(_charName);
packet.writeS(_roomName); packet.writeS(_roomName);
return true; return true;

View File

@@ -38,7 +38,6 @@ public class ExAskModifyPartyLooting implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_ASK_MODIFY_PARTY_LOOTING.writeId(packet); OutgoingPackets.EX_ASK_MODIFY_PARTY_LOOTING.writeId(packet);
packet.writeS(_requestor); packet.writeS(_requestor);
packet.writeD(_partyDistributionType.getId()); packet.writeD(_partyDistributionType.getId());
return true; return true;

View File

@@ -45,7 +45,6 @@ public class ExAttributeEnchantResult implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_ATTRIBUTE_ENCHANT_RESULT.writeId(packet); OutgoingPackets.EX_ATTRIBUTE_ENCHANT_RESULT.writeId(packet);
packet.writeD(_result); packet.writeD(_result);
packet.writeC(_isWeapon); packet.writeC(_isWeapon);
packet.writeH(_type); packet.writeH(_type);

View File

@@ -42,9 +42,8 @@ public class ExAutoSoulShot implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_AUTO_SOUL_SHOT.writeId(packet); OutgoingPackets.EX_AUTO_SOUL_SHOT.writeId(packet);
packet.writeD(_itemId); packet.writeD(_itemId);
// packet.writeD(_enable ? 0x01 : 0x00); // packet.writeD(_enable ? 1 : 0);
packet.writeD(_type); packet.writeD(_type);
return true; return true;
} }

View File

@@ -37,8 +37,7 @@ public class ExBaseAttributeCancelResult implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_BASE_ATTRIBUTE_CANCEL_RESULT.writeId(packet); OutgoingPackets.EX_BASE_ATTRIBUTE_CANCEL_RESULT.writeId(packet);
packet.writeD(1); // result
packet.writeD(0x01); // result
packet.writeD(_objId); packet.writeD(_objId);
packet.writeD(_attribute); packet.writeD(_attribute);
return true; return true;

View File

@@ -75,7 +75,6 @@ public class ExBasicActionList implements IClientOutgoingPacket
1149, 1150, 1151, 1152, 1149, 1150, 1151, 1152,
1153, 1154, 1155 1153, 1154, 1155
}; };
public static final int[] DEFAULT_ACTION_LIST = public static final int[] DEFAULT_ACTION_LIST =
{ {
0, 1, 2, 3, 0, 1, 2, 3,
@@ -145,7 +144,6 @@ public class ExBasicActionList implements IClientOutgoingPacket
5012, 5013, 5014, 5015 5012, 5013, 5014, 5015
}; };
//@formatter:on //@formatter:on
public static final ExBasicActionList STATIC_PACKET = new ExBasicActionList(DEFAULT_ACTION_LIST); public static final ExBasicActionList STATIC_PACKET = new ExBasicActionList(DEFAULT_ACTION_LIST);
private final int[] _actionIds; private final int[] _actionIds;
@@ -159,7 +157,6 @@ public class ExBasicActionList implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_BASIC_ACTION_LIST.writeId(packet); OutgoingPackets.EX_BASIC_ACTION_LIST.writeId(packet);
packet.writeD(_actionIds.length); packet.writeD(_actionIds.length);
for (int _actionId : _actionIds) for (int _actionId : _actionIds)
{ {

View File

@@ -34,13 +34,14 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
*/ */
public class ExBeautyItemList implements IClientOutgoingPacket public class ExBeautyItemList implements IClientOutgoingPacket
{ {
private int _colorCount;
private final BeautyData _beautyData;
private final Map<Integer, List<BeautyItem>> _colorData = new HashMap<>();
private static final int HAIR_TYPE = 0; private static final int HAIR_TYPE = 0;
private static final int FACE_TYPE = 1; private static final int FACE_TYPE = 1;
private static final int COLOR_TYPE = 2; private static final int COLOR_TYPE = 2;
private int _colorCount;
private final BeautyData _beautyData;
private final Map<Integer, List<BeautyItem>> _colorData = new HashMap<>();
public ExBeautyItemList(Player player) public ExBeautyItemList(Player player)
{ {
_beautyData = BeautyShopData.getInstance().getBeautyData(player.getRace(), player.getAppearance().getSexType()); _beautyData = BeautyShopData.getInstance().getBeautyData(player.getRace(), player.getAppearance().getSexType());
@@ -60,7 +61,6 @@ public class ExBeautyItemList implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_BEAUTY_ITEM_LIST.writeId(packet); OutgoingPackets.EX_BEAUTY_ITEM_LIST.writeId(packet);
packet.writeD(HAIR_TYPE); packet.writeD(HAIR_TYPE);
packet.writeD(_beautyData.getHairList().size()); packet.writeD(_beautyData.getHairList().size());
for (BeautyItem hair : _beautyData.getHairList().values()) for (BeautyItem hair : _beautyData.getHairList().values())
@@ -72,7 +72,6 @@ public class ExBeautyItemList implements IClientOutgoingPacket
packet.writeD(hair.getBeautyShopTicket()); packet.writeD(hair.getBeautyShopTicket());
packet.writeD(1); // Limit packet.writeD(1); // Limit
} }
packet.writeD(FACE_TYPE); packet.writeD(FACE_TYPE);
packet.writeD(_beautyData.getFaceList().size()); packet.writeD(_beautyData.getFaceList().size());
for (BeautyItem face : _beautyData.getFaceList().values()) for (BeautyItem face : _beautyData.getFaceList().values())
@@ -84,7 +83,6 @@ public class ExBeautyItemList implements IClientOutgoingPacket
packet.writeD(face.getBeautyShopTicket()); packet.writeD(face.getBeautyShopTicket());
packet.writeD(1); // Limit packet.writeD(1); // Limit
} }
packet.writeD(COLOR_TYPE); packet.writeD(COLOR_TYPE);
packet.writeD(_colorCount); packet.writeD(_colorCount);
for (Entry<Integer, List<BeautyItem>> entry : _colorData.entrySet()) for (Entry<Integer, List<BeautyItem>> entry : _colorData.entrySet())

View File

@@ -34,7 +34,6 @@ public class ExBirthdayPopup implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_NOTIFY_BIRTH_DAY.writeId(packet); OutgoingPackets.EX_NOTIFY_BIRTH_DAY.writeId(packet);
return true; return true;
} }
} }

View File

@@ -26,6 +26,12 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
*/ */
public class ExBrBroadcastEventState implements IClientOutgoingPacket public class ExBrBroadcastEventState implements IClientOutgoingPacket
{ {
public static final int APRIL_FOOLS = 20090401;
public static final int EVAS_INFERNO = 20090801; // event state (0 - hide, 1 - show), day (1-14), percent (0-100)
public static final int HALLOWEEN_EVENT = 20091031; // event state (0 - hide, 1 - show)
public static final int RAISING_RUDOLPH = 20091225; // event state (0 - hide, 1 - show)
public static final int LOVERS_JUBILEE = 20100214; // event state (0 - hide, 1 - show)
private final int _eventId; private final int _eventId;
private final int _eventState; private final int _eventState;
private int _param0; private int _param0;
@@ -36,12 +42,6 @@ public class ExBrBroadcastEventState implements IClientOutgoingPacket
private String _param5; private String _param5;
private String _param6; private String _param6;
public static final int APRIL_FOOLS = 20090401;
public static final int EVAS_INFERNO = 20090801; // event state (0 - hide, 1 - show), day (1-14), percent (0-100)
public static final int HALLOWEEN_EVENT = 20091031; // event state (0 - hide, 1 - show)
public static final int RAISING_RUDOLPH = 20091225; // event state (0 - hide, 1 - show)
public static final int LOVERS_JUBILEE = 20100214; // event state (0 - hide, 1 - show)
public ExBrBroadcastEventState(int eventId, int eventState) public ExBrBroadcastEventState(int eventId, int eventState)
{ {
_eventId = eventId; _eventId = eventId;
@@ -65,7 +65,6 @@ public class ExBrBroadcastEventState implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_BR_BROADCAST_EVENT_STATE.writeId(packet); OutgoingPackets.EX_BR_BROADCAST_EVENT_STATE.writeId(packet);
packet.writeD(_eventId); packet.writeD(_eventId);
packet.writeD(_eventState); packet.writeD(_eventState);
packet.writeD(_param0); packet.writeD(_param0);

View File

@@ -44,7 +44,6 @@ public class ExBrBuffEventState implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_BR_BUFF_EVENT_STATE.writeId(packet); OutgoingPackets.EX_BR_BUFF_EVENT_STATE.writeId(packet);
packet.writeD(_type); packet.writeD(_type);
packet.writeD(_value); packet.writeD(_value);
packet.writeD(_state); packet.writeD(_state);

View File

@@ -43,7 +43,6 @@ public class ExBrLoadEventTopRankers implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_BR_LOAD_EVENT_TOP_RANKERS.writeId(packet); OutgoingPackets.EX_BR_LOAD_EVENT_TOP_RANKERS.writeId(packet);
packet.writeD(_eventId); packet.writeD(_eventId);
packet.writeD(_day); packet.writeD(_day);
packet.writeD(_count); packet.writeD(_count);

View File

@@ -36,9 +36,8 @@ public class ExBrPremiumState implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_BR_PREMIUM_STATE.writeId(packet); OutgoingPackets.EX_BR_PREMIUM_STATE.writeId(packet);
packet.writeD(_player.getObjectId()); packet.writeD(_player.getObjectId());
packet.writeC(_player.hasPremiumStatus() ? 0x01 : 0x00); packet.writeC(_player.hasPremiumStatus() ? 1 : 0);
return true; return true;
} }
} }

View File

@@ -59,10 +59,8 @@ public class ExBuySellList extends AbstractItemPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_BUY_SELL_LIST.writeId(packet); OutgoingPackets.EX_BUY_SELL_LIST.writeId(packet);
packet.writeD(1); // Type SELL
packet.writeD(0x01); // Type SELL
packet.writeD(_inventorySlots); packet.writeD(_inventorySlots);
if ((_sellList != null)) if ((_sellList != null))
{ {
packet.writeH(_sellList.size()); packet.writeH(_sellList.size());
@@ -74,9 +72,8 @@ public class ExBuySellList extends AbstractItemPacket
} }
else else
{ {
packet.writeH(0x00); packet.writeH(0);
} }
if ((_refundList != null) && !_refundList.isEmpty()) if ((_refundList != null) && !_refundList.isEmpty())
{ {
packet.writeH(_refundList.size()); packet.writeH(_refundList.size());
@@ -90,10 +87,9 @@ public class ExBuySellList extends AbstractItemPacket
} }
else else
{ {
packet.writeH(0x00); packet.writeH(0);
} }
packet.writeC(_done ? 1 : 0);
packet.writeC(_done ? 0x01 : 0x00);
return true; return true;
} }
} }

View File

@@ -39,7 +39,6 @@ public class ExCastleState implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_CASTLE_STATE.writeId(packet); OutgoingPackets.EX_CASTLE_STATE.writeId(packet);
packet.writeD(_castleId); packet.writeD(_castleId);
packet.writeD(_castleSide.ordinal()); packet.writeD(_castleSide.ordinal());
return true; return true;

View File

@@ -52,7 +52,6 @@ public class ExChangeClientEffectInfo implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_CHANGE_CLIENT_EFFECT_INFO.writeId(packet); OutgoingPackets.EX_CHANGE_CLIENT_EFFECT_INFO.writeId(packet);
packet.writeD(_type); packet.writeD(_type);
packet.writeD(_key); packet.writeD(_key);
packet.writeD(_value); packet.writeD(_value);

View File

@@ -37,7 +37,6 @@ public class ExChangeNpcState implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_CHANGE_NPC_STATE.writeId(packet); OutgoingPackets.EX_CHANGE_NPC_STATE.writeId(packet);
packet.writeD(_objId); packet.writeD(_objId);
packet.writeD(_state); packet.writeD(_state);
return true; return true;

View File

@@ -49,7 +49,6 @@ public class ExChangePostState implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_CHANGE_POST_STATE.writeId(packet); OutgoingPackets.EX_CHANGE_POST_STATE.writeId(packet);
packet.writeD(_receivedBoard ? 1 : 0); packet.writeD(_receivedBoard ? 1 : 0);
packet.writeD(_changedMsgIds.length); packet.writeD(_changedMsgIds.length);
for (int postId : _changedMsgIds) for (int postId : _changedMsgIds)

View File

@@ -35,7 +35,6 @@ public class ExChangeToAwakenedClass implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_CHANGE_TO_AWAKENED_CLASS.writeId(packet); OutgoingPackets.EX_CHANGE_TO_AWAKENED_CLASS.writeId(packet);
packet.writeD(_classId); packet.writeD(_classId);
return true; return true;
} }

View File

@@ -47,7 +47,6 @@ public class ExChooseInventoryAttributeItem implements IClientOutgoingPacket
throw new IllegalArgumentException("Undefined Atribute item: " + stone); throw new IllegalArgumentException("Undefined Atribute item: " + stone);
} }
_level = ElementalAttributeData.getInstance().getMaxElementLevel(_itemId); _level = ElementalAttributeData.getInstance().getMaxElementLevel(_itemId);
// Register only items that can be put an attribute stone/crystal // Register only items that can be put an attribute stone/crystal
for (Item item : player.getInventory().getItems()) for (Item item : player.getInventory().getItems())
{ {
@@ -62,7 +61,6 @@ public class ExChooseInventoryAttributeItem implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_CHOOSE_INVENTORY_ATTRIBUTE_ITEM.writeId(packet); OutgoingPackets.EX_CHOOSE_INVENTORY_ATTRIBUTE_ITEM.writeId(packet);
packet.writeD(_itemId); packet.writeD(_itemId);
packet.writeQ(_count); packet.writeQ(_count);
packet.writeD(_atribute == AttributeType.FIRE ? 1 : 0); // Fire packet.writeD(_atribute == AttributeType.FIRE ? 1 : 0); // Fire

View File

@@ -35,7 +35,6 @@ public class ExCloseMPCC implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_CLOSE_MPCC.writeId(packet); OutgoingPackets.EX_CLOSE_MPCC.writeId(packet);
return true; return true;
} }
} }

View File

@@ -34,7 +34,6 @@ public class ExClosePartyRoom implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_CLOSE_PARTY_ROOM.writeId(packet); OutgoingPackets.EX_CLOSE_PARTY_ROOM.writeId(packet);
return true; return true;
} }
} }

View File

@@ -54,7 +54,6 @@ public class ExColosseumFenceInfo implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_COLOSSEUM_FENCE_INFO.writeId(packet); OutgoingPackets.EX_COLOSSEUM_FENCE_INFO.writeId(packet);
packet.writeD(_objId); packet.writeD(_objId);
packet.writeD(_clientState); packet.writeD(_clientState);
packet.writeD(_x); packet.writeD(_x);
@@ -62,7 +61,6 @@ public class ExColosseumFenceInfo implements IClientOutgoingPacket
packet.writeD(_z); packet.writeD(_z);
packet.writeD(_width); packet.writeD(_width);
packet.writeD(_length); packet.writeD(_length);
return true; return true;
} }
} }

View File

@@ -37,9 +37,8 @@ public class ExConfirmAddingContact implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_AGIT_AUCTION_CMD.writeId(packet); OutgoingPackets.EX_AGIT_AUCTION_CMD.writeId(packet);
packet.writeS(_charName); packet.writeS(_charName);
packet.writeD(_added ? 0x01 : 0x00); packet.writeD(_added ? 1 : 0);
return true; return true;
} }
} }

View File

@@ -43,12 +43,9 @@ public class ExCubeGameAddPlayer implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet); OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet);
packet.writeD(1);
packet.writeD(0x01);
packet.writeD(0xffffffff); packet.writeD(0xffffffff);
packet.writeD(_isRedTeam ? 1 : 0);
packet.writeD(_isRedTeam ? 0x01 : 0x00);
packet.writeD(_player.getObjectId()); packet.writeD(_player.getObjectId());
packet.writeS(_player.getName()); packet.writeS(_player.getName());
return true; return true;

View File

@@ -45,9 +45,7 @@ public class ExCubeGameChangePoints implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_BLOCK_UP_SET_STATE.writeId(packet); OutgoingPackets.EX_BLOCK_UP_SET_STATE.writeId(packet);
packet.writeD(2);
packet.writeD(0x02);
packet.writeD(_timeLeft); packet.writeD(_timeLeft);
packet.writeD(_bluePoints); packet.writeD(_bluePoints);
packet.writeD(_redPoints); packet.writeD(_redPoints);

View File

@@ -43,12 +43,10 @@ public class ExCubeGameChangeTeam implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet); OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet);
packet.writeD(5);
packet.writeD(0x05);
packet.writeD(_player.getObjectId()); packet.writeD(_player.getObjectId());
packet.writeD(_fromRedTeam ? 0x01 : 0x00); packet.writeD(_fromRedTeam ? 1 : 0);
packet.writeD(_fromRedTeam ? 0x00 : 0x01); packet.writeD(_fromRedTeam ? 0 : 1);
return true; return true;
} }
} }

View File

@@ -39,9 +39,7 @@ public class ExCubeGameChangeTimeToStart implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet); OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet);
packet.writeD(3);
packet.writeD(0x03);
packet.writeD(_seconds); packet.writeD(_seconds);
return true; return true;
} }

View File

@@ -35,7 +35,6 @@ public class ExCubeGameCloseUI implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet); OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet);
packet.writeD(0xffffffff); packet.writeD(0xffffffff);
return true; return true;
} }

View File

@@ -40,11 +40,9 @@ public class ExCubeGameEnd implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_BLOCK_UP_SET_STATE.writeId(packet); OutgoingPackets.EX_BLOCK_UP_SET_STATE.writeId(packet);
packet.writeD(1);
packet.writeD(0x01); packet.writeD(_isRedTeamWin ? 1 : 0);
packet.writeD(0); // TODO: Find me!
packet.writeD(_isRedTeamWin ? 0x01 : 0x00);
packet.writeD(0x00); // TODO: Find me!
return true; return true;
} }
} }

View File

@@ -55,14 +55,11 @@ public class ExCubeGameExtendedChangePoints implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_BLOCK_UP_SET_STATE.writeId(packet); OutgoingPackets.EX_BLOCK_UP_SET_STATE.writeId(packet);
packet.writeD(0);
packet.writeD(0x00);
packet.writeD(_timeLeft); packet.writeD(_timeLeft);
packet.writeD(_bluePoints); packet.writeD(_bluePoints);
packet.writeD(_redPoints); packet.writeD(_redPoints);
packet.writeD(_isRedTeam ? 1 : 0);
packet.writeD(_isRedTeam ? 0x01 : 0x00);
packet.writeD(_player.getObjectId()); packet.writeD(_player.getObjectId());
packet.writeD(_playerPoints); packet.writeD(_playerPoints);
return true; return true;

View File

@@ -43,12 +43,9 @@ public class ExCubeGameRemovePlayer implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet); OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet);
packet.writeD(2);
packet.writeD(0x02);
packet.writeD(0xffffffff); packet.writeD(0xffffffff);
packet.writeD(_isRedTeam ? 1 : 0);
packet.writeD(_isRedTeam ? 0x01 : 0x00);
packet.writeD(_player.getObjectId()); packet.writeD(_player.getObjectId());
return true; return true;
} }

View File

@@ -35,8 +35,7 @@ public class ExCubeGameRequestReady implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet); OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet);
packet.writeD(4);
packet.writeD(0x04);
return true; return true;
} }
} }

View File

@@ -30,7 +30,6 @@ public class ExCubeGameTeamList implements IClientOutgoingPacket
// Players Lists // Players Lists
private final List<Player> _bluePlayers; private final List<Player> _bluePlayers;
private final List<Player> _redPlayers; private final List<Player> _redPlayers;
// Common Values // Common Values
private final int _roomNumber; private final int _roomNumber;
@@ -51,12 +50,9 @@ public class ExCubeGameTeamList implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet); OutgoingPackets.EX_BLOCK_UP_SET_LIST.writeId(packet);
packet.writeD(0);
packet.writeD(0x00);
packet.writeD(_roomNumber); packet.writeD(_roomNumber);
packet.writeD(0xffffffff); packet.writeD(0xffffffff);
packet.writeD(_bluePlayers.size()); packet.writeD(_bluePlayers.size());
for (Player player : _bluePlayers) for (Player player : _bluePlayers)
{ {

View File

@@ -31,7 +31,6 @@ public class ExCursedWeaponList implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_CURSED_WEAPON_LIST.writeId(packet); OutgoingPackets.EX_CURSED_WEAPON_LIST.writeId(packet);
final Set<Integer> ids = CursedWeaponsManager.getInstance().getCursedWeaponsIds(); final Set<Integer> ids = CursedWeaponsManager.getInstance().getCursedWeaponsIds();
packet.writeD(ids.size()); packet.writeD(ids.size());
ids.forEach(packet::writeD); ids.forEach(packet::writeD);

View File

@@ -39,7 +39,6 @@ public class ExCursedWeaponLocation implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_CURSED_WEAPON_LOCATION.writeId(packet); OutgoingPackets.EX_CURSED_WEAPON_LOCATION.writeId(packet);
if (!_cursedWeaponInfo.isEmpty()) if (!_cursedWeaponInfo.isEmpty())
{ {
packet.writeD(_cursedWeaponInfo.size()); packet.writeD(_cursedWeaponInfo.size());
@@ -47,7 +46,6 @@ public class ExCursedWeaponLocation implements IClientOutgoingPacket
{ {
packet.writeD(w.id); packet.writeD(w.id);
packet.writeD(w.activated); packet.writeD(w.activated);
packet.writeD(w.pos.getX()); packet.writeD(w.pos.getX());
packet.writeD(w.pos.getY()); packet.writeD(w.pos.getY());
packet.writeD(w.pos.getZ()); packet.writeD(w.pos.getZ());

View File

@@ -34,7 +34,6 @@ public class ExDissmissMPCCRoom implements IClientOutgoingPacket
public boolean write(PacketWriter packet) public boolean write(PacketWriter packet)
{ {
OutgoingPackets.EX_DISSMISS_MPCC_ROOM.writeId(packet); OutgoingPackets.EX_DISSMISS_MPCC_ROOM.writeId(packet);
return true; return true;
} }
} }

Some files were not shown because too many files have changed in this diff Show More