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

天堂裝備保護卷軸的java寫法!

功能解說:使用此道具點選裝備時,強化失敗時不會消失,但是強化值回歸至零

L1ItemInstance.Java 直接在最下面加入

//裝備保護卷軸
private boolean proctect = false;

public boolean getproctect() {
return proctect;
}
public void setproctect(boolean i) {
proctect = i;
}
//裝備保護卷軸

C_ItemUSe.Java
搜尋

|| itemId == L1ItemId.C_SCROLL_OF_ENCHANT_WEAPON

在後面加入

|| itemId == 300039

接著找個地方加入

//裝備保護卷軸
} else if (itemId == 300039) {
if (l1iteminstance1 != null){
if (l1iteminstance1.getEnchantLevel() <= -1){
pc.sendPackets(new S_ServerMessage(1309));
return;
}
if (l1iteminstance1.getproctect() == true){
pc.sendPackets(new S_ServerMessage(1300));
return;
}
if (l1iteminstance1.getItem().getType2() == 0){
pc.sendPackets(new S_ServerMessage(79));
return;
} else {
l1iteminstance1.setproctect(true);
pc.sendPackets(new S_SystemMessage(l1iteminstance1.getEnchantLevel()+l1iteminstance1.getName()+"受到魔法力量的保護。"));
pc.getInventory().removeItem(l1iteminstance, 1);
}
}
//裝備保護卷軸

Enchant
搜尋
//強化成功
private void SuccessEnchant(L1PcInstance pc, L1ItemInstance item, ClientThread client, int i) {

在下面加入

//裝備保護卷軸
item.setproctect(false);
//裝備保護卷軸

搜尋
//強化失敗
private void FailureEnchant(L1PcInstance pc, L1ItemInstance item,
ClientThread client) {

在下面加入

//裝備保護卷軸
if (item.getproctect() == true){
item.setEnchantLevel(0);
pc.sendPackets(new S_ItemStatus(item));
pc.getInventory().saveItem(item, L1PcInventory.COL_ENCHANTLVL);
item.setproctect(false);
pc.sendPackets(new S_ServerMessage(1310));
return;
}
//裝備保護卷軸



上一篇文章:天堂法利昂的治癒守護的java寫法!
下一篇文章:天堂tbl的說明!

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