| 
 | 
 
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 
 
 
完成!!! 
 
 |   
 
 
 
 |