Slupik98

TOD

Feb 22nd, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.33 KB | None | 0 0
  1. command /osiagniecia [<text>] [<text>]:
  2. trigger:
  3. if {Osiagniecia::gracz::%player%::pkt} is not set:
  4. set {Osiagniecia::gracz::%player%::pkt} to 0
  5. if {Osiagniecia::MaxPkt} is not set:
  6. set {Osiagniecia::MaxPkt} to 0
  7. delete {Osiagniecia::lista::*}
  8. add "Kill", "SKill" and "Chest" to {Osiagniecia::lista::*}
  9. add 10, 20, 30 ,40 and 50 to {Osiagniecia::lista::Kill::*}
  10. add 11, 22, 33 ,44 and 55 to {Osiagniecia::lista::SKill::*}
  11. add 12, 24, 36 ,48 and 60 to {Osiagniecia::lista::Chest::*}
  12. if arg 1 is "add":
  13. if arg 2 is set:
  14. add 10 to {osiagniecia::gracz::%player%::lista::kill::%arg 2%::ilosc}
  15. send "dodane"
  16. if arg 1 is "debuge":
  17. send "OK"
  18. delete {Osiagniecia::*}
  19. if arg 1 is not set:
  20. open chest with 4 rows named "&9---===&f[&4&l Osiagniecia &f]&9===---" to player
  21. wait a tick
  22. set {_item} to red stained glass pane
  23. add 0, 1, 2, 3, 4, 5, 6, 7, 8, 17, 15, 13, 11, 9, 18, 19, 21, 23, 25, 26, 35, 33, 32, 30, 29 and 27 to {_list::*}
  24. loop {_list::*}:
  25. set slot loop-value of player's current inventory to orange stained glass pane named "&a"
  26. while inventory name of player's current inventory contains "&9---===&f[&4&l Osiagniecia &f]&9===---":
  27. set slot 10 of player's current inventory to stone sword named "&e&l[&5&l Kill &e&l]"
  28. set slot 12 of player's current inventory to diamond sword named "&e&l[&5&l SKill &e&l]"
  29. set slot 14 of player's current inventory to chest named "&e&l[&5&l Chest &e&l]"
  30. set slot 31 of player's current inventory to Fire charge named "&e&l[&5&l Punkty %{Osiagniecia::gracz::%player%::pkt}%/%{Osiagniecia::MaxPkt}% &e&l]"
  31. add 1 to {_start}
  32. set slot {_list::%{_start}%} of player's current inventory to {_item} named "&a"
  33. if {_start} = size of {_list::*}:
  34. set {_start} to 0
  35. add 1 to {_loop}
  36. set {_old} to {_item}
  37. if {_loop} = 1:
  38. set {_item} to orange stained glass pane
  39. if {_loop} = 2:
  40. set {_item} to yellow stained glass pane
  41. if {_loop} = 3:
  42. set {_item} to light green stained glass pane
  43. if {_loop} = 4:
  44. set {_item} to green stained glass pane
  45. if {_loop} = 5:
  46. set {_item} to blue stained glass pane
  47. if {_loop} = 6:
  48. set {_item} to purple stained glass pane
  49. if {_loop} = 7:
  50. set {_item} to magenta stained glass pane
  51. if {_loop} = 8:
  52. set {_item} to cyan stained glass pane
  53. if {_loop} = 9:
  54. set {_item} to light blue stained glass pane
  55. if {_loop} = 10:
  56. set {_item} to white stained glass pane
  57. if {_loop} = 11:
  58. set {_item} to gray stained glass pane
  59. if {_loop} = 12:
  60. set {_item} to black stained glass pane
  61. else if {_loop} > 12:
  62. set {_loop} to 0
  63. wait 3 ticks
  64. if arg 2 is set:
  65. set {_strona} to arg 2
  66. set {_strona} to {_strona} parsed as integer
  67. set {_stronaSign} to {_strona}+1
  68. loop {Osiagniecia::lista::*}:
  69. set {_NameOsiagniecia} to loop-value
  70. if arg 1 is "%{_NameOsiagniecia}%":
  71. open chest with 4 rows named "&9---===&f[&4&l Osiagniecia - %{_NameOsiagniecia}% (%{_strona}%) &f]&9===---" to player
  72. wait a tick
  73.  
  74. set slot 34 of player's current inventory to Sign named "&e&l[&5&l Strona %{_stronaSign}% &e&l]"
  75. set slot 35 of player's current inventory to barrier named "&e&l[&5&l Wroc &e&l]"
  76.  
  77. set {_itemsPerPage} to 34
  78. set {_index} to ({_page}-1)*{_itemsPerPage}+1
  79. set {_maxIndex} to {_strona}*{_itemsPerPage}+1
  80. while {_doWhile}:
  81. if {_index} is smaller than {_maxIndex}:
  82. if loop-value-1 is "Kill":
  83. set {_lore} to "Zabij"
  84. if loop-value-1 is "SKill":
  85. set {_lore} to "Zabij nie zginac"
  86. if loop-value-1 is "Chest":
  87. set {_lore} to "Otworz"
  88.  
  89. if {Osiagniecia::lista::%{_NameOsiagniecia}%::%{_index}%} is set:
  90. if {osiagniecia::gracz::%player%::lista::%{_NameOsiagniecia}%::%{_index}%::status} is not set:
  91. set slot {_index}-1 of player's current inventory to white stained glass pane named "&9&l%{_NameOsiagniecia}% &e&l- &e&l[&5&l %{_index}% &e&l]" with lore "&e&l[&5&l %{_lore}% %{Osiagniecia::lista::%{_NameOsiagniecia}%::%{_index}%}% &e&l]"
  92. if "%{osiagniecia::gracz::%player%::lista::%{_NameOsiagniecia}%::%{_index}%::status}%" is "Start":
  93. set slot {_index}-1 of player's current inventory to green stained glass pane named "&9&l%{_NameOsiagniecia}% &e&l- &e&l[&5&l %{_index}% &e&l]" with lore "&e&l[&5&l %{_lore}% %{osiagniecia::gracz::%player%::lista::%{_NameOsiagniecia}%::%{_index}%::ilosc}%/%{Osiagniecia::lista::%{_NameOsiagniecia}%::%{_index}%}% - &aW trakcje &e&l]"
  94. if "%{osiagniecia::gracz::%player%::lista::%{_NameOsiagniecia}%::%{_index}%::status}%" is "zakonczone":
  95. set slot {_index}-1 of player's current inventory to red stained glass pane named "&e&l[&5&l %{_lore}% %{Osiagniecia::lista::%{_NameOsiagniecia}%::%{_index}%}% - &aZakonczone &e&l]"
  96. else:
  97. exit loop
  98. else:
  99. exit loop
  100.  
  101. On mor.Inventory Click:
  102. if inventory name of player's current inventory is set:
  103. if inventory name of player's current inventory is not "container.crafting":
  104. cancel event
  105. if event-item's name is "&e&l[&5&l Wroc &e&l]":
  106. make player execute command "/osiagniecia"
  107. if inventory name of player's current inventory is "&9---===&f[&4&l Osiagniecia &f]&9===---":
  108. loop {Osiagniecia::lista::*}:
  109. set {_NameOsiagniecia} to loop-value
  110. set {_stronaSign} to event-item's name
  111. replace all "&e&l[&5&l Strona " with "" in {_stronaSign}
  112. replace all " &e&l]" with "" in {_stronaSign}
  113. set {_stronaSign} to {_stronaSign} parsed as integer
  114. if event-item's name is "&e&l[&5&l %{_NameOsiagniecia}% &e&l]":
  115. make player execute command "/osiagniecia %{_NameOsiagniecia}% 1"
  116. stop
  117. loop {Osiagniecia::lista::*}:
  118. set {_NameOsiagniecia} to loop-value
  119. set {_strona} to inventory name of player's current inventory
  120. replace all "&9---===&f[&4&l Osiagniecia - %{_NameOsiagniecia}% (" with "" in {_strona}
  121. replace all ") &f]&9===---" with "" in {_strona}
  122. if inventory name of player's current inventory is "&9---===&f[&4&l Osiagniecia - %{_NameOsiagniecia}% (%{_strona}%) &f]&9===---":
  123. if event-item is sign:
  124. set {_stronaSign} to event-item's name
  125. replace all "&e&l[&5&l Strona " with "" in {_stronaSign}
  126. replace all " &e&l]" with "" in {_stronaSign}
  127. set {_stronaSign} to {_stronaSign} parsed as integer
  128. if event-item's name is "&e&l[&5&l Strona %{_stronaSign}% &e&l]":
  129. make player execute command "/osiagniecia %{_NameOsiagniecia}% %{_stronaSign}%"
  130. stop
  131. set {_name} to event-item's name
  132. replace all "&9&lKill &e&l- &e&l[&5&l " with "" in {_name}
  133. replace all " &e&l]" with "" in {_name}
  134. set {_name} to {_name} parsed as integer
  135. if {_name} is set:
  136. if {osiagniecia::gracz::%player%::lista::%{_NameOsiagniecia}%::wykonane} is not set:
  137. if {_name} is 1:
  138. set {osiagniecia::gracz::%player%::lista::%{_NameOsiagniecia}%::wykonane} to 1
  139. else:
  140. send "Musisz wykonac pierwsze osiagniecie ( &9&l%{_NameOsiagniecia}% &e&l- &e&l[&5&l 1 &e&l] )"
  141. stop
  142. if {osiagniecia::gracz::%player%::lista::%{_NameOsiagniecia}%::wykonane} is set:
  143. if {osiagniecia::gracz::%player%::lista::%{_NameOsiagniecia}%::wykonane} is {_name}:
  144. if {osiagniecia::gracz::%player%::lista::%{_NameOsiagniecia}%::%{_name}%::status} is not set:
  145. set {osiagniecia::gracz::%player%::lista::%{_NameOsiagniecia}%::%{_name}%::status} to "Start"
  146. set {osiagniecia::gracz::%player%::lista::%{_NameOsiagniecia}%::%{_name}%::ilosc} to 0
  147. make player execute command "/osiagniecia %{_NameOsiagniecia}%"
  148. stop
  149. if {osiagniecia::gracz::%player%::lista::%{_NameOsiagniecia}%::%{_name}%::status} is "Start":
  150. if {osiagniecia::gracz::%player%::lista::%{_NameOsiagniecia}%::%{_name}%::ilosc} is greater than or equal to {Osiagniecia::lista::%{_NameOsiagniecia}%::%{_name}%}:
  151. set {osiagniecia::gracz::%player%::lista::%{_NameOsiagniecia}%::%{_name}%::status} to "zakonczone"
  152. delete {osiagniecia::gracz::%player%::lista::%{_NameOsiagniecia}%::%{_name}%::ilosc}
  153. add 1 to {osiagniecia::gracz::%player%::lista::%{_NameOsiagniecia}%::wykonane}
  154. make player execute command "/osiagniecia %{_NameOsiagniecia}%"
  155. else:
  156. send "Musisz wykonac poprzednie osiagniecie"
Advertisement
Add Comment
Please, Sign In to add comment