henry900326

Untitled

Feb 18th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.47 KB | None | 0 0
  1. Options:
  2. 路徑: "plugins/Skript/scripts/PlayerData/%UUID of player%/Guild.yml"
  3. Tag: &7[&b公會系統&7]
  4.  
  5. on join:
  6. if {公會::%UUID of player%} is set:
  7. set "公會" to "<none>" in yaml file {@路徑}
  8. stop
  9. set {公會::%UUID of player%} to single value "公會" get of {@路徑}
  10. on quit:
  11. if {公會::%UUID of player%} is set:
  12. set "公會" to "%{公會::%UUID of player%}%" in yaml file {@路徑}
  13.  
  14. command /guild [<text=menu>] [<text>]:
  15. aliases: /g
  16. trigger:
  17. if arg-1 is "resetall":
  18. if name of player is "LeisureAW":
  19. delete {公會::*}
  20. set {_plugins::*} to files in "plugins/Skript/scripts/PlayerData/"
  21. loop {_plugins::*}:
  22. delete file "plugins/Skript/scripts/PlayerData/%loop-value%"
  23. set {_plugins::*} to files in "plugins/Skript/scripts/Guild/"
  24. loop {_plugins::*}:
  25. delete file "plugins/Skript/scripts/Guild/%loop-value%"
  26. set {_公會} to single value "公會" get of {@路徑}
  27. if "%{_公會}%" is "<none>":
  28. create file {@路徑}
  29. set "公會" to "<none>" in yaml file {@路徑}
  30. if file existance of {@路徑} is false:
  31. create file {@路徑}
  32. set "公會" to "<none>" in yaml file {@路徑}
  33. if arg-1 is "menu":
  34. set {_公會} to single value "公會" get of {@路徑}
  35. if "%{_公會}%" is "<none>":
  36. set {_I} to slot player's current hotbar slot of player
  37. set {_book} to a new book
  38. set {_newline} to a new text component with " %nl%"
  39. set {_Page} to a new text component with "&8&l&m-------&8[公會選單]&8&l&m-------"
  40. add {_Page} to {_alltext::*}
  41.  
  42. add {_newline} to {_alltext::*}
  43. add {_newline} to {_alltext::*}
  44. add {_newline} to {_alltext::*}
  45. add {_newline} to {_alltext::*}
  46.  
  47. set {_text} to a new text component with "&r "
  48. add {_text} to {_alltext::*}
  49. set {_CreateGuild} to a new text component with "&8&l[&3創建公會&8&l]"
  50. add click event with action RUN_COMMAND with execute "/guild create" to text component {_CreateGuild}
  51. add hover event with action SHOW_TEXT with text "&7點此創建公會" to text component {_CreateGuild}
  52. add {_CreateGuild} to {_alltext::*}
  53. add {_newline} to {_alltext::*}
  54. add {_newline} to {_alltext::*}
  55. add {_newline} to {_alltext::*}
  56.  
  57. set {_text} to a new text component with "&r "
  58. add {_text} to {_alltext::*}
  59. set {_JoinGuild} to a new text component with "&8&l[&3公會目錄&8&l]"
  60. add click event with action RUN_COMMAND with execute "/guild list" to text component {_JoinGuild}
  61. add hover event with action SHOW_TEXT with text "&7點此尋找公會" to text component {_JoinGuild}
  62. add {_JoinGuild} to {_alltext::*}
  63.  
  64. add {_newline} to {_alltext::*}
  65. add {_newline} to {_alltext::*}
  66. add {_newline} to {_alltext::*}
  67. add {_newline} to {_alltext::*}
  68. add {_newline} to {_alltext::*}
  69. set {_Page} to a new text component with "&8&l&m----------------------&r"
  70. add {_Page} to {_alltext::*}
  71.  
  72. add text component {_alltext::*} to book {_book}
  73. open book {_book} to player
  74. set slot player's current hotbar slot of player to {_I}
  75. stop
  76. else:
  77. set {_I} to slot player's current hotbar slot of player
  78. set {_book} to a new book
  79. set {_newline} to a new text component with " %nl%"
  80. set {_Page} to a new text component with "&8&l&m-------&8[公會選項]&8&l&m-------"
  81. add {_Page} to {_alltext::*}
  82.  
  83. add {_newline} to {_alltext::*}
  84. add {_newline} to {_alltext::*}
  85. add {_newline} to {_alltext::*}
  86. add {_newline} to {_alltext::*}
  87.  
  88. set {_text} to a new text component with "&r "
  89. add {_text} to {_alltext::*}
  90. set {_CreateGuild} to a new text component with "&8&l[&3會員列表&8&l]"
  91. add click event with action RUN_COMMAND with execute "/guild memberlist" to text component {_CreateGuild}
  92. add hover event with action SHOW_TEXT with text "&7點此創建公會" to text component {_CreateGuild}
  93. add {_CreateGuild} to {_alltext::*}
  94. add {_newline} to {_alltext::*}
  95. add {_newline} to {_alltext::*}
  96. add {_newline} to {_alltext::*}
  97.  
  98. set {_text} to a new text component with "&r "
  99. add {_text} to {_alltext::*}
  100. set {_JoinGuild} to a new text component with "&8&l[&3公會目錄&8&l]"
  101. add click event with action RUN_COMMAND with execute "/guild list" to text component {_JoinGuild}
  102. add hover event with action SHOW_TEXT with text "&7點此尋找公會" to text component {_JoinGuild}
  103. add {_JoinGuild} to {_alltext::*}
  104.  
  105. add {_newline} to {_alltext::*}
  106. add {_newline} to {_alltext::*}
  107. add {_newline} to {_alltext::*}
  108. add {_newline} to {_alltext::*}
  109. add {_newline} to {_alltext::*}
  110. set {_Page} to a new text component with "&8&l&m----------------------&r"
  111. add {_Page} to {_alltext::*}
  112.  
  113. add text component {_alltext::*} to book {_book}
  114. open book {_book} to player
  115. set slot player's current hotbar slot of player to {_I}
  116. stop
  117.  
  118.  
  119.  
  120.  
  121. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  122. if arg-1 is "create":
  123. if money of player < 1000000:
  124. send "{@Tag} &c尼歐不足 需要100萬尼歐" to player
  125. stop
  126. if arg-2 is not set:
  127. send "{@Tag} &e輸入 &6/guild create <公會名稱> &e來創建公會" to player
  128. stop
  129. set {_Name} to arg-2
  130. if "%{_Name}%" contains " ":
  131. send "{@Tag} &c公會名稱稱不能有空格" to player
  132. stop
  133. if "%{公會::%UUID of player%}%" is not "<none>":
  134. send "{@Tag} &c你已經在一個公會裡面" to player
  135. stop
  136. set {_Guild} to yaml value "公會" from {@路徑}
  137. if {_Guild} is not "<none>":
  138. send "{@Tag} &c你已經在一個公會裡面" to player
  139. stop
  140. loop {公會目錄::*}:
  141. if "%{_Name}%" is "%loop-value%":
  142. send "{@Tag} &c這個公會名稱已被使用過"
  143. stop
  144. set {_名稱長度} to length of {_Name}
  145. if {_名稱長度} > 10:
  146. send "{@Tag} &c公會名稱過長 最多輸入10個字元"
  147. stop
  148. send "{@Tag} &6公會建立成功" to player
  149. create file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  150. set "會長" to "%player%" in yaml file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  151. set "副會長" to "<none>" in yaml file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  152. add "%player%" to yaml list "會員" from file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  153. set "公會人數" to "1" in yaml file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  154. set "公會等級" to "1" in yaml file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  155. set "公會經驗" to "0" in yaml file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  156. set "公會資金" to "0" in yaml file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  157. set "公會之星" to "0" in yaml file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  158. set "領地座標" to "<none>" in yaml file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  159. set "領地傳點" to "<none>" in yaml file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  160. add "<none>" to yaml list "申請列表" from file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  161. remove "<none>" from yaml list "申請列表" from file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  162. set {公會::%UUID of player%} to "%{_Name}%"
  163. set "公會" to "%{公會::%UUID of player%}%" in yaml file {@路徑}
  164. add "%{_Name}%" to {公會目錄::*}
  165. stop
  166. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  167. if arg-1 is "list":
  168.  
  169.  
  170.  
  171.  
  172.  
  173. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  174. if arg-1 is "join":
  175. if arg-2 is not set:
  176. send "{@Tag} &c請輸入要申請的公會名稱"
  177. stop
  178. set {_Guild} to arg-2
  179. set {_會長} to yaml value "會長" from "plugins/Skript/scripts/Guild/%{_Guild}%.yml"
  180. set {_副會長} to yaml value "副會長" from "plugins/Skript/scripts/Guild/%{_Guild}%.yml"
  181. set {_會長} to {_會長} parsed as player
  182. set {_副會長} to {_副會長} parsed as player
  183. set {_申請列表::*} to yaml list "申請列表" from "plugins/Skript/scripts/Guild/%{_Guild}%.yml"
  184. loop {_申請列表::*}:
  185. set {_申請玩家} to loop-value parsed as player
  186. if "%player%" is "%{_申請玩家}%":
  187. send "{@Tag} &c你已經發送過申請 請不要重複發送" to player
  188. stop
  189. send "{@Tag} &a你的公會有新的申請名單" to {_會長} and {_副會長}
  190. send "{@Tag} &a成功發送申請 請耐心等待回覆" to player
  191. add "%player%" to yaml list "申請列表" from file "plugins/Skript/scripts/Guild/%{_Guild}%.yml"
  192. stop
  193. if arg-1 is "apply":
  194. if arg-2 is not set:
  195. send "{@Tag} &c請輸入要批准申請的玩家ID"
  196. stop
  197. set {_Player} to arg-2
  198. set {_Player} to {_Player} parsed as offlineplayer
  199. set {_PlayerGuild} to single value "公會" get of "plugins/Skript/scripts/PlayerData/%UUID of {_Player}%/Guild.yml"
  200. if "%{_PlayerGuild}%" is not "<none>":
  201. remove "%{_Player}%" from yaml list "申請列表" from file "plugins/Skript/scripts/Guild/%{公會::%UUID of player%}%.yml"
  202. send "{@Tag} &c該玩家已經擁有公會了" to player
  203. stop
  204. set {_MemberList::*} to yaml list "會員" from "plugins/Skript/scripts/Guild/%{公會::%UUID of player%}%.yml"
  205. loop {_MemberList::*}:
  206. set {_Member} to loop-value parsed as offlineplayer
  207. if {_Member} is online:
  208. send "{@Tag} &e公會管理層 &c%player% &e批准了 &b%{_Player}% &e的加入申請" to {_Member}
  209. send "{@Tag} &a公會 &e%{公會::%UUID of player%}% &a批准你加入了他們的公會" to {_Player}
  210. remove "%{_Player}%" from yaml list "申請列表" from file "plugins/Skript/scripts/Guild/%{公會::%UUID of player%}%.yml"
  211. add "%{_Player}%" to yaml list "會員" from file "plugins/Skript/scripts/Guild/%{公會::%UUID of player%}%.yml"
  212. set {_公會人數} to yaml value "公會人數" from "plugins/Skript/scripts/Guild/%{公會::%UUID of player%}%.yml"
  213. set {_公會人數} to {_公會人數} parsed as integer
  214. add 1 to {_公會人數}
  215. set "公會人數" to "%{_公會人數}%" in yaml file "plugins/Skript/scripts/Guild/%{公會::%UUID of player%}%.yml"
  216. if {_Player} is online:
  217. set {_uuid} to uuid of {_player}
  218. set {公會::%{_uuid}%} to {公會::%UUID of player%}
  219. set "公會" to "%{公會::%UUID of player%}%" in yaml file "plugins/Skript/scripts/PlayerData/%UUID of {_Player}%/Guild.yml"
  220. if arg-1 is "deny":
  221. if arg-2 is not set:
  222. send "{@Tag} &c請輸入要拒絕申請的玩家ID"
  223. stop
  224. set {_Player} to arg-2
  225. set {_Player} to {_Player} parsed as offlineplayer
  226. remove "%{_Player}%" from yaml list "申請列表" from file "plugins/Skript/scripts/Guild/%{公會::%UUID of player%}%.yml"
  227. set {_MemberList::*} to yaml list "會員" from "plugins/Skript/scripts/Guild/%{公會::%UUID of player%}%.yml"
  228. loop {_MemberList::*}:
  229. set {_Member} to loop-value parsed as offlineplayer
  230. if {_Member} is online:
  231. send "{@Tag} &c公會管理層 &c%player% &c拒絕了 &b%{_Player}% &c的加入申請" to {_Member}
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  239.  
  240. command /guild12 [<text=menu>]:
  241. trigger:
  242. open anvil gui named "&0輸入公會名稱稱" to player with text "在此輸入名稱" and item book with lore "||&7輸入完名稱後||&7點擊右方物品確認||||&c&l確認後將不可反悔"
  243. stop
  244. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  245. set {_Page} to a new text component with "&8&l&m-------&8[公會選單]&8&l&m-------"
  246. add {_Page} to {_alltext::*}
  247. add {_newline} to {_alltext::*}
  248.  
  249.  
  250.  
  251.  
  252. add {_newline} to {_alltext::*}
  253. add {_newline} to {_alltext::*}
  254.  
  255. add {_newline} to {_alltext::*}
  256. add {_newline} to {_alltext::*}
  257.  
  258.  
  259. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  260. set {_Page} to a new text component with "&8 剩餘點數: &5%{Data::%uuid of player%::技能點}%"
  261. add {_Page} to {_alltext::*}
  262. #
  263. set {_Back} to a new text component with "&0&l◀◀◀"
  264. add click event with action RUN_COMMAND with execute "/Menu_Sp1" to text component {_Back}
  265. add hover event with action SHOW_TEXT with text "&6&o上一頁" to text component {_Back}
  266. add {_Back} to {_alltext::*}
  267. #
  268. set {_Page} to a new text component with "&r &r"
  269. add {_Page} to {_alltext::*}
  270. #
  271. set {_Back} to a new text component with "&0&l▶▶▶"
  272. add click event with action RUN_COMMAND with execute "/Menu_Sp2" to text component {_Back}
  273. add hover event with action SHOW_TEXT with text "&6&o下一頁" to text component {_Back}
  274. add {_Back} to {_alltext::*}
  275. #
  276. add text component {_alltext::*} to book {_book}
  277. clear {_alltext::*}
  278. open book {_book} to player
  279. set slot player's current hotbar slot of player to {_I}
Advertisement
Add Comment
Please, Sign In to add comment