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

天堂商城直接出售強化過的裝備武器的java寫法!

打開你的

L1Shop.java

for (L1ShopBuyOrder order : orderList.getList()) {
int itemId = order.getItem().getItemId();
int amount = order.getCount();
L1ItemInstance item = ItemTable.getInstance().createItem(itemId);
item.setCount(amount);
item.setIdentified(true);
inv.storeItem(item);
if (_npcId == 70068 || _npcId == 70020) {
item.setIdentified(false);
Random random = new Random();
int chance = random.nextInt(100) + 1;
if (chance <= 15) {
item.setEnchantLevel(-2);
} else if (chance >= 16 && chance <= 30) {
item.setEnchantLevel(-1);
} else if (chance >= 31 && chance <= 70) {
item.setEnchantLevel(0);
} else if (chance >= 71 && chance <= 87) {
item.setEnchantLevel(random.nextInt(2) + 1);
} else if (chance >= 88 && chance <= 97) {
item.setEnchantLevel(random.nextInt(3) + 3);
} else if (chance >= 98 && chance <= 99) {
item.setEnchantLevel(6);
} else if (chance == 100) {
item.setEnchantLevel(7);
}
}
}

15%的機率-2的
15%的機率-1的
40%的機率0的
17%機率隨機0~3
12%機率隨機3~6
1%機率+7



上一篇文章:天堂100%武防捲的java寫法!
下一篇文章:天堂城堡專屬對話的java寫法!

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