Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.61 KB | None | 0 0
  1. quest deviltower_zone begin
  2. state start begin
  3. when login begin
  4. if pc.get_map_index() == 66 then
  5. if pc.get_level() < 40 then
  6. warp_to_village()
  7. else
  8. if pc.get_x() < 2048+88 or pc.get_y() < 6656+577 or pc.get_x() > 2048+236 or pc.get_y() > 6656+737 then
  9. pc.warp(590500, 110500)
  10. end
  11.  
  12. pc.set_warp_location(65, 5905, 1105)
  13. end
  14. elseif pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 then
  15. if pc.get_level() < 40 then
  16. warp_to_village()
  17. else
  18. pc.set_warp_location(65, 5905, 1105)
  19. end
  20. end
  21. end
  22.  
  23. when logout begin
  24. -- metin and key
  25. if pc.count_item(30300) >= 1 then
  26. pc.remove_item(30300, pc.count_item(30300))
  27. end
  28. if pc.count_item(30302) >= 1 then
  29. pc.remove_item(30302, pc.count_item(30302))
  30. end
  31. end
  32.  
  33. when 20348.chat."Do Wieży Demonów..." begin
  34. if pc.get_level() < 40 then
  35. say_title("Strażnik Wieży Demonów")
  36. say("Chyba zgłupiałeś... Masz za mały poziom")
  37. say("Wróć do mnie, gdy osiągniesz 40 poziom postaci.")
  38. else
  39. say_title("Strażnik Wieży Demonów")
  40. say("Ta wieża jest opanowana przez demony. Na jej")
  41. say("szczyt mogą dostać się jedynie najsilniejsi.")
  42. say("Chodzą słuchy, że jeszcze nikt nie wyszedł z niej")
  43. say("żywy. Czy nadal chcesz wejść do Wieży")
  44. say("Demonów?")
  45. local s = select("Wejdź ","Nie wchodź ")
  46. if s == 2 then
  47. return
  48. end
  49. -- warp into!
  50. pc.warp(216500,727000)
  51. end
  52. end
  53.  
  54. when 8015.kill with pc.get_map_index() == 66 begin
  55. timer("devil_stone1_1", 3)
  56. end
  57.  
  58. when devil_stone1_1.timer begin
  59. d.new_jump_all(66, special.devil_tower[2][1], special.devil_tower[2][2])
  60. d.regen_file("data/dungeon/deviltower3_regen.txt")
  61. end
  62.  
  63. when devil_stone3.kill with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  64. d.set_warp_at_eliminate(4, d.get_map_index(), special.devil_tower[3][1], special.devil_tower[3][2], "data/dungeon/deviltower4_regen.txt")
  65. d.check_eliminated()
  66. end
  67.  
  68. function get_4floor_stone_pos()
  69. local positions =
  70. {
  71. {368, 629}, {419, 630}, {428, 653}, {422, 679},
  72. {395, 689}, {369, 679}, {361, 658},
  73. }
  74. for i = 1, 6 do
  75. local j = number(i, 7)
  76. if i != j then
  77. local t = positions[i];
  78. positions[i] = positions[j];
  79. positions[j] = t;
  80. end
  81. end
  82. return positions
  83. end
  84.  
  85. when 8016.kill with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  86. d.setf("level", 4)
  87. local positions = deviltower_zone.get_4floor_stone_pos()
  88.  
  89. for i = 1, 6 do
  90. d.set_unique("fake" .. i , d.spawn_mob(8017, positions[i][1], positions[i][2]))
  91. end
  92.  
  93. local vid = d.spawn_mob(8017, positions[7][1], positions[7][2])
  94. d.set_unique("real", vid)
  95. server_loop_timer('devil_stone4_11_updat', 10, pc.get_map_index())
  96. server_timer('devil_stone4_11_faill1', 5*60, pc.get_map_index())
  97.  
  98. d.notice("Dotarłeś do Bramy Wyboru na 3. piętrze. Wiele");
  99. d.notice("kamieni Metin będzie drażnić Twoje oczy i uszy.");
  100. d.notice("Znajdź właściwy kamień Metin i zniszcz go w ciągu");
  101. d.notice("15 minut! To jedyny sposób aby przejść dalej.");
  102. end
  103.  
  104. when devil_stone4_11_faill1.server_timer begin
  105. if d.select(get_server_timer_arg()) then
  106. if d.getf("level") == 4 then
  107. d.notice("Pozostało 10 minut!")
  108. server_timer('devil_stone4_11_faill2', 5*60, get_server_timer_arg())
  109. end
  110. end
  111. end
  112.  
  113. when devil_stone4_11_faill2.server_timer begin
  114. if d.select(get_server_timer_arg()) then
  115. if d.getf("level") == 4 then
  116. d.notice("Pozostało 5 minut!")
  117. server_timer('devil_stone4_11_faill', 5*60, get_server_timer_arg())
  118. end
  119. end
  120. end
  121.  
  122. when devil_stone4_11_faill.server_timer begin
  123. if d.select(get_server_timer_arg()) then
  124. if d.getf("level") == 4 then
  125. d.notice("Czas się skończył.")
  126. d.clear_regen()
  127. d.exit_all()
  128. clear_server_timer('devil_stone4_11_updat', get_server_timer_arg())
  129. end
  130. end
  131. end
  132.  
  133. when devil_stone4_11_updat.server_timer begin
  134. if d.select(get_server_timer_arg()) then
  135. if not d.is_unique_dead("real") then
  136. for i = 1, 6 do
  137. if d.getf("fakedead" .. i) == 0 then
  138. if d.unique_get_hp_perc("fake" .. i) < 50 then
  139. d.purge_unique("fake" .. i)
  140. d.setf("fakedead" .. i, 1)
  141. d.notice("Fałszywe kamienie Metin znikają...");
  142. end
  143. end
  144. end
  145. else
  146. server_timer('devil_stone5_11_tp', 5, get_server_timer_arg())
  147. d.notice("Wykazałeś się doskonałym słuchem i instynktem");
  148. d.notice("Zniszczyłeś prawidłowy kamień Metin! Za chwilę ")
  149. d.notice("dotrzesz na 5. piętro!")
  150. d.purge()
  151. end
  152. else
  153. server_timer('devil_stone4_11_stop_timers', 1, get_server_timer_arg())
  154. end
  155. end
  156.  
  157. when devil_stone4_11_stop_timers.server_timer begin
  158. clear_server_timer('devil_stone4_11_updat', get_server_timer_arg())
  159. end
  160.  
  161. when devil_stone5_11_tp.server_timer begin
  162. if d.select(get_server_timer_arg()) then
  163. clear_server_timer('devil_stone4_11_updat', get_server_timer_arg())
  164. clear_server_timer('devil_stone4_11_faill1', get_server_timer_arg())
  165. clear_server_timer('devil_stone4_11_faill2', get_server_timer_arg())
  166. clear_server_timer('devil_stone4_11_faill', get_server_timer_arg())
  167.  
  168. d.setf("level", 5)
  169.  
  170. d.notice("Dotarłeś do zamkniętej Bramy na 4. piętrze!")
  171. d.notice("Znajduje się tu wiele potworów, które strzegą ")
  172. d.notice("tajemniczych kamieni - będziesz ich potrzebował.")
  173. d.notice("Bez nich nie dostaniesz się na 5. poziom Wieży.")
  174. d.notice("Zdobądź Kamienie od potworów i użyj ich, aby")
  175. d.notice("odblokować Starożytne Pieczęcie. Na wykonanie")
  176. d.notice("tego zadania masz tylko 20 minut - spiesz się!")
  177. d.jump_all(special.devil_tower[4][1], special.devil_tower[4][2])
  178.  
  179. server_timer('devil_stone5_11_faill1', 5*60, get_server_timer_arg())
  180. clear_server_timer('devil_stone4_11_updat', get_server_timer_arg())
  181.  
  182. d.set_regen_file("data/dungeon/deviltower5_regen.txt")
  183.  
  184. d.spawn_mob(20073, 421, 452)
  185. d.spawn_mob(20073, 380, 460)
  186. d.spawn_mob(20073, 428, 414)
  187. d.spawn_mob(20073, 398, 392)
  188. d.spawn_mob(20073, 359, 426)
  189. end
  190. end
  191.  
  192. when devil_stone5_11_faill1.server_timer begin
  193. if d.select(get_server_timer_arg()) then
  194. if d.getf("level") == 5 then
  195. d.notice("Pozostało 15 minut!")
  196. server_timer('devil_stone5_11_faill2', 5*60, get_server_timer_arg())
  197. end
  198. end
  199. end
  200.  
  201. when devil_stone5_11_faill2.server_timer begin
  202. if d.select(get_server_timer_arg()) then
  203. if d.getf("level") == 5 then
  204. d.notice("Pozostało 10 minut!")
  205. server_timer('devil_stone5_11_faill3', 5*60, get_server_timer_arg())
  206. end
  207. end
  208. end
  209.  
  210. when devil_stone5_11_faill3.server_timer begin
  211. if d.select(get_server_timer_arg()) then
  212. if d.getf("level") == 5 then
  213. d.notice("Pozostało 5 minut!")
  214. server_timer('devil_stone5_11_faill', 5*60, get_server_timer_arg())
  215. end
  216. end
  217. end
  218.  
  219. when devil_stone5_11_faill.server_timer begin
  220. if d.select(get_server_timer_arg()) then
  221. if d.getf("level") == 5 then
  222. d.notice("Czas się skończył.")
  223. d.exit_all()
  224. end
  225. end
  226. end
  227.  
  228. when 1062.kill with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 5 begin
  229. local KILL_COUNT_FOR_DROP_KEY = 50
  230. local n =d.getf("count") + 1
  231.  
  232. d.setf("count", n)
  233.  
  234. if n == KILL_COUNT_FOR_DROP_KEY then
  235. game.drop_item(50084, 1)
  236. d.setf("count", 0)
  237. end
  238. end
  239.  
  240. when 20073.take with item.vnum == 50084 and pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 5 begin
  241. npc.purge()
  242. item.remove()
  243. d.setf("stone_counts", d.getf("stone_counts") + 1)
  244. if d.getf("stone_counts") <= 4 then
  245. d.notice("Otworzyłeś pieczęć! Pozostało jeszcze: "..5 - d.getf("stone_counts").."!")
  246. elseif d.getf("stone_counts") > 4 then
  247. d.clear_regen()
  248. d.kill_all()
  249. d.notice("Wszystkie Starożytne Pieczęci zostały otwarte.")
  250. d.notice("Teraz dotrzesz na 5. poziom Wieży Demonów. ")
  251.  
  252. clear_server_timer('devil_stone5_11_faill1', get_server_timer_arg())
  253. clear_server_timer('devil_stone5_11_faill2', get_server_timer_arg())
  254. clear_server_timer('devil_stone5_11_faill3', get_server_timer_arg())
  255. clear_server_timer('devil_stone5_11_faill', get_server_timer_arg())
  256.  
  257. d.setf("level", 6)
  258. d.setf("stone_counts", 0)
  259. d.jump_all(special.devil_tower[5][1], special.devil_tower[5][2])
  260. d.regen_file("data/dungeon/deviltower6_regen.txt")
  261.  
  262. d.notice("Zabij wszystkie potwory na 5. piętrze, jednak ")
  263. d.notice("uważaj Piętro to należy do Króla Demonów! ")
  264. end
  265. end
  266.  
  267. when 1092.kill with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 6 begin
  268. d.setqf("can_refine", 1)
  269. d.kill_all()
  270. d.notice("Zabiłeś wszystkie potwory, jako nagrodę otrzymasz")
  271. d.notice("możliwość ulepszenia jednego z Twoich przedmiotów")
  272. d.notice("u Kowala. Po prostu przeciągnij przedmiot,")
  273. d.notice("który chcesz ulepszyć na Kowala.")
  274. local reward_alchemist = {20074, 20075, 20076}
  275. d.spawn_mob(reward_alchemist[number(1,3)], 425, 216);
  276. end
  277.  
  278. when 20074.chat."Opcja 'Wyższe piętro'" or 20075.chat."Opcja 'Wyższe piętro'" or 20076.chat."Opcja 'Wyższe piętro'" with pc.is_gm() begin
  279. say_title(mob_name(20074))
  280. say("Co chcesz zrobić z opcją 'Wyższe piętro'?")
  281. local s = select("Blokuj", "Odblokuj", "Anuluj")
  282. if s == 3 then
  283. return
  284. elseif s == 1 then
  285. if d.getf("can_warp") == 1 then
  286. say_title(mob_name(20074))
  287. say("Opcja 'Wyższe piętro' jest zablokowana.")
  288. return
  289. end
  290. say_title(mob_name(20074))
  291. say("Opcja 'Wyższe piętro' została zablokowana.")
  292. d.setf("can_warp", 1)
  293. return
  294. elseif s == 2 then
  295. if d.getf("can_warp") == 0 then
  296. say_title(mob_name(20074))
  297. say("Opcja 'Wyższe piętro' jest odblokowana.")
  298. return
  299. end
  300. say_title(mob_name(20074))
  301. say("Opcja 'Wyższe piętro' została odblokowana.")
  302. d.setf("can_warp", 0)
  303. return
  304. end
  305. end
  306.  
  307. when 20074.chat."Wyższe piętro" with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 6 and npc.lock() and d.getf("can_warp") == 0 begin
  308. say_title(mob_name(20074))
  309. say("Co?! Chcesz udać się na 6. poziom Wieży? ")
  310. say("Wyprawa na wyższe poziomy wymaga")
  311. say("naprawdę dobrego przygotowania.")
  312. say("Jeżeli osiągnąłeś 75. poziom mogę ")
  313. say("przenieść Cię na wyższe piętro.")
  314. wait()
  315. if pc.level >=75 then
  316. say_title(mob_name(20074))
  317. say("Masz odpowiedni poziom i dlatego masz spore ")
  318. say("szanse na przetrwanie na wyższych piętrach.")
  319. say("Możesz wejść.")
  320. local s= select("Wchodzę ", "Zostaję ")
  321. if s==2 then
  322. return
  323. end
  324.  
  325. timer("devil_jump_7", 6)
  326. npc.unlock()
  327. d.purge()
  328. return
  329. end
  330. say_title(mob_name(20074))
  331. say("Nie mogę Ciebie wpuścić na wyższe piętro")
  332. say("Twoje doświadczenie nie wystarcza, aby tam")
  333. say("przetrwać. Wróć tutaj po osiągnięciu co najmniej")
  334. say("75 poziomie.")
  335. return
  336. end
  337.  
  338. when 20075.chat."Wyższe piętro" with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 6 and npc.lock() and d.getf("can_warp") == 0 begin
  339. say_title(mob_name(20075))
  340. say("Co?! Chcesz udać się na 6. poziom Wieży? ")
  341. say("Wyprawa na wyższe poziomy wymaga")
  342. say("naprawdę dobrego przygotowania.")
  343. say("Jeżeli osiągnąłeś 75. poziom mogę ")
  344. say("przenieść Cię na wyższe piętro.")
  345. wait()
  346. if pc.level >=75 then
  347. say_title(mob_name(20075))
  348. say("Masz odpowiedni poziom i dlatego masz spore ")
  349. say("szanse na przetrwanie na wyższych piętrach.")
  350. say("Możesz wejść.")
  351. local s= select("Wchodzę ", "Zostaję ")
  352. if s==2 then
  353. return
  354. end
  355.  
  356. timer("devil_jump_7", 6)
  357. npc.unlock()
  358. d.purge()
  359. return
  360. end
  361. say_title(mob_name(20075))
  362. say("Nie mogę Ciebie wpuścić na wyższe piętro")
  363. say("Twoje doświadczenie nie wystarcza, aby tam")
  364. say("przetrwać. Wróć tutaj po osiągnięciu co najmniej")
  365. say("75 poziomie.")
  366. return
  367. end
  368.  
  369. when 20076.chat."Wyższe piętro" with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 6 and npc.lock() and d.getf("can_warp") == 0 begin
  370. say_title(mob_name(20076))
  371. say("Co?! Chcesz udać się na 6. poziom Wieży? ")
  372. say("Wyprawa na wyższe poziomy wymaga")
  373. say("naprawdę dobrego przygotowania.")
  374. say("Jeżeli osiągnąłeś 75. poziom mogę ")
  375. say("przenieść Cię na wyższe piętro.")
  376. wait()
  377. if pc.level >=75 then
  378. say_title(mob_name(20076))
  379. say("Masz odpowiedni poziom i dlatego masz spore ")
  380. say("szanse na przetrwanie na wyższych piętrach.")
  381. say("Możesz wejść.")
  382. local s= select("Wchodzę ", "Zostaję ")
  383. if s==2 then
  384. return
  385. end
  386.  
  387. timer("devil_jump_7", 6)
  388. npc.unlock()
  389. d.purge()
  390. return
  391. end
  392. say_title(mob_name(20076))
  393. say("Nie mogę Ciebie wpuścić na wyższe piętro")
  394. say("Twoje doświadczenie nie wystarcza, aby tam")
  395. say("przetrwać. Wróć tutaj po osiągnięciu co najmniej")
  396. say("75 poziomie.")
  397. return
  398. end
  399.  
  400. when devil_jump_7.timer begin
  401. d.clear_regen()
  402.  
  403. d.spawn_mob(8018, 639, 658)
  404. d.spawn_mob(8018, 611, 637)
  405. d.spawn_mob(8018, 596, 674)
  406. d.spawn_mob(8018, 629, 670)
  407.  
  408. d.setf("level", 7)
  409.  
  410. d.jump_all(2048+590, 6656+638)
  411. end
  412.  
  413. when 8018.kill with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 7 begin
  414. local cont = d.getf("7_stone_kill") + 1
  415. d.setf("7_stone_kill", cont)
  416.  
  417. if cont >= 4 then
  418. d.notice("Bijcie teraz Metiny Morderstwa, aby odszukać prawidłową mapę.")
  419. elseif cont >= 3 then
  420. d.notice("Został wam jeszcze "..4-d.getf("7_stone_kill").." metin.")
  421. else
  422. d.notice("Zostały wam jeszcze "..4-d.getf("7_stone_kill").." metiny.")
  423. end
  424.  
  425. if cont >= 4 then
  426. d.setf("7_stone_kill", 0)
  427. d.set_regen_file("data/dungeon/deviltower7_regen.txt")
  428. end
  429. end
  430.  
  431. when 8019.kill with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 7 begin
  432. game.drop_item(30300, 1)
  433. end
  434.  
  435. when 30300.use with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 7 begin
  436. pc.remove_item("30300", 1)
  437.  
  438. local pct = number(1,3)
  439.  
  440. if pct == 1 then
  441. game.drop_item(30302, 1)
  442. d.clear_regen()
  443. else
  444. -- nothing happens cause the items isnt used in the game
  445. -- game.drop_item(30301, 1)
  446. end
  447. end
  448.  
  449. when 30302.use with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 7 begin
  450. if d.getf( "level" ) != 7 then
  451. pc.remove_item("30302", 1)
  452. chat("Bugowanie Wieży Demonów jest zabronione!")
  453. return
  454. end
  455. say_title("Informacja")
  456. say("Ta mapa przeniesie Cię na 7. poziom Wieży")
  457. say("Demonów.")
  458. pc.remove_item("30302", 1)
  459. timer("devil_jump_8", 6)
  460. d.clear_regen()
  461. end
  462.  
  463. when devil_jump_8.timer begin
  464. d.setf("level", 8)
  465. local plusone = d.getf("check") +1
  466. d.setf("check", plusone)
  467. d.notice("Znajdź odpowieni klucz!")
  468. d.notice("Potrzebujesz klucza Zin-Bong-In aby")
  469. d.notice("móc otworzyć pieczęć Sa-Soein i dostać ")
  470. d.notice("się na następne piętro Wieży.")
  471. d.jump_all(2048+590, 6656+403)
  472. d.set_regen_file("data/dungeon/deviltower8_regen.txt")
  473. d.spawn_mob(20366, 640, 460)
  474. local _count = pc.count_item(30302)
  475. pc.remove_item(30302,_count)
  476.  
  477. if d.getf("check") != 1 then
  478. d.notice("Wykryto bug! Wasza wyprawa się kończy.")
  479. timer("devil_jump_8_bug", 3)
  480. end
  481. end
  482.  
  483. when devil_jump_8_bug.timer begin
  484. d.clear_regen()
  485. d.exit_all()
  486. end
  487.  
  488. when 1040.kill with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 8 begin
  489. local pct1 = number(1, 4)
  490. if pct1 == 1 then
  491. local pct2 = number(1, 4)
  492. if pct2 == 1 then
  493. game.drop_item(30304, 1)
  494. else
  495. game.drop_item(30303, 1)
  496. end
  497. else
  498. return
  499. end
  500. end
  501.  
  502. when 20366.take with item.vnum == 30304 and pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 8 begin
  503. npc.purge()
  504. item.remove()
  505. timer("devil_jump_9", 6)
  506. end
  507.  
  508. when devil_jump_9.timer begin
  509. d.setf("level", 9)
  510. d.notice("Zabij Umarłego Rozpruwacza!")
  511. d.jump_all(2048+590, 6656+155)
  512. d.regen_file("data/dungeon/deviltower9_regen.txt")
  513. end
  514.  
  515. when 1093.kill with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 9 begin
  516. if number(2,5) == 5 then
  517. game.drop_item_with_ownership(30319)
  518. end
  519. d.kill_all()
  520. d.setf("level", 0)
  521. notice_all("Umarły Rozpruwacz został pokonany przez "..pc.get_name().."!")
  522. timer("devil_end_jump", 60)
  523. end
  524.  
  525. when devil_end_jump.timer begin
  526. d.clear_regen()
  527. d.exit_all()
  528. end
  529. end
  530. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement