akon1248

KitPvP-2

Apr 4th, 2019
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.09 KB | None | 0 0
  1. function pitchAtan2(loc1: location, loc2: location) :: number:
  2. set {_dx} to x-coordinate of {_loc2} - x-coordinate of {_loc1}
  3. set {_dy} to y-coordinate of {_loc2} - y-coordinate of {_loc1}
  4. set {_dz} to z-coordinate of {_loc2} - z-coordinate of {_loc1}
  5. set {_pitch} to 0-atan2(sqrt({_dx}^2+{_dz}^2), {_dy})
  6. return {_pitch}
  7. function yawAtan2(loc1: location, loc2: location) :: number:
  8. set {_dx} to x-coordinate of {_loc2} - x-coordinate of {_loc1}
  9. set {_dz} to z-coordinate of {_loc2} - z-coordinate of {_loc1}
  10. set {_yaw} to atan2({_dx}, {_dz})-90
  11. return {_yaw}
  12. function getVectorSizeFromMotionNBT(e: entity) :: number:
  13. set {_motionnbt} to "%tag ""Motion"" of nbt of {_e}%"
  14. replace "[", "]" and "d" in {_motionnbt} with ""
  15. set {_powers::*} to split {_motionnbt} by ","
  16. return sqrt({_powers::1} parsed as number^2+{_powers::2} parsed as number^2+{_powers::3} parsed as number^2)
  17. function getTagValues(e: entity) :: strings:
  18. set {_tagnbt} to "%tag ""Tags"" of nbt of {_e}%"
  19. replace "[""" and """]" in {_tagnbt} with ""
  20. return split {_tagnbt} by ""","""
  21. on rightclick with redstone:
  22. name of player's tool is "&6Booster"
  23. cancel event
  24. {kitpvp.timers.%player%::bootster} is not set
  25. play sound "block.anvil.place" to all players at player with volume 1 pitch 1
  26. apply potion regeneration 0 to player for 15 second and ambient true
  27. apply potion resistance 0 to player for 15 second and ambient true
  28. apply potion speed 1 to player for 15 second and ambient true
  29. set {kitpvp.timers.%player%::bootster} to 900
  30. on rightclick with glowstone dust:
  31. name of player's tool is "&cAttack Booster"
  32. cancel event
  33. {kitpvp.timers.%player%::atkbooster} is not set
  34. play sound "entity.blaze.ambient" to all players at player with volume 1 pitch 1
  35. apply potion strength 0 to player for 15 second and ambient true
  36. set {kitpvp.timers.%player%::atkbooster} to 900
  37. on rightclick with iron ingot:
  38. name of player's tool is "&9Defence Booster"
  39. cancel event
  40. {kitpvp.timers.%player%::defbooster} is not set
  41. play sound "entity.zombie.attack_iron_door" to all players at player with volume 1 pitch 1
  42. apply potion resistance 3 to player for 10 second and ambient true
  43. apply potion slowness 1 to player for 10 second and ambient true
  44. set {kitpvp.timers.%player%::defbooster} to 600
  45. every tick:
  46. loop all players:
  47. if {kitpvp.timers.%loop-player%::bootster} >= 1:
  48. remove 1 from {kitpvp.timers.%loop-player%::bootster}
  49. if loop-player's tool is redstone:
  50. name of loop-player's tool is "&6Booster"
  51. send action bar from "&6Booster&aが使用可能になるまであと%ceil({kitpvp.timers.%loop-player%::bootster}/20)%秒" to loop-player
  52. {kitpvp.timers.%loop-player%::bootster} is 0
  53. delete {kitpvp.timers.%loop-player%::bootster}
  54. send action bar from "&6Booster&aが使用可能になりました" to loop-player
  55. if {kitpvp.timers.%loop-player%::atkbooster} >= 1:
  56. remove 1 from {kitpvp.timers.%loop-player%::atkbooster}
  57. if loop-player's tool is glowstone dust:
  58. name of loop-player's tool is "&cAttack Booster"
  59. send action bar from "&cAttack Booster&aが使用可能になるまであと%ceil({kitpvp.timers.%loop-player%::atkbooster}/20)%秒" to loop-player
  60. {kitpvp.timers.%loop-player%::atkbooster} is 0
  61. delete {kitpvp.timers.%loop-player%::atkbooster}
  62. send action bar from "&cAttack Booster&aが使用可能になりました" to loop-player
  63. if {kitpvp.timers.%loop-player%::defbooster} >= 1:
  64. remove 1 from {kitpvp.timers.%loop-player%::defbooster}
  65. if loop-player's tool is iron ingot:
  66. name of loop-player's tool is "&9Defence Booster"
  67. send action bar from "&9Defence Booster&aが使用可能になるまであと%ceil({kitpvp.timers.%loop-player%::defbooster}/20)%秒" to loop-player
  68. {kitpvp.timers.%loop-player%::defbooster} is 0
  69. delete {kitpvp.timers.%loop-player%::defbooster}
  70. send action bar from "&9Defence Booster&aが使用可能になりました" to loop-player
  71. on shoot:
  72. shooter is a player
  73. projectile is an arrow
  74. name of shooter's tool is "&aArcher's Bow"
  75. set {_vector} to getVectorSizeFromMotionNBT(projectile)
  76. set {_crit} to tag "crit" of nbt of projectile
  77. loop items in shooter's inventory:
  78. id of loop-item is 351
  79. durability of loop-item is 5
  80. name of loop-item is "&5Arrow Effector"
  81. set {_mode} to line 2 of lore of loop-item
  82. replace "&7Mode: " in {_mode} with ""
  83. if {_mode} is "Normal":
  84. delete {_mode}
  85. if {_mode} is set:
  86. shooter's gamemode is survival or adventure
  87. add "{damage:0.0d}" to nbt of projectile
  88. loop items in shooter's inventory:
  89. id of loop-item is 351
  90. durability of loop-item is 5
  91. name of loop-item is "&5Arrow Effector"
  92. set {_item} to loop-item
  93. set item amount of {_item} to 1
  94. remove {_item} from loop-item
  95. stop loop
  96. if {_mode} is "&cFlame":
  97. add "{Color:14981690,Fire:32767s}" to nbt of projectile
  98. else if {_mode} is "&bMultiple":
  99. add "{Color:65535}" to nbt of projectile
  100. set {_shootloc1} to location 0.5 meter forwards location of shooter's head
  101. set yaw of {_shootloc1} to yawAtan2(location of shooter, location 5 meter forwards location 1 meter horizontal to the right location of shooter)
  102. set pitch of {_shootloc1} to pitchAtan2(location of shooter, location 5 meter forwards location 1 meter horizontal to the right location of shooter)
  103. set {_shootloc2} to location 0.5 meter forwards location of shooter's head
  104. set yaw of {_shootloc2} to yawAtan2(location of shooter, location 5 meter forwards location 1 meter horizontal to the left location of shooter)
  105. set pitch of {_shootloc2} to pitchAtan2(location of shooter, location 5 meter forwards location 1 meter horizontal to the left location of shooter)
  106. shoot an arrow from {_shootloc1} with speed {_vector}
  107. set shooter of shot projectile to shooter
  108. add "{Color:65535}" to nbt of shot projectile
  109. if {_crit} is 1:
  110. add "{crit:1b}" to nbt of shot projectile
  111. shoot an arrow from {_shootloc2} with speed {_vector}
  112. set shooter of shot projectile to shooter
  113. add "{Color:65535}" to nbt of shot projectile
  114. if {_crit} is 1:
  115. add "{crit:1b}" to nbt of shot projectile
  116. else if {_mode} is "&6Machine Gun":
  117. add "{Tags:[""machinegunarrow""],Color:16759552}" to nbt of projectile
  118. loop 4 times:
  119. wait 5 tick
  120. set {_shootloc} to location 0.5 meter forwards location of shooter's head
  121. shoot an arrow from {_shootloc} with speed {_vector}
  122. set shooter of shot projectile to shooter
  123. add "{Tags:[""machinegunarrow""],Color:16759552}" to nbt of shot projectile
  124. play sound "entity.arrow.shoot" to all players at shooter with volume 1 pitch 1
  125. if {_crit} is 1:
  126. add "{crit:1b}" to nbt of shot projectile
  127. on damage:
  128. projectile is an arrow
  129. set {_tags::*} to getTagValues(projectile)
  130. {_tags::*} contain "machinegunarrow"
  131. set damage to damage/2
  132. set {_damagedelay} to damage delay of victim
  133. set damage delay of victim to 0 tick
  134. wait 1 tick
  135. set damage delay of victim to {_damagedelay}
  136. on rightclick:
  137. id of player's tool is 351
  138. durability of player's tool is 5
  139. name of player's tool is "&5Arrow Effector"
  140. if line 2 of lore of player's tool is "&7Mode: Normal":
  141. loop items in player's inventory:
  142. id of loop-item is 351
  143. durability of loop-item is 5
  144. name of loop-item is "&5Arrow Effector"
  145. set line 2 of lore of loop-item to "&7Mode: &cFlame"
  146. send "&a矢の効果を&cFlame&aに設定しました"
  147. play sound "UI_BUTTON_CLICK" to player with volume 1 and pitch 15
  148. else if line 2 of lore of player's tool is "&7Mode: &cFlame":
  149. loop items in player's inventory:
  150. id of loop-item is 351
  151. durability of loop-item is 5
  152. name of loop-item is "&5Arrow Effector"
  153. set line 2 of lore of loop-item to "&7Mode: &bMultiple"
  154. send "&a矢の効果を&bMultiple&aに設定しました"
  155. play sound "UI_BUTTON_CLICK" to player with volume 1 and pitch 15
  156. else if line 2 of lore of player's tool is "&7Mode: &bMultiple":
  157. loop items in player's inventory:
  158. id of loop-item is 351
  159. durability of loop-item is 5
  160. name of loop-item is "&5Arrow Effector"
  161. set line 2 of lore of loop-item to "&7Mode: &6Machine Gun"
  162. send "&a矢の効果を&6Machine Gun&aに設定しました"
  163. play sound "UI_BUTTON_CLICK" to player with volume 1 and pitch 15
  164. else if line 2 of lore of player's tool is "&7Mode: &6Machine Gun":
  165. loop items in player's inventory:
  166. id of loop-item is 351
  167. durability of loop-item is 5
  168. name of loop-item is "&5Arrow Effector"
  169. set line 2 of lore of loop-item to "&7Mode: Normal"
  170. send "&a矢の効果を&7Normal&aに設定しました"
  171. play sound "UI_BUTTON_CLICK" to player with volume 1 and pitch 15
  172. every tick:
  173. loop all players:
  174. chance of 0.5%:
  175. loop items in loop-player's inventory:
  176. loop-item is a bow
  177. name of loop-item is "&aArcher's Bow"
  178. set {_caeamount} to 0
  179. loop items in loop-player's inventory:
  180. id of loop-item-2 is 351
  181. durability of loop-item-2 is 5
  182. name of loop-item-2 is "&5Arrow Effector"
  183. set {_mode} to line 2 of lore of loop-item-2
  184. replace "&7Mode: " in {_mode} with ""
  185. add item amount of loop-item-2 to {_caeamount}
  186. if {_caeamount} < 10:
  187. if {_mode} is set:
  188. give loop-player purple dye with nbt "{display:{Name:""&5Arrow Effector"",Lore:[""&d&oUndroppable"",""&7Mode: %{_mode}%""]},ench:[{id:0s,lvl:0s}],HideFlags:1}"
  189. else if {_mode} is not set:
  190. give loop-player purple dye with nbt "{display:{Name:""&5Arrow Effector"",Lore:[""&d&oUndroppable"",""&7Mode: Normal""]},ench:[{id:0s,lvl:0s}],HideFlags:1}"
  191. stop loop
  192. on damage:
  193. attacker is a player
  194. attacker's tool is stone sword
  195. name of attacker's tool is "&2Debuff Sword"
  196. chance of 10%:
  197. set {_debuffpattern} to random integer between 1 and 4
  198. if {_debuffpattern} is 1:
  199. execute console command "execute %UUID of victim% ~ ~ ~ effect @s poison 10 0"
  200. if {_debuffpattern} is 2:
  201. execute console command "execute %UUID of victim% ~ ~ ~ effect @s blindness 3 0"
  202. if {_debuffpattern} is 3:
  203. execute console command "execute %UUID of victim% ~ ~ ~ effect @s slowness 15 2"
  204. if {_debuffpattern} is 4:
  205. execute console command "execute %UUID of victim% ~ ~ ~ effect @s weakness 5 0"
  206. function witchRandomPotion() :: item:
  207. set {_potionpattern} to random integer between 1 and 52
  208. if {_potionpattern} is between 1 and 5:
  209. return potion with nbt "{Potion:""minecraft:strong_regeneration""}"
  210. if {_potionpattern} is between 6 and 8:
  211. return potion with nbt "{display:{LocName:""potion.effect.strength""},CustomPotionEffects:[{Id:5b,Amplifier:0b,Duration:300,ShowParticles:1b}],CustomPotionColor:9643043}"
  212. if {_potionpattern} is between 9 and 13:
  213. return splash potion with nbt "{Potion:""minecraft:strong_harming""}"
  214. if {_potionpattern} is between 14 and 18:
  215. return splash potion with nbt "{Potion:""minecraft:regeneration""}"
  216. if {_potionpattern} is between 19 and 23:
  217. return splash potion with nbt "{Potion:""minecraft:strong_poison""}"
  218. if {_potionpattern} is between 24 and 28:
  219. return splash potion with nbt "{display:{LocName:""potion.effect.swiftness""},CustomPotionEffects:[{Id:1b,Amplifier:1b,Duration:600,ShowParticles:1b}],CustomPotionColor:8171462}"
  220. if {_potionpattern} is between 29 and 31:
  221. return splash potion with nbt "{display:{Name:""&rSplash Potion of Nausea""},CustomPotionEffects:[{Id:9b,Amplifier:0b,Duration:300,ShowParticles:1b}],CustomPotionColor:5578058}"
  222. if {_potionpattern} is between 32 and 34:
  223. return splash potion with nbt "{display:{Name:""&rSplash Potion of Blindness""},CustomPotionEffects:[{Id:15b,Amplifier:0b,Duration:100,ShowParticles:1b}],CustomPotionColor:2039587}"
  224. if {_potionpattern} is between 35 and 37:
  225. return splash potion with nbt "{display:{Name:""&rSplash Potion of Wither""},CustomPotionEffects:[{Id:20b,Amplifier:0b,Duration:100,ShowParticles:1b}],CustomPotionColor:3484199}"
  226. if {_potionpattern} is between 38 and 40:
  227. return potion with nbt "{display:{Name:""&6Kangaroo Potion""},CustomPotionEffects:[{Id:8b,Amplifier:4b,Duration:400,ShowParticles:1b}],CustomPotionColor:2293580}"
  228. if {_potionpattern} is between 41 and 42:
  229. return splash potion with nbt "{display:{Name:""&8The Weaker""},CustomPotionEffects:[{Id:2b,Amplifier:1b,Duration:200,ShowParticles:1b},{Id:18b,Amplifier:1b,Duration:200,ShowParticles:1b}],CustomPotionColor:5332325}"
  230. if {_potionpattern} is 43:
  231. return splash potion with nbt "{display:{Name:""&4Blood Magic""},CustomPotionEffects:[{Id:20b,Amplifier:2b,Duration:100,ShowParticles:1b},{Id:7b,Amplifier:1b,Duration:20,ShowParticles:1b}],CustomPotionColor:6291456}"
  232. if {_potionpattern} is between 44 and 46:
  233. return splash potion with nbt "{display:{Name:""&0Black Potion""},CustomPotionEffects:[{Id:20b,Amplifier:1b,Duration:150,ShowParticles:1b},{Id:15b,Amplifier:0b,Duration:150,ShowParticles:1b}],CustomPotionColor:0}"
  234. if {_potionpattern} is between 47 and 50:
  235. return splash potion with nbt "{display:{Name:""&eAlchol""},CustomPotionEffects:[{Id:9b,Amplifier:0b,Duration:300,ShowParticles:1b},{Id:10b,Amplifier:0b,Duration:200,ShowParticles:1b}],CustomPotionColor:16770718}"
  236. if {_potionpattern} is between 51 and 52:
  237. return splash potion with nbt "{display:{Name:""&dUltimate Healing""},CustomPotionEffects:[{Id:10b,Amplifier:4b,Duration:300,ShowParticles:1b},{Id:21b,Amplifier:4b,Duration:300,ShowParticles:1b},{Id:22,Amplifier:4b,Duration:300,ShowParticles:1b}]}"
  238. on projectile hit:
  239. "%tag ""Potion"" of nbt of projectile%" is "{id:""minecraft:splash_potion"",Count:1b,tag:{CustomPotionColor:16770718,CustomPotionEffects:[{Ambient:0b,ShowParticles:1b,Duration:300,Id:9b,Amplifier:0b},{Ambient:0b,ShowParticles:1b,Duration:200,Id:10b,Amplifier:0b}],Potion:""minecraft:empty"",display:{Name:""§eAlchol""}},Damage:0s}"
  240. id of block at location of projectile is 10 or 11 or 51
  241. make safe explosion with power 4 at projectile
  242. loop blocks in radius 5 around projectile:
  243. loop-block is air
  244. chance of 30%:
  245. set loop-block to fire
  246. loop entities in radius 5 around projectile:
  247. ignite loop-entity for 15 second
  248. on rightclick with chest:
  249. name of player's tool is "&5Potion Box"
  250. cancel event
  251. {kitpvp.timers.%player%::potionbox} is not set
  252. open inventory "HOPPER" named "&5Potion Box" to player
  253. play sound "BLOCK_CHEST_OPEN" to player with volume 1 and pitch 5
  254. set {_slots::*} to 0, 1, 2, 3 and 4
  255. loop random integer between 1 and 5 times:
  256. set {_slot} to random element out of {_slots::*}
  257. remove {_slot} from {_slots::*}
  258. set slot {_slot} of player's current inventory to witchRandomPotion()
  259. set {kitpvp.timers.%player%::potionbox} to 900
  260. every tick:
  261. loop all players:
  262. {kitpvp.timers.%loop-player%::potionbox} >= 1
  263. remove 1 from {kitpvp.timers.%loop-player%::potionbox}
  264. if loop-player's tool is chest:
  265. name of loop-player's tool is "&5Potion Box"
  266. send action bar from "&5Potion Box&aが使用可能になるまであと%ceil({kitpvp.timers.%loop-player%::potionbox}/20)%秒" to loop-player
  267. {kitpvp.timers.%loop-player%::potionbox} is 0
  268. delete {kitpvp.timers.%loop-player%::potionbox}
  269. send action bar from "&5Potion Box&aが使用可能になりました" to loop-player
  270. on inventory close:
  271. inventory type of player's current inventory is "HOPPER"
  272. "%player's current inventory%" is "inventory of <none>"
  273. inventory name of player's current inventory is "&5Potion Box"
  274. play sound "BLOCK_CHEST_CLOSE" to player with volume 1 and pitch 5
  275. on rightclick with blaze rod:
  276. name of player's tool is "&cBlaze Wand"
  277. cancel event
  278. if line 2 of lore of player's tool is "&7Charged Fireballs: 3":
  279. play sound "ENTITY_BLAZE_SHOOT" with volume 3 and pitch 1 at player
  280. shoot a small fireball from player with speed 2
  281. add "{Tags:[""blazefireball1""]}" to nbt of shot projectile
  282. loop items in player's inventory:
  283. loop-item is blaze rod
  284. name of loop-item is "&cBlaze Wand"
  285. set line 2 of lore of loop-item to "&7Charged Fireballs: 2"
  286. else if line 2 of lore of player's tool is "&7Charged Fireballs: 2":
  287. play sound "ENTITY_BLAZE_SHOOT" with volume 3 and pitch 1 at player
  288. shoot a fireball from player with speed 2
  289. add "{Tags:[""blazefireball2""]}" to nbt of shot projectile
  290. loop items in player's inventory:
  291. loop-item is blaze rod
  292. name of loop-item is "&cBlaze Wand"
  293. set line 2 of lore of loop-item to "&7Charged Fireballs: 1"
  294. else if line 2 of lore of player's tool is "&7Charged Fireballs: 1":
  295. play sound "ENTITY_BLAZE_SHOOT" with volume 3 and pitch 1 at player
  296. shoot a fireball from player with speed 2
  297. add "{Tags:[""blazefireball3""],ExplosionPower:3}" to nbt of shot projectile
  298. loop items in player's inventory:
  299. loop-item is blaze rod
  300. name of loop-item is "&cBlaze Wand"
  301. set line 2 of lore of loop-item to "&7Charged Fireballs: 0"
  302. set {kitpvp.timers.%player%::blazewand} to 900
  303. every tick:
  304. loop all players:
  305. {kitpvp.timers.%loop-player%::blazewand} >= 1
  306. remove 1 from {kitpvp.timers.%loop-player%::blazewand}
  307. if loop-player's tool is blaze rod:
  308. name of loop-player's tool is "&cBlaze Wand"
  309. send action bar from "&cBlaze Wand&aが使用可能になるまであと%ceil({kitpvp.timers.%loop-player%::blazewand}/20)%秒" to loop-player
  310. {kitpvp.timers.%loop-player%::blazewand} is 0
  311. delete {kitpvp.timers.%loop-player%::blazewand}
  312. send action bar from "&cBlaze Wand&aが使用可能になりました" to loop-player
  313. loop items in loop-player's inventory:
  314. loop-item is blaze rod
  315. name of loop-item is "&cBlaze Wand"
  316. set line 2 of lore of loop-item to "&7Charged Fireballs: 3"
  317. on damage:
  318. if projectile is a small fireball:
  319. set {_tags::*} to getTagValues(projectile)
  320. {_tags::*} contain "blazefireball1"
  321. set damage to 2.5
  322. else if projectile is a large fireball:
  323. set {_tags::*} to getTagValues(projectile)
  324. {_tags::*} contain "blazefireball2"
  325. set damage to damage*2
  326. on projectile hit:
  327. set {_tags::*} to getTagValues(projectile)
  328. if {_tags::*} contain "blazefireball2":
  329. block at projectile is air
  330. set block at projectile to fire
  331. if {_tags::*} contain "blazefireball3":
  332. loop blocks in radius 3 around projectile:
  333. loop-block is air
  334. chance of 30%:
  335. set loop-block to fire
  336. on damage:
  337. victim is a large fireball
  338. set {_tags::*} to getTagValues(victim)
  339. {_tags::*} contain "blazefireball2" or "blazefireball3"
  340. cancel event
Add Comment
Please, Sign In to add comment