主页| 免费发布天堂1开机信息| 站长qq:1161903

java加入装备保护卷轴

来源:2TT天堂发布网 www.2tt.cc    发布时间:2018/9/4 0:55:55    浏览量:951

修改Java:l1j\server\server\model\instance\L1ItemInstance
l1j\server\server\clientpackets\C_ItemUSe
功能解说:使用此道具点选装备时,强化失败时不会消失,但是强化值回归至零
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);
}
}
//装备保护卷轴

搜寻
codeprivate 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;
}
//装备保护卷轴