Advertisement
Guest User

Untitled

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