Advertisement
Guest User

Untitled

a guest
Sep 1st, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.99 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_x() < 2048+88 or pc.get_y() < 6656+577 or pc.get_x() > 2048+236 or pc.get_y() > 6656+737 then
  6. pc.warp((5376+532)*100, (512+596+4)*100, 65)
  7. end
  8. pc.set_warp_location(65, 5376+532, 512+596+4)
  9. elseif pc.get_map_index() >= 660000 and pc.get_map_index() <= 670000 then
  10. pc.set_warp_location(65, 5376+532, 512+596+4)
  11. end
  12. end
  13. when 20348.chat."Wieża Demonów" begin
  14. if pc.get_level() < 40 then
  15. say_title_pomaranczowy("Strażnik Wieży Demonów:")
  16. say_zloty("Nie masz odpowiedniego poziomu.")
  17. say_zloty("Aby wejść potrzebujesz przynajmniej 40.")
  18. else
  19. say_title_pomaranczowy("Strażnik Wieży Demonów:")
  20. say_zloty("Wieża demonów jest pełna dzikich")
  21. say_zloty("potworów zesłannych z piekieł.")
  22. say_zloty("Musisz być bardzo odważny!")
  23. say_zloty("")
  24. say_reward("Czy chcesz wejść do Wieży Demonów?")
  25. local s = select("Tak", "Nie")
  26. if s == 1 then
  27. -- warp into!
  28. pc.warp(216500,727000)
  29. end
  30. end
  31. end
  32. when devil_stone1.kill begin
  33. timer("devil_stone1_1", 5)
  34. end
  35. when devil_stone1_1.timer begin
  36. local mapto7= pc.count_item(30302) -- ®ř·Ŕ¤ŁŞľ¬O§_¦s¦bŞşŻu¤`ĆF¶đ
  37. pc.remove_item(30302,mapto7)
  38.  
  39. local boxto7= pc.count_item(30300) -- ®ř·Ŕ¤ŁŞľ¬O§_¦s¦bŞş¤ŁŞľ¦WŞş˝c¤l
  40. pc.remove_item(30300,boxto7)
  41. d.new_jump_all(66, special.devil_tower[1][1], special.devil_tower[1][2])
  42. d.regen_file("data/dungeon/deviltower2_regen.txt")
  43. d.set_warp_at_eliminate(4, d.get_map_index(), special.devil_tower[2][1], special.devil_tower[2][2], "data/dungeon/deviltower3_regen.txt")
  44. end
  45. --when devil_stone2.kill begin
  46. --d.jump_all_local(special.devil_tower[2][1], special.devil_tower[2][2])
  47. --end
  48. when devil_stone3.kill begin
  49. --d.jump_all_local(special.devil_tower[3][1], special.devil_tower[3][2])
  50. --d.set_exit_all_at_eliminate(6)
  51. --d.set_warp_at_eliminate(6, d.get_map_index(), 100, 100)
  52. --d.set_warp_at_eliminate(4, 65, 5376+532, 512+596+4)
  53. 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")
  54. d.check_eliminated()
  55. --d.exit_all()
  56. end
  57. function get_4floor_stone_pos()
  58. local positions = {
  59. {368, 629},
  60. {419, 630},
  61. {428, 653},
  62. {422, 679},
  63. {395, 689},
  64. {369, 679},
  65. {361, 658},
  66. }
  67. for i = 1, 6 do
  68. local j = number(i, 7)
  69. if i != j then
  70. local t = positions[i];
  71. positions[i] = positions[j];
  72. positions[j] = t;
  73. end
  74. end
  75. --for i = 1, 7 do
  76. -- positions[i][1] = positions[i][1] * 100
  77. -- positions[i][2] = positions[i][2] * 100
  78. -- end
  79. return positions
  80. end
  81. when 8016.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  82. d.setf("level", 4)
  83. -- ¦A˛{¤j¶q©ÇŞ«¤Î»słyŻuĄŰŔY©M°˛ĄŰŔY
  84. --d.regen_file("data/dungeon/deviltower4_regen.txt")
  85. local positions = deviltower_zone.get_4floor_stone_pos()
  86. for i = 1, 6 do
  87. chat(positions[i][1], positions[i][2])
  88. d.set_unique("fake" .. i , d.spawn_mob(8017, positions[i][1], positions[i][2]))
  89. end
  90. chat(positions[7][1], positions[7][2])
  91. local vid = d.spawn_mob(8017, positions[7][1], positions[7][2])
  92. chat(vid)
  93. d.set_unique("real", vid)
  94. server_loop_timer('devil_stone4_update', 10, pc.get_map_index())
  95. server_timer('devil_stone4_fail1', 5*60, pc.get_map_index())
  96.  
  97. d.notice("Zniszcz Prawdziwego Metina!");
  98. d.notice("");
  99. d.notice("Macie 15 minut, aby to dokonać ");
  100. d.notice("W innym przypadku, wszyscy zostaną wylogowani.");
  101. end
  102.  
  103. when devil_stone4_fail1.server_timer begin
  104. if d.select(get_server_timer_arg()) then
  105. d.notice("Pozostało 10 minut!")
  106. server_timer('devil_stone4_fail2', 5*60, get_server_timer_arg())
  107. end
  108. end
  109.  
  110. when devil_stone4_fail2.server_timer begin
  111. if d.select(get_server_timer_arg()) then
  112. d.notice("Pozostało 5 minut!")
  113. server_timer('devil_stone4_fail', 5*60, get_server_timer_arg())
  114. end
  115. end
  116.  
  117. when devil_stone4_fail.server_timer begin
  118. if d.select(get_server_timer_arg()) then
  119. d.notice("Czas się skończył.")
  120. d.exit_all()
  121. clear_server_timer('devil_stone4_update', get_server_timer_arg())
  122. end
  123. end
  124.  
  125. when devil_stone4_update.server_timer begin
  126. if d.select(get_server_timer_arg()) then
  127. if not d.is_unique_dead("real") then
  128. for i = 1, 6 do
  129. if d.getf("fakedead" .. i) == 0 then
  130. if d.unique_get_hp_perc("fake" .. i) < 50 then
  131. d.purge_unique("fake" .. i)
  132. d.setf("fakedead" .. i, 1)
  133. d.notice("Ten Kamień był fałszywy....");
  134. end
  135. end
  136. end
  137. else
  138. --d.clear_regen()
  139. --d.regen_file("data/dungeon/deviltower5_regen.txt")
  140. server_timer("devil_stone4_end", 5, get_server_timer_arg())
  141. d.notice("Udało wam się zniszczyć prawdziwego metina!");
  142. d.notice("Zostaniecie teleportowani na 5 piętro.")
  143. clear_server_timer('devil_stone4_fail1', get_server_timer_arg())
  144. clear_server_timer('devil_stone4_fail2', get_server_timer_arg())
  145. clear_server_timer('devil_stone4_fail', get_server_timer_arg())
  146. end
  147. else
  148. server_timer('devil_stone4_stop_timer', 1, get_server_timer_arg())
  149. end
  150. end
  151.  
  152. when devil_stone4_stop_timer.server_timer begin
  153. clear_server_timer('devil_stone4_update', get_server_timer_arg())
  154. end
  155. ---------------------------------------------
  156. -- Pietro 5
  157. ---------------------------------------------
  158. when devil_stone4_end.server_timer begin
  159. if d.select(get_server_timer_arg()) then
  160. d.setf("level", 5)
  161. d.setf("stone_count", 5)
  162. d.notice("Jesteś na 5 piętrze!")
  163. d.notice("Waszym zadaniem jest otworzyć wszystkie Starożytne Pieczęci")
  164. d.notice("Kamieniami Otwarcia, które lecą z demonów!")
  165. d.notice("Macie na to 15 minut!")
  166. d.notice("Powodzenia!")
  167.  
  168. d.jump_all(special.devil_tower[4][1], special.devil_tower[4][2])
  169. server_timer('devil_stone5_fail1', 5*60, get_server_timer_arg())
  170. clear_server_timer('devil_stone4_update', get_server_timer_arg())
  171.  
  172. -- 5ĽÓÄ~Äň¦A˛{
  173. d.set_regen_file("data/dungeon/deviltower5_regen.txt")
  174.  
  175. -- 5ĽÓ«Ę¦LĄŰ¦A˛{
  176. d.spawn_mob(20073, 421, 452)
  177. d.spawn_mob(20073, 380, 460)
  178. d.spawn_mob(20073, 428, 414)
  179. d.spawn_mob(20073, 398, 392)
  180. d.spawn_mob(20073, 359, 426)
  181. end
  182. end
  183.  
  184. when devil_stone5_fail1.server_timer begin
  185. if d.select(get_server_timer_arg()) then
  186. d.notice("Pozostało 15 minut!")
  187. server_timer('devil_stone5_fail2', 5*60, get_server_timer_arg())
  188. end
  189. end
  190.  
  191. when devil_stone5_fail2.server_timer begin
  192. if d.select(get_server_timer_arg()) then
  193. d.notice("Pozostało 10 minut!")
  194. server_timer('devil_stone5_fail3', 5*60, get_server_timer_arg())
  195. end
  196. end
  197.  
  198. when devil_stone5_fail3.server_timer begin
  199. if d.select(get_server_timer_arg()) then
  200. d.notice("Pozostało 5 minut!")
  201. server_timer('devil_stone5_fail', 5*60, get_server_timer_arg())
  202. end
  203. end
  204.  
  205. when devil_stone5_fail.server_timer begin
  206. if d.select(get_server_timer_arg()) then
  207. d.notice("Czas się skończył!")
  208. d.exit_all()
  209. end
  210. end
  211.  
  212. --when devil_stone4.kill begin
  213. --d.setf("level", 5)
  214. --d.setf("stone_count", 4)
  215. --d.clear_regen()
  216. --d.regen_file("data/dungeon/deviltower5_regen.txt")
  217. --d.jump_all_local(special.devil_tower[4][1], special.devil_tower[4][2])
  218. --end
  219.  
  220. when 1062.kill with pc.in_dungeon() and d.getf("level") == 5 begin
  221. local KILL_COUNT_FOR_DROP_KEY = 50
  222. --if is_test_server() then
  223. --KILL_COUNT_FOR_DROP_KEY = 1
  224. --end
  225. local n =d.getf("count") + 1
  226. d.setf("count", n)
  227. if n == KILL_COUNT_FOR_DROP_KEY then
  228. -- ±Ľ¤UÂę°Í
  229. game.drop_item(50084, 1)
  230. d.setf("count", 0)
  231. end
  232. end
  233. when devil_stone5.take with item.vnum == 50084 begin
  234. npc.purge()
  235. item.remove()
  236. d.setf("stone_count", d.getf("stone_count") - 1)
  237. if d.getf("stone_count") <= 0 then
  238. d.setf("level", 6)
  239. d.clear_regen()
  240. d.regen_file("data/dungeon/deviltower6_regen.txt")
  241.  
  242. d.notice("Otworzono ostatnią pieczęć!")
  243. d.notice("Wszyscy zostaną teleportowani na 6 piętro!")
  244. d.jump_all(special.devil_tower[5][1], special.devil_tower[5][2])
  245. clear_server_timer('devil_stone5_fail1', get_server_timer_arg())
  246. clear_server_timer('devil_stone5_fail2', get_server_timer_arg())
  247. clear_server_timer('devil_stone5_fail3', get_server_timer_arg())
  248. clear_server_timer('devil_stone5_fail', get_server_timer_arg())
  249. else
  250. d.notice("Pozostało jeszcze "..d.getf("stone_count").." pieczęci do otwarcia!")
  251. end
  252. end
  253.  
  254. ---------------------------------------------
  255. -- Pietro 6
  256. ---------------------------------------------
  257. when devil_stone6.kill begin
  258.  
  259. -- Geschickt, um eine Karte, wo die Verfeinerung St.
  260. -- Ansonsten ˇĽfnen Sie ein neues Lian Sheng
  261. -- d.jump_all(special.devil_tower[6][1], special.devil_tower[6][2])
  262.  
  263. d.kill_all()
  264.  
  265. --d.set_warp_at_eliminate(3*60, 65, 5376+532, 512+596+4)
  266.  
  267. d.notice("Elitarny Król Demonów został zabity!")
  268. d.notice("Jeden z trzech kowalów zaraz się pojawi!")
  269.  
  270. timer("schmied_spawn",10)
  271.  
  272. --d.check_eliminated()
  273. --local reward_alchemist = {20074, 20075, 20076}
  274. --d.spawn_mob(reward_alchemist[number(1,3)], 425, 216);
  275. --d.setqf("can_refine", 1)
  276. end
  277.  
  278. when schmied_spawn.timer begin
  279. d.check_eliminated()
  280. local reward_alchemist = {20074, 20075, 20076}
  281. d.spawn_mob(reward_alchemist[number(1,3)], 425, 216);
  282. d.setqf("can_refine", 1)
  283. end
  284.  
  285. when 20074.chat."Chcę iść dalej!" with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000begin
  286. npc.lock()
  287. say_title_pomaranczowy("Brońmistrz Wieży Demonów:")
  288. say_zloty("Dobrze, więc chcesz iść dalej..")
  289. say("Musisz posiadać równy lub wyższy poziom")
  290. say("niż 75.")
  291. say("Więc zobaczmy czy masz taki...")
  292. wait()
  293. if pc.level >=75 then
  294. say_title_pomaranczowy("Brońmistrz Wieży Demonów:")
  295. say_zloty("Okey masz, mogę Cię przenieść.")
  296. say("")
  297. say("")
  298. say_reward("Zostaniecie teleportowani!")
  299. npc.purge()
  300. timer("devil_jump_7", 6)
  301. return
  302. end
  303. say_title_pomaranczowy("Brońmistrz Wieży Demonów:")
  304. say_zloty("Nie posiadasz 75 poziomu!")
  305. say("Teleportacja nie jest możliwa!")
  306. say("Może ktoś inny na tym piętrze")
  307. say("ma 75 poziom?")
  308. say("")
  309. wait()
  310. pc.warp(590500, 110500)
  311. return
  312. end
  313. when 20075.chat."Chcę iść dalej!" with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  314. npc.lock()
  315. say_title_pomaranczowy("Płatneż Wieży Demonów:")
  316. say_zloty("Dobrze, więc chcesz iść dalej..")
  317. say("Musisz posiadać równy lub wyższy poziom")
  318. say("niż 75.")
  319. say("Więc zobaczmy czy masz taki...")
  320. wait()
  321. if pc.level >=75 then
  322. say_title_pomaranczowy("Płatneż Wieży Demonów:")
  323. say_zloty("Okey masz, mogę Cię przenieść.")
  324. say("")
  325. say("")
  326. say_reward("Zostaniecie teleportowani!")
  327. npc.purge()
  328. timer("devil_jump_7", 6)
  329. return
  330. end
  331. say_title_pomaranczowy("Płatneż Wieży Demonów:")
  332. say_zloty("Nie posiadasz 75 poziomu!")
  333. say("Teleportacja nie jest możliwa!")
  334. say("Może ktoś inny na tym piętrze")
  335. say("ma 75 poziom?")
  336. say("")
  337. wait()
  338. pc.warp(590500, 110500)
  339. return
  340. end
  341. when 20076.chat."Chcę iść dalej!" with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  342. npc.lock()
  343. say_title_pomaranczowy("Jubiler Wieży Demonów:")
  344. say_zloty("Dobrze, więc chcesz iść dalej..")
  345. say("Musisz posiadać równy lub wyższy poziom")
  346. say("niż 75.")
  347. say("Więc zobaczmy czy masz taki...")
  348. wait()
  349. if pc.level >=75 then
  350. say_title_pomaranczowy("Jubiler Wieży Demonów:")
  351. say_zloty("Okey masz, mogę Cię przenieść.")
  352. say("")
  353. say("")
  354. say_reward("Zostaniecie teleportowani!")
  355. npc.purge()
  356. timer("devil_jump_7", 6)
  357. return
  358. end
  359. say_title_pomaranczowy("Jubiler Wieży Demonów:")
  360. say_zloty("Nie posiadasz 75 poziomu!")
  361. say("Teleportacja nie jest możliwa!")
  362. say("Może ktoś inny na tym piętrze")
  363. say("ma 75 poziom?")
  364. say("")
  365. wait()
  366. pc.warp(590500, 110500)
  367. return
  368. end
  369.  
  370. ---------------------------------------------
  371. -- Pietro 7
  372. ---------------------------------------------
  373. when devil_jump_7.timer begin
  374. d.clear_regen()
  375.  
  376. d.spawn_mob(8018, 639, 658)
  377. d.spawn_mob(8018, 611, 637)
  378. d.spawn_mob(8018, 596, 674)
  379. d.spawn_mob(8018, 629, 670)
  380.  
  381. d.setf("level", 7)
  382.  
  383. d.jump_all(2048+590, 6656+638)
  384. end
  385.  
  386. when 8018.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  387. local cont = d.getf("7_stone_kill") + 1
  388. d.setf("7_stone_kill", cont)
  389.  
  390. if cont >= 4 then
  391. d.setf("7_stone_kill", 0)
  392. d.set_regen_file("data/dungeon/deviltower7_regen.txt")
  393. end
  394. end
  395.  
  396. when 8019.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  397. game.drop_item(30300, 1)
  398. end
  399.  
  400. when 30300.use with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  401. pc.remove_item("30300", 1)
  402.  
  403. local pct = number(1,10)
  404.  
  405. if pct == 1 then
  406. -- ±Ľ¤UŻu¦aąĎ
  407. game.drop_item(30302, 1)
  408. d.clear_regen()
  409. else
  410. -- ±Ľ¤U°˛¦aąĎ
  411. game.drop_item(30301, 1)
  412.  
  413. end
  414. end
  415.  
  416.  
  417. --------------------------------------------
  418. -- Pietro 8
  419. --------------------------------------------
  420. when devil_jump_8.timer begin
  421. d.setf("level", 8)
  422. d.jump_all(2048+590, 6656+403)
  423. d.set_regen_file("data/dungeon/deviltower8_regen.txt")
  424. d.spawn_mob(20366, 640, 460)
  425.  
  426. local _count= pc.count_item(30302)-- ®ř·ŔŻu¤`ĆF¶đ
  427. pc.remove_item(30302,_count)
  428.  
  429. end
  430.  
  431. when 1040.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  432. local pct1 = number(1, 5)
  433. if pct1 == 1 then
  434. local pct2 = number(1, 10)
  435. if pct2 == 1 then
  436. -- ±Ľ¤UŻuÂę°Í
  437. game.drop_item(30304, 1)
  438. else
  439. -- ±Ľ¤U°˛Âę°Í
  440. game.drop_item(30303, 1)
  441. end
  442. else
  443. return
  444. end
  445. end
  446.  
  447. when 20366.take with item.vnum == 30304 begin
  448. -- 9ĽÓ«Ę¦L¸Ń°Ł
  449. npc.purge()
  450. item.remove()
  451. d.kill_all()
  452. timer("devil_jump_9", 6)
  453. end
  454.  
  455. ---------------------------------------------
  456. -- Pietro 8
  457. ---------------------------------------------
  458. when devil_jump_9.timer begin
  459. d.setf("level", 9)
  460. d.jump_all(2048+590, 6656+155)
  461. d.clear_regen()
  462. d.regen_file("data/dungeon/deviltower9_regen.txt")
  463. end
  464.  
  465. when 1093.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
  466. d.notice("Zabiłeś Przywódce Demonów!")
  467. d.notice("Gratulacje! Teraz możesz się wylogować!")
  468. d.kill_all()
  469. end
  470.  
  471. end
  472. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement