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

天堂在線一段時間後給予道具的java寫法!

L1SkillId

加入

/** 在線一段時間後給予一個狀態(自訂) */
public static final int LOGIN_TIME_GET_ITEM = 9000;


L1SkillTimer

料理関係

在上面加入

else if (skillId == LOGIN_TIME_GET_ITEM) { // 在線一段時間後給予道具 by 丫傑
if (Config.OnLine_Accumulate_Time) {
if (cha instanceof L1PcInstance) {
L1PcInstance pc = (L1PcInstance) cha;
L1ItemInstance item = ItemTable.getInstance().createItem(
Config.O_L_A_T_Item);
item.setCount(1);
if (item != null) {
if (pc.getInventory().checkAddItem(item, 1) == L1Inventory.OK) {
pc.getInventory().storeItem(item);
} else { // 持てない場合は地面に落とす 處理のキャンセルはしない(不正防止)
L1World.getInstance()
.getInventory(pc.getX(), pc.getY(),
pc.getMapId()).storeItem(item);
}
pc.sendPackets(new S_ServerMessage(403, item
.getLogName())); // %0を手に入
}
}
cha.setSkillEffect(L1SkillId.LOGIN_TIME_GET_ITEM,
Config.O_L_A_T_Time * 1000); // N分鐘
}
}

C_LoginToServer
宣告

import static l1j.server.server.model.skill.L1SkillId.LOGIN_TIME_GET_ITEM; // 在線一段時間後給予一個狀態

public static void items(L1PcInstance pc) {

在上面加入

// 在線一段時間後給予道具 by 丫傑
if (Config.OnLine_Accumulate_Time) {
if (!pc.hasSkillEffect(LOGIN_TIME_GET_ITEM)) {
pc.setSkillEffect(LOGIN_TIME_GET_ITEM,
Config.O_L_A_T_Time * 1000); // N分鐘
}
}
// end

Config
位置我放在(//othersettings.properties)

加入1

public static boolean OnLine_Accumulate_Time; // 設定在線一段時間後是否給予道具
public static short O_L_A_T_Time; // 累積時間
public static int O_L_A_T_Item; // 發送道具編號

加入2

OnLine_Accumulate_Time = Boolean.parseBoolean(otherSettings
.getProperty("OnLineAccumulateTime", "false")); // 設定在線一段時間後是否給予道具
O_L_A_T_Time = Short.parseShort(otherSettings.getProperty(
"OLATTime", "3600")); // 累積時間
O_L_A_T_Item = Integer.parseInt(otherSettings.getProperty(
"OLATItem", "60000")); // 發送道具編號

加入3

} else if (pName.equalsIgnoreCase("OnLineAccumulateTime")) {
OnLine_Accumulate_Time = Boolean.valueOf(pValue); // 設定在線一段時間後是否給予道具
} else if (pName.equalsIgnoreCase("OLATTime")) {
O_L_A_T_Time = Short.valueOf(pValue); // 累積時間
} else if (pName.equalsIgnoreCase("OLATItem")) {
O_L_A_T_Item = Short.valueOf(pValue); // 發送道具編號

最後

模擬器開啟

config資料夾

othersettings.properties檔

加入

#a-設定在線一段時間後是否給予道具? True=是, False=否
OnLineAccumulateTime = True
#b-累積時間 (單位:秒)
OLATTime = 900
#c-發送道具編號 (item_id)
OLATItem = 40733


完成!!!



上一篇文章:天堂3.63C 解決戒指bug問題的java寫法!
下一篇文章:天堂身上道具無法重複領取的java寫法!

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