最近罎子裡很冷清,小發一帖,全作抛磚引玉之用,人格保證絕對可用,遇到問題觸類旁通。
---頹廢三道
首先,個人包袱和精靈倉庫,個人倉庫,血盟倉庫,都在最後面加兩個欄位。
mountcount 和 addmr
類型int 長度11 默認null
L1ItemInstance.java
搜索
public int getMr() {
int mr =
_item.get_mdef()
替換為
public int getMr() {
int mr =
_item.get_mdef() + getaddMr(); //鑲嵌
搜索
public void
updateAll() {
在上面增加
public int
mountcount; //鑲嵌
public int addmr; //鑲嵌
搜索
addhp = getaddHp();
addmp = getaddMp();
addsp = getaddSp();
hpr = getHpr();
mpr = getMpr();
在下面增加
mountcount = getMountCount(); //鑲嵌
addmr = getaddMr(); //鑲嵌
搜索
public void
updateHpr() {
hpr = getHpr();
}
public void
updateMpr() {
mpr = getMpr();
}
在下面增加
public void
updateMountCount() { //鑲嵌
mountcount = getMountCount();
}
public void
updateMr() { //鑲嵌
addmr = getaddMr();
}
搜索
if (isEquipped()) {
if (itemType2 == 1) {
name.append("
($9)"); // 裝備(Armed)
} else if (itemType2 == 2) {
name.append("
($117)"); // 裝備(Worn)
} else if (itemType2 == 0 && getItem().getType() ==
11) { // petitem
name.append("
($117)"); // 裝備(Worn)
}
}
return
name.toString();
在上面增加
// 武器裝備強化系統 BY XCALONE 20100918
int weaponcount = 0;
int armorcount =0;
weaponcount = 20 -
getUpdateCount();
armorcount = 3 -
getMountCount();
if (isIdentified()
&& getItem().getType2() == 1) {
name.append("鑲嵌." + weaponcount + " ");
}
if (isIdentified()
&& getItem().getType2() == 2) {
name.append(" 鑲嵌." + armorcount);
}
搜索
public int getaddMp() {
return _addMp;
}
public void setaddMp(int i) {
_addMp = i;
}
在下面增加
private int _addMr = 0; //鑲嵌
public int getaddMr() {
return _addMr;
}
public void setaddMr(int i) {
_addMr = i;
}
//鑲嵌次數
private int _MountCount = 3;
public int getMountCount() {
return _MountCount;
}
public void setMountCount(int i) {
_MountCount = i;
}
L1DwarfForClanInventory.java
(4 個匹配項)
搜索
public
synchronized void loadItems()
將 整段替換為
public synchronized void loadItems() { // 同步鎖保證只有1個執行緒跑該程式
Connection con =
null;
PreparedStatement
pstm = null;
ResultSet rs =
null;
try {
con = L1DatabaseFactory.getInstance().getConnection();
pstm = con
.prepareStatement("SELECT * FROM clan_warehouse WHERE clan_name =
? order by item_id");
pstm.setString(1, _clan.getClanName());
rs = pstm.executeQuery();
while (rs.next()) {
L1ItemInstance item
= new L1ItemInstance();
int objectId =
rs.getInt("id");
item.setId(objectId);
int itemId = rs.getInt("item_id");
L1Item itemTemplate
= ItemTable.getInstance().getTemplate(
itemId);
if (itemTemplate ==
null) {
throw new NullPointerException("item_id=" + itemId
+ " not found");
}
item.setItem(itemTemplate);
item.setCount(rs.getInt("count"));
item.setEquipped(false);
item.setEnchantLevel(rs.getInt("enchantlvl"));
item.setIdentified(rs.getInt("is_id")
!= 0 ? true : false);
item.set_durability(rs.getInt("durability"));
item.setChargeCount(rs.getInt("charge_count"));
item.setRemainingTime(rs.getInt("remaining_time"));
item.setLastUsed(rs.getTimestamp("last_used"));
item.setBless(rs.getInt("bless"));
item.setAttrEnchantKind(rs.getInt("attr_enchant_kind"));
item.setAttrEnchantLevel(rs.getInt("attr_enchant_level"));
item.setFireMr(rs.getInt("firemr"));// 飾品強化卷軸
item.setWaterMr(rs.getInt("watermr"));// 飾品強化卷軸
item.setEarthMr(rs.getInt("earthmr"));//
飾品強化卷軸
item.setWindMr(rs.getInt("windmr"));// 飾品強化卷軸
item.setaddSp(rs.getInt("addsp"));// 飾品強化卷軸
item.setaddHp(rs.getInt("addhp"));//
飾品強化卷軸
item.setaddMp(rs.getInt("addmp"));//
飾品強化卷軸
item.setHpr(rs.getInt("hpr"));// 飾品強化卷軸
item.setMpr(rs.getInt("mpr"));//
飾品強化卷軸
item.setMountCount(rs.getInt("mountcount")); //裝備鑲嵌
item.setaddMr(rs.getInt("addmr")); //裝備鑲嵌
// 武器強化卷
if (ItemUpdate.getInstance().checkItem(item.getId())
!= 0) {
ItemUpdate itemUpdate = new ItemUpdate();
for (L1WilliamItemUpdate item_update : itemUpdate.getItemUpdateList())
{
if (item_update.getId() ==
item.getId()) {
item.setUpdateCount(item_update.getCount()); // 剩餘次數
item.setUpdateDmg(item_update.getAddDmg()); // 基礎攻擊
item.setUpdateDmgModifier(item_update.getAddDmgModifier());
// 額外攻擊
item.setUpdateHitModifier(item_update.getAddHitModifier());
// 攻擊成功
}
}
}
_items.add(item);
L1World.getInstance().storeObject(item);
}
} catch
(SQLException e) {
_log.log(Level.SEVERE, e.getLocalizedMessage(), e);
} finally {
SQLUtil.close(rs);
SQLUtil.close(pstm);
SQLUtil.close(con);
}
}
搜索
public
synchronized void insertItem(L1ItemInstance item) {
替換整段為
public synchronized void
insertItem(L1ItemInstance item) {
Connection con =
null;
PreparedStatement
pstm = null;
try {
con = L1DatabaseFactory.getInstance().getConnection();
pstm = con
.prepareStatement("INSERT INTO clan_warehouse SET id
= ?, clan_name = ?, item_id = ?, item_name = ?, count = ?, is_equipped=0,
enchantlvl = ?, is_id= ?, durability = ?, charge_count = ?, remaining_time =
?, last_used = ?, bless = ?, attr_enchant_kind = ?, attr_enchant_level = ?,
firemr = ?, watermr = ?, earthmr = ?, windmr = ?, addsp = ?, addhp = ?, addmp
= ?, hpr = ?, mpr = ?, mountcount = ?, addmr = ?"); //waja change
pstm.setInt(1, item.getId());
pstm.setString(2, _clan.getClanName());
pstm.setInt(3, item.getItemId());
pstm.setString(4, item.getName());
pstm.setInt(5, item.getCount());
pstm.setInt(6, item.getEnchantLevel());
pstm.setInt(7, item.isIdentified() ? 1 : 0);
pstm.setInt(8, item.get_durability());
pstm.setInt(9, item.getChargeCount());
pstm.setInt(10, item.getRemainingTime());
pstm.setTimestamp(11, item.getLastUsed());
pstm.setInt(12, item.getBless());
pstm.setInt(13, item.getAttrEnchantKind());
pstm.setInt(14, item.getAttrEnchantLevel());
pstm.setInt(15, item.getFireMr());// 飾品強化卷軸
pstm.setInt(16, item.getWaterMr());// 飾品強化卷軸
pstm.setInt(17, item.getEarthMr());// 飾品強化卷軸
pstm.setInt(18, item.getWindMr());// 飾品強化卷軸
pstm.setInt(19, item.getaddSp());// 飾品強化卷軸
pstm.setInt(20, item.getaddHp());// 飾品強化卷軸
pstm.setInt(21, item.getaddMp());// 飾品強化卷軸
pstm.setInt(22, item.getHpr());// 飾品強化卷軸
pstm.setInt(23, item.getMpr());// 飾品強化卷軸
pstm.setInt(24, item.getMountCount()); //裝備鑲嵌
pstm.setInt(25, item.getaddMr()); //裝備鑲嵌
pstm.execute();
} catch
(SQLException e) {
_log.log(Level.SEVERE, e.getLocalizedMessage(), e);
} finally {
SQLUtil.close(pstm);
SQLUtil.close(con);
}
}
|
沒有留言:
張貼留言