看他的寫法應該是打算只用一個道具就能選擇召喚哪個龍門
但是出現的對話框卻沒有正確的連結到各自的NPC
看起來這功能還沒寫完整
我有另一個寫法不會出現龍門選單
47010改為:龍門鑰匙(地龍),classname欄位設定為extra.DragonKey 70932
增加47011為:龍門鑰匙(水龍), classname欄位設定為extra.DragonKey 70937
再增加47012為:龍門鑰匙(風龍), classname欄位設定為extra.DragonKey 70934
點擊鑰匙後能召出龍門並正確連到龍門對話檔
能夠正常進入副本地圖
====================以下為寫法===============================
package com.lineage.data.item_etcitem.extra;
import com.lineage.config.ConfigAlt;
import com.lineage.data.executor.ItemExecutor;
import com.lineage.server.model.Instance.L1ItemInstance;
import com.lineage.server.model.Instance.L1PcInstance;
import com.lineage.server.model.L1CastleLocation;
import com.lineage.server.serverpackets.S_ServerMessage;
import com.lineage.server.serverpackets.S_SystemMessage;
import com.lineage.server.utils.L1SpawnUtil;
import com.lineage.server.world.World;
public class DragonKey
extends ItemExecutor {
private int _npcId;
private int _time;
private DragonKey() {
}
public static ItemExecutor get() {
return new DragonKey();
}
public void execute(int[] data, L1PcInstance pc, L1ItemInstance item) {
if (pc.getMapId() == 16384 || pc.getMapId() == 16896 || pc.getMapId() == 17408 || pc.getMapId() == 17920 || pc.getMapId() == 18432 || pc.getMapId() == 18944 || pc.getMapId() == 19968 || pc.getMapId() == 19456 || pc.getMapId() == 20480 || pc.getMapId() == 20992 || pc.getMapId() == 21504 || pc.getMapId() == 22016 || pc.getMapId() == 22528 || pc.getMapId() == 23040 || pc.getMapId() == 23552 || pc.getMapId() == 24064 || pc.getMapId() == 24576 || pc.getMapId() == 25088 || L1CastleLocation.checkInAllWarArea(pc.getLocation())) {
pc.sendPackets(new S_ServerMessage(79));
return;
}
boolean isChecked = false;
for (int mapid : ConfigAlt.DRAGON_KEY_MAP_LIST) {
if (mapid != pc.getMapId()) continue;
isChecked = true;
break;
}
if (!isChecked) {
pc.sendPackets(new S_ServerMessage(1892));
return;
}
if (this._npcId == 0) {
pc.sendPackets(new S_SystemMessage("龍門編號設定錯誤,請通知線上GM"));
return;
}
pc.getInventory().deleteItem(item);
int timeDragon = this._time;
L1SpawnUtil.spawn(pc, this._npcId, 0, timeDragon);
World.get().broadcastPacketToAll(new S_ServerMessage(2921));
}
public void set_set(String[] set) {
try {
this._npcId = Integer.parseInt(set[1]);
this._time = Integer.parseInt(set[2]);
}
catch (Exception exception) {
}
}
}