天堂特效天堂私服
Would you like to react to this message? Create an account in a few clicks or log in to continue.


補丁設計、版本販售、DB修改、天堂私服
 
首頁常見問題搜尋Latest images會員列表會員群組登入會員註冊

 

 [核心]java挖礦系統

向下 
發表人內容
美工GM
版主
版主
美工GM


文章數 : 646
注冊日期 : 2021-09-23

[核心]java挖礦系統 Empty
發表主題: [核心]java挖礦系統   [核心]java挖礦系統 Empty周一 10月 04, 2021 11:18 pm


// 鋤頭
} else if (itemId == 40527) {
if (pc.getMapId() == 330) { // 金銀島-礦地ID
pc.sendPackets(new S_SystemMessage("\\fW挖礦已經開始嚕..."));
Thread.sleep(5000); // 閒置時間
int rnd = Random.nextInt(100);
int r1 = (byte) Random.nextInt(6) + 1; // 隨機(0~5) + 額外
if (rnd >= 80) {
pc.sendPackets(new S_SystemMessage(
"\\fW鋤頭太爛啦,什麽都沒有。"));
} else if (rnd >= 60 && rnd < 80) {
pc.sendPackets(new S_SystemMessage(
"\\fW似乎挖到古代破羊皮紙了。"));
createNewItem(pc, 50006, r1); // 魔法卷軸 (冰箭)
} else if (rnd >= 40 && rnd < 60) {
pc.sendPackets(new S_SystemMessage(
"\\fW似乎挖到古煉金術士燒烤後,遺留的寶物.."));
createNewItem(pc, 40043, 1); // 兔子的肝
} else if (rnd >= 20 && rnd < 40) {
pc.sendPackets(new S_SystemMessage(
"\\fW鏗、鏗..似乎挖到礦脈了。"));
createNewItem(pc, 41104, r1 - 1); // 鐵礦石
} else if (rnd < 20) {
pc.sendPackets(new S_SystemMessage(
"\\fW登、登、登、等..似乎挖到鑽石礦脈了。"));
createNewItem(pc, 41108, 1); // 鑽石原石
}
pc.getInventory().consumeItem(60050, 1); // 鋤頭 使用一次就消失。
} else {
pc.sendPackets(new S_SystemMessage(
"\\fW【你給我死到挖礦地,再說吧!!】"));
return;
}
打開 Config.java 加入
//挖礦
public static int o1;
public static int o2;
public static int o3;
public static int o4;
public static int o5;
public static int p1;
public static int p2;
public static int p3;
public static int p4;
public static int p5;
public static int w1;
public static int w2;
public static int w3;
public static int w4;
public static int w5;
public static int z1;
public static int z2;
public static int z3;
public static int z4;
public static int z5;
public static int x1;
public static int x2;
public static int x3;
public static int x4;
public static int x5;

o1 = Integer.parseInt(jctnSettings.getProperty("o1", "30"));
o2 = Integer.parseInt(jctnSettings.getProperty("o2", "30"));
o3 = Integer.parseInt(jctnSettings.getProperty("o3", "30"));
o4 = Integer.parseInt(jctnSettings.getProperty("o4", "30"));
o5 = Integer.parseInt(jctnSettings.getProperty("o5", "30"));
p1 = Integer.parseInt(jctnSettings.getProperty("p1", "30"));
p2 = Integer.parseInt(jctnSettings.getProperty("p2", "30"));
p3 = Integer.parseInt(jctnSettings.getProperty("p3", "30"));
p4 = Integer.parseInt(jctnSettings.getProperty("p4", "30"));
p5 = Integer.parseInt(jctnSettings.getProperty("p5", "30"));
w1 = Integer.parseInt(jctnSettings.getProperty("w1", "30"));
w2 = Integer.parseInt(jctnSettings.getProperty("w2", "30"));
w3 = Integer.parseInt(jctnSettings.getProperty("w3", "30"));
w4 = Integer.parseInt(jctnSettings.getProperty("w4", "30"));
w5 = Integer.parseInt(jctnSettings.getProperty("w5", "30"));
z1 = Integer.parseInt(jctnSettings.getProperty("z1", "30"));
z2 = Integer.parseInt(jctnSettings.getProperty("z2", "30"));
z3 = Integer.parseInt(jctnSettings.getProperty("z3", "30"));
z4 = Integer.parseInt(jctnSettings.getProperty("z4", "30"));
z5 = Integer.parseInt(jctnSettings.getProperty("z5", "30"));
x1 = Integer.parseInt(jctnSettings.getProperty("x1", "30"));
x2 = Integer.parseInt(jctnSettings.getProperty("x2", "30"));
x3 = Integer.parseInt(jctnSettings.getProperty("x3", "30"));
x4 = Integer.parseInt(jctnSettings.getProperty("x4", "30"));
x5 = Integer.parseInt(jctnSettings.getProperty("x5", "30"));
回頂端 向下
https://lineage888.666forum.com
 
[核心]java挖礦系統
回頂端 
1頁(共1頁)

這個論壇的權限:無法 在這個版面回復文章
天堂特效天堂私服 :: 【教學相關資料】-
前往: