 | 分享一鍵血盟組隊
在C包下 C_NPCAction類下 新增
if (s.matches("yjzd"))
{
Iterator<L1PcInstance> localPreparedStatement;
for (localPreparedStatement = World.get().getAllPlayers().iterator(); localPreparedStatement.hasNext();)
{
L1PcInstance tgpc = (L1PcInstance)localPreparedStatement.next();
if (pc.getLocation().isInScreen(tgpc.getLocation()) && !tgpc.isInParty() && tgpc.getClanname().equalsIgnoreCase(pc.getClanname()) && pc.getId() != tgpc.getId())
{
tgpc.setPartyID(pc.getId());
tgpc.sendPackets(new S_Message_YN(953, pc.getName()));
pc.sendPackets(new S_SystemMessage((new StringBuilder("\\fR邀請與你\\fY同盟或無盟\\fR的玩家\\fY【")).append(tgpc.getName()).append("】\\fR加入隊伍!").toString()));
}
if (pc.getLocation().isInScreen(tgpc.getLocation()) && pc.getId() != tgpc.getId() && (tgpc.isInParty() || !tgpc.getClanname().equalsIgnoreCase(pc.getClanname())))
pc.sendPackets(new S_SystemMessage((new StringBuilder("\\fR玩家\\fY【")).append(tgpc.getName()).append("】\\fR與你\\fY不同盟\\fR或\\fV已經有隊伍了!").toString()));
}
}
請注意 else的寫法
此寫法是 執行道具的寫法 依薇版本!!
大陸JAVA技術 QQ:263075225
| |