User987

CastTNT - Innowacyjny skrypt na rzucane tnt

Oct 7th, 2014
1,305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.15 KB | None | 0 0
  1. #CastTNT 1.1v#
  2. options:
  3. #==================#
  4. #
  5. #
  6. # Konfiguracja ogolna
  7. #
  8. #
  9. #==================#
  10. #Czy w konsoli maja pojawiac sie logi o prawidlowym wlaczeniu i wlaczeniu skryptu? [tak/nie]
  11. log: tak
  12.  
  13. #Co ile sekund ma sprawdzac wersje skryptu?
  14. autoczas: 500
  15.  
  16. #Czy crafting rzucanego tnt ma byc wlaczony? [tak/nie] Chwilowo nie ma mozliwosci edycji craftingu w opcjach.
  17. crafting: tak
  18.  
  19. #Nazwa rzucanego tnt.
  20. tntnazwa: &cRzucane tnt
  21.  
  22. #Opis rzucanego tnt.
  23. tntopis: &7Kliknij aby wystrzelic
  24.  
  25. #Moc tnt po wyrzuceniu.
  26. moc: 2.0
  27.  
  28. #==================#
  29. #
  30. #
  31. # Konfiguracja dropu z mobow
  32. #
  33. #
  34. #==================#
  35.  
  36. #Czy z mobow w losowej ilosci (1-32) ma wypadac rzucane tnt (tak/nie)
  37. mobgive: tak
  38.  
  39. #Z jakich mobow ma wypadac rzucane tnt w losowej ilosci (1-32)
  40. moby: skeleton or wither or zombie or spider or witch or creeper or enderman or blaze or ghast
  41.  
  42. #Szansa na losowa ilosc (1-32) rzucanego tnt z powyzszych mobow.
  43. szansa: 1.0
  44.  
  45. #Po wylosowaniu dostajemy skrzynie. Gdy klikniemy PPM wylosujemy rzucane tnt
  46. #Nazwa skrzynki dropiacej z mobow
  47. chestnazwa: &6Magiczna skrzynka
  48.  
  49. #Opis skrzynki dropiacej z mobow
  50. chestopis: &7Kliknij aby wylosowac rzucane tnt
  51. #==================#
  52. #
  53. #
  54. # Konfiguracja komendy
  55. #
  56. #
  57. #==================#
  58.  
  59. #Czy komenda wreczajaca rzucanetnt ma byc wlaczona? [tak/nie]
  60. komenda: nie
  61.  
  62. #Itemy wymagane do uzycia komendy, aby zostawic puste pole wpisz "none"
  63. item1: 8 tnt
  64. item2: 1 ender pearl
  65. item3: none
  66. item4: none
  67. #==================#
  68. #
  69. #
  70. # Konfiguracja wiadomosci
  71. #
  72. #
  73. #==================#
  74.  
  75. #Czas na jaki ma pojawiac sie pasek smoka z wiadomoscia w sekundach.
  76. bossbar_time_message: 10
  77.  
  78. #Wiadomosc po otrzymaniu rzucanego tnt przez komende /casttnt
  79. message_casttnt_command: &7&lOtrzymales rzucane tnt! Itemy zostaly pobrane.
  80.  
  81. #Wiadomosc wyswietlajaca sie gdy komenda /Casttnt zostala zablokowana w opcjach.
  82. message_casttnt_disablecommand: &cTa komenda zostala wylaczona przez administratora.
  83.  
  84. #Wiadomosc o braku uprawnien do komendy /casttnt.
  85. message_casttnt_nopermissions: &cNie posiadasz uprawnien do tej komendy
  86.  
  87. #Wiadomosci o braku wymaganych itemow do uzycia komendy /casttnt
  88. message_casttnt_item1: &cNie posiadasz TU WPISZ PIERWSZY ITEM WYMAGANY DO UZYCIA KOMENDY
  89.  
  90. message_casttnt_item2: &cNie posiadasz TU WPISZ DRUGI ITEM WYMAGANY DO UZYCIA KOMENDY
  91.  
  92. message_casttnt_item3: &cNie posiadasz TU WPISZ TRZECI ITEM WYMAGANY DO UZYCIA KOMENDY
  93.  
  94. message_casttnt_item4: &cNie posiadasz TU WPISZ CZWARTY ITEM WYMAGANY DO UZYCIA KOMENDY
  95.  
  96. #Wiadomosc o wystrzeleniu tnt
  97. message_power: Tnt zostanie wystrzelone za kilka sekund.
  98.  
  99. #Wiadomosc po wystrzeleniu tnt
  100. message_start: &cWystrzelono!
  101.  
  102. #Wiadomosc przy probie polozenia rzucanego tnt.
  103. message_noplace: &cNie mozesz polozyc tego rodzaju tnt!
  104.  
  105. #Wiadomosc przy probie polozenia skrzynki losujacej rzucane tnt.
  106. message_noplacechest: &cNie mozesz polozyc tego rodzaju skrzyni!
  107.  
  108. #Wiadomosc o braku uprawnien administratora
  109. uprawnienia: &c Nie masz uprawnien do panelu admina
  110.  
  111. #Wiadomosc o wylosowaniu rzucanego tnt z moba
  112. message_mob: Wylosowales skrzynke z losowa iloscia rzucanego tnt
  113.  
  114.  
  115.  
  116. #==================#
  117. #
  118. #
  119. # Koniec konfiguracji
  120. # Kod skryptu
  121. #
  122. #==================#
  123. on script load:
  124. if "{@log}" is "tak":
  125. send "" to the console
  126. send "[CastTNT] Skrypt zostal zaladowany." to the console
  127. send "[CastTNT] Author: Anastair | Version: 1.0" to the console
  128. send "" to the console
  129.  
  130. on script unload:
  131. if "{@log}" is "tak":
  132. send "" to the console
  133. send "[CastTNT] Skrypt zostal wylaczony." to the console
  134. send "[CastTNT] Sciezka: plugins/Skript/scripts/%script%.sk" to the console
  135. send "" to the console
  136.  
  137. #Crafting rzucanego tnt
  138. on load:
  139. if "{@crafting}" is "tak":
  140. new Recipe "Tnt"
  141. "Tnt".Recipe.registerIngredient{1, 1 tnt};
  142. "Tnt".Recipe.registerIngredient{2, 1 tnt};
  143. "Tnt".Recipe.registerIngredient{3, 1 tnt};
  144. "Tnt".Recipe.registerIngredient{4, 1 tnt};
  145. "Tnt".Recipe.registerIngredient{5, 1 ender pearl};
  146. "Tnt".Recipe.registerIngredient{6, 1 tnt};
  147. "Tnt".Recipe.registerIngredient{7, 1 tnt};
  148. "Tnt".Recipe.registerIngredient{8, 1 tnt};
  149. "Tnt".Recipe.registerIngredient{9, 1 tnt};
  150. "Tnt".Recipe.registerResult{tnt of unbreaking 10 with name "{@tntnazwa}" with lore "{@tntopis}"};
  151. "Tnt".Recipe.register{};
  152.  
  153. command /casttntadmin [<text>] [<text>]:
  154. trigger:
  155. if player has permissions "rzucanetnt.admin" or "rzucanetnt.*":
  156. if arg 1 is not set:
  157. send "&c&l0=0=0=0=0=0 &7Cast-Admim &c&l0=0=0=0=0=0=0"
  158. send "&e/casttntadmin daj <nick> &6- &7Wrecza graczowi rzucane tnt."
  159. send "&e/casttntadmin odswiez &6- &7Odswieza skrypt."
  160. send "&e/casttntadmin usun &6- &7Usuwa skrypt z ftp."
  161. send "&e/casttntadmin reinstalacja &6- &7Usuwa i pobiera skrypt od nowa."
  162. send "&e/aktulizacja sprawdz &6- &7Sprawdza aktulizacje."
  163. send "&e/aktulizacja pobierz &6- &7pobiera aktulizacje."
  164. if arg 1 is "daj":
  165. if arg 2 is set:
  166. give 32 tnt named "{@tntnazwa}" with lore "{@tntopis}" to arg 2 parsed as player
  167. send "&c%arg 2% otrzymal 32 rzucanego tnt."
  168. if arg 1 is "reinstalacja":
  169. if arg 2 is not set:
  170. send "&aTrwa przygotowanie do reinstalacji."
  171. wait 1 second
  172. df "plugins/Skript/scripts/%script%.sk"
  173. send "&7Plik %script%.sk zostal usuniety"
  174. wait 2 seconds
  175. send "&7Trwa wyszukiwanie najnowszej wersji skryptu."
  176. wait 2 seconds
  177. download "http://pastebin.com/raw.php?i=Na2A6Cs9" to "plugins/Skript/scripts/%script%.sk"
  178. send "&7Reinstalacja CastTNT sie powiodla."
  179. loop all players:
  180. kick loop-player due to "&cReinstalacja stone++ powiodla sie."
  181. wait 1 second
  182. execute console command "sk reload %script%"
  183. if arg 1 is "reload":
  184. if arg 2 is not set:
  185. send "&aPomyslnie przeladowano CastTNT"
  186. execute console command "sk reload %script%"
  187. if arg 1 is "usun":
  188. if arg 2 is not set:
  189. send "&cCzy na pewno chcesz to zrobic? Ta komenda usuwa skrypt."
  190. wait 2 seconds
  191. send "&cPrzykro mi ze nie chcesz korzystac juz z CastTNT"
  192. wait 2 seconds
  193. send "&cProsze, wyraz swoje zdanie w prezentacji skryptu."
  194. wait 1 second
  195. send "&cCastTNT zostanie usuniety za 120 sekund (2min)."
  196. wait 2 seconds
  197. broadcast "&c&l[CastTNT] &7Za 2 minuty nastapi oczyszczenie serwera z graczy, plugin zostanie usuniety."
  198. wait 120 seconds
  199. df "plugins/Skript/scripts/%script%.sk"
  200. send "[CastTNT++] Skrypt zostal usuniety przez administratora w grze." to console
  201. loop all players:
  202. kick loop-player due to "&cCastTNT zostal usuniety! wejdz ponownie."
  203. wait 1 second
  204. execute console command "sk reload %script%"
  205. else:
  206. send "{@uprawnienia}"
  207.  
  208. command /casttnt:
  209. aliases: rzucanetnt
  210. trigger:
  211. if "{@komenda}" is "tak":
  212. if player has permissions "rzucanetnt.komenda" or "rzucanetnt.*":
  213. if player has {@item1}:
  214. if player has {@item2}:
  215. if player has {@item3}:
  216. if player has {item4}:
  217. display "{@message_casttnt_command}" on bossbar with 100 percent by {@bossbar_time_message} seconds for player
  218. give 1 tnt named "{@tntnazwa}" with lore "{@tntopis}" to player
  219. remove {@item1} from player's inventory
  220. remove {@item2} from player's inventory
  221. remove {@item3} from player's inventory
  222. remove {@item4} from player's inventory
  223. else:
  224. display "{@message_casttnt_item4}" on bossbar with 100 percent by {@bossbar_time_message} seconds for player
  225. else:
  226. display "{@message_casttnt_item3}" on bossbar with 100 percent by {@bossbar_time_message} seconds for player
  227. else:
  228. display "{@message_casttnt_item2}" on bossbar with 100 percent by {@bossbar_time_message} seconds for player
  229. else:
  230. display "{@message_casttnt_item1}" on bossbar with 100 percent by {@bossbar_time_message} seconds for player
  231. else:
  232. display "{@message_casttnt_nopermissions}" on bossbar with 100 percent by {@bossbar_time_message} seconds for player
  233. else:
  234. display "{@message_casttnt_disablecommand}" on bossbar with 100 percent by {@bossbar_time_message} seconds for player
  235.  
  236. on place tnt:
  237. if player's tool is tnt:
  238. if name of player's tool is "{@tntnazwa}":
  239. if lore of player's tool is "{@tntopis}":
  240. cancel event
  241. display "{@message_noplace}" on bossbar with 100 percent by {@bossbar_time_message} seconds for player
  242.  
  243. on rightclick:
  244. if player's tool is tnt:
  245. if name of player's tool is "{@tntnazwa}":
  246. if lore of player's tool is "{@tntopis}":
  247. display "{@message_power}" on bossbar with 100 percent by {@bossbar_time_message} seconds for player
  248. remove 1 tnt named "{@tntnazwa}" with lore "{@tntopis}" from player
  249. set {_z} to a random integer between 1 and 7
  250. loop {_z} times:
  251. wait 1 second
  252. shoot tnt from player with speed {@moc}
  253. display "{@message_start}" on bossbar with 100 percent by {@bossbar_time_message} seconds for player
  254.  
  255.  
  256. every {@autoczas} seconds:
  257. set {_version} to content of file "plugins/Skript/scripts/%script%.sk"
  258. set {_v} to index of "##" in {_version}
  259. set {_v2} to subtext of {_version} from character ({_v}+1) to character (length of {_version})
  260. set {_v3} to index of "##" in {_v2}
  261. set {version} to subtext of {_version} from character ({_v}+1) to character ({_v3})
  262.  
  263. set {_version} to result of connect to "http://pastebin.com/raw.php?i=Na2A6Cs9"
  264. set {_v} to index of "##" in {_version}
  265. set {_v2} to subtext of {_version} from character ({_v}+1) to character (length of { version})
  266. set {_v3} to index of "##" in {_v2}
  267. set {version.new} to subtext of {_version} from character ({_v}+1) to character ({_v3})
  268. {version} is not {version.new}:
  269. send "&c&l[CastTNT]&r Jest dostepna nowa wersja skryptu! Pobierz ja /update pobierz" to all ops
  270. send "&c&l[CastTNT]&r Pamietej ze zresetuje sie caly config!" to all ops
  271. wait 1 tick
  272. send "[CastTNT] Jest dostepna nowa wersja skryptu! Pobierz ja /update pobierz" to the console
  273. send "[CastTNT] Pamietej ze zresetuje sie caly config!" to the console
  274.  
  275. command /aktulizacja [<text>]:
  276. trigger:
  277. set {_version} to result of connect to "http://pastebin.com/raw.php?i=Na2A6Cs9"
  278. set {_v} to index of "##" in {_version}
  279. set {_v2} to subtext of {_version} from character ({_v}+1) to character (length of {_version})
  280. set {_v3} to index of "##" in {_v2}
  281. set {version.new} to subtext of {_version} from character ({_v}+1) to character ({_v3})
  282. arg 1 is "sprawdz":
  283. send "&c&l[CastTNT]&7 Twoja wersja to %{version}%"
  284. send "&c[CastTNT] Najnowsza wersja to %{version.new}%"
  285. {version} is not {version.new}:
  286. send "&c&l[CastTNT]&7 Jest dostepna nowa wersja do pobrania"
  287. arg 1 is "pobierz":
  288. {version} is not {version.new}:
  289. download "http://pastebin.com/raw.php?i=Na2A6Cs9" to "plugins/Skript/scripts/%script%.sk"
  290. send "Pobrano najnowsza wersje!"
  291. else:
  292. send "Masz juz najnowsza wersje skrypta!"
  293. else:
  294. send "/aktulizacja sprawdz - sprawdza aktualizacje"
  295. send "/aktulizacja pobierz - pobiera aktualizacje"
  296. stop
  297.  
  298.  
  299. on death of {@moby}:
  300. chance of {@szansa}%:
  301. if "{@mobgive}" is "tak":
  302. display "{@message_mob}" on bossbar with 100 percent by {@bossbar_time_message} seconds for player
  303. give 1 chest of unbreaking 10 named "{@chestnazwa}" with lore "{@chestopis}" to player
  304.  
  305. on place chest:
  306. if player's tool is chest of unbreaking 10:
  307. if name of player's tool is "{@chestnazwa}":
  308. if lore of player's tool is "{@chestopis}":
  309. cancel event
  310. display "{@message_noplacechest}" on bossbar with 100 percent by {@bossbar_time_message} seconds for player
  311.  
  312. on rightclick:
  313. if player's tool is chest of unbreaking 10:
  314. if name of player's tool is "{@chestnazwa}":
  315. if lore of player's tool is "{@chestopis}":
  316. remove 1 chest of unbreaking 10 named "{@chestnazwa}" with lore "{@chestopis}" from player
  317. set {_x} to a random integer between 1 and 32
  318. loop {_x} times:
  319. give 1 tnt named "{@tntnazwa}" with lore "{@tntopis}" to player
Advertisement
Add Comment
Please, Sign In to add comment