底比斯天堂
瘋天堂私服發佈網站廣告欄位!
害怕天堂私服倒閉嗎?快使用天堂分析師!
天堂私服抽獎扭蛋物品及機率測試器
天堂私服稱號顏色製造器
瘋天堂私服發佈網站教您註冊推文收藏私服!
天堂私服血量魔力計算器
瘋天堂私服發布網站廣告贊助及爆料私服客服
教您如何不用註冊也可以推文天堂私服!
天堂私服270怪物查詢掉落資料庫
天堂私服盟徽製造器
test0428
2009-02-21 17:41

天堂新增組隊等級限制的java寫法!

新增組隊等級限制


修改

C_CreateParty.java

加入


// 限制玩家組隊等級
import l1j.server.Config;
// 限制玩家組隊等級 end


搜尋

L1PcInstance targetPc = (L1PcInstance) temp;


下面加入

// 限制玩家組隊等級
// 低組低
if (pc.getLevel() <= Config.Party_Lv && targetPc.getLevel() <= Config.Party_Lv) {
pc.sendPackets(new S_ServerMessage(166, "等級尚未達到 " + (Config.Party_Lv + 1) + " 級,所以無法組隊"));
targetPc.sendPackets(new S_ServerMessage(166, "等級尚未達到 " + (Config.Party_Lv + 1) + " 級,所以無法組隊"));
}
// 低組高
if (pc.getLevel() <= Config.Party_Lv && targetPc.getLevel() > Config.Party_Lv) {
pc.sendPackets(new S_ServerMessage(166, "等級尚未達到 " + (Config.Party_Lv + 1) + " 級,所以無法組隊"));
targetPc.sendPackets(new S_ServerMessage(166, "對方等級尚未達到 " + (Config.Party_Lv + 1) + " 級,所以無法組隊"));
}
// 高組低
if (pc.getLevel() > Config.Party_Lv && targetPc.getLevel() <= Config.Party_Lv) {
pc.sendPackets(new S_ServerMessage(166, "對方等級尚未達到 " + (Config.Party_Lv + 1) + " 級,所以無法組隊"));
targetPc.sendPackets(new S_ServerMessage(166, "等級尚未達到 " + (Config.Party_Lv + 1) + " 級,所以無法組隊"));
}
// 限制玩家組隊等級 end


搜尋

if (pc.isInParty()) {


上面加入

// 限制玩家組隊等級
if (pc.getLevel() > Config.Party_Lv && targetPc.getLevel() > Config.Party_Lv) {
// 限制玩家組隊等級 end


搜尋

targetPc.sendPackets(new S_Message_YN(953, pc.getName()));


下面加入

// 限制玩家組隊等級
}
// 限制玩家組隊等級 end


修改

CalcExp.java

搜尋

if (party_level > 0) {
dist = ((ptMembers[cnt].getLevel() * ptMembers[cnt]
.getLevel()) / party_level);
}


把這段修改為

// 限制玩家組隊等級
if (party_level > Config.Party_Lv) {
dist = ((ptMembers[cnt].getLevel() * ptMembers[cnt]
.getLevel()) / party_level);
} else {
party_exp = 0;
}
// 限制玩家組隊等級 end


修改

Config.java

搜尋

public static int DEFAULT_CHARACTER_SLOT;


下面加入

// 限制玩家組隊等級
public static int Party_Lv;
// 限制玩家組隊等級 end


搜尋

DEFAULT_CHARACTER_SLOT = Integer.parseInt(altSettings.getProperty(
"DefaultCharacterSlot", "6"));


下面加入

// 限制玩家組隊等級
Party_Lv = Integer.parseInt(altSettings.getProperty(
"PartyLv", "5"));
// 限制玩家組隊等級 end


搜尋

} else if (pName.equalsIgnoreCase("DefaultCharacterSlot")) {
DEFAULT_CHARACTER_SLOT = Integer.valueOf(pValue);


下面加入

// 限制玩家組隊等級
} else if (pName.equalsIgnoreCase("PartyLv")) {
Party_Lv = Integer.parseInt(pValue);
// 限制玩家組隊等級 end


修改

altsettings.properties

最下面新增

#-------------------------------------------------------------
#玩家等級高於多少 才能組隊 等級低於設定值 就算組隊 獲得的經驗值為0
#不限制玩家等級 則設定為 = 0
PartyLv = 5
#-------------------------------------------------------------



上一篇文章:天堂裝備特殊武器角色頭上出現皇冠的java寫法!
下一篇文章:天堂設定創新角色是否設定為GM的java寫法!

分享文章:分享到微博! 分享到臉書! 分享到噗浪! 分享到維特! 分享到Google+! 分享到LINE!