天堂私服123首頁 | GM發布私服 | 在線人員: 1609936
當前位置:天堂私服123>私服架設>為天堂私服GM的指令加上線上調整掉寶~

為天堂私服GM的指令加上線上調整掉寶~

發表時間:2016-10-15

將下列原碼新增加到srcl1jserverservercommandexecutor裡面

/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* 請點此開啟連結或下載檔案
*/
package l1j.server.server.command.executor;

import java.util.StringTokenizer;
import java.util.logging.Logger;

import l1j.server.Config;
import l1j.server.server.model.L1World;
import l1j.server.server.model.Instance.L1ItemInstance;
import l1j.server.server.model.Instance.L1PcInstance;
import l1j.server.server.model.item.L1ItemId;
import l1j.server.server.serverpackets.S_SystemMessage;

public class L1ChangeDrop implements L1CommandExecutor {
private static Logger _log = Logger.getLogger(L1ChangeDrop.class.getName());

private L1ChangeDrop() {
}

public static L1CommandExecutor getInstance() {
return new L1ChangeDrop();
}

//TODO 線上調整掉寶率 by 710410
private Thread changeExpThread = null;

//@Override
public void execute(L1PcInstance pc, String cmdName, String arg) {
try {
StringTokenizer st = new StringTokenizer(arg);
int index = Integer.parseInt(st.nextToken());

String arg1 = null;
String arg2 = null;

if (index >= 0) {
StringTokenizer token = new StringTokenizer(arg, " ");

if (token.hasMoreTokens()) {
arg1 = token.nextToken().trim();
}
if (token.hasMoreTokens()) {
arg2 = token.nextToken().trim();
}
}

if (arg1 != null && !arg1.equals("")) {
final double rateDrop = Double.parseDouble(arg1);
final double oldrateDrop = Config.RATE_DROP_ITEMS;
if (arg2 != null && !arg2.equals("")) {
final int interval = Integer.parseInt(arg2) * 60 * 1000;
if (this.changeExpThread == null) {
this.changeExpThread = new Thread() {
public void run() {
Config.RATE_DROP_ITEMS = rateDrop;
try {
sleep(interval);
} catch (Exception e) {
System.out.println(e);
}
Config.RATE_DROP_ITEMS = oldrateDrop;
}
};
this.changeExpThread.start();
} else {
this.changeExpThread.interrupt();

this.changeExpThread = new Thread() {
public void run() {
Config.RATE_DROP_ITEMS = rateDrop;
try {
sleep(interval);
} catch (Exception e) {
System.out.println(e);
}
Config.RATE_DROP_ITEMS = oldrateDrop;
}
};
this.changeExpThread.start();
}
} else {
Config.RATE_DROP_ITEMS = rateDrop;
}
try {
Thread.sleep(400);
} catch (Exception e) {
System.out.println(e);
}
L1World.getInstance().broadcastServerMessage(
"系統公告" + ": " +
"掉寶率已調整為" + "【" + Config.RATE_DROP_ITEMS + " 】" +
"倍" + "。");
pc.sendPackets(new S_SystemMessage(
"掉寶率已調整為" + "【" + Config.RATE_DROP_ITEMS + " 】" +
"倍" + "。"));
} else {
pc.sendPackets(new S_SystemMessage(
"目前的掉寶率為" + "【" + Config.RATE_DROP_ITEMS + " 】" +
"倍" + "。"));
}
} catch (Exception e) {
pc.sendPackets(new S_SystemMessage("請輸入『.drop 倍率』。"));
}
}
}


記得DB內要新增掉保指令!!就大功告成囉!!趕快上線測試看看吧!!^^

 
其他分類
私服技巧
玩家分享
私服架設
私服新手區
 
相關推薦
優化MYSQL數據庫減少天堂私服當機的機會!
天堂私服玩家不知道的秘密!!
天堂私服GM指令簡易列表!
一個為兒子買天幣的媽媽~淚流滿面!
一段被騙天堂帳號的回憶
揭密天堂私服電腦容易中毒的原因,以及某些私服業者惡意的行為!!
天堂私服玩家無法進入論壇與遊戲的解決方法之一!
天堂私服內LH2喝水設定詳細教學
天堂私服內建自動喝水LHZ使用教學
防止外掛特殊況狀使用喝水功能!
如何在天堂私服盟戰中發揮技巧~
教你Lineage3.0天堂不能玩私服的解決方法!
自我檢測無法玩天堂私服的原因!!
小妙招幾步驟可以幫助你更快速的玩天堂遊戲喔!!
玩天堂不關機延長電腦硬碟壽命的方法
總是打不贏別人嗎?看看天堂打架技巧教戰守則吧!!
天堂打稱號★顏色代碼★符號★教您如何使用!
超骨灰級!這些天堂技巧你知道多少?又用過多少?
怎麼上傳天堂盟徽?不會上傳天堂盟徽嗎?教您如何上傳!!
天堂各職業出生/洗血配點.洗血後配點(王族篇)
   

網站地圖關於天堂私服123天堂私服123列表免責聲明刊登廣告私服合作私服百科天堂私服123粉絲團天堂私服123 GOOGLE+
天堂私服123 © https://playsf.net/ Corporation All Rights Reserved.