- UID
- 30573
- 好友
- 0
- 记录
- 0
- 日志
- 0
- 相册
- 0
- 回帖
- 56
- 主题
- 1
- 分享
- 0
- 精华
- 0
- 积分
- 42
- 阅读权限
- 1
- 注册时间
- 2010-7-9
- 在线时间
- 6 小时
- 最后登录
- 2016-2-7
新手上路
- 威望
- 2 点
- 冒险币
- 102 个
- 贡献值
- 1 点
- 好评度
- 0 点
|
发表于 2015-2-16 21:23:16
|
显示全部楼层
当人物达到一个等级,自动打开NPC
打开 MapleCharacter.java
在类似net.s f.odinms.scripting下面添加
import net.s f.odinms.scripting.npc.NPCScriptManager;
找到
if (level == 200 && !isGM()) {
exp.set(0);
MaplePacket packet = MaplePacketCreator.serverNotice(6, "[Congrats] " + getName() + " has reached Level 200! Congratulate " + getName() + " on such an amazing achievment!");
try {
getClient().getChannelServer().getWorldInterface().broadcastMessage(getName(), packet.getBytes());
} catch (RemoteException e) {
getClient().getChannelServer().reconnectWorld();
}
}
增加
if (level == 10) {
NPCScriptManager npc = NPCScriptManager.getInstance();
npc.start(client, 9201027);
}
if (level == 30) {
NPCScriptManager npc = NPCScriptManager.getInstance();
npc.start(client, 9201027);
}
if (level == 70) {
NPCScriptManager npc = NPCScriptManager.getInstance();
npc.start(client, 9201027);
}
if (level == 120) {
NPCScriptManager npc = NPCScriptManager.getInstance();
npc.start(client, 9201027);
}
if (level == 200) {
NPCScriptManager npc = NPCScriptManager.getInstance();
npc.start(client, 9201027);
}
得到某个物品与NPC对话
if (haveItem == [itemid, amount]) {
NPCScriptManager npc = NPCScriptManager.getInstance();
npc.start(client, [npcid]);
} |
|