| 本帖最後由 kao0820 於 2020-10-24 20:11 編輯
1.先在db的etcitem中加入
60316(編號自編) 35體精藥水 power.ConWis35 35體精藥水 other normal gemstone 0 4110 3963 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0
etcitem中classname欄位輸入的power.ConWis35(power.點後檔名要是你編的檔名喔!)
2.在原碼中 com\lineage\data\item_etcitem\power 下copy--->Panacea35.java到桌面改檔名ConWis35.java在丟回去
將ConWis35.java 拉入編輯對應位置(com\lineage\data\item_etcitem\power)
點擊ConWis35編輯
搜尋"Panacea35"全部修改為我們新增的"ConWis35"檔名
搜尋
pc.addBaseCha((byte) (35 - pc.getBaseCha())); 魅
pc.addBaseStr((byte) (35 - pc.getBaseStr())); 力
pc.addBaseDex((byte) (35 - pc.getBaseDex())); 敏
pc.addBaseInt((byte) (35 - pc.getBaseInt())); 智
pc.addBaseCon((byte) (35 - pc.getBaseCon())); 體
pc.addBaseWis((byte) (35 - pc.getBaseWis())); 精
除體精其他刪掉(當然你要做魅力35就只留魅力以此類推)
※如要能力25就把(除了檔名以外)所有數字35改25就行了※
以上完成後在壓入核心對應位置就OK了
※範例如下※
/**
* 35體精藥水
*
* @author dexc
*
*/
public class ConWis35 extends ItemExecutor {
private static final Log _log = LogFactory.getLog(ConWis35.class);
private ConWis35() {
// TODO Auto-generated constructor stub
}
public static ItemExecutor get() {
return new ConWis35();
}
/**
* 道具物件執行
*
* @param data
* 參數
* @param pc
* 執行者
* @param item
* 物件
*/
// @Override
public void execute(final int[] data, final L1PcInstance pc,
final L1ItemInstance item) {
if (pc.getBaseCha() < 35 || pc.getBaseStr() < 35
|| pc.getBaseDex() < 35 || pc.getBaseInt() < 35
|| pc.getBaseCon() < 35 || pc.getBaseWis() < 35) { // 2屬性其中一個小於35就給喝
pc.addBaseCon((byte) (35 - pc.getBaseCon()));
pc.addBaseWis((byte) (35 - pc.getBaseWis()));
pc.getInventory().removeItem(item, 1);
pc.sendPackets(new S_OwnCharStatus2(pc));
try {
pc.save();
} catch (final Exception e) {
_log.error(e.getLocalizedMessage(), e);
}
} else {
pc.sendPackets(new S_ServerMessage(166, "属性最大值只能到35"));
}
}
}
以上就能輕鬆創出你要的屬性藥水了
| |