Sync with L2JServer Jan 12th 2015.
This commit is contained in:
@@ -18,12 +18,9 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jserver.gameserver.model.PcCondOverride;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Summon;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2TrapInstance;
|
||||
import com.l2jserver.gameserver.model.skills.AbnormalVisualEffect;
|
||||
import com.l2jserver.gameserver.model.zone.ZoneId;
|
||||
|
||||
public abstract class AbstractNpcInfo extends L2GameServerPacket
|
||||
@@ -125,7 +122,7 @@ public abstract class AbstractNpcInfo extends L2GameServerPacket
|
||||
writeD(_trap.getPvpFlag());
|
||||
writeD(_trap.getKarma());
|
||||
|
||||
writeD(_trap.isInvisible() ? _trap.getAbnormalVisualEffects() | AbnormalVisualEffect.STEALTH.getMask() : _trap.getAbnormalVisualEffects());
|
||||
writeD(0); // was AVE and was adding stealth
|
||||
writeD(0x00); // clan id
|
||||
writeD(0x00); // crest id
|
||||
writeD(0000); // C2
|
||||
@@ -178,16 +175,6 @@ public abstract class AbstractNpcInfo extends L2GameServerPacket
|
||||
@Override
|
||||
protected void writeImpl()
|
||||
{
|
||||
boolean gmSeeInvis = false;
|
||||
if (isInvisible())
|
||||
{
|
||||
final L2PcInstance activeChar = getClient().getActiveChar();
|
||||
if ((activeChar != null) && activeChar.canOverrideCond(PcCondOverride.SEE_ALL_PLAYERS))
|
||||
{
|
||||
gmSeeInvis = true;
|
||||
}
|
||||
}
|
||||
|
||||
writeC(0x0c);
|
||||
writeD(_summon.getObjectId());
|
||||
writeD(_idTemplate + 1000000); // npctype id
|
||||
@@ -228,7 +215,7 @@ public abstract class AbstractNpcInfo extends L2GameServerPacket
|
||||
writeD(_summon.getPvpFlag());
|
||||
writeD(_summon.getKarma());
|
||||
|
||||
writeD(gmSeeInvis ? _summon.getAbnormalVisualEffects() | AbnormalVisualEffect.STEALTH.getMask() : _summon.getAbnormalVisualEffects());
|
||||
writeD(0); // was AVE and was adding stealth
|
||||
|
||||
writeD(0x00); // clan id
|
||||
writeD(0x00); // crest id
|
||||
@@ -246,7 +233,7 @@ public abstract class AbstractNpcInfo extends L2GameServerPacket
|
||||
writeD(_form); // CT1.5 Pet form and skills
|
||||
writeC(0x01);
|
||||
writeC(0x01);
|
||||
writeD(_summon.getAbnormalVisualEffectSpecial());
|
||||
// writeD(_summon.getAbnormalVisualEffectSpecial());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -18,12 +18,15 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.instancemanager.CursedWeaponsManager;
|
||||
import com.l2jserver.gameserver.model.PcCondOverride;
|
||||
import com.l2jserver.gameserver.model.actor.L2Decoy;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.Inventory;
|
||||
import com.l2jserver.gameserver.model.skills.AbnormalVisualEffect;
|
||||
import com.l2jserver.gameserver.model.zone.ZoneId;
|
||||
|
||||
public class CharInfo extends L2GameServerPacket
|
||||
@@ -252,10 +255,11 @@ public class CharInfo extends L2GameServerPacket
|
||||
writeD((int) Math.round(_activeChar.getCurrentMp())); // Confirmed
|
||||
|
||||
writeC(0x00); // TODO: Find me!
|
||||
writeD(_activeChar.getAbnormalVisualEffectsList().size()); // Confirmed
|
||||
for (int abnormalId : _activeChar.getAbnormalVisualEffectsList())
|
||||
final Set<AbnormalVisualEffect> abnormalVisualEffects = _activeChar.getCurrentAbnormalVisualEffects();
|
||||
writeD(abnormalVisualEffects.size()); // Confirmed
|
||||
for (AbnormalVisualEffect abnormalVisualEffect : abnormalVisualEffects)
|
||||
{
|
||||
writeH(abnormalId); // Confirmed
|
||||
writeH(abnormalVisualEffect.getClientId()); // Confirmed
|
||||
}
|
||||
writeC(0x00); // TODO: Find me!
|
||||
writeC(_activeChar.isHairAccessoryEnabled() ? 0x01 : 0x00); // Hair accessory
|
||||
|
@@ -62,9 +62,8 @@ public class CharSelected extends L2GameServerPacket
|
||||
writeD(_activeChar.getKarma()); // thx evill33t
|
||||
writeD(_activeChar.getPkKills());
|
||||
writeD(GameTimeController.getInstance().getGameTime() % (24 * 60)); // "reset" on 24th hour
|
||||
writeD(_activeChar.getClassId().getId());
|
||||
|
||||
writeD(0x00);
|
||||
writeD(_activeChar.getClassId().getId());
|
||||
|
||||
writeB(new byte[16]);
|
||||
|
||||
|
@@ -18,24 +18,39 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
|
||||
|
||||
public class EnchantResult extends L2GameServerPacket
|
||||
{
|
||||
public static int SUCCESS = 0;
|
||||
public static int FAIL = 1;
|
||||
public static int ERROR = 2;
|
||||
public static int BLESSED_FAIL = 3;
|
||||
public static int NO_CRYSTAL = 4;
|
||||
public static int SAFE_FAIL = 5;
|
||||
private final int _result;
|
||||
private final int _crystal;
|
||||
private final int _count;
|
||||
private final int _enchantLevel;
|
||||
private final int[] _enchantOptions;
|
||||
|
||||
public EnchantResult(int result, int crystal, int count)
|
||||
{
|
||||
this(result, crystal, count, 0);
|
||||
}
|
||||
|
||||
public EnchantResult(int result, int crystal, int count, int enchantLevel)
|
||||
public EnchantResult(int result, int crystal, int count, int enchantLevel, int[] options)
|
||||
{
|
||||
_result = result;
|
||||
_crystal = crystal;
|
||||
_count = count;
|
||||
_enchantLevel = enchantLevel;
|
||||
_enchantOptions = options;
|
||||
}
|
||||
|
||||
public EnchantResult(int result, int crystal, int count)
|
||||
{
|
||||
this(result, crystal, count, 0, L2ItemInstance.DEFAULT_ENCHANT_OPTIONS);
|
||||
}
|
||||
|
||||
public EnchantResult(int result, L2ItemInstance item)
|
||||
{
|
||||
this(result, 0, 0, 0, item.getEnchantOptions());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -46,8 +61,9 @@ public class EnchantResult extends L2GameServerPacket
|
||||
writeD(_crystal);
|
||||
writeQ(_count);
|
||||
writeD(_enchantLevel);
|
||||
writeH(0x00);
|
||||
writeH(0x00);
|
||||
writeH(0x00);
|
||||
for (int option : _enchantOptions)
|
||||
{
|
||||
writeH(option);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,53 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2015 L2J Server
|
||||
*
|
||||
*
|
||||
* This file is part of L2J Server.
|
||||
*
|
||||
*
|
||||
* L2J Server is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* L2J Server is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.model.actor.stat.PcStat;
|
||||
import com.l2jserver.gameserver.model.variables.AccountVariables;
|
||||
import com.l2jserver.gameserver.network.L2GameClient;
|
||||
|
||||
/**
|
||||
* ExBrExtraUserInfo server packet implementation.
|
||||
* @author Kerberos, Zoey76
|
||||
* @author Sdw
|
||||
*/
|
||||
public class ExBrExtraUserInfo extends L2GameServerPacket
|
||||
public class ExLoginVitalityEffectInfo extends L2GameServerPacket
|
||||
{
|
||||
/** Player object ID. */
|
||||
private final int _charObjId;
|
||||
/** Event abnormal visual effects map. */
|
||||
private final int _abnormalVisualEffectsEvent;
|
||||
/** Lecture mark. */
|
||||
private final int _lectureMark;
|
||||
private final int _points;
|
||||
|
||||
public ExBrExtraUserInfo(L2PcInstance player)
|
||||
public ExLoginVitalityEffectInfo(L2GameClient client)
|
||||
{
|
||||
_charObjId = player.getObjectId();
|
||||
_abnormalVisualEffectsEvent = player.getAbnormalVisualEffectEvent();
|
||||
_lectureMark = 1; // TODO: Implement.
|
||||
setInvisible(player.isInvisible());
|
||||
final AccountVariables vars = new AccountVariables(client.getAccountName());
|
||||
_points = vars.getInt(PcStat.VITALITY_VARIABLE, Config.STARTING_VITALITY_POINTS);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0xDB);
|
||||
writeD(_charObjId);
|
||||
writeD(_abnormalVisualEffectsEvent);
|
||||
writeC(_lectureMark);
|
||||
writeH(0x119);
|
||||
|
||||
writeD((int) (Config.RATE_VITALITY_EXP_MULTIPLIER * 100));
|
||||
writeD(5); // Remaining item counts
|
||||
|
||||
writeD(_points);
|
||||
writeD(0);
|
||||
writeD(0);
|
||||
writeD(0);
|
||||
}
|
||||
}
|
@@ -29,16 +29,14 @@ public class ExPledgeEmblem extends L2GameServerPacket
|
||||
private final int _clanId;
|
||||
private final byte[] _data;
|
||||
private final int _chunkId;
|
||||
private final int _chunkSize;
|
||||
private static final int TOTAL_SIZE = 65664;
|
||||
|
||||
public ExPledgeEmblem(int crestId, byte[] chunkedData, int clanId, int chunkId, int chunkSize)
|
||||
public ExPledgeEmblem(int crestId, byte[] chunkedData, int clanId, int chunkId)
|
||||
{
|
||||
_crestId = crestId;
|
||||
_data = chunkedData;
|
||||
_clanId = clanId;
|
||||
_chunkId = chunkId;
|
||||
_chunkSize = chunkSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -51,7 +49,6 @@ public class ExPledgeEmblem extends L2GameServerPacket
|
||||
writeD(_crestId);
|
||||
writeD(_chunkId);
|
||||
writeD(TOTAL_SIZE);
|
||||
writeD(_chunkSize);
|
||||
if (_data != null)
|
||||
{
|
||||
writeD(_data.length);
|
||||
|
@@ -23,6 +23,8 @@ package com.l2jserver.gameserver.network.serverpackets;
|
||||
*/
|
||||
public class ExRemoveEnchantSupportItemResult extends L2GameServerPacket
|
||||
{
|
||||
public static final ExRemoveEnchantSupportItemResult STATIC_PACKET = new ExRemoveEnchantSupportItemResult();
|
||||
|
||||
public ExRemoveEnchantSupportItemResult()
|
||||
{
|
||||
}
|
||||
|
@@ -18,7 +18,10 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.skills.AbnormalVisualEffect;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
@@ -40,11 +43,12 @@ public class ExUserInfoAbnormalVisualEffect extends L2GameServerPacket
|
||||
|
||||
writeD(_activeChar.getObjectId());
|
||||
writeD(_activeChar.getTransformationId());
|
||||
writeD(_activeChar.getAbnormalVisualEffectsList().size());
|
||||
|
||||
for (int abnormalVisualEffectId : _activeChar.getAbnormalVisualEffectsList())
|
||||
final Set<AbnormalVisualEffect> abnormalVisualEffects = _activeChar.getCurrentAbnormalVisualEffects();
|
||||
writeD(abnormalVisualEffects.size());
|
||||
for (AbnormalVisualEffect abnormalVisualEffect : abnormalVisualEffects)
|
||||
{
|
||||
writeH(abnormalVisualEffectId);
|
||||
writeH(abnormalVisualEffect.getClientId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -55,8 +55,8 @@ public final class HennaInfo extends L2GameServerPacket
|
||||
writeC(_activeChar.getHennaStatMEN()); // equip MEN
|
||||
writeC(_activeChar.getHennaStatDEX()); // equip DEX
|
||||
writeC(_activeChar.getHennaStatWIT()); // equip WIT
|
||||
writeC(0x00); // equip LUC
|
||||
writeC(0x00); // equip CHA
|
||||
writeC(_activeChar.getHennaStatLUC()); // equip LUC
|
||||
writeC(_activeChar.getHennaStatCHA()); // equip CHA
|
||||
writeD(3 - _activeChar.getHennaEmptySlots()); // Slots
|
||||
writeD(_hennas.size()); // Size
|
||||
for (L2Henna henna : _hennas)
|
||||
|
@@ -57,10 +57,10 @@ public class HennaItemDrawInfo extends L2GameServerPacket
|
||||
writeC(_activeChar.getDEX() + _henna.getStatDEX()); // equip DEX
|
||||
writeD(_activeChar.getWIT()); // current WIT
|
||||
writeC(_activeChar.getWIT() + _henna.getStatWIT()); // equip WIT
|
||||
writeD(0x00); // current LUC
|
||||
writeC(0x00); // equip LUC
|
||||
writeD(0x00); // current CHA
|
||||
writeC(0x00); // equip CHA
|
||||
writeD(_activeChar.getLUC()); // current LUC
|
||||
writeC(_activeChar.getLUC() + _henna.getStatLUC()); // equip LUC
|
||||
writeD(_activeChar.getCHA()); // current CHA
|
||||
writeC(_activeChar.getCHA() + _henna.getStatCHA()); // equip CHA
|
||||
writeD(0x00); // TODO: Find me!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -57,10 +57,10 @@ public final class HennaItemRemoveInfo extends L2GameServerPacket
|
||||
writeC(_activeChar.getDEX() - _henna.getStatDEX()); // equip DEX
|
||||
writeD(_activeChar.getWIT()); // current WIT
|
||||
writeC(_activeChar.getWIT() - _henna.getStatWIT()); // equip WIT
|
||||
writeD(0x00); // current LUC
|
||||
writeC(0x00); // equip LUC
|
||||
writeD(0x00); // current CHA
|
||||
writeC(0x00); // equip CHA
|
||||
writeD(_activeChar.getLUC()); // current LUC
|
||||
writeC(_activeChar.getLUC() - _henna.getStatLUC()); // equip LUC
|
||||
writeD(_activeChar.getCHA()); // current CHA
|
||||
writeC(_activeChar.getCHA() - _henna.getStatCHA()); // equip CHA
|
||||
writeD(0x00);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -28,6 +28,7 @@ import com.l2jserver.gameserver.instancemanager.TownManager;
|
||||
import com.l2jserver.gameserver.model.L2Clan;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2GuardInstance;
|
||||
import com.l2jserver.gameserver.model.skills.AbnormalVisualEffect;
|
||||
import com.l2jserver.gameserver.model.zone.ZoneId;
|
||||
|
||||
/**
|
||||
@@ -42,7 +43,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
|
||||
(byte) 0x0C,
|
||||
(byte) 0x0C,
|
||||
(byte) 0x00,
|
||||
(byte) 0x04
|
||||
(byte) 0x00
|
||||
};
|
||||
|
||||
private int _initSize = 0;
|
||||
@@ -54,10 +55,12 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
|
||||
private int _allyId = 0;
|
||||
private int _clanId = 0;
|
||||
private int _statusMask = 0;
|
||||
private final Set<AbnormalVisualEffect> _abnormalVisualEffects;
|
||||
|
||||
public NpcInfo(L2Npc npc)
|
||||
{
|
||||
_npc = npc;
|
||||
_abnormalVisualEffects = npc.getCurrentAbnormalVisualEffects();
|
||||
|
||||
if (npc.getTemplate().getDisplayId() != npc.getTemplate().getId())
|
||||
{
|
||||
@@ -131,7 +134,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
|
||||
addComponentType(NpcInfoType.NAME);
|
||||
}
|
||||
|
||||
if (!npc.getAbnormalVisualEffectsList().isEmpty())
|
||||
if (!_abnormalVisualEffects.isEmpty())
|
||||
{
|
||||
addComponentType(NpcInfoType.ABNORMALS);
|
||||
}
|
||||
@@ -182,8 +185,10 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
|
||||
_statusMask |= 0x08;
|
||||
}
|
||||
|
||||
// Add one byte.
|
||||
_blockSize++;
|
||||
if (_statusMask != 0)
|
||||
{
|
||||
addComponentType(NpcInfoType.VISUAL_STATE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -382,15 +387,17 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
|
||||
writeD(_allyCrest);
|
||||
}
|
||||
|
||||
writeC(_statusMask);
|
||||
if (containsMask(NpcInfoType.VISUAL_STATE))
|
||||
{
|
||||
writeC(_statusMask);
|
||||
}
|
||||
|
||||
if (containsMask(NpcInfoType.ABNORMALS))
|
||||
{
|
||||
final Set<Integer> visualEffects = _npc.getAbnormalVisualEffectsList();
|
||||
writeH(visualEffects.size());
|
||||
for (int visualEffect : visualEffects)
|
||||
writeH(_abnormalVisualEffects.size());
|
||||
for (AbnormalVisualEffect abnormalVisualEffect : _abnormalVisualEffects)
|
||||
{
|
||||
writeH(visualEffect);
|
||||
writeH(abnormalVisualEffect.getClientId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -18,9 +18,12 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.serverpackets;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.L2Summon;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2ServitorInstance;
|
||||
import com.l2jserver.gameserver.model.skills.AbnormalVisualEffect;
|
||||
|
||||
public class PetInfo extends L2GameServerPacket
|
||||
{
|
||||
@@ -160,12 +163,13 @@ public class PetInfo extends L2GameServerPacket
|
||||
writeC(0x00); // Used Summon Points
|
||||
writeC(0x00); // Maximum Summon Points
|
||||
|
||||
writeH(_summon.getAbnormalVisualEffectsList().size()); // Confirmed
|
||||
for (int abnormalId : _summon.getAbnormalVisualEffectsList())
|
||||
final Set<AbnormalVisualEffect> aves = _summon.getCurrentAbnormalVisualEffects();
|
||||
writeH(aves.size()); // Confirmed
|
||||
for (AbnormalVisualEffect ave : aves)
|
||||
{
|
||||
writeH(abnormalId); // Confirmed
|
||||
writeH(ave.getClientId()); // Confirmed
|
||||
}
|
||||
|
||||
writeC(0x00); // TODO: Find me
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user