|
|
 | |  |  |
你說的還是有問題,可能是你加的位置不對。代碼如下:
- /**
- * 物件封包
- *
- * @param npc
- */
- public S_NPCPack(final L1NpcInstance npc,final L1PcInstance pc) {
- this.writeC(S_PUT_OBJECT);
- this.writeH(npc.getX());
- this.writeH(npc.getY());
- this.writeD(npc.getId());
- if (npc.getTempCharGfx() == 0) {
- this.writeH(npc.getGfxId());
- } else {
- this.writeH(npc.getTempCharGfx());
- }
- if (npc.getNpcTemplate().is_doppel() && (npc.getGfxId() != 31)) { // スライムの姿をしていなければドッペル
- this.writeC(0x04); // 拿剑
- } else {
- this.writeC(npc.getStatus());
- }
- this.writeC(npc.getHeading());
- this.writeC(npc.getChaLightSize());
- this.writeC(npc.getMoveSpeed());
- this.writeD((int) npc.getExp());
- this.writeH(npc.getTempLawful());
- String levelname = npc.getNameId();
- if ((pc.getLevel() - npc.getLevel() >= 5 && pc.getLevel()
- - npc.getLevel() <= 10)
- || (npc.getLevel() - pc.getLevel() >= 5 && npc.getLevel()
- - pc.getLevel() <= 10)) {
- levelname = "\\f2" + npc.getNameId();
- } else if (npc.getLevel() - pc.getLevel() >= 30) {
- levelname = "\\f3" + npc.getNameId();
- } else if (npc.getLevel() - pc.getLevel() >= 20) {
- levelname = "\\fC" + npc.getNameId();
- } else if (npc.getLevel() - pc.getLevel() >= 11) {
- levelname = "\\f:" + npc.getNameId();
- }
- writeS(levelname);
- if (!ConfigAlt.NPCid){
- writeS(levelname);
- }else{
- writeS(levelname + "[" + npc.getNpcId() + "]");
- }
- this.writeS(npc.getTitle());//白条问题修复 by IQN 20240808
- /**
- * ???? - 0:mob,item(atk pointer), 1:poisoned(), 2:invisable(), 4:pc,
- * 8:cursed(), 16:brave(), 32:??, 64:??(??), 128:invisable but name
- */
- int status = 0;
- if (npc.getPoison() != null) { // 毒状态
- if (npc.getPoison().getEffectId() == 1) {
- status |= STATUS_POISON;
- }
- }
- if (npc.getNpcTemplate().is_doppel()) {
- // PC属性だとエヴァの祝福を渡せないためWIZクエストのドッペルは例外
- if (npc.getNpcTemplate().get_npcId() != 81069) {
- status |= STATUS_PC;
- }
- }
- if (npc.getNpcTemplate().get_npcId() == 90024) {
- status |= STATUS_POISON;
- }
- this.writeC(status); // 状态
- this.writeD(0x00000000); // 0以外にするとC_27が飞ぶ
- this.writeS(null);
- this.writeS(null); // マスター名?
- this.writeC(0x00); // 物件分类
- this.writeC(0xff); // HP
- this.writeC(0x00);
- this.writeC(0x00);// LV
- // this.writeC(npc.getLevel());// LV
- this.writeC(0x00);
- this.writeC(0xff);
- this.writeC(0xff);
- }
複製代碼
| |  | |  |
|
|