--变量定义 YiChan_TimerMin = 0 Open_Time = 0 OpenTimes = 0 ------------------------------此部分需要填入坐标----------------------------- YiChan_Point = {} YiChan_Point[3424071720] = {} --s05 北洲 YiChan_Point[3424071720][1] = {x=2409 ,y=7628 ,z=1602 } YiChan_Point[3424071720][2] = {x=2554 ,y=7687 ,z=1388 } YiChan_Point[3424071720][3] = {x=2203 ,y=8510 ,z=1001 } YiChan_Point[3424071720][4] = {x=2235 ,y=14350 ,z=3211 } YiChan_Point[3424071720][5] = {x=2598 ,y=13262 ,z=3139 } YiChan_Point[3424071720][6] = {x=2435 ,y=11748 ,z=3493 } YiChan_Point[3424071720][7] = {x=881 ,y=9048 ,z=3359 } YiChan_Point[3424071720][8] = {x=772 ,y=8696 ,z=3271 } YiChan_Point[3424071720][9] = {x=894 ,y=9025 ,z=3126 } YiChan_Point[3424071720][10] = {x=1090 ,y=9064 ,z=3203 } YiChan_Point[3424071720][11] = {x=1359 ,y=8762 ,z=3091 } YiChan_Point[3424071720][12] = {x=1500 ,y=12921 ,z=3270 } YiChan_Point[3424071720][13] = {x=1761 ,y=13305 ,z=3206 } YiChan_Point[3424071720][14] = {x=1890 ,y=13681 ,z=3274 } YiChan_Point[3424071720][15] = {x=1674 ,y=13425 ,z=3233 } YiChan_Point[3424071720][16] = {x=1787 ,y=13301 ,z=3218 } YiChan_Point[3424071720][17] = {x=1179 ,y=8193 ,z=2711 } YiChan_Point[3424071720][18] = {x=1086 ,y=7710 ,z=2433 } YiChan_Point[3424071720][19] = {x=1000 ,y=7964 ,z=2340 } YiChan_Point[3424071720][20] = {x=915 ,y=7413 ,z=2459 } YiChan_Point[3424071720][21] = {x=950 ,y=7400 ,z=2596 } YiChan_Point[3424071720][22] = {x=1069 ,y=7731 ,z=2132 } YiChan_Point[3424071720][23] = {x=1192 ,y=9378 ,z=2013 } YiChan_Point[3424071720][24] = {x=1205 ,y=8785 ,z=2127 } YiChan_Point[3424071720][25] = {x=854 ,y=8855 ,z=1817 } YiChan_Point[3424071720][26] = {x=1064 ,y=9653 ,z=1556 } YiChan_Point[3424071720][27] = {x=1512 ,y=8061 ,z=1577 } YiChan_Point[3424071720][28] = {x=1745 ,y=11754 ,z=1610 } YiChan_Point[3424071720][29] = {x=1580 ,y=14206 ,z=1877 } YiChan_Point[3424071720][30] = {x=1676 ,y=14199 ,z=1992 } YiChan_Point[3424071720][31] = {x=1532 ,y=15571 ,z=2245 } YiChan_Point[3424071720][32] = {x=1248 ,y=17217 ,z=877 } YiChan_Point[3424071720][33] = {x=1196 ,y=16895 ,z=837 } YiChan_Point[3424071720][34] = {x=1365 ,y=17098 ,z=661 } YiChan_Point[3424071720][35] = {x=1362 ,y=17500 ,z=855 } YiChan_Point[3424071720][36] = {x=1275 ,y=16257 ,z=673 } YiChan_Point[3424071720][37] = {x=864 ,y=8116 ,z=788 } YiChan_Point[3424071720][38] = {x=925 ,y=8137 ,z=791 } YiChan_Point[3424071720][39] = {x=1016 ,y=8580 ,z=675 } YiChan_Point[3424071720][40] = {x=995 ,y=8653 ,z=546 } YiChan_Point[3424071720][41] = {x=1159 ,y=9450 ,z=522 } YiChan_Point[3424071720][42] = {x=1628 ,y=9900 ,z=428 } YiChan_Point[3424071720][43] = {x=1842 ,y=8072 ,z=495 } YiChan_Point[3424071720][44] = {x=1937 ,y=7890 ,z=340 } YiChan_Point[3424071720][45] = {x=1786 ,y=8844 ,z=243 } YiChan_Point[3424071720][46] = {x=1762 ,y=9118 ,z=536 } YiChan_Point[3424071720][47] = {x=3111 ,y=7456 ,z=2397 } YiChan_Point[3424071720][48] = {x=3235 ,y=7463 ,z=2340 } YiChan_Point[3424071720][49] = {x=3367 ,y=7387 ,z=2377 } YiChan_Point[3424071720][50] = {x=3235 ,y=7463 ,z=2340 } YiChan_Point[3424072488] = {} --s06 西洲 YiChan_Point[3424072488][1] = {x=1090 ,y=4900 ,z=2273 } YiChan_Point[3424072488][2] = {x=1350 ,y=7553 ,z=2273 } YiChan_Point[3424072488][3] = {x=804 ,y=6004 ,z=2057 } YiChan_Point[3424072488][4] = {x=1483 ,y=3046 ,z=578 } YiChan_Point[3424072488][5] = {x=1509 ,y=3093 ,z=252 } YiChan_Point[3424072488][6] = {x=1672 ,y=5802 ,z=1162 } YiChan_Point[3424072488][7] = {x=613 ,y=7050 ,z=481 } YiChan_Point[3424072488][8] = {x=684 ,y=7050 ,z=350 } YiChan_Point[3424072488][9] = {x=823 ,y=5501 ,z=420 } YiChan_Point[3424072488][10] = {x=958 ,y=7461 ,z=696 } YiChan_Point[3424072488][11] = {x=2620 ,y=5000 ,z=566 } YiChan_Point[3424072488][12] = {x=2558 ,y=4997 ,z=416 } YiChan_Point[3424072488][13] = {x=2344 ,y=7255 ,z=553 } YiChan_Point[3424072488][14] = {x=2565 ,y=8167 ,z=1021 } YiChan_Point[3424072488][15] = {x=2777 ,y=8299 ,z=1075 } YiChan_Point[3424072488][16] = {x=2565 ,y=4815 ,z=1552 } YiChan_Point[3424072488][17] = {x=2695 ,y=5904 ,z=1915 } YiChan_Point[3424072488][18] = {x=2468 ,y=4236 ,z=1855 } YiChan_Point[3424072488][19] = {x=2566 ,y=5816 ,z=1943 } YiChan_Point[3424072488][20] = {x=2432 ,y=4291 ,z=1887 } YiChan_Point[3424072488][21] = {x=2656 ,y=3967 ,z=2680 } YiChan_Point[3424072488][22] = {x=1938 ,y=3500 ,z=2568 } YiChan_Point[3424072488][23] = {x=1457 ,y=7354 ,z=2254 } YiChan_Point[3424072488][24] = {x=1793 ,y=3939 ,z=2306 } YiChan_Point[3424072488][25] = {x=1703 ,y=4747 ,z=2168 } YiChan_Point[3424072488][26] = {x=1585 ,y=7689 ,z=1750 } YiChan_Point[3424072488][27] = {x=1266 ,y=7932 ,z=2114 } YiChan_Point[3424072488][28] = {x=1052 ,y=7152 ,z=1025 } YiChan_Point[3424072488][29] = {x=1538 ,y=3100 ,z=454 } YiChan_Point[3424072488][30] = {x=1749 ,y=3077 ,z=775 } YiChan_Point[3424072488][31] = {x=1714 ,y=5800 ,z=1085 } YiChan_Point[3424072488][32] = {x=1709 ,y=4270 ,z=1486 } YiChan_Point[3424072488][33] = {x=1841 ,y=3225 ,z=1287 } YiChan_Point[3424072488][34] = {x=1967 ,y=5760 ,z=1181 } YiChan_Point[3424072488][35] = {x=2175 ,y=5857 ,z=1105 } YiChan_Point[3424072488][36] = {x=2125 ,y=3278 ,z=966 } YiChan_Point[3424072488][37] = {x=2161 ,y=7200 ,z=693 } YiChan_Point[3424072488][38] = {x=1612 ,y=6503 ,z=718 } YiChan_Point[3424072488][39] = {x=1427 ,y=3106 ,z=595 } YiChan_Point[3424072488][40] = {x=1274 ,y=3211 ,z=369 } YiChan_Point[3424072488][41] = {x=1200 ,y=7829 ,z=2080 } YiChan_Point[3424072488][42] = {x=837 ,y=6036 ,z=2075 } YiChan_Point[3424072488][43] = {x=1375 ,y=5865 ,z=1303 } YiChan_Point[3424072488][44] = {x=1332 ,y=6362 ,z=1529 } YiChan_Point[3424072488][45] = {x=823 ,y=5907 ,z=2177 } YiChan_Point[3424072488][46] = {x=1839 ,y=3514 ,z=2360 } YiChan_Point[3424072488][47] = {x=2040 ,y=6000 ,z=1774 } YiChan_Point[3424072488][48] = {x=2047 ,y=6000 ,z=1846 } YiChan_Point[3424072488][49] = {x=2406 ,y=4061 ,z=2497 } YiChan_Point[3424072488][50] = {x=2355 ,y=4702 ,z=1285 } YiChan_Point[3424072232] = {} --s07 南洲 YiChan_Point[3424072232][1] = {x=2228 ,y=3457 ,z=1273 } YiChan_Point[3424072232][2] = {x=2329 ,y=3430 ,z=1383 } YiChan_Point[3424072232][3] = {x=2384 ,y=3616 ,z=1519 } YiChan_Point[3424072232][4] = {x=2325 ,y=4369 ,z=1744 } YiChan_Point[3424072232][5] = {x=2275 ,y=4746 ,z=1864 } YiChan_Point[3424072232][6] = {x=2205 ,y=4167 ,z=1839 } YiChan_Point[3424072232][7] = {x=2352 ,y=4384 ,z=1878 } YiChan_Point[3424072232][8] = {x=2059 ,y=5632 ,z=2298 } YiChan_Point[3424072232][9] = {x=1911 ,y=5796 ,z=2116 } YiChan_Point[3424072232][10] = {x=1883 ,y=6400 ,z=2214 } YiChan_Point[3424072232][11] = {x=2596 ,y=2973 ,z=2439 } YiChan_Point[3424072232][12] = {x=2565 ,y=2911 ,z=2432 } YiChan_Point[3424072232][13] = {x=2587 ,y=2884 ,z=2382 } YiChan_Point[3424072232][14] = {x=1623 ,y=4959 ,z=2665 } YiChan_Point[3424072232][15] = {x=2246 ,y=10085 ,z=2607 } YiChan_Point[3424072232][16] = {x=2246 ,y=10085 ,z=2607 } YiChan_Point[3424072232][17] = {x=2031 ,y=8913 ,z=2659 } YiChan_Point[3424072232][18] = {x=2038 ,y=8942 ,z=2540 } YiChan_Point[3424072232][19] = {x=1774 ,y=5722 ,z=2643 } YiChan_Point[3424072232][20] = {x=1604 ,y=4653 ,z=2420 } YiChan_Point[3424072232][21] = {x=1559 ,y=4519 ,z=2327 } YiChan_Point[3424072232][22] = {x=1403 ,y=5760 ,z=2303 } YiChan_Point[3424072232][23] = {x=1538 ,y=4400 ,z=2434 } YiChan_Point[3424072232][24] = {x=1590 ,y=4409 ,z=2267 } YiChan_Point[3424072232][25] = {x=1648 ,y=5771 ,z=2040 } YiChan_Point[3424072232][26] = {x=1519 ,y=5997 ,z=2022 } YiChan_Point[3424072232][27] = {x=1249 ,y=11695 ,z=2009 } YiChan_Point[3424072232][28] = {x=1093 ,y=11755 ,z=2097 } YiChan_Point[3424072232][29] = {x=826 ,y=12285 ,z=1993 } YiChan_Point[3424072232][30] = {x=799 ,y=14388 ,z=1593 } YiChan_Point[3424072232][31] = {x=712 ,y=14595 ,z=1546 } YiChan_Point[3424072232][32] = {x=788 ,y=14604 ,z=1460 } YiChan_Point[3424072232][33] = {x=701 ,y=13164 ,z=1417 } YiChan_Point[3424072232][34] = {x=601 ,y=14756 ,z=1365 } YiChan_Point[3424072232][35] = {x=754 ,y=14600 ,z=1326 } YiChan_Point[3424072232][36] = {x=2330 ,y=4262 ,z=1788 } YiChan_Point[3424072232][37] = {x=2310 ,y=7176 ,z=865 } YiChan_Point[3424072232][38] = {x=2297 ,y=7320 ,z=778 } YiChan_Point[3424072232][39] = {x=2183 ,y=7201 ,z=825 } YiChan_Point[3424072232][40] = {x=1934 ,y=4190 ,z=796 } YiChan_Point[3424072232][41] = {x=1886 ,y=3894 ,z=848 } YiChan_Point[3424072232][42] = {x=2011 ,y=3441 ,z=1057 } YiChan_Point[3424072232][43] = {x=1822 ,y=3465 ,z=950 } YiChan_Point[3424072232][44] = {x=1795 ,y=3456 ,z=860 } YiChan_Point[3424072232][45] = {x=1298 ,y=2879 ,z=618 } YiChan_Point[3424072232][46] = {x=1131 ,y=2872 ,z=625 } YiChan_Point[3424072232][47] = {x=1128 ,y=2809 ,z=470 } YiChan_Point[3424072232][48] = {x=1284 ,y=2838 ,z=438 } YiChan_Point[3424072232][49] = {x=1391 ,y=2986 ,z=663 } YiChan_Point[3424072232][50] = {x=1468 ,y=3680 ,z=980 } YiChan_Point[3424075048] = {} --s08 东洲 YiChan_Point[3424075048][1] = {x=1579,y=6697,z=2879} YiChan_Point[3424075048][2] = {x=1500,y=6620,z=2784} YiChan_Point[3424075048][3] = {x=1567,y=5500,z=2374} YiChan_Point[3424075048][4] = {x=1449,y=5500,z=2324} YiChan_Point[3424075048][5] = {x=1641,y=9164,z=2624} YiChan_Point[3424075048][6] = {x=1774,y=10515,z=2351} YiChan_Point[3424075048][7] = {x=1785,y=10716,z=2177} YiChan_Point[3424075048][8] = {x=1888,y=9700,z=2136} YiChan_Point[3424075048][9] = {x=1973,y=10057,z=2245} YiChan_Point[3424075048][10] = {x=1952,y=10842,z=2444} YiChan_Point[3424075048][11] = {x=2258,y=10970,z=2409} YiChan_Point[3424075048][12] = {x=2172,y=10964,z=2588} YiChan_Point[3424075048][13] = {x=2354,y=11351,z=2439} YiChan_Point[3424075048][14] = {x=2446,y=13987,z=2837} YiChan_Point[3424075048][15] = {x=2751,y=11033,z=2670} YiChan_Point[3424075048][16] = {x=2795,y=10332,z=2503} YiChan_Point[3424075048][17] = {x=2730,y=10387,z=2416} YiChan_Point[3424075048][18] = {x=2762,y=10020,z=2218} YiChan_Point[3424075048][19] = {x=2688,y=11152,z=2057} YiChan_Point[3424075048][20] = {x=2746,y=12074,z=1857} YiChan_Point[3424075048][21] = {x=2883,y=16874,z=1500} YiChan_Point[3424075048][22] = {x=2774,y=16714,z=1443} YiChan_Point[3424075048][23] = {x=2341,y=10388,z=1623} YiChan_Point[3424075048][24] = {x=2238,y=10126,z=1696} YiChan_Point[3424075048][25] = {x=2154,y=8217,z=1654} YiChan_Point[3424075048][26] = {x=2059,y=8122,z=1770} YiChan_Point[3424075048][27] = {x=2204,y=7710,z=2024} YiChan_Point[3424075048][28] = {x=1776,y=10206,z=1716} YiChan_Point[3424075048][29] = {x=1682,y=9600,z=1629} YiChan_Point[3424075048][30] = {x=1442,y=10931,z=1720} YiChan_Point[3424075048][31] = {x=846,y=10600,z=2444} YiChan_Point[3424075048][32] = {x=643,y=10978,z=2679} YiChan_Point[3424075048][33] = {x=534,y=10641,z=2053} YiChan_Point[3424075048][34] = {x=212,y=11842,z=1674} YiChan_Point[3424075048][35] = {x=427,y=9208,z=1519} YiChan_Point[3424075048][36] = {x=883,y=8549,z=1304} YiChan_Point[3424075048][37] = {x=1159,y=4448,z=1159} YiChan_Point[3424075048][38] = {x=1217,y=4387,z=879} YiChan_Point[3424075048][39] = {x=1243,y=4390,z=422} YiChan_Point[3424075048][40] = {x=877,y=10004,z=222} YiChan_Point[3424075048][41] = {x=448,y=12556,z=444} YiChan_Point[3424075048][42] = {x=1342,y=11187,z=1450} YiChan_Point[3424075048][43] = {x=1573,y=14054,z=771} YiChan_Point[3424075048][44] = {x=1542,y=13317,z=451} YiChan_Point[3424075048][45] = {x=2031,y=10309,z=444} YiChan_Point[3424075048][46] = {x=2053,y=7593,z=922} YiChan_Point[3424075048][47] = {x=2770,y=9707,z=541} YiChan_Point[3424075048][48] = {x=2776,y=9288,z=361} YiChan_Point[3424075048][49] = {x=2595,y=10993,z=910} YiChan_Point[3424075048][50] = {x=2574,y=11815,z=1222} ------------------------------此部分需要填入ID及设计公告----------------------------- function YiChan_OnStart(actID) -- 活动开始 --重置TimerMin YiChan_TimerMin = 0 --记录遗产的进行时间 Open_Time = 0 --记录上次活动 OpenTimes = 0 local curmin = tonumber(os.date("%M")) local curhour = tonumber(os.date("%H")) YiChan_TimerMin = YiChan_TimerMin + (curhour-18)*60 + curmin local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 100171) --活动开始说明 msg.DispatchBroadcast(MsgID, -1, -1, -1) end aux.RegisterActEvent(33, 2, "YiChan_OnStart") --此处需要填一个活动ID function YiChan_OnTimerMin(actID) --活动每进行1分钟调用一次。第一次调用是18:01 YiChan_TimerMin = YiChan_TimerMin + 1 ---------------------局部函数----------------------------- local function Yichan_CreatCreature(Time) --此为局部函数,作用为刷新宝箱。宝箱刷新时,西洲和北州前6个是不随机的,后面得坐标才会随机,同时保证不会随到同样的点。 local beizhou = {} local xizhou = {} local nanzhou = {} local dongzhou = {} for i = 1, 50 do beizhou[i] = {x=YiChan_Point[3424071720][i].x,y=YiChan_Point[3424071720][i].y,z=YiChan_Point[3424071720][i].z} xizhou[i] = {x=YiChan_Point[3424072488][i].x,y=YiChan_Point[3424072488][i].y,z=YiChan_Point[3424072488][i].z} nanzhou[i] = {x=YiChan_Point[3424072232][i].x,y=YiChan_Point[3424072232][i].y,z=YiChan_Point[3424072232][i].z} dongzhou[i] = {x=YiChan_Point[3424075048][i].x,y=YiChan_Point[3424075048][i].y,z=YiChan_Point[3424075048][i].z} end if Time - Open_Time == 5 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 100174) --“5分钟后,在北洲、西洲、南洲将出现妖精的遗产宝箱!” msg.DispatchBroadcast(MsgID, -1, -1, -1) for i = 1,30 do if i <= 6 then map.MapCreateCreature(3424071720, -1, 5513004, beizhou[1].x, beizhou[1].y, beizhou[1].z) table.remove(beizhou,1) --将表中的一个元素删除,并将其后的所有元素上移一位 else local k = math.random(51-i) map.MapCreateCreature(3424071720, -1,5513004 , beizhou[k].x, beizhou[k].y, beizhou[k].z) table.remove(beizhou,k) end end for i = 1,20 do if i <= 6 then map.MapCreateCreature(3424072488, -1, 5513013, xizhou[1].x, xizhou[1].y, xizhou[1].z) table.remove(xizhou,1) else local k = math.random(51-i) map.MapCreateCreature(3424072488, -1, 5513013, xizhou[k].x, xizhou[k].y, xizhou[k].z) table.remove(xizhou,k) end end for i = 1,10 do local k = math.random(51-i) map.MapCreateCreature(3424072232, -1,5513014 , nanzhou[k].x, nanzhou[k].y, nanzhou[k].z) table.remove(nanzhou,k) end for i = 1,10 do local k = math.random(51-i) map.MapCreateCreature(3424075048, -1, 5513020, dongzhou[k].x, dongzhou[k].y, dongzhou[k].z) table.remove(nanzhou,k) end elseif (Time - Open_Time) % 5 == 0 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 100174) --“5分钟后,在北洲、西洲、南洲将出现妖精的遗产宝箱!” msg.DispatchBroadcast(MsgID, -1, -1, -1) for i = 1,8 do local k = math.random(51-i) map.MapCreateCreature(3424071720, -1,5513004 , beizhou[k].x, beizhou[k].y, beizhou[k].z) table.remove(beizhou,k) end for i = 1,5 do local k = math.random(51-i) map.MapCreateCreature(3424072488, -1, 5513013, xizhou[k].x, xizhou[k].y, xizhou[k].z) table.remove(xizhou,k) end for i = 1,2 do local k = math.random(51-i) map.MapCreateCreature(3424072232, -1, 5513014, nanzhou[k].x, nanzhou[k].y, nanzhou[k].z) table.remove(nanzhou,k) end for i = 1,2 do local k = math.random(51-i) map.MapCreateCreature(3424075048, -1, 5513020, dongzhou[k].x, dongzhou[k].y, dongzhou[k].z) table.remove(dongzhou,k) end end end --------------------------子活动开启的判断--------------------- if YiChan_TimerMin % 30 == 1 then if Open_Time == 0 then if YiChan_TimerMin >= 31 then if math.random(100) <= 30 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 100172) --“5分钟后,在北洲、西洲、南洲将出现妖精的遗产宝箱!” msg.DispatchBroadcast(MsgID, -1, -1, -1) Open_Time = YiChan_TimerMin --记录子活动开始时间 OpenTimes = OpenTimes + 1 --记录子活动已经开始的次数 --Yichan_CreatCreature(YiChan_TimerMin) --刷宝箱,调用局部函数 end else if math.random(100) <= 15 then--xiugaiguo local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 100172) --公告刷出宝箱 msg.DispatchBroadcast(MsgID, -1, -1, -1) Open_Time = YiChan_TimerMin --记录子活动开始时间 OpenTimes = OpenTimes + 1 --记录子活动已经开始的次数 --Yichan_CreatCreature(YiChan_TimerMin) end end else if YiChan_TimerMin - Open_Time == 60 then if math.random(100) <= 15 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102,100172 ) --公告刷出宝箱 msg.DispatchBroadcast(MsgID, -1, -1, -1) Open_Time = YiChan_TimerMin --记录子活动开始时间 OpenTimes = OpenTimes + 1 --记录子活动已经开始的次数 --Yichan_CreatCreature(YiChan_TimerMin) end elseif YiChan_TimerMin - Open_Time >= 90 then if math.random(100) <= 30 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 100172) --公告刷出宝箱 msg.DispatchBroadcast(MsgID, -1, -1, -1) Open_Time = YiChan_TimerMin --记录子活动开始时间 OpenTimes = OpenTimes + 1 --记录子活动已经开始的次数 --Yichan_CreatCreature(YiChan_TimerMin) end end end if YiChan_TimerMin == 241 and OpenTimes < 2 and Open_Time ~= YiChan_TimerMin then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102, 100172) --公告刷出宝箱 msg.DispatchBroadcast(MsgID, -1, -1, -1) Open_Time = YiChan_TimerMin --记录子活动开始时间 OpenTimes = OpenTimes + 1 --记录子活动已经开始的次数 --Yichan_CreatCreature(YiChan_TimerMin) elseif YiChan_TimerMin == 301 and OpenTimes < 3 and Open_Time ~= YiChan_TimerMin then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102,100172 ) --公告刷出宝箱 msg.DispatchBroadcast(MsgID, -1, -1, -1) Open_Time = YiChan_TimerMin --记录子活动开始时间 OpenTimes = OpenTimes + 1 --记录子活动已经开始的次数 --Yichan_CreatCreature(YiChan_TimerMin) end end if YiChan_TimerMin - Open_Time < 30 then Yichan_CreatCreature(YiChan_TimerMin) end end aux.RegisterActEvent(33, 4, "YiChan_OnTimerMin") --此处需要填一个活动ID --活动结束 function YiChan_OnEnd(actID) local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 102,100173 ) --公告活动结束 msg.DispatchBroadcast(MsgID, -1, -1, -1) end aux.RegisterActEvent(33, 3, "YiChan_OnEnd") --此处需要填一个活动ID --当玩家对宝箱使用专用调查技能 function YiChan_OnCheck(MapID, InstanceID, TargetID, TargetTypeID, RoleID) end aux.RegisterCreatureEvent(5513004, 4, "YiChan_OnCheck") aux.RegisterCreatureEvent(5513013, 4, "YiChan_OnCheck") aux.RegisterCreatureEvent(5513014, 4, "YiChan_OnCheck") aux.RegisterCreatureEvent(5513020, 4, "YiChan_OnCheck") -- 副本传送人: function x5513001_OnTalk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) if TalkIndex == -1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604000) --“是否进入副本” msg.AddMsgEvent(MsgID, 24, TargetID) --npcid 这个只要是服务器控制的对话就必须要写 msg.AddMsgEvent(MsgID, 21, 4) --此处的4在玩家选择“取消”之后会作为TalkIndex的值返回 msg.AddMsgEvent(MsgID, 1, 100001) --“确定” msg.AddMsgEvent(MsgID, 21, 5) --此处的5在玩家选择“取消”之后会作为TalkIndex的值返回 msg.AddMsgEvent(MsgID, 1, 100002) --“取消” msg.DispatchRoleMsgEvent(RoleID, MsgID) elseif TalkIndex == 4 then role.RoleGotoNewMap(MapID, InstanceID, RoleID, 619034298, 118, 40, 189) end end --注册妖精幻境传送 aux.RegisterCreatureEvent(5513001, 7, "x5513001_OnTalk") --召唤怪物: function x5513002_OnTalk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) if TalkIndex == -1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604004) --对话提示 msg.AddMsgEvent(MsgID, 24, TargetID) --npcid 这个只要是服务器控制的对话就必须要写 msg.AddMsgEvent(MsgID, 21, 6) --此处的4在玩家选择“取消”之后会作为TalkIndex的值返回 msg.AddMsgEvent(MsgID, 1, 604003) --雪之女王选项 msg.AddMsgEvent(MsgID, 21, 9) --此处的4在玩家选择“取消”之后会作为TalkIndex的值返回 msg.AddMsgEvent(MsgID, 1, 604005) --死亡契约选项 msg.AddMsgEvent(MsgID, 21, 10) --此处的4在玩家选择“取消”之后会作为TalkIndex的值返回 msg.AddMsgEvent(MsgID, 1, 604007) --暗夜卡露拉选项 msg.AddMsgEvent(MsgID, 21, 11) --此处的4在玩家选择“取消”之后会作为TalkIndex的值返回 msg.AddMsgEvent(MsgID, 1, 604009) --堕落妖精贝妮嘉选项 msg.AddMsgEvent(MsgID, 21, 12) --此处的4在玩家选择“取消”之后会作为TalkIndex的值返回 msg.AddMsgEvent(MsgID, 1, 604011) --仙妖后选项 msg.AddMsgEvent(MsgID, 21, 13) --此处的4在玩家选择“取消”之后会作为TalkIndex的值返回 msg.AddMsgEvent(MsgID, 1, 604013) --幻妖姬选项 msg.AddMsgEvent(MsgID, 21, 14) --此处的4在玩家选择“取消”之后会作为TalkIndex的值返回 msg.AddMsgEvent(MsgID, 1, 604015) --神女选项 msg.AddMsgEvent(MsgID, 21, 15) --此处的4在玩家选择“取消”之后会作为TalkIndex的值返回 msg.AddMsgEvent(MsgID, 1, 604017) --冥神姬选项 msg.AddMsgEvent(MsgID, 21, 5) --此处的5在玩家选择“取消”之后会作为TalkIndex的值返回 msg.AddMsgEvent(MsgID, 1, 100002) --“取消” msg.DispatchRoleMsgEvent(RoleID, MsgID) --elseif Index == 6 then --需要召唤妖精列表 elseif TalkIndex == 6 then --雪之女王 local num = role.GetRoleItemNum(RoleID, 4400202) if num >= 20 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604001) ---“对话后提示:“真的药招吗” msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, 101) --确定按钮 msg.AddMsgEvent(MsgID, 1,100001) --“确定” msg.AddMsgEvent(MsgID, 21, 102) --取消按钮 msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604002) ---“对话后提示:“您没有足够的道具” msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, 103) --取消按钮 msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) end elseif TalkIndex == 101 then local num = role.GetRoleItemNum(RoleID, 4400202) if num >= 20 then role.RemoveFromRole(MapID, InstanceID, RoleID, 4400202, 20, 420) map.MapCreateCreature(619034298, InstanceID, 1092001, 104, 1994, 141) map.MapDeleteCreature(MapID, InstanceID, TargetID) end elseif TalkIndex == 9 then --死亡契约 local num = role.GetRoleItemNum(RoleID, 4400203) if num >= 20 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604006) ---“对话后提示:“真的药招吗” msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, 111) --确定按钮 msg.AddMsgEvent(MsgID, 1,100001) --“确定” msg.AddMsgEvent(MsgID, 21, 112) --取消按钮 msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604002) ---“对话后提示:“您没有足够的道具” msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, 113) --取消按钮 msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) end elseif TalkIndex == 111 then local num = role.GetRoleItemNum(RoleID, 4400203) if num >= 20 then role.RemoveFromRole(MapID, InstanceID, RoleID, 4400203, 20, 420) map.MapCreateCreature(619034298, InstanceID, 1092006, 104, 1994, 141) map.MapDeleteCreature(MapID, InstanceID, TargetID) end elseif TalkIndex == 10 then --暗夜卡露拉 local num = role.GetRoleItemNum(RoleID, 4400204) if num >= 30 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604008) ---“对话后提示:“真的药招吗” msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, 121) --确定按钮 msg.AddMsgEvent(MsgID, 1,100001) --“确定” msg.AddMsgEvent(MsgID, 21, 122) --取消按钮 msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604002) ---“对话后提示:“您没有足够的道具” msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, 123) --取消按钮 msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) end elseif TalkIndex == 121 then local num = role.GetRoleItemNum(RoleID, 4400204) if num >= 30 then role.RemoveFromRole(MapID, InstanceID, RoleID, 4400204, 30, 420) map.MapCreateCreature(619034298, InstanceID, 1092002, 104, 1994, 141) map.MapDeleteCreature(MapID, InstanceID, TargetID) end elseif TalkIndex == 11 then --堕落妖精 local num = role.GetRoleItemNum(RoleID, 4400205) if num >= 30 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604010) ---“对话后提示:“真的药招吗” msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, 131) --确定按钮 msg.AddMsgEvent(MsgID, 1,100001) --“确定” msg.AddMsgEvent(MsgID, 21, 132) --取消按钮 msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604002) ---“对话后提示:“您没有足够的道具” msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, 133) --取消按钮 msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) end elseif TalkIndex == 131 then local num = role.GetRoleItemNum(RoleID, 4400205) if num >= 30 then role.RemoveFromRole(MapID, InstanceID, RoleID, 4400205, 30, 420) map.MapCreateCreature(619034298, InstanceID, 1092007, 104, 1994, 141) map.MapDeleteCreature(MapID, InstanceID, TargetID) end elseif TalkIndex == 12 then --仙妖后 local num = role.GetRoleItemNum(RoleID, 4400206) if num >= 40 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604012) ---“对话后提示:“真的药招吗” msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, 141) --确定按钮 msg.AddMsgEvent(MsgID, 1,100001) --“确定” msg.AddMsgEvent(MsgID, 21, 142) --取消按钮 msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604002) ---“对话后提示:“您没有足够的道具” msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, 143) --取消按钮 msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) end elseif TalkIndex == 141 then local num = role.GetRoleItemNum(RoleID, 4400206) if num >= 40 then role.RemoveFromRole(MapID, InstanceID, RoleID, 4400206, 40, 420) map.MapCreateCreature(619034298, InstanceID, 1092003, 104, 1994, 141) map.MapDeleteCreature(MapID, InstanceID, TargetID) end elseif TalkIndex == 13 then --幻妖姬 local num = role.GetRoleItemNum(RoleID, 4400207) if num >= 40 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604014) ---“对话后提示:“真的药招吗” msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, 151) --确定按钮 msg.AddMsgEvent(MsgID, 1,100001) --“确定” msg.AddMsgEvent(MsgID, 21, 152) --取消按钮 msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604002) ---“对话后提示:“您没有足够的道具” msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, 153) --取消按钮 msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) end elseif TalkIndex == 151 then local num = role.GetRoleItemNum(RoleID, 4400207) if num >= 40 then role.RemoveFromRole(MapID, InstanceID, RoleID, 4400207, 40, 420) map.MapCreateCreature(619034298, InstanceID, 1092008, 104, 1994, 141) map.MapDeleteCreature(MapID, InstanceID, TargetID) end elseif TalkIndex == 14 then --神女 local num = role.GetRoleItemNum(RoleID, 4400208) if num >= 50 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604016) ---“对话后提示:“真的药招吗” msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, 161) --确定按钮 msg.AddMsgEvent(MsgID, 1,100001) --“确定” msg.AddMsgEvent(MsgID, 21, 162) --取消按钮 msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604002) ---“对话后提示:“您没有足够的道具” msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, 163) --取消按钮 msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) end elseif TalkIndex == 161 then local num = role.GetRoleItemNum(RoleID, 4400208) if num >= 50 then role.RemoveFromRole(MapID, InstanceID, RoleID, 4400208, 50, 420) map.MapCreateCreature(619034298, InstanceID, 1092004, 104, 1994, 141) map.MapDeleteCreature(MapID, InstanceID, TargetID) end elseif TalkIndex == 15 then --冥神姬 local num = role.GetRoleItemNum(RoleID, 4400209) if num >= 50 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604018) ---“对话后提示:“真的药招吗” msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, 171) --确定按钮 msg.AddMsgEvent(MsgID, 1,100001) --“确定” msg.AddMsgEvent(MsgID, 21, 172) --取消按钮 msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604002) ---“对话后提示:“您没有足够的道具” msg.AddMsgEvent(MsgID, 24, TargetID) --npcid msg.AddMsgEvent(MsgID, 21, 173) --取消按钮 msg.AddMsgEvent(MsgID, 1, 100002) msg.DispatchRoleMsgEvent(RoleID, MsgID) end elseif TalkIndex == 171 then local num = role.GetRoleItemNum(RoleID, 4400209) if num >= 50 then role.RemoveFromRole(MapID, InstanceID, RoleID, 4400209, 50, 420) map.MapCreateCreature(619034298, InstanceID, 1092009, 104, 1994, 141) map.MapDeleteCreature(MapID, InstanceID, TargetID) end end end --注册对话事件 aux.RegisterCreatureEvent(5513002, 7, "x5513002_OnTalk") --妖精幻境说明人 function x5513003_OnTalk(MapID, InstanceID, TargetID, TargetTypeID, RoleID, TalkIndex) if TalkIndex == -1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604019) --您现在所处的位置妖精幻境,有什么需要帮助吗 msg.AddMsgEvent(MsgID, 24, TargetID) --npcid 这个只要是服务器控制的对话就必须要写 msg.AddMsgEvent(MsgID, 21, 1001) -- msg.AddMsgEvent(MsgID, 1, 604020) --妖精幻境介绍 msg.AddMsgEvent(MsgID, 21, 1002) -- msg.AddMsgEvent(MsgID, 1, 604021) --如何召唤妖精 msg.AddMsgEvent(MsgID, 21, 1003) --此处的4在玩家选择“取消”之后会作为TalkIndex的值返回 msg.AddMsgEvent(MsgID, 1, 604022) --召唤妖精的条件和妖精类型 msg.AddMsgEvent(MsgID, 21, 1004) --此处的4在玩家选择“取消”之后会作为TalkIndex的值返回 msg.AddMsgEvent(MsgID, 1, 604023) --击杀妖精后的奖励 msg.AddMsgEvent(MsgID, 21, 5) --此处的5在玩家选择“取消”之后会作为TalkIndex的值返回 msg.AddMsgEvent(MsgID, 1, 100002) --取消 msg.DispatchRoleMsgEvent(RoleID, MsgID) elseif TalkIndex ==1001 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604024) -- msg.AddMsgEvent(MsgID, 24, TargetID) --npcid 这个只要是服务器控制的对话就必须要写 msg.AddMsgEvent(MsgID, 21, 5) --此处的5在玩家选择“取消”之后会作为TalkIndex的值返回 msg.AddMsgEvent(MsgID, 1, 100002) --取消 msg.DispatchRoleMsgEvent(RoleID, MsgID) elseif TalkIndex ==1002 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604025) -- msg.AddMsgEvent(MsgID, 24, TargetID) --npcid 这个只要是服务器控制的对话就必须要写 msg.AddMsgEvent(MsgID, 21, 5) --此处的5在玩家选择“取消”之后会作为TalkIndex的值返回 msg.AddMsgEvent(MsgID, 1, 100002) --取消 msg.DispatchRoleMsgEvent(RoleID, MsgID) elseif TalkIndex ==1003 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604026) -- msg.AddMsgEvent(MsgID, 24, TargetID) --npcid 这个只要是服务器控制的对话就必须要写 msg.AddMsgEvent(MsgID, 21, 5) --此处的5在玩家选择“取消”之后会作为TalkIndex的值返回 msg.AddMsgEvent(MsgID, 1, 100002) --取消 msg.DispatchRoleMsgEvent(RoleID, MsgID) elseif TalkIndex ==1004 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 20, 604027) -- msg.AddMsgEvent(MsgID, 24, TargetID) --npcid 这个只要是服务器控制的对话就必须要写 msg.AddMsgEvent(MsgID, 21, 5) --此处的5在玩家选择“取消”之后会作为TalkIndex的值返回 msg.AddMsgEvent(MsgID, 1, 100002) --取消 msg.DispatchRoleMsgEvent(RoleID, MsgID) end end --注册妖精幻境说明人 aux.RegisterCreatureEvent(5513003, 7, "x5513003_OnTalk")