Wie kann man Event zum laufen bekommen?

    • Wie kann man Event zum laufen bekommen?

      Hallo,
      Ich habe bereits im Fame Fragetheard gepostet, aber niemand konnte mir helfen. Vielleicht wird das hier jemand sehen und mir helfen kann.
      Also ich habe versucht einen event zu machen, aber es geht nicht.
      Es zeigt mir ingame gar kein event an.
      Ich will, dass der Event jeden neuerstelltem Charackter welche Items gibt.
      Weill das im jobItem nicht funktioniert...
      Danke im vorraus.
    • Werbung zur Unterstützung des Forums ( Bitte AddBlocker deaktivieren )

    • Event.lua :

      Brainfuck-Quellcode

      1. ---------------------------------------------------
      2. ---- À̺¥Æ® °ü·Ã ·ç¾Æ ÇÔ¼ö ·Îµù -------------------
      3. ---------------------------------------------------
      4. dofile(".\\LuaFunc\\EventFunc.lua")
      5. ---------------------------------------------------
      6. ---------------------------------------------------
      7. ---- ÃʱâÈ* ---------------------------------------
      8. tHour = { 505, 409, 324, 280, 220, 203, 202, 212,
      9. 227, 261, 302, 349, 571, 701, 764, 803,
      10. 790, 789, 754, 849, 936, 940, 919, 720 }
      11. ---------------------------------------------------
      12. ----------------------------------------------------------------------------------------------------------------
      13. ---- 1. AddEvent( strDesc ) -- À̺¥Æ® Ãß°¡ ¹× ¼³¸í µî·Ï
      14. ---- 2. SetTime( strStartTime, strEndTime ) -- ÇØ´ç À̺¥Æ®ÀÇ ½ÃÀÛ ½Ã°£, Á¾·á ½Ã°£ µî·Ï(¿©·¯°³ ¼³Á¤ °¡´É)
      15. ---- ( ½Ã°£ Çü½Ä -- "2007-05-03 17:53" )
      16. ---- 3. SetItem( ItemId, nMax, nNum, nLevel ) -- À̺¥Æ®¿ë µå·Ó ¾ÆÀÌÅÛ, ÀÏÀÏ ÃÖ´ë·®, µå·Ó °¹¼ö(·£´ý),
      17. ---- ¾ÆÀÌÅÛÀ» µå·ÓÇÒ ¸ó½ºÅÍÀÇ ÃÖ¼Ò ·¹º§ - ¿©·¯°³ °¡´É
      18. ---- 4. SetExpFactor( fFactor ) -- °æÇèÁö Áõ°¡ ¹è¼ö
      19. ---- 5. SetItemDropRate( fFactor ) -- ¾ÆÀÌÅÛ µå·Ó·ü Áõ°¡ ¹è¼ö
      20. ---- 6. SetPieceItemDropRate( fFactor ) -- ¸ó½ºÅͰ¡ °¡Áö°í ÀÖ´Â ³¹°³ ¾ÆÀÌÅÛÀÇ µå¶ø·ü Áõ°¡ ¹è¼ö
      21. ---- 7. SetGoldDropFactor( fFactor ) -- Æä³Ä µå·Ó ¹è¼ö
      22. ---- 8. SetAttackPower( nAttackPower ) -- °ø°Ý·Â Áõ°¡
      23. ---- 9. SetDefensePower( nDefensePower ) -- ¹æ¾î·Â Áõ°¡
      24. ---- 10. SetCouponEvent( SEC(n) ) -- ÄíÆù À̺¥Æ®( Á¢¼Ó½Ã°£ - SEC(n) ¶Ç´Â MIN(n) )
      25. ---- 11. SetLevelUpGift( nLevel, "all", ItemId, nNum ) -- ·¹º§¾÷ ¼±¹°( nLevel´Þ¼º½Ã ¾ÆÀÌÅÛ Áö±Þ, "all" ºÎºÐ¿¡ ƯÁ¤ °èÁ¤ ÁöÁ¤ °¡´É(¿¹. "__bu" - ¹öµð, "__an" - ¿£Á© )
      26. ---- *** À̺¥Æ® Ãß°¡ µî·Ï½Ã 1¹øºÎÅÍ ¹Ýº¹Çϰí 3~11¹øÀº Çʿ信 µû¶ó »ý·«°¡´ÉÇÏ´Ù.
      27. ----------------------------------------------------------------------------------------------------------------
      28. --[[ SAMPLE
      29. AddEvent( "EVENT TEST 01" )
      30. --{
      31. SetTime( "2007-06-08 14:23", "2007-06-08 16:11" )
      32. SetTime( "2007-06-09 14:23", "2007-06-10 00:00" )
      33. SetItem( "II_SYS_SYS_EVE_HAPPYMONEY01", 30000, 5, 15 )
      34. SetItem( "II_SYS_SYS_EVE_PUMPKIN01", 2000, 3, 15 )
      35. SetExpFactor( 2 )
      36. SetItemDropRate( 2 )
      37. SetPieceItemDropRate( 2 )
      38. SetGoldDropFactor( 2 )
      39. SetAttackPower( 150 )
      40. SetDefensePower( 100 )
      41. SetCouponEvent( MIN(120) )
      42. SetLevelUpGift( 15, "__bu", "II_SYS_SYS_SCR_BX_PET_LAWOLF7", 1 )
      43. --}
      44. --]]
      45. ------------------------------------------------------
      46. ---- Begin Script ------------------------------------
      47. ------------------------------------------------------
      48. AddEvent( "Pet Event" )
      49. --{
      50. SetTime( "2009-10-26 21:00", "2020-10-26 21:00" )
      51. SetLevelUpGift( 15, "all", "II_SYS_SYS_SCR_BX_PET_LAWOLF7", 1 )
      52. --}
      53. --]]
      Alles anzeigen


      EventFunc.lua:

      Brainfuck-Quellcode

      1. tEvent = {} -- À̺¥Æ® ÀúÀå Å×À̺í
      2. function SEC( n )
      3. return n*1000
      4. end
      5. function MIN( n )
      6. return n*SEC(60)
      7. end
      8. -----------------------------------------------------------------------------------
      9. ------- C¿¡¼* È£ÃâÇÒ ·ç¾Æ ÇÔ¼ö ----------------------------------------------------
      10. -----------------------------------------------------------------------------------
      11. -- º¯°æµÈ À̺¥Æ® ¸®½ºÆ® (DBSERVER)
      12. function GetEventState()
      13. local tReturn = {}
      14. local nCount = 1
      15. for i in pairs(tEvent) do
      16. local OldState = tEvent[i].State
      17. for j in pairs(tEvent[i].Time) do
      18. if( tEvent[i].Time[j].nStart <= tonumber(os.date("%Y%m%d%H%M")) ) then
      19. if( tEvent[i].Time[j].nEnd > tonumber(os.date("%Y%m%d%H%M")) ) then
      20. if( tEvent[i].State == 0 ) then
      21. tEvent[i].State = 1
      22. end
      23. else
      24. if( tEvent[i].State == 1 ) then
      25. tEvent[i].State = 0
      26. end
      27. end
      28. end
      29. end
      30. if( OldState ~= tEvent[i].State ) then
      31. tReturn[nCount] = {}
      32. tReturn[nCount].nId = i
      33. tReturn[nCount].State = tEvent[i].State
      34. nCount = nCount + 1
      35. end
      36. end
      37. return tReturn
      38. end
      39. -- WORLDSERVER¿¡¼* ½ÇÇàµÈ ½ºÅ©¸³Æ® ÆÄÀÏ¿¡µµ º¯°æµÈ state¸¦ Àû¿ëÇϱâ À§ÇÑ ÇÔ¼ö
      40. function SetState( nId, nState )
      41. tEvent[nId].State = nState
      42. TRACE( string.format( "Event - ID:%d, Title:%s, State:%d", nId, tEvent[nId].Desc, tEvent[nId].State ) )
      43. ERROR( string.format( "Event - ID:%d, Title:%s, State:%d", nId, tEvent[nId].Desc, tEvent[nId].State ) )
      44. end
      45. -- ÁøÇàÁßÀÎ À̺¥Æ® ¸®½ºÆ®
      46. function GetEventList()
      47. local tList = {}
      48. local nCount = 1
      49. for i in pairs(tEvent) do
      50. if( tEvent[i].State == 1 ) then
      51. tList[nCount] = i
      52. nCount = nCount + 1
      53. end
      54. end
      55. return tList
      56. end
      57. -- À̺¥Æ® Å×ÀÌºí¿¡ ÀÖ´Â ¸ðµç ¸®½ºÆ®
      58. function GetAllEventList()
      59. local tAllList = {}
      60. local nCount = 1
      61. for i in pairs(tEvent) do
      62. tAllList[nCount] = {}
      63. tAllList[nCount].nId = i
      64. tAllList[nCount].strTitle = tEvent[i].Desc
      65. tAllList[nCount].nState = tEvent[i].State
      66. nCount = nCount + 1
      67. end
      68. return tAllList
      69. end
      70. -- À̺¥Æ® »ó¼¼ Á¤º¸ Å×À̺íÀ» ¸®ÅÏ
      71. function GetEventInfo( nId )
      72. local tEventInfo = {}
      73. if( tEvent[nId] == nil ) then
      74. tEventInfo[1] = "No EventInfo ID = "..nId
      75. return tEventInfo
      76. end
      77. local nCount = 3
      78. tEventInfo[1] = "Title = " .. tEvent[nId].Desc
      79. tEventInfo[2] = "State = " .. tEvent[nId].State
      80. for i in pairs(tEvent[nId].Time) do
      81. local strTime = tEvent[nId].Time[i].nStart .. ", " ..tEvent[nId].Time[i].nEnd
      82. tEventInfo[nCount] = "Time["..i.."] = " .. strTime
      83. nCount = nCount + 1
      84. end
      85. for i in pairs(tEvent[nId].Item) do
      86. local strItem = tEvent[nId].Item[i].ItemId ..", ".. tEvent[nId].Item[i].ItemMaxNum ..", ".. tEvent[nId].Item[i].ItemNum ..", ".. tEvent[nId].Item[i].nLevel
      87. tEventInfo[nCount] = "Item["..i.."] = " .. strItem
      88. nCount = nCount + 1
      89. end
      90. if( tEvent[nId].fExpFactor ~= 5 ) then
      91. tEventInfo[nCount] = "ExpFactor = " .. tEvent[nId].fExpFactor
      92. nCount = nCount + 1
      93. end
      94. if( tEvent[nId].fItemDropRate ~= 5 ) then
      95. tEventInfo[nCount] = "ItemDropRate = " .. tEvent[nId].fItemDropRate
      96. nCount = nCount + 1
      97. end
      98. if( tEvent[nId].fPieceItemDropRate ~= 5 ) then
      99. tEventInfo[nCount] = "fPieceItemDropRate = " .. tEvent[nId].fPieceItemDropRate
      100. nCount = nCount + 1
      101. end
      102. if( tEvent[nId].fGoldDropFactor ~= 5 ) then
      103. tEventInfo[nCount] = "fGoldDropFactor = " .. tEvent[nId].fGoldDropFactor
      104. nCount = nCount + 1
      105. end
      106. if( tEvent[nId].nAttackPower ~= 0 ) then
      107. tEventInfo[nCount] = "nAttackPower = " .. tEvent[nId].nAttackPower
      108. nCount = nCount + 1
      109. end
      110. if( tEvent[nId].nDefensePower ~= 0 ) then
      111. tEventInfo[nCount] = "nDefensePower = " .. tEvent[nId].nDefensePower
      112. nCount = nCount + 1
      113. end
      114. if( tEvent[nId].nCouponEvent ~= 0 ) then
      115. if( tEvent[nId].nCouponEvent < MIN(1) ) then
      116. tEventInfo[nCount] = "nCouponEventTime = " .. tEvent[nId].nCouponEvent / SEC(1) .. "Sec"
      117. else
      118. tEventInfo[nCount] = "nCouponEventTime = " .. tEvent[nId].nCouponEvent / MIN(1) .. "Min"
      119. end
      120. nCount = nCount + 1
      121. end
      122. for i in pairs(tEvent[nId].Gift) do
      123. local strGift = tEvent[nId].Gift[i].nLevel ..", ".. tEvent[nId].Gift[i].strAccount ..", ".. tEvent[nId].Gift[i].strItemId ..", ".. tEvent[nId].Gift[i].nItemNum
      124. tEventInfo[nCount] = "Gift["..i.."] = " .. strGift
      125. nCount = nCount + 1
      126. end
      127. return tEventInfo
      128. end
      129. -- À̺¥Æ® ¼³¸í
      130. function GetDesc( nId )
      131. local strDesc = tEvent[nId].Desc
      132. return strDesc
      133. end
      134. -- ½Ã°£À» ¼ýÀÚ·Î ¹Ù²ãÁÖ´Â ÇÔ¼ö
      135. function GetTimeToNumber( strTime )
      136. local strTemp = ""
      137. local j = 0
      138. for i in string.gfind( strTime, "%d+" ) do
      139. j = j + 1
      140. if( (j~=1) and (tonumber(i)<10) ) then
      141. i = "0"..tonumber(i)
      142. end
      143. strTemp = strTemp..i
      144. end
      145. return tonumber( strTemp )
      146. end
      147. ---------------------------------------------------------------------------
      148. ------ µ¥ÀÌÅÍ Ãß°¡ ÇÔ¼ö ---------------------------------------------------
      149. ---------------------------------------------------------------------------
      150. -- »õ·Î¿î À̺¥Æ® Ãß°¡
      151. function AddEvent( strDesc )
      152. local nEventId = table.getn(tEvent) + 1
      153. tEvent[nEventId] = {}
      154. tEvent[nEventId].Item = {}
      155. tEvent[nEventId].Time = {}
      156. tEvent[nEventId].Desc = strDesc
      157. tEvent[nEventId].fExpFactor = 1
      158. tEvent[nEventId].fItemDropRate = 1
      159. tEvent[nEventId].fPieceItemDropRate = 1
      160. tEvent[nEventId].fGoldDropFactor = 1
      161. tEvent[nEventId].State = 0
      162. tEvent[nEventId].nAttackPower = 0
      163. tEvent[nEventId].nDefensePower = 0
      164. tEvent[nEventId].nCouponEvent = 0
      165. tEvent[nEventId].Gift = {}
      166. end
      167. -- ½ÃÀ۽ð£, ³¡½Ã°£
      168. function SetTime( strStart, strEnd )
      169. local nEventId = table.getn(tEvent)
      170. local nSize = table.getn( tEvent[nEventId].Time ) + 1
      171. tEvent[nEventId].Time[nSize] = {}
      172. tEvent[nEventId].Time[nSize].nStart = GetTimeToNumber( strStart )
      173. tEvent[nEventId].Time[nSize].nEnd = GetTimeToNumber( strEnd )
      174. end
      175. -- ¾ÆÀÌÅÛ
      176. function SetItem( ItemId, nItemMaxNum, nItemNum, nLevel )
      177. local nEventId = table.getn(tEvent)
      178. local nSize = table.getn(tEvent[nEventId].Item)
      179. tEvent[nEventId].Item[nSize+1] = {}
      180. tEvent[nEventId].Item[nSize+1].ItemId = ItemId
      181. tEvent[nEventId].Item[nSize+1].ItemMaxNum = nItemMaxNum
      182. tEvent[nEventId].Item[nSize+1].ItemNum = nItemNum
      183. tEvent[nEventId].Item[nSize+1].nLevel = nLevel
      184. tEvent[nEventId].Item[nSize+1].TimeOut = 0
      185. tEvent[nEventId].Item[nSize+1].Skip = 0
      186. local tInterval = {}
      187. local nTotal = 0
      188. for i in pairs(tHour) do
      189. nTotal = nTotal + tHour[i]
      190. end
      191. for i in pairs(tHour) do
      192. tInterval[i] = 3600000 / ( nItemMaxNum * tHour[i] / nTotal )
      193. tInterval[i] = math.floor(tInterval[i])
      194. end
      195. tEvent[nEventId].Item[nSize+1].tInterval = tInterval
      196. end
      197. -- µå·ÓµÉ ¾ÆÀÌÅÛ ¸ñ·Ï
      198. function GetItem( nTickCount, nLevel )
      199. local nHour = tonumber(os.date("%H")) + 1
      200. local tList = GetEventList()
      201. local tReturn = {}
      202. local nCount = 1
      203. for i in pairs(tList) do
      204. local tItem = tEvent[tList[i]].Item
      205. for j in pairs(tItem) do
      206. if( (nTickCount >= tItem[j].TimeOut) and (tItem[j].nLevel <= nLevel) ) then
      207. tItem[j].TimeOut = tItem[j].tInterval[nHour] + nTickCount
      208. if( tItem[j].Skip == 0 ) then
      209. local nRandom = math.random(1, tItem[j].ItemNum)
      210. tReturn[nCount] = {}
      211. tReturn[nCount].ItemId = tItem[j].ItemId
      212. tReturn[nCount].ItemNum = nRandom
      213. tItem[j].Skip = nRandom - 1
      214. nCount = nCount + 1
      215. TRACE( "Event.lua : GetItem() - Drop - "..tItem[j].ItemId..", "..nRandom.."°³, Skip:"..tItem[j].Skip.." ½Ã°£´ë:"..(nHour-1).." ~ "..nHour )
      216. else
      217. tItem[j].Skip = tItem[j].Skip - 1
      218. TRACE( "Event.lua : GetItem() - Skip - "..tItem[j].ItemId..", ³²Àº Skip:"..tItem[j].Skip.." ½Ã°£´ë:"..(nHour-1).." ~ "..nHour )
      219. end
      220. end
      221. end
      222. end
      223. return tReturn
      224. end
      225. -- °æÇèÄ¡ ¹è¼ö
      226. function SetExpFactor( fExpFactor )
      227. local nEventId = table.getn(tEvent)
      228. tEvent[nEventId].fExpFactor = fExpFactor
      229. end
      230. function GetExpFactor()
      231. local tList = GetEventList()
      232. local fExpFactor = 10000
      233. for i in pairs(tList) do
      234. if( tEvent[tList[i]].fExpFactor ~= nil ) then
      235. fExpFactor = fExpFactor * tEvent[tList[i]].fExpFactor
      236. end
      237. end
      238. return fExpFactor
      239. end
      240. -- ¾ÆÀÌÅÛ µå·Ó·ü ¹è¼ö
      241. function SetItemDropRate( fItemDropRate )
      242. local nEventId = table.getn(tEvent)
      243. tEvent[nEventId].fItemDropRate = fItemDropRate
      244. end
      245. function GetItemDropRate()
      246. local tList = GetEventList()
      247. local fItemDropRate = 500
      248. for i in pairs(tList) do
      249. if( tEvent[tList[i]].fItemDropRate ~= nil ) then
      250. fItemDropRate = fItemDropRate * tEvent[tList[i]].fItemDropRate
      251. end
      252. end
      253. return fItemDropRate
      254. end
      255. -- °³º° ¾ÆÀÌÅÛ µå·Ó·ü ¹è¼ö
      256. function SetPieceItemDropRate( fPieceItemDropRate )
      257. local nEventId = table.getn(tEvent)
      258. tEvent[nEventId].fPieceItemDropRate = fPieceItemDropRate
      259. end
      260. function GetPieceItemDropRate()
      261. local tList = GetEventList()
      262. local fPieceItemDropRate = 200
      263. for i in pairs(tList) do
      264. if( tEvent[tList[i]].fPieceItemDropRate ~= nil ) then
      265. fPieceItemDropRate = fPieceItemDropRate * tEvent[tList[i]].fPieceItemDropRate
      266. end
      267. end
      268. return fPieceItemDropRate
      269. end
      270. -- Æä³Ä µå·Ó ¹è¼ö
      271. function SetGoldDropFactor( fGoldDropFactor )
      272. local nEventId = table.getn(tEvent)
      273. tEvent[nEventId].fGoldDropFactor = fGoldDropFactor
      274. end
      275. function GetGoldDropFactor()
      276. local tList = GetEventList()
      277. local fGoldDropFactor = 20000
      278. for i in pairs(tList) do
      279. if( tEvent[tList[i]].fGoldDropFactor ~= nil ) then
      280. fGoldDropFactor = fGoldDropFactor * tEvent[tList[i]].fGoldDropFactor
      281. end
      282. end
      283. return fGoldDropFactor
      284. end
      285. -- °ø°Ý·Â Áõ°¡
      286. function SetAttackPower( nAttackPower )
      287. local nEventId = table.getn(tEvent)
      288. tEvent[nEventId].nAttackPower = nAttackPower
      289. end
      290. function GetAttackPower()
      291. local tList = GetEventList()
      292. local nAttackPower = 0
      293. for i in pairs(tList) do
      294. if( tEvent[tList[i]].nAttackPower ~= nil ) then
      295. nAttackPower = nAttackPower + tEvent[tList[i]].nAttackPower
      296. end
      297. end
      298. return nAttackPower
      299. end
      300. -- ¹æ¾î·Â Áõ°¡
      301. function SetDefensePower( nDefensePower )
      302. local nEventId = table.getn(tEvent)
      303. tEvent[nEventId].nDefensePower = nDefensePower
      304. end
      305. function GetDefensePower()
      306. local tList = GetEventList()
      307. local nDefensePower = 0
      308. for i in pairs(tList) do
      309. if( tEvent[tList[i]].nDefensePower ~= nil ) then
      310. nDefensePower = nDefensePower + tEvent[tList[i]].nDefensePower
      311. end
      312. end
      313. return nDefensePower
      314. end
      315. -- ÄíÆù À̺¥Æ®
      316. function SetCouponEvent( nTime )
      317. local nEventId = table.getn(tEvent)
      318. tEvent[nEventId].nCouponEvent = nTime
      319. end
      320. function GetCouponEvent()
      321. local tList = GetEventList()
      322. for i in pairs(tList) do
      323. if( tEvent[tList[i]].nCouponEvent ~= 0 ) then
      324. return tEvent[tList[i]].nCouponEvent
      325. end
      326. end
      327. return 0
      328. end
      329. function SetLevelUpGift( nLevel, strAccount, strItemId, nItemNum )
      330. local nEventId = table.getn(tEvent)
      331. local nSize = table.getn(tEvent[nEventId].Gift)
      332. tEvent[nEventId].Gift[nSize+1] = {}
      333. tEvent[nEventId].Gift[nSize+1].nLevel = nLevel
      334. tEvent[nEventId].Gift[nSize+1].strAccount = strAccount
      335. tEvent[nEventId].Gift[nSize+1].strItemId = strItemId
      336. tEvent[nEventId].Gift[nSize+1].nItemNum = nItemNum
      337. end
      338. function GetLevelUpGift( nLevel, strAccount )
      339. local nCount = 1
      340. local tGiftList = {}
      341. local tList = GetEventList()
      342. for i in pairs(tList) do
      343. local tGift = tEvent[tList[i]].Gift
      344. for j in pairs(tGift) do
      345. local nTemp = string.find( strAccount, tGift[j].strAccount )
      346. if( (tGift[j].strAccount == "all") or (nTemp ~= nil) ) then
      347. if( tGift[j].nLevel == nLevel ) then
      348. tGiftList[nCount] = {}
      349. tGiftList[nCount].strItemId = tGift[j].strItemId
      350. tGiftList[nCount].nItemNum = tGift[j].nItemNum
      351. nCount = nCount + 1
      352. end
      353. end
      354. end
      355. end
      356. return tGiftList
      357. end
      358. AddEvent( "Pet Event" )
      359. --{
      360. SetTime( "2009-10-26 21:00", "2020-10-26 21:00" )
      361. SetLevelUpGift( 15, "all", "II_SYS_SYS_SCR_BX_PET_LAWOLF7", 1 )
      362. --}
      363. --]]
      Alles anzeigen
    • Dreckigerhund;45269 schrieb:

      also bei mir funtzt das mit /lua Event perfekt ich weiss nicht was das problem sein sollte
      die files müssen das event einspielen denke ich mal also /lua Event eingeben dann steht in grün load Event oder so dann startet das auch
      Das Event wird auch schon ohne diese Eingabe gestartet!