📄 s_owncharpack.java
字号:
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package l1j.server.server.serverpackets;
import java.util.logging.Logger;
import l1j.server.server.Opcodes;
import l1j.server.server.model.Instance.L1PcInstance;
// Referenced classes of package l1j.server.server.serverpackets:
// ServerBasePacket
public class S_OwnCharPack extends ServerBasePacket {
private static final String S_OWN_CHAR_PACK = "[S] S_OwnCharPack";
private static Logger _log = Logger
.getLogger(S_OwnCharPack.class.getName());
private static final int STATUS_POISON = 1;
private static final int STATUS_INVISIBLE = 2;
private static final int STATUS_PC = 4;
private static final int STATUS_FREEZE = 8;
private static final int STATUS_BRAVE = 16;
private static final int STATUS_ELFBRAVE = 32;
private static final int STATUS_FASTMOVABLE = 64;
private static final int STATUS_GHOST = 128;
private byte[] _byte = null;
public S_OwnCharPack(L1PcInstance pc) {
buildPacket(pc);
}
private void buildPacket(L1PcInstance pc) {
int status = STATUS_PC;
// グール毒みたいな緑の毒
// if (pc.isPoison()) {
// status |= STATUS_POISON;
// }
if (pc.isInvisble() || pc.isGmInvis()) {
status |= STATUS_INVISIBLE;
}
if (pc.isBrave()) {
status |= STATUS_BRAVE;
}
if (pc.isElfBrave()) {
// エルヴンワッフルの場合は、STATUS_BRAVEとSTATUS_ELFBRAVEを立てる。
// STATUS_ELFBRAVEのみでは效果が無い?
status |= STATUS_BRAVE;
status |= STATUS_ELFBRAVE;
}
if (pc.isFastMovable()) {
status |= STATUS_FASTMOVABLE;
}
if (pc.isGhost()) {
status |= STATUS_GHOST;
}
// int addbyte = 0;
writeC(Opcodes.S_OPCODE_CHARPACK);
writeH(pc.getX());
writeH(pc.getY());
writeD(pc.getId());
if (pc.isDead()) {
writeH(pc.getTempCharGfxAtDead());
} else {
writeH(pc.getTempCharGfx());
}
if (pc.isDead()) {
writeC(pc.getStatus());
} else {
writeC(pc.getCurrentWeapon());
}
writeC(pc.getHeading());
// writeC(addbyte);
writeC(pc.getOwnLightSize());
writeC(pc.getMoveSpeed());
writeD(pc.getExp());
writeH(pc.getLawful());
writeS(pc.getName());
writeS(pc.getTitle());
writeC(status);
writeD(pc.getClanid());
writeS(pc.getClanname()); // クラン名
writeS(null); // ペッホチング?
writeC(0); // ?
if (pc.isInParty()) // パーティー中
{
writeC(100 * pc.getCurrentHp() / pc.getMaxHp());
} else {
writeC(0xFF);
}
writeC(0); // タルクック距離(通り)
writeC(0); // PC = 0, Mon = Lv
writeC(0); // ?
writeC(0xFF);
writeC(0xFF);
}
@Override
public byte[] getContent() {
if (_byte == null) {
_byte = _bao.toByteArray();
}
return _byte;
}
@Override
public String getType() {
return S_OWN_CHAR_PACK;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -