|
藉由 底比斯宝箱 && 龟裂之核 语法;进而延伸,可使武器、防具、饰品进化
开启 C_ItemUSe
收寻49092 || itemId == 49092 //龟裂之核
复制代码在下方新增 <进化媒介>|| itemId == 49092 //龟裂之核
|| itemId == 700117 //武器进化媒介
复制代码然后再找个好位子 再新增
//ADD 新增 简易武器进化系统 700117
} else if (itemId == 700117) { //武器进化媒介编号
int WeaponId = l1iteminstance1.getItem().getItemId();
if (WeaponId == 武器编号 || WeaponId == 武器编号) { /
/进化前的武器;ex: Lv1 绝世好剑 编号:500
if (_random.nextInt(100) <= 20) { //进化机率,不要就抓掉
createNewItem(pc, WeaponId + 1, 1);
//进化后的武器 ;ex: Lv2 绝世好剑 编号:501
//db 请设定正确;公式如语法 ↑↑
pc.getInventory().consumeItem(WeaponId, 1); //进化前武器消失
} else {
pc.sendPackets(new S_SystemMessage(\"武器进化失败。 \" ));
}
pc.getInventory().consumeItem(700117, 1); //进化媒介消失
} else {
pc.sendPackets(new S_ServerMessage(79));
return;
}
//END
复制代码DB内 道具700117武器进化石武器进化石materialchoicegemstone0327970900100000000000000010
复制代码DB内 武器,上面语法公式没改,这边记得要设定连号500LV1进化前武器Lv1 绝世好剑swordiron4000035245901012161111111100000000000000000001000000
501LV2进化后武器Lv2 绝世好剑swordiron4000035245901012161111111100000000000000000001000000
复制代码0612 增加强化值设定
打开 L1PcInventory.java
找到 public int checkAddItem
在这段上面增加 //香 武器进化 增加强化值
public int checkAddItem_LV(L1ItemInstance item, int count, int EnchantLevel) {
return checkAddItem_LV(item, count, EnchantLevel, true);
}
public int checkAddItem_LV(L1ItemInstance item, int count, int EnchantLevel, boolean message) {
if (item == null) {
return -1;
}
if (getSize() > MAX_SIZE
|| (getSize() == MAX_SIZE && (!item.isStackable() || !checkItem(item
.getItem().getItemId())))) { // 容量确认
if (message) {
sendOverMessage(263); // \f1一人のキャラクターが持って歩けるアイテムは最大180个までです。
}
return SIZE_OVER;
}
int weight = getWeight() + item.getItem().getWeight() * count / 1000 + 1;
if (weight < 0 || (item.getItem().getWeight() * count / 1000) < 0) {
if (message) {
sendOverMessage(82); // アイテムが重すぎて、これ以上持てません。
}
return WEIGHT_OVER;
}
if (calcWeight240(weight) >= 240) {
if (message) {
}
return WEIGHT_OVER;
}
return OK;
}
int rndLV = _random.nextInt(6)+3; //0~5 +3 强化值
int t_ItemLV = l1iteminstance1.getEnchantLevel(); ***0613修改处
if (WeaponId == 武器编号 || WeaponId == 武器编号) {
//进化前的武器;ex: Lv1 绝世好剑 编号:500
if (_random.nextInt(100) <= 20) { //进化机率,不要就抓掉
createNewItem_LV(pc, WeaponId + 1, 1, t_ItemLV ); ***0613修改处
//进化后的武器 ;ex: Lv2 绝世好剑 编号:501
//db 请设定正确;公式如语法 ↑↑
pc.getInventory().consumeItem(WeaponId, 1); //进化前武器消失
} else {
pc.sendPackets(new S_SystemMessage(\"武器进化失败。 \" ));
}
pc.getInventory().consumeItem( ); //进化媒介消失
} else {
pc.sendPackets(new S_ServerMessage( ));
return;
}
//END
0612
若要不管+几去合成,合成出来都是一样的强化值;就设定(1)+你要的数值。
_random.nextInt(1)+7 ←这样就是合成出来都+7
0613
t_ItemLV,增加此语法..即可合成出相同强化值的武器
下列写法已测试过,可行!!
加入种类判别 } else if (itemId = ) { // 武器进化系统
int t_ItemId = l1iteminstance1.getItem().getItemId();
int pc_ItemLV = pc.getWeapon().getEnchantLevel();
int rndLV = _random.nextInt(6)+3;
if (l1iteminstance1.getItem().getType2() == 1) { // 道具种类判别 1:武器 2:防具 0:道具
if (t_ItemId >= >= t_ItemId) { 合成武器的区块
createNewItem_LV(pc, 4, 1, rndLV);//合成为指定道具
pc.getInventory().consumeItem(t_ItemId, );
pc.getInventory().consumeItem(300053, 1);
} else {
pc.sendPackets(new S_ServerMessage());
return;
}
} else {
pc.sendPackets(new S_ServerMessage( ));
return;
}
复制代码补充增加~开启 C_ItemUSe
找到 private boolean createNewItem// 香 武器进化 增加强化值
private boolean createNewItem_LV(L1PcInstance pc, int item_id, int count, int EnchantLevel) {
L1ItemInstance item = ItemTable.getInstance().createItem(item_id);
item.setCount(count);
item.setEnchantLevel(EnchantLevel);
if (item != null) {
if (pc.getInventory().checkAddItem_LV(item, count, EnchantLevel) == L1Inventory.OK) {
pc.getInventory().storeItem(item);
} else { // 持てない场合は地面に落とす 处理のキャンセルはしない(不正防止)
L1World.getInstance().getInventory(pc.getX(), pc.getY(),
pc.getMapId()).storeItem(item);
}
pc.sendPackets(new S_ServerMessage(403, item.getLogName())); // %0を手に入れました。
return true;
} else {
return false;
}
}
|
|