2013年5月15日 星期三

【Java教學】 寶箱公告化

這個開寶箱公告前提是要有braod公告 DB
1.打開config.java
2.搜尋public static final boolean DEBUG = false;
3.下面插入
  public static boolean I_T_E_M;// 開寶箱寶物公告
4.再來往下搜尋(如果你沒有othersettings 請把所有othersettings替代成altsettings

      try {
        Properties otherSettings = new Properties();
        is = new FileInputStream(new File(OTHER_SETTINGS_CONFIG_FILE));
        otherSettings.load(is);
        is.close();

5.底下插入
        I_T_E_M = Boolean.parseBoolean(otherSettings.getProperty("ITEM",
              "false"));

6.存檔壓入核心

7.打開L1TreasureBox.java

8.搜尋
  pc.sendPackets(new S_ServerMessage(403, item.getLogName())); 

9.底下插入
[       if (item.getItem().getBroad() == 1 && (Config.I_T_E_M)) {
        L1World.getInstance().broadcastPacketToAll(
              new S_ServerMessage(166, "\\fW恭喜玩家《" + pc.getName()
                  + "》"));
        L1World.getInstance().broadcastPacketToAll(
              new S_ServerMessage(166, "\\fW開出《" + item.getLogName()
                  + "》數量《" + item.getCount() + "》"));
      }

11.儲存加入核心
12.
開啟 othersettings(或altsttings).properties
找地方加入

#======================================
#開到特殊物品公告? True=顯示, False=不顯示.
ITEM = True
#======================================
這樣你就可以有打寶箱公告以及可以方便開啟或關閉喔。^^

沒有留言:

張貼留言