akon1248

Untitled

Jan 27th, 2019
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.17 KB | None | 0 0
  1. command /customdrop [<text>] [<text>] [<text>]:
  2. permission: acd.admin
  3. permission message: &cYou do not permission to use this command.
  4. trigger:
  5. if arg-1 is not set:
  6. send "&cUsage: /customdrop <add|remove> <dropname> OR /customdrop drops"
  7. stop
  8. if arg-1 is not "add" or "remove" or "drops":
  9. send "&cUsage: /customdrop <add|remove> <dropname> OR /customdrop drops"
  10. stop
  11. if arg-1 is "add" or "remove":
  12. if arg-2 is not set:
  13. send "&cUsage: /customdrop %arg-1% <dropname>"
  14. stop
  15. if arg-3 is set:
  16. send "&cドロップアイテム名に空白は使用できません"
  17. stop
  18. if arg-1 is set:
  19. if arg-1 is "add":
  20. if {customdrops::%arg-2%} is set:
  21. send "&cドロップアイテム%arg-2%は既に存在しています"
  22. stop
  23. if player's tool is air:
  24. send "&cメインハンドに追加したいアイテムを持ってください"
  25. stop
  26. if player's tool is not air:
  27. set {customdrops::%arg-2%} to player's tool
  28. send "&e新しいドロップアイテム%arg-2%を追加しました"
  29. stop
  30. if arg-1 is "remove":
  31. if {customdrops::%arg-2%} is not set:
  32. send "&cドロップアイテム%arg-2%は存在しません"
  33. stop
  34. if {customdrops::%arg-2%} is set:
  35. delete {customdrops::%arg-2%}
  36. send "&eドロップアイテム%arg-2%を消去しました"
  37. stop
  38. else if arg-1 is "drops":
  39. if {customdrops::*} is not set:
  40. send "&c登録されているドロップアイテムはありません"
  41. else if {customdrops::*} is set:
  42. loop {customdrops::*}:
  43. set {_dropstext} to "&e%loop-index%"
  44. stop loop
  45. set {_loopnumber} to 0
  46. loop {customdrops::*}:
  47. add 1 to {_loopnumber}
  48. {_loopnumber} >= 2
  49. set {_dropstext} to "%{_dropstext}%&f, &e%loop-index%"
  50. send "&7Drops (%size of {customdrops::*}%): %{_dropstext}%"
  51. function getTags(tags: string) :: strings:
  52. replace "[""" and """]" in {_tags} with ""
  53. set {_returnvalue::*} to split {_tags} by ""","""
  54. return {_returnvalue::*}
  55. on death:
  56. victim is a living entity
  57. victim is not a player
  58. victim is not armor stand
  59. set {_tags::*} to getTags("%tag ""Tags"" of nbt of victim%")
  60. if {_tags::*} contain "only_custom_drop":
  61. clear drops
  62. loop {_tags::*}:
  63. set {_dropoption} to "{%loop-value%}"
  64. send "success" to attacker
  65. replace ";" in {_dropoption} with ","
  66. send "success" to attacker
  67. send "%{_dropoption}%" to attacker
  68. send "success" to attacker
  69. set {_customdropname} to tag "Drop" of {_dropoption}
  70. send "success" to attacker
  71. replace """" in {_customdropname} with ""
  72. send "success" to attacker
  73. set {_dropchance} to "%tag ""DropChance"" of {_dropoption}%" parsed as number
  74. send "success" to attacker
  75. set {_maxcount} to "%tag ""MaxCount"" of {_dropoption}%" parsed as integer
  76. send "success" to attacker
  77. set {_mincount} to "%tag ""MinCount"" of {_dropoption}%" parsed as integer
  78. send "success" to attacker
  79. set {_onlywhenkilledbyplayer} to "%tag ""OnlyWhenKilledByPlayer"" of {_dropoption}%"
  80. send "success" to attacker
  81. send "%{_onlywhenkilledbyplayer}%" to attacker
  82. if {_onlywhenkilledbyplayer} is "1b":
  83. send "success" to attacker
  84. attacker is a player
  85. chance of {_dropchance}%:
  86. loop random integer between {_maxcount} and {_mincount} times:
  87. if {customdrops::%{_customdropname}%} is set:
  88. drop {customdrops::%{_customdropname}%} at victim
  89. else if {customdrops::%{_customdropname}%} is not set:
  90. set {_dropitem} to {_customdropname} parsed as itemtype
  91. {_dropitem} is set
  92. drop {_dropitem} at victim
  93. else if {_onlywhenkilledbyplayer} is "0b":
  94. send "success" to attacker
  95. chance of {_dropchance}%:
  96. loop random integer between {_maxcount} and {_mincount} times:
  97. if {customdrops::%{_customdropname}%} is set:
  98. drop {customdrops::%{_customdropname}%} at victim
  99. else if {customdrops::%{_customdropname}%} is not set:
  100. set {_dropitem} to {_customdropname} parsed as itemtype
  101. {_dropitem} is set
  102. drop {_dropitem} at victim
  103. send "%tag ""Drop"" of {_dropoption}% %{_dropchance}% %{_maxcount}% %{_mincount}% %{_onlywhenkilledbyplayer}%" to attacker
Advertisement
Add Comment
Please, Sign In to add comment