henry900326

Untitled

Feb 28th, 2019
841
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 87.92 KB | None | 0 0
  1. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  2. # #Options #設置 # 設定
  3. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  4. Options:
  5. 路徑: "plugins/Skript/scripts/PlayerData/%UUID of player%.yml"
  6. Tag: &7[&b公會系統&7]
  7. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  8. # #Function #函式 #函數
  9. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  10. Function RandomGuildUID() :: integer:
  11. set {_1} to random integer between 0 and 9
  12. set {_2} to random integer between 0 and 9
  13. set {_3} to random integer between 0 and 9
  14. set {_4} to random integer between 0 and 9
  15. set {_5} to random integer between 0 and 9
  16. set {_6} to random integer between 0 and 9
  17. set {_all} to "%{_1}%%{_2}%%{_3}%%{_4}%%{_5}%%{_6}%" parsed as integer
  18. return {_all}
  19. Function GetGuildExpNeed(Lv:integer) :: integer:
  20. if {_LV} is 1:#1-2
  21. set {_ExpNeed} to 50000
  22. if {_LV} is 2:#2-3
  23. set {_ExpNeed} to 200000
  24. if {_LV} is 3:#3-4
  25. set {_ExpNeed} to 500000
  26. if {_LV} is 4:#4-5
  27. set {_ExpNeed} to 1000000
  28. if {_LV} is 5:#5-6
  29. set {_ExpNeed} to 2000000
  30. if {_LV} is 6:#6-7
  31. set {_ExpNeed} to 3500000
  32. if {_LV} is 7:#7-8
  33. set {_ExpNeed} to 5500000
  34. if {_LV} is 8:#8-9
  35. set {_ExpNeed} to 8000000
  36. if {_LV} is 9:#9-10
  37. set {_ExpNeed} to 10000000
  38. return {_ExpNeed}
  39. Function GetGuildLevelNeed(Lv:integer) :: text:
  40. set {_ExpNeed} to GetGuildExpNeed({_LV})
  41. if {_LV} is 1:#1-2
  42. set {_MoneyNeed} to 10000
  43. set {_StarNeed} to 10
  44. set {_MemberNeed} to 10
  45. if {_LV} is 2:#2-3
  46. set {_MoneyNeed} to 25000
  47. set {_StarNeed} to 30
  48. set {_MemberNeed} to 10
  49. if {_LV} is 3:#3-4
  50. set {_MoneyNeed} to 80000
  51. set {_StarNeed} to 75
  52. set {_MemberNeed} to 10
  53. if {_LV} is 4:#4-5
  54. set {_MoneyNeed} to 135000
  55. set {_StarNeed} to 120
  56. set {_MemberNeed} to 20
  57. if {_LV} is 5:#5-6
  58. set {_MoneyNeed} to 200000
  59. set {_StarNeed} to 250
  60. set {_MemberNeed} to 20
  61. if {_LV} is 6:#6-7
  62. set {_MoneyNeed} to 275000
  63. set {_StarNeed} to 400
  64. set {_MemberNeed} to 20
  65. if {_LV} is 7:#7-8
  66. set {_MoneyNeed} to 350000
  67. set {_StarNeed} to 1000
  68. set {_MemberNeed} to 30
  69. if {_LV} is 8:#8-9
  70. set {_MoneyNeed} to 500000
  71. set {_StarNeed} to 2500
  72. set {_MemberNeed} to 30
  73. if {_LV} is 9:#9-10
  74. set {_MoneyNeed} to 600000
  75. set {_StarNeed} to 5000
  76. set {_MemberNeed} to 30
  77. set {_Need} to "%{_LV}%/%{_ExpNeed}%/%{_MoneyNeed}%/%{_StarNeed}%/%{_MemberNeed}%"
  78. return {_Need}
  79. Function GetGuildLevelUpNeedText(Lv:integer, Exp:integer, Money:integer, Star:integer, Member:integer) :: text:
  80. set {_ExpNeed} to GetGuildExpNeed({_LV})
  81. if {_LV} is 1:#1-2
  82. set {_MoneyNeed} to 10000
  83. set {_StarNeed} to 10
  84. set {_MemberNeed} to 10
  85. if {_LV} is 2:#2-3
  86. set {_MoneyNeed} to 25000
  87. set {_StarNeed} to 30
  88. set {_MemberNeed} to 10
  89. if {_LV} is 3:#3-4
  90. set {_MoneyNeed} to 80000
  91. set {_StarNeed} to 75
  92. set {_MemberNeed} to 10
  93. if {_LV} is 4:#4-5
  94. set {_MoneyNeed} to 135000
  95. set {_StarNeed} to 120
  96. set {_MemberNeed} to 20
  97. if {_LV} is 5:#5-6
  98. set {_MoneyNeed} to 200000
  99. set {_StarNeed} to 250
  100. set {_MemberNeed} to 20
  101. if {_LV} is 6:#6-7
  102. set {_MoneyNeed} to 275000
  103. set {_StarNeed} to 400
  104. set {_MemberNeed} to 20
  105. if {_LV} is 7:#7-8
  106. set {_MoneyNeed} to 350000
  107. set {_StarNeed} to 1000
  108. set {_MemberNeed} to 30
  109. if {_LV} is 8:#8-9
  110. set {_MoneyNeed} to 500000
  111. set {_StarNeed} to 2500
  112. set {_MemberNeed} to 30
  113. if {_LV} is 9:#9-10
  114. set {_MoneyNeed} to 600000
  115. set {_StarNeed} to 5000
  116. set {_MemberNeed} to 30
  117. set {_Need} to "&7 - &e公會等級 &f(%{_LV}%&7/&f%{_LV}%&f)%nl%&7 - &e公會經驗 &f(%{_Exp}%&7/&f%{_ExpNeed}%&f)%nl%&7 - &e公會資金 &f(%{_Money}%&7/&f%{_MoneyNeed}%&f)%nl%&7 - &e公會之星 &f(%{_Star}%&7/&f%{_StarNeed}%&f)%nl%&7 - &e公會人數 &f(%{_Member}%&7/&f%{_MemberNeed}%&f)"
  118. return {_Need}
  119. Function NumberToTimespan(Number:number) :: text:
  120. set {_Hour} to floor({_Number}/3600)
  121. set {_Minute} to mod({_Number},3600)
  122. set {_Minute} to floor({_Minute}/60)
  123. set {_Second} to mod({_Number},3600)
  124. set {_Second} to mod({_Second},60)
  125. return "%{_Hour}%時 %{_Minute}%分 %{_Second}%秒"
  126. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  127. # #存取 #讀取 #儲存
  128. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  129. on join:
  130. if {公會系統::%UUID of player%::公會} is set:
  131. set "公會" to "%{公會系統::%UUID of player%::公會}%" in yaml file {@路徑}
  132. set "公會點數" to "%{公會系統::%UUID of player%::點數}%" in yaml file {@路徑}
  133. set "公會任務.編號" to "%{公會系統::%UUID of player%::任務::編號}%" in yaml file {@路徑}
  134. set "公會任務.冷卻" to "%{公會系統::%UUID of player%::任務::冷卻}%" in yaml file {@路徑}
  135. set "公會任務.分類" to "%{公會系統::%UUID of player%::任務::分類}%" in yaml file {@路徑}
  136. set "公會任務.獎勵" to "%{公會系統::%UUID of player%::任務::獎勵}%" in yaml file {@路徑}
  137. set "公會任務.目標" to "%{公會系統::%UUID of player%::任務::目標}%" in yaml file {@路徑}
  138. set "公會懲罰" to "%{公會系統::%UUID of player%::懲罰}%" in yaml file {@路徑}
  139. stop
  140. set {公會系統::%UUID of player%::公會} to single value "公會" get of {@路徑}
  141. set {公會系統::%UUID of player%::點數} to single value "公會點數" get of {@路徑}
  142. set {公會系統::%UUID of player%::任務::編號} to single value "公會任務.編號" get of {@路徑}
  143. set {公會系統::%UUID of player%::任務::冷卻} to single value "公會任務.冷卻" get of {@路徑}
  144. set {公會系統::%UUID of player%::任務::分類} to single value "公會任務.分類" get of {@路徑}
  145. set {公會系統::%UUID of player%::任務::獎勵} to single value "公會任務.獎勵" get of {@路徑}
  146. set {公會系統::%UUID of player%::任務::目標} to single value "公會任務.目標" get of {@路徑}
  147. set {公會系統::%UUID of player%::懲罰} to single value "公會懲罰" get of {@路徑}
  148. on quit:
  149. if {公會系統::%UUID of player%::公會} is set:
  150. set "公會" to "%{公會系統::%UUID of player%::公會}%" in yaml file {@路徑}
  151. set "公會點數" to "%{公會系統::%UUID of player%::點數}%" in yaml file {@路徑}
  152. set "公會任務.編號" to "%{公會系統::%UUID of player%::任務::編號}%" in yaml file {@路徑}
  153. set "公會任務.冷卻" to "%{公會系統::%UUID of player%::任務::冷卻}%" in yaml file {@路徑}
  154. set "公會任務.分類" to "%{公會系統::%UUID of player%::任務::分類}%" in yaml file {@路徑}
  155. set "公會任務.獎勵" to "%{公會系統::%UUID of player%::任務::獎勵}%" in yaml file {@路徑}
  156. set "公會任務.目標" to "%{公會系統::%UUID of player%::任務::目標}%" in yaml file {@路徑}
  157. set "公會懲罰" to "%{公會系統::%UUID of player%::懲罰}%" in yaml file {@路徑}
  158. delete {公會系統::%UUID of player%::*}
  159. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  160. # #NPC #介面限制
  161. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  162. on right click on entity:
  163. if name of clicked entity contains "公會接待員":
  164. make player execute command "/guild"
  165. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  166. # #Command #指令
  167. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  168. command /guild [<text=menu>] [<text>] [<text>]:
  169. aliases: /g
  170. trigger:
  171. if arg-1 is "test":
  172. if name of player is "LeisureAW":
  173. if arg-2 is not set:
  174. set {_Player} to player
  175. set {_Player} to arg-2 parsed as offlineplayer
  176. set {_uuid} to uuid of {_Player}
  177. send "&b%{_Player}% &7/ &6%{公會系統::%{_uuid}%::公會}% &7/ &4%{公會點數::%{_uuid}%}%" to player
  178. stop
  179. if arg-1 is "resetall":
  180. if name of player is "LeisureAW":
  181. delete {公會系統::*}
  182. delete {公會目錄::*}
  183. set {_plugins::*} to files in "plugins/Skript/scripts/PlayerData/"
  184. loop {_plugins::*}:
  185. delete file "plugins/Skript/scripts/PlayerData/%loop-value%"
  186. set {_plugins::*} to files in "plugins/Skript/scripts/Guild/"
  187. loop {_plugins::*}:
  188. delete file "plugins/Skript/scripts/Guild/%loop-value%"
  189. send all players title "&7[&c系統公告&7]" with subtitle "&e公會系統所有資料已重置" for 2 seconds
  190. stop
  191. loop entities in radius 4 around block at location of player:
  192. if name of loop-entity contains "公會接待員":
  193. player's targeted entity is loop-entity
  194. set {_OpenGuildMenu} to 1
  195. stop loop
  196. if {_OpenGuildMenu} is not 1:
  197. stop
  198. if file existance of {@路徑} is false:
  199. create file {@路徑}
  200. set "公會" to "<none>" in yaml file {@路徑}
  201. set "公會點數" to "0" in yaml file {@路徑}
  202. set "公會任務" to "0" in yaml file {@路徑}
  203. set {_公會} to single value "公會" get of {@路徑}
  204. if arg-1 is "menu":
  205. set {_I} to slot player's current hotbar slot of player
  206. set {_book} to a new book
  207. set {_newline} to a new text component with " %nl%"
  208. set {_Page} to a new text component with "&8&l&m-------&8[公會選單]&8&l&m-------"
  209. add {_Page} to {_alltext::*}
  210. if "%{_公會}%" is "<none>":
  211. add {_newline} to {_alltext::*}
  212. add {_newline} to {_alltext::*}
  213. add {_newline} to {_alltext::*}
  214.  
  215. set {_text} to a new text component with "&r "
  216. add {_text} to {_alltext::*}
  217. set {_text} to a new text component with "&8&l[&3創建公會&8&l]"
  218. add click event with action RUN_COMMAND with execute "/guild create" to text component {_text}
  219. add hover event with action SHOW_TEXT with text "&7點此創建公會" to text component {_text}
  220. add {_text} to {_alltext::*}
  221. add {_newline} to {_alltext::*}
  222. add {_newline} to {_alltext::*}
  223. add {_newline} to {_alltext::*}
  224.  
  225. set {_text} to a new text component with "&r "
  226. add {_text} to {_alltext::*}
  227. set {_text} to a new text component with "&8&l[&3公會列表&8&l]"
  228. add click event with action RUN_COMMAND with execute "/guild list" to text component {_text}
  229. add hover event with action SHOW_TEXT with text "&7點此尋找公會" to text component {_text}
  230. add {_text} to {_alltext::*}
  231. add {_newline} to {_alltext::*}
  232. add {_newline} to {_alltext::*}
  233. add {_newline} to {_alltext::*}
  234.  
  235. set {_text} to a new text component with "&r "
  236. add {_text} to {_alltext::*}
  237. set {_text} to a new text component with "&8&l[&3加入公會&8&l]"
  238. add hover event with action SHOW_TEXT with text "&7使用&e/guild apply <公會編號>&7來加入公會" to text component {_text}
  239. add {_text} to {_alltext::*}
  240. add {_newline} to {_alltext::*}
  241. add {_newline} to {_alltext::*}
  242. add {_newline} to {_alltext::*}
  243. set {_Page} to a new text component with "&8&l&m----------------------&r"
  244. add {_Page} to {_alltext::*}
  245.  
  246. add text component {_alltext::*} to book {_book}
  247. open book {_book} to player
  248. set slot player's current hotbar slot of player to {_I}
  249. stop
  250. else if "%{_公會}%" is not "<none>":
  251. set {_會長} to single value "會長" get of "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  252. set {_公會人數} to single value "公會人數" get of "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  253. set {_公會等級} to single value "公會等級" get of "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  254. set {_公會經驗} to single value "公會經驗" get of "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  255. set {_公會資金} to single value "公會資金" get of "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  256. set {_公會之星} to single value "公會之星" get of "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  257. set {_公會編號} to single value "公會編號" get of "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  258. set {_領地座標} to single value "領地座標" get of "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  259. set {_公會人數} to {_公會人數} parsed as number
  260. set {_公會等級} to {_公會等級} parsed as number
  261. set {_公會經驗} to {_公會經驗} parsed as number
  262. set {_公會資金} to {_公會資金} parsed as number
  263. set {_公會之星} to {_公會之星} parsed as number
  264. set {_公會編號} to {_公會編號} parsed as number
  265.  
  266. add {_newline} to {_alltext::*}
  267.  
  268. set {_text} to a new text component with "&4 ✧ 公會名稱&8:&r &0%{公會系統::%UUID of player%::公會}%"
  269. add {_text} to {_alltext::*}
  270. add {_newline} to {_alltext::*}
  271. #
  272. set {_text} to a new text component with "&4 ✧ 公會編號&8:&r &0%{_公會編號}%"
  273. add {_text} to {_alltext::*}
  274. add {_newline} to {_alltext::*}
  275. #
  276. set {_text} to a new text component with "&4 ✧ 公會人數&8:&r &0%{_公會人數}%"
  277. add {_text} to {_alltext::*}
  278. add {_newline} to {_alltext::*}
  279. #
  280. set {_text} to a new text component with "&4 ✧ 公會等級&8:&r &0%{_公會等級}% "
  281. add {_text} to {_alltext::*}
  282. if {_公會經驗} >= GetGuildExpNeed({_公會等級}):
  283. set {_text} to a new text component with "&3[升級&3&l▲&3]"
  284. add click event with action RUN_COMMAND with execute "/guild levelup" to text component {_text}
  285. add hover event with action SHOW_TEXT with text "&f✧ &6公會經驗值已滿 &f✧%nl%%nl%&a公會升級需求&7:%nl%%GetGuildLevelUpNeedText({_公會等級},{_公會經驗},{_公會資金},{_公會之星},{_公會人數})%%nl%%nl%&c達成指定條件後%nl%點此即可升級公會" to text component {_text}
  286. else:
  287. set {_max} to {_公會經驗}/GetGuildExpNeed({_公會等級})*35
  288. set {_max} to round({_max})
  289. set {_need} to 35-{_max}
  290. if {_max} > 0:
  291. loop {_max} times:
  292. add "&3|" to {_exp_line::*}
  293. if {_need} > 0:
  294. loop {_need} times:
  295. add "&7|" to {_exp_line::*}
  296. set {_exp_line} to "%{_exp_line::*}%"
  297. replace all ",", "and" and " " with "" in {_exp_line}
  298. set {_text} to a new text component with "&3[%{_exp_line}%&3]"
  299. add hover event with action SHOW_TEXT with text "&3&l%{_公會經驗}/GetGuildExpNeed({_公會等級})*100%%%&r &f(&f&o%{_公會經驗}%/%GetGuildExpNeed({_公會等級})%&f)" to text component {_text}
  300. add {_text} to {_alltext::*}
  301. add {_newline} to {_alltext::*}
  302. #
  303. set {_text} to a new text component with "&4 ✧ 公會資金&8:&r ☪&0%{_公會資金}% "
  304. add {_text} to {_alltext::*}
  305. set {_text} to a new text component with "&7<&2&l+&7>"
  306. add click event with action RUN_COMMAND with execute "/guild donate" to text component {_text}
  307. add hover event with action SHOW_TEXT with text "&6捐獻資金" to text component {_text}
  308. add {_text} to {_alltext::*}
  309. add {_newline} to {_alltext::*}
  310. #
  311. set {_text} to a new text component with "&4 ✧ 公會之星&8:&r &0%{_公會之星}%"
  312. add {_text} to {_alltext::*}
  313. add {_newline} to {_alltext::*}
  314. add {_newline} to {_alltext::*}
  315. #
  316. set {_Page} to a new text component with "&8&l&m----------------------&r"
  317. add {_Page} to {_alltext::*}
  318. add {_newline} to {_alltext::*}
  319. #
  320. set {_text} to a new text component with "&r "
  321. add {_text} to {_alltext::*}
  322. set {_text} to a new text component with "&8||&3會員列表&8||"
  323. add click event with action RUN_COMMAND with execute "/guild memberlist" to text component {_text}
  324. add hover event with action SHOW_TEXT with text "&e點此查看會員資料" to text component {_text}
  325. add {_text} to {_alltext::*}
  326. set {_text} to a new text component with "&r "
  327. add {_text} to {_alltext::*}
  328. set {_text} to a new text component with "&8||&5申請名單&8||"
  329. add click event with action RUN_COMMAND with execute "/guild applylist" to text component {_text}
  330. add hover event with action SHOW_TEXT with text "&e點此查看申請名單%nl%&7&o只有公會管理員能使用該功能" to text component {_text}
  331. add {_text} to {_alltext::*}
  332. add {_newline} to {_alltext::*}
  333. #
  334. set {_text} to a new text component with "&r "
  335. add {_text} to {_alltext::*}
  336. set {_text} to a new text component with "&8||&2公會領地&8||"
  337. add click event with action RUN_COMMAND with execute "/guild domain" to text component {_text}
  338. add hover event with action SHOW_TEXT with text "&e點此查看領地相關資訊" to text component {_text}
  339. add {_text} to {_alltext::*}
  340. set {_text} to a new text component with "&r "
  341. add {_text} to {_alltext::*}
  342. set {_text} to a new text component with "&8||&1公會任務&8||"
  343. add click event with action RUN_COMMAND with execute "/guild quest" to text component {_text}
  344. add hover event with action SHOW_TEXT with text "&e點此查看公會任務" to text component {_text}
  345. add {_text} to {_alltext::*}
  346. add {_newline} to {_alltext::*}
  347. #
  348. set {_text} to a new text component with "&r "
  349. add {_text} to {_alltext::*}
  350. set {_text} to a new text component with "&8||&6公會列表&8||"
  351. add click event with action RUN_COMMAND with execute "/guild list" to text component {_text}
  352. add hover event with action SHOW_TEXT with text "&e點此查看會員資料" to text component {_text}
  353. add {_text} to {_alltext::*}
  354. set {_text} to a new text component with "&r "
  355. add {_text} to {_alltext::*}
  356. #
  357. set {_會長} to yaml value "會長" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  358. if "%player%" is "%{_會長}%":
  359. set {_text} to a new text component with "&8||&4解散公會&8||"
  360. add click event with action RUN_COMMAND with execute "/guild disband" to text component {_text}
  361. add hover event with action SHOW_TEXT with text "&e點此解散公會%nl%&c&o注意! 解散後將無法反悔%nl%&c&o所有成員將退出且資源無法返還" to text component {_text}
  362. add {_text} to {_alltext::*}
  363. else:
  364. set {_text} to a new text component with "&8||&4離開公會&8||"
  365. add click event with action RUN_COMMAND with execute "/guild leave" to text component {_text}
  366. add hover event with action SHOW_TEXT with text "&e點此離開公會%nl%&c&o注意! 離開後將無法返回%nl%&c&o需再次受到批准才可加入" to text component {_text}
  367. add {_text} to {_alltext::*}
  368. add {_newline} to {_alltext::*}
  369.  
  370. #
  371. set {_Page} to a new text component with "&8&l&m----------------------&r"
  372. add {_Page} to {_alltext::*}
  373. add text component {_alltext::*} to book {_book}
  374. open book {_book} to player
  375. set slot player's current hotbar slot of player to {_I}
  376. stop
  377. stop
  378. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  379. # #Create #創建
  380. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  381. if arg-1 is "create":
  382. if {公會系統::%uuid of player%::懲罰} is set:
  383. set {_冷卻} to "%difference between {公會系統::%uuid of player%::懲罰} and now%" parsed as timespan
  384. set {_冷卻} to {_冷卻} converted to seconds
  385. if {_冷卻} < 86400:
  386. set {_Time} to NumberToTimespan(86400-{_冷卻})
  387. send "{@Tag} &c由於退出/解散公會的懲罰 你暫時無法加入公會"
  388. send "{@Tag} &c你可以於 &f%{_Time}% &c後再次加入或創建公會"
  389. stop
  390. delete {公會系統::%uuid of player%::懲罰}
  391. if money of player < 1000000:
  392. send "{@Tag} &c尼歐不足 需要100萬尼歐" to player
  393. stop
  394. set {_Name} to arg-2
  395. if "%{_Name}%" contains " ":
  396. send "{@Tag} &c公會名稱稱不能有空格" to player
  397. stop
  398. if "%{公會系統::%UUID of player%::公會}%" is not "<none>":
  399. send "{@Tag} &c你已經在一個公會裡面" to player
  400. stop
  401. set {_Guild} to yaml value "公會" from {@路徑}
  402. if "%{_Guild}%" is not "<none>":
  403. send "{@Tag} &c你已經在一個公會裡面" to player
  404. stop
  405. if arg-2 is not set:
  406. send "{@Tag} &e輸入 &6/guild create <公會名稱> &e來創建公會" to player
  407. stop
  408. loop {公會目錄::*}:
  409. if "%{_Name}%" is "%loop-value%":
  410. send "{@Tag} &c這個公會名稱已被使用過"
  411. stop
  412. set {_UID} to RandomGuildUID()
  413. loop {公會目錄::*}:
  414. if loop-index = "%RandomGuildUID()%":
  415. send "{@Tag} &c創建過程發生錯誤 請重新創建"
  416. send "{@Tag} &c若你認為這訊息有誤 請至伺服器DC回報問題"
  417. stop
  418. set {_名稱長度} to length of {_Name}
  419. if {_名稱長度} > 10:
  420. send "{@Tag} &c公會名稱過長 最多輸入10個字元"
  421. stop
  422. send "{@Tag} &6公會建立成功" to player
  423. create file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  424. set "會長" to "%player%" in yaml file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  425. add "<none>" to yaml list "副會長" from file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  426. remove "<none>" from yaml list "副會長" from file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  427. add "%player%" to yaml list "會員" from file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  428. set "公會人數" to "1" in yaml file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  429. set "公會等級" to "1" in yaml file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  430. set "公會經驗" to "0" in yaml file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  431. set "公會資金" to "0" in yaml file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  432. set "公會之星" to "0" in yaml file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  433. set "公會編號" to "%{_UID}%" in yaml file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  434. set "領地座標" to "<none>" in yaml file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  435. set "領地傳點" to "<none>" in yaml file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  436. add "<none>" to yaml list "申請列表" from file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  437. remove "<none>" from yaml list "申請列表" from file "plugins/Skript/scripts/Guild/%{_Name}%.yml"
  438. set {公會系統::%UUID of player%::公會} to "%{_Name}%"
  439. set "公會" to "%{公會系統::%UUID of player%::公會}%" in yaml file {@路徑}
  440. set {公會目錄::%{_UID}%} to "%{_Name}%"
  441. remove 1000000 from player's money
  442. stop
  443. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  444. # #List #列表
  445. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  446. if arg-1 is "list":
  447. set {_I} to slot player's current hotbar slot of player
  448. set {_book} to a new book
  449. set {_newline} to a new text component with " %nl%"
  450. set {_Amount} to amount of {公會目錄::*}
  451. if {_Amount} is 0:
  452. set {_Page} to a new text component with "&8&l&m-------&8[公會列表]&8&l&m-------"
  453. add {_Page} to {_alltext::*}
  454. add {_newline} to {_alltext::*}
  455. loop 10 times:
  456. set {_text} to a new text component with "&8 - &r"
  457. add {_text} to {_alltext::*}
  458. add {_newline} to {_alltext::*}
  459. add {_newline} to {_alltext::*}
  460. set {_Page} to a new text component with "&8&l&m----------------------&r"
  461. add {_Page} to {_alltext::*}
  462. add text component {_alltext::*} to book {_book}
  463. open book {_book} to player
  464. set slot player's current hotbar slot of player to {_I}
  465. stop
  466. set {_PageAmount} to ceil({_Amount}/10)
  467. set {_Remainder} to mod({_Amount},10)
  468. if {_Remainder} is not 0:
  469. set {_Remainder} to 10-{_Remainder}
  470. loop {公會目錄::*}:
  471. set {_公會目錄::%loop-index%} to loop-value
  472. loop {_PageAmount} times:
  473. set {_Page} to a new text component with "&8&l&m-------&8[公會列表]&8&l&m-------"
  474. add {_Page} to {_alltext::*}
  475. add {_newline} to {_alltext::*}
  476. loop 10 times:
  477. loop {_公會目錄::*}:
  478. set {_text} to a new text component with "&8 - &4%loop-value-3%"
  479. set {_公會等級} to single value "公會等級" get of "plugins/Skript/scripts/Guild/%loop-value-3%.yml"
  480. if "%{公會系統::%UUID of player%::公會}%" is not "<none>":
  481. add hover event with action SHOW_TEXT with text "&e公會名稱&7: &r%loop-value-3%%nl%&e公會編號&7: &f%loop-index%%nl%&e公會等級&7: &f%{_公會等級}%" to text component {_text}
  482. else:
  483. add hover event with action SHOW_TEXT with text "&e公會名稱&7: &r%loop-value-3%%nl%&e公會編號&7: &f%loop-index%%nl%&e公會等級&7: &f%{_公會等級}%%nl%%nl%&7[&a申請加入&7]" to text component {_text}
  484. add click event with action RUN_COMMAND with execute "/guild apply %loop-index%" to text component {_text}
  485. add {_text} to {_alltext::*}
  486. add {_newline} to {_alltext::*}
  487. remove loop-value-3 from {_公會目錄::*}
  488. stop loop
  489. if {_PageAmount} is loop-number-1:
  490. loop {_Remainder} times:
  491. set {_text} to a new text component with "&8 - &r"
  492. add {_text} to {_alltext::*}
  493. add {_newline} to {_alltext::*}
  494. add {_newline} to {_alltext::*}
  495. set {_Page} to a new text component with "&8&l&m----------------------&r"
  496. add {_Page} to {_alltext::*}
  497. add text component {_alltext::*} to book {_book}
  498. clear {_alltext::*}
  499. open book {_book} to player
  500. set slot player's current hotbar slot of player to {_I}
  501. stop
  502. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  503. # #Apply #申請 #申請加入
  504. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  505. if arg-1 is "apply":
  506. if {公會系統::%uuid of player%::懲罰} is set:
  507. set {_冷卻} to "%difference between {公會系統::%uuid of player%::懲罰} and now%" parsed as timespan
  508. set {_冷卻} to {_冷卻} converted to seconds
  509. if {_冷卻} < 86400:
  510. set {_Time} to NumberToTimespan(86400-{_冷卻})
  511. send "{@Tag} &c由於退出/解散公會的懲罰 你暫時無法加入公會"
  512. send "{@Tag} &c你可以於 &f%{_Time}% &c後再次加入或創建公會"
  513. stop
  514. delete {公會系統::%uuid of player%::懲罰}
  515. if arg-2 is not set:
  516. send "{@Tag} &c請輸入要申請的公會編號"
  517. stop
  518. set {_GuildUID} to arg-2
  519. set {_Guild} to {公會目錄::%{_GuildUID}%}
  520. set {_會長} to yaml value "會長" from "plugins/Skript/scripts/Guild/%{_Guild}%.yml"
  521. set {_會長} to {_會長} parsed as offlineplayer
  522. set {_副會長::*} to yaml list "副會長" from "plugins/Skript/scripts/Guild/%{_Guild}%.yml"
  523. loop {_副會長::*}:
  524. set {_副會長::%loop-index%} to {_副會長::%loop-index%} parsed as offlineplayer
  525. set {_申請列表::*} to yaml list "申請列表" from "plugins/Skript/scripts/Guild/%{_Guild}%.yml"
  526. loop {_申請列表::*}:
  527. set {_申請玩家} to loop-value parsed as player
  528. if "%player%" is "%{_申請玩家}%":
  529. send "{@Tag} &c你已經發送過申請 請不要重複發送" to player
  530. stop
  531. send "{@Tag} &a你的公會有新的申請名單" to {_會長} and {_副會長::*}
  532. send "{@Tag} &a成功發送申請 請耐心等待回覆" to player
  533. add "%player%" to yaml list "申請列表" from file "plugins/Skript/scripts/Guild/%{_Guild}%.yml"
  534. stop
  535. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  536. # #ApplyList #申請名單 #申請列表
  537. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  538. if arg-1 is "applyList":
  539. if "%{公會系統::%UUID of player%::公會}%" is not "<none>":
  540. set {_會長} to yaml value "會長" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  541. if "%player%" is "%{_會長}%":
  542. set {_pass} to 1
  543. set {_副會長::*} to yaml list "副會長" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  544. loop {_副會長::*}:
  545. if "%player%" is "%loop-value%":
  546. set {_pass} to 1
  547. stop loop
  548. if {_pass} is not 1:
  549. send "{@Tag} &c權限不足無法使用該功能"
  550. stop
  551. set {_I} to slot player's current hotbar slot of player
  552. set {_book} to a new book
  553. set {_newline} to a new text component with " %nl%"
  554. set {_申請列表::*} to yaml list "申請列表" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  555. set {_Amount} to amount of {_申請列表::*}
  556. if {_Amount} is 0:
  557. set {_Page} to a new text component with "&8&l&m-------&8[申請名單]&8&l&m-------"
  558. add {_Page} to {_alltext::*}
  559. add {_newline} to {_alltext::*}
  560. loop 10 times:
  561. set {_text} to a new text component with "&8 - &r"
  562. add {_text} to {_alltext::*}
  563. add {_newline} to {_alltext::*}
  564. add {_newline} to {_alltext::*}
  565. set {_Page} to a new text component with "&8&l&m----------------------&r"
  566. add {_Page} to {_alltext::*}
  567. add text component {_alltext::*} to book {_book}
  568. open book {_book} to player
  569. set slot player's current hotbar slot of player to {_I}
  570. stop
  571. set {_PageAmount} to ceil({_Amount}/10)
  572. set {_Remainder} to mod({_Amount},10)
  573. if {_Remainder} is not 0:
  574. set {_Remainder} to 10-{_Remainder}
  575. loop {_PageAmount} times:
  576. set {_Page} to a new text component with "&8&l&m-------&8[申請名單]&8&l&m-------"
  577. add {_Page} to {_alltext::*}
  578. add {_newline} to {_alltext::*}
  579. loop 10 times:
  580. loop {_申請列表::*}:
  581. set {_text} to a new text component with " &8%loop-value-3% "
  582. add {_text} to {_alltext::*}
  583. set {_text} to a new text component with "&2[批准]"
  584. add hover event with action SHOW_TEXT with text "&a批准 &b%loop-value-3% &a加入公會" to text component {_text}
  585. add click event with action RUN_COMMAND with execute "/guild accept %loop-value-3%" to text component {_text}
  586. add {_text} to {_alltext::*}
  587. set {_text} to a new text component with " "
  588. add {_text} to {_alltext::*}
  589. set {_text} to a new text component with "&4[拒絕]"
  590. add hover event with action SHOW_TEXT with text "&c拒絕 &b%loop-value-3% &c加入公會" to text component {_text}
  591. add click event with action RUN_COMMAND with execute "/guild deny %loop-value-3%" to text component {_text}
  592. add {_text} to {_alltext::*}
  593. add {_newline} to {_alltext::*}
  594. remove loop-value-3 from {_申請列表::*}
  595. stop loop
  596. if {_PageAmount} is loop-number-1:
  597. loop {_Remainder} times:
  598. set {_text} to a new text component with "&8 - &r"
  599. add {_text} to {_alltext::*}
  600. add {_newline} to {_alltext::*}
  601. add {_newline} to {_alltext::*}
  602. set {_Page} to a new text component with "&8&l&m----------------------&r"
  603. add {_Page} to {_alltext::*}
  604. add text component {_alltext::*} to book {_book}
  605. clear {_alltext::*}
  606. open book {_book} to player
  607. set slot player's current hotbar slot of player to {_I}
  608. stop
  609. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  610. # #Accept #批准
  611. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  612. if arg-1 is "accept":
  613. if "%{公會系統::%UUID of player%::公會}%" is not "<none>":
  614. set {_會長} to yaml value "會長" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  615. if "%player%" is "%{_會長}%":
  616. set {_pass} to 1
  617. set {_副會長::*} to yaml list "副會長" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  618. loop {_副會長::*}:
  619. if "%player%" is "%loop-value%":
  620. set {_pass} to 1
  621. stop loop
  622. if {_pass} is not 1:
  623. send "{@Tag} &c權限不足無法使用該功能"
  624. stop
  625. if arg-2 is not set:
  626. send "{@Tag} &c請輸入要批准申請的玩家ID"
  627. stop
  628. set {_Player} to arg-2
  629. set {_Player} to {_Player} parsed as offlineplayer
  630. set {_PlayerGuild} to single value "公會" get of "plugins/Skript/scripts/PlayerData/%UUID of {_Player}%.yml"
  631. if "%{_PlayerGuild}%" is not "<none>":
  632. remove "%{_Player}%" from yaml list "申請列表" from file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  633. send "{@Tag} &c該玩家已經擁有公會了" to player
  634. stop
  635. set {_MemberList::*} to yaml list "會員" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  636. loop {_MemberList::*}:
  637. set {_Member} to loop-value parsed as offlineplayer
  638. if {_Member} is online:
  639. send "{@Tag} &a公會管理層 &6%player% &a批准了 &b%{_Player}% &a的加入申請" to {_Member}
  640. send "{@Tag} &a公會 &e%{公會系統::%UUID of player%::公會}% &a批准你加入了他們的公會" to {_Player}
  641. remove "%{_Player}%" from yaml list "申請列表" from file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  642. add "%{_Player}%" to yaml list "會員" from file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  643. set {_公會人數} to yaml value "公會人數" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  644. set {_公會人數} to {_公會人數} parsed as integer
  645. add 1 to {_公會人數}
  646. set "公會人數" to "%{_公會人數}%" in yaml file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  647. if {_Player} is online:
  648. set {_uuid} to uuid of {_Player}
  649. set {公會系統::%{_uuid}%::公會} to {公會系統::%UUID of player%::公會}
  650. set "公會" to "%{公會系統::%UUID of player%::公會}%" in yaml file "plugins/Skript/scripts/PlayerData/%UUID of {_Player}%.yml"
  651. wait 1 tick
  652. make player execute command "/guild applyList"
  653. stop
  654. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  655. # #Deny #拒絕
  656. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  657. if arg-1 is "deny":
  658. if "%{公會系統::%UUID of player%::公會}%" is not "<none>":
  659. set {_會長} to yaml value "會長" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  660. if "%player%" is "%{_會長}%":
  661. set {_pass} to 1
  662. set {_副會長::*} to yaml list "申請列表" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  663. loop {_副會長::*}:
  664. if "%player%" is "%loop-value%":
  665. set {_pass} to 1
  666. stop loop
  667. if {_pass} is not 1:
  668. send "{@Tag} &c權限不足無法使用該功能"
  669. stop
  670. if arg-2 is not set:
  671. send "{@Tag} &c請輸入要拒絕申請的玩家ID"
  672. stop
  673. set {_Player} to arg-2
  674. set {_Player} to {_Player} parsed as offlineplayer
  675. remove "%{_Player}%" from yaml list "申請列表" from file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  676. set {_MemberList::*} to yaml list "會員" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  677. loop {_MemberList::*}:
  678. set {_Member} to loop-value parsed as offlineplayer
  679. if {_Member} is online:
  680. send "{@Tag} &c公會管理層 &6%player% &c拒絕了 &b%{_Player}% &c的加入申請" to {_Member}
  681. wait 1 tick
  682. make player execute command "/guild applyList"
  683. stop
  684. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  685. # #MemberList #Member #會員列表 #會員
  686. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  687. if arg-1 is "memberlist":
  688. if "%{公會系統::%UUID of player%::公會}%" is not "<none>":
  689. set {_會長} to yaml value "會長" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  690. if "%player%" is "%{_會長}%":
  691. set {_pass} to 1
  692. set {_副會長::*} to yaml list "副會長" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  693. loop {_副會長::*}:
  694. if "%player%" is "%loop-value%":
  695. set {_pass} to 1
  696. stop loop
  697. set {_I} to slot player's current hotbar slot of player
  698. set {_book} to a new book
  699. set {_newline} to a new text component with " %nl%"
  700. set {_會員::*} to yaml list "會員" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  701. set {_MasterAmount} to 1
  702. set {_AdminAmount} to amount of {_副會長::*}
  703. set {_Amount} to amount of {_會員::*}
  704. remove {_會長} from {_會員::*}
  705. remove {_副會長::*} from {_會員::*}
  706. set {_PageAmount} to ceil({_Amount}/10)
  707. set {_Remainder} to mod({_Amount},10)
  708. if {_Remainder} is not 0:
  709. set {_Remainder} to 10-{_Remainder}
  710. loop {_PageAmount} times:
  711. set {_Page} to a new text component with "&8&l&m-------&8[會員資料]&8&l&m-------"
  712. add {_Page} to {_alltext::*}
  713. add {_newline} to {_alltext::*}
  714. if loop-number-1 is 1:
  715. set {_text} to a new text component with " &4<公會長> %{_會長}%"
  716. add {_text} to {_alltext::*}
  717. add {_newline} to {_alltext::*}
  718. loop {_AdminAmount} times:
  719. loop {_副會長::*}:
  720. set {_text} to a new text component with " &6<副會長> &8%loop-value-3% "
  721. add {_text} to {_alltext::*}
  722. if {_pass} is 1:
  723. set {_text} to a new text component with "&2[管理]"
  724. add hover event with action SHOW_TEXT with text "&7改動 &e%loop-value-3% &7的權限" to text component {_text}
  725. add click event with action RUN_COMMAND with execute "/guild permission %loop-value-3%" to text component {_text}
  726. add {_text} to {_alltext::*}
  727. add {_newline} to {_alltext::*}
  728. remove loop-value-3 from {_副會長::*}
  729. stop loop
  730. set {_Times} to 10-({_MasterAmount}+{_AdminAmount})
  731. loop {_Times} times:
  732. loop {_會員::*}:
  733. set {_text} to a new text component with " &3<會員> &8%loop-value-3% "
  734. add {_text} to {_alltext::*}
  735. if {_pass} is 1:
  736. set {_text} to a new text component with "&2[管理]"
  737. add hover event with action SHOW_TEXT with text "&7改動 &e%loop-value-3% &7的權限" to text component {_text}
  738. add click event with action RUN_COMMAND with execute "/guild permission %loop-value-3%" to text component {_text}
  739. add {_text} to {_alltext::*}
  740. add {_newline} to {_alltext::*}
  741. remove loop-value-3 from {_會員::*}
  742. stop loop
  743. if {_PageAmount} is loop-number-1:
  744. loop {_Remainder} times:
  745. set {_text} to a new text component with "&8 - &r"
  746. add {_text} to {_alltext::*}
  747. add {_newline} to {_alltext::*}
  748. set {_MasterAmount} to 0
  749. set {_AdminAmount} to 0
  750. add {_newline} to {_alltext::*}
  751. set {_Page} to a new text component with "&8&l&m----------------------&r"
  752. add {_Page} to {_alltext::*}
  753. add text component {_alltext::*} to book {_book}
  754. clear {_alltext::*}
  755. open book {_book} to player
  756. set slot player's current hotbar slot of player to {_I}
  757. stop
  758. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  759. # #Permission #權限
  760. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  761. if arg-1 is "permission":
  762. if "%{公會系統::%UUID of player%::公會}%" is not "<none>":
  763. set {_會長} to yaml value "會長" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  764. if "%player%" is "%{_會長}%":
  765. set {_pass} to 1
  766. set {_副會長::*} to yaml list "副會長" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  767. loop {_副會長::*}:
  768. if "%player%" is "%loop-value%":
  769. set {_pass} to 1
  770. stop loop
  771. if {_pass} is not 1:
  772. send "{@Tag} &c權限不足無法使用該功能"
  773. stop
  774. if arg-2 is not set:
  775. send "{@Tag} &c請輸入要修改權限的會員"
  776. stop
  777. set {_Player} to arg-2 parsed as offlineplayer
  778. if arg-3 is set:
  779. if arg-3 is "3":
  780. if "%player%" is "%{_會長}%":
  781. loop {_副會長::*}:
  782. if "%{_Player}%" is "%loop-value%":
  783. set {_pass2} to 1
  784. stop loop
  785. if {_pass2} is 1:
  786. set "會長" to "%{_Player}%" in yaml file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  787. add "%player%" to yaml list "副會長" from file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  788. remove "%{_Player}%" from yaml list "副會長" from file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  789. send "{@Tag} &a轉讓成功 現在 &b%{_Player}% &a是公會長" to player
  790. set {_MemberList::*} to yaml list "會員" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  791. loop {_MemberList::*}:
  792. set {_Member} to loop-value parsed as offlineplayer
  793. if {_Member} is online:
  794. send "{@Tag} &c公會長由 &6%player% &c轉讓給了 &b%{_Player}%" to {_Member}
  795. stop
  796. else:
  797. send "{@Tag} &c對象必須是副會長才能轉讓"
  798. stop
  799. else:
  800. send "{@Tag} &c權限不足無法使用該功能"
  801. stop
  802. stop
  803. if arg-3 is "2":
  804. if "%player%" is "%{_會長}%":
  805. loop {_副會長::*}:
  806. if "%{_Player}%" is "%loop-value%":
  807. send "{@Tag} &c對象已經是副會長"
  808. stop
  809. set {_Amount} to amount of {_副會長::*}
  810. if {_Amount} = 5:
  811. send "{@Tag} &c副會長最大上限5人已滿"
  812. stop
  813. add "%{_Player}%" to yaml list "副會長" from file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  814. set {_MemberList::*} to yaml list "會員" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  815. loop {_MemberList::*}:
  816. set {_Member} to loop-value parsed as offlineplayer
  817. if {_Member} is online:
  818. send "{@Tag} &a公會長 &6%player% &a任命 &b%{_Player}% &a為副會長" to {_Member}
  819. else:
  820. send "{@Tag} &c權限不足無法使用該功能"
  821. stop
  822. stop
  823. if arg-3 is "1":
  824. if "%player%" is "%{_會長}%":
  825. loop {_副會長::*}:
  826. if "%{_Player}%" is "%loop-value%":
  827. set {_pass2} to 1
  828. stop loop
  829. if {_pass2} is 1:
  830. remove "%{_Player}%" from yaml list "副會長" from file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  831. set {_MemberList::*} to yaml list "會員" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  832. loop {_MemberList::*}:
  833. set {_Member} to loop-value parsed as offlineplayer
  834. if {_Member} is online:
  835. send "{@Tag} &c公會長 &6%player% &c將 &b%{_Player}% &c降級為會員" to {_Member}
  836. else:
  837. send "{@Tag} &c對象已經是會員"
  838. stop
  839. else:
  840. send "{@Tag} &c權限不足無法使用該功能"
  841. stop
  842. stop
  843. else:
  844. make player execute command "/guild permission %{_Player}%"
  845. stop
  846. if arg-3 is not set:
  847. set {_I} to slot player's current hotbar slot of player
  848. set {_book} to a new book
  849. set {_newline} to a new text component with " %nl%"
  850. set {_Page} to a new text component with "&8&l&m-------&8[更改權限]&8&l&m-------"
  851. add {_Page} to {_alltext::*}
  852. add {_newline} to {_alltext::*}
  853. add {_newline} to {_alltext::*}
  854. set {_text} to a new text component with "&r %{_Player}%"
  855. add {_text} to {_alltext::*}
  856. add {_newline} to {_alltext::*}
  857. add {_newline} to {_alltext::*}
  858. #
  859. set {_text} to a new text component with "&r "
  860. add {_text} to {_alltext::*}
  861. set {_text} to a new text component with "&8&l[&4轉讓公會長&8&l]"
  862. add hover event with action SHOW_TEXT with text "&7將 &e%{_Player}% &7的權限%nl%&7更改為 &4公會長%nl%%nl%&c注意! 更改後你將降級為副會長" to text component {_text}
  863. add click event with action RUN_COMMAND with execute "/guild permission %{_Player}% 3" to text component {_text}
  864. add {_text} to {_alltext::*}
  865. add {_newline} to {_alltext::*}
  866. add {_newline} to {_alltext::*}
  867. #
  868. set {_text} to a new text component with "&r "
  869. add {_text} to {_alltext::*}
  870. set {_text} to a new text component with "&8&l[&6晉升為副會長&8&l]"
  871. add hover event with action SHOW_TEXT with text "&7將 &e%{_Player}% &7的權限%nl%&7更改為 &6副會長" to text component {_text}
  872. add click event with action RUN_COMMAND with execute "/guild permission %{_Player}% 2" to text component {_text}
  873. add {_text} to {_alltext::*}
  874. add {_newline} to {_alltext::*}
  875. add {_newline} to {_alltext::*}
  876. #
  877. set {_text} to a new text component with "&r "
  878. add {_text} to {_alltext::*}
  879. set {_text} to a new text component with "&8&l[&3降級為會員&8&l]"
  880. add hover event with action SHOW_TEXT with text "&7將 &e%{_Player}% &7的權限%nl%&7更改為 &3會員" to text component {_text}
  881. add click event with action RUN_COMMAND with execute "/guild permission %{_Player}% 1" to text component {_text}
  882. add {_text} to {_alltext::*}
  883. add {_newline} to {_alltext::*}
  884. add {_newline} to {_alltext::*}
  885. #
  886. set {_text} to a new text component with "&r "
  887. add {_text} to {_alltext::*}
  888. set {_text} to a new text component with "&8&l[&0踢出公會&8&l]"
  889. add hover event with action SHOW_TEXT with text "&7將 &e%{_Player}% &7踢出公會%nl%%nl%&c注意! 踢出後將無法反悔%nl%必續重新完成申請手續才可返回" to text component {_text}
  890. add click event with action RUN_COMMAND with execute "/guild kick %{_Player}%" to text component {_text}
  891. add {_text} to {_alltext::*}
  892. add {_newline} to {_alltext::*}
  893. add {_newline} to {_alltext::*}
  894. #
  895. set {_Page} to a new text component with "&8&l&m----------------------&r"
  896. add {_Page} to {_alltext::*}
  897. add text component {_alltext::*} to book {_book}
  898. clear {_alltext::*}
  899. open book {_book} to player
  900. set slot player's current hotbar slot of player to {_I}
  901. stop
  902. stop
  903. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  904. # #Kick #踢出
  905. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  906. if arg-1 is "kick":
  907. if "%{公會系統::%UUID of player%::公會}%" is not "<none>":
  908. set {_會長} to yaml value "會長" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  909. if "%player%" is "%{_會長}%":
  910. set {_pass} to 1
  911. set {_副會長::*} to yaml list "副會長" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  912. loop {_副會長::*}:
  913. if "%player%" is "%loop-value%":
  914. set {_pass} to 1
  915. stop loop
  916. if {_pass} is not 1:
  917. send "{@Tag} &c權限不足無法使用該功能"
  918. stop
  919. if arg-2 is not set:
  920. send "{@Tag} &c請輸入要踢出公會的會員"
  921. stop
  922. set {_Player} to arg-2 parsed as offlineplayer
  923. set "公會" to "<none>" in yaml file "plugins/Skript/scripts/PlayerData/%UUID of {_Player}%.yml"
  924. set {_uuid} to uuid of {_Player}
  925. delete {公會系統::%{_uuid}%::公會}
  926. send "{@Tag} &c你已被公會 &6%{公會系統::%UUID of player%::公會}% &c踢出" to {_Player}
  927. set {_公會人數} to yaml value "公會人數" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  928. set {_公會人數} to {_公會人數} parsed as integer
  929. remove 1 from {_公會人數}
  930. set "公會人數" to "%{_公會人數}%" in yaml file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  931. remove "%{_Player}%" from yaml list "會員" from file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  932. remove "%{_Player}%" from yaml list "副會長" from file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  933. set {_MemberList::*} to yaml list "會員" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  934. loop {_MemberList::*}:
  935. set {_Member} to loop-value parsed as offlineplayer
  936. if {_Member} is online:
  937. send "{@Tag} &c公會管理員 &6%player% &c將 &b%{_Player}% &c踢出公會" to {_Member}
  938. wait 1 tick
  939. make player execute command "/guild memberlist"
  940. stop
  941. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  942. # #Leave #退出 #離開
  943. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  944. if arg-1 is "leave":
  945. if "%{公會系統::%UUID of player%::公會}%" is not "<none>":
  946. set {_會長} to yaml value "會長" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  947. if "%player%" is "%{_會長}%":
  948. set {_stop} to 1
  949. if {_stop} is 1:
  950. send "{@Tag} &c會長無法退出公會 請解散或轉讓會長"
  951. stop
  952. if arg-2 is "riohnsepoguibvefcwcb":
  953. remove "%player%" from yaml list "會員" from file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  954. set {_MemberList::*} to yaml list "會員" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  955. loop {_MemberList::*}:
  956. set {_Member} to loop-value parsed as offlineplayer
  957. if {_Member} is online:
  958. send "{@Tag} &c公會成員 &b%player% &c退出了公會" to {_Member}
  959. set {_副會長::*} to yaml list "副會長" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  960. loop {_副會長::*}:
  961. if "%player%" is "%loop-value%":
  962. remove "%player%" from yaml list "副會長" from file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  963. stop loop
  964. set {_公會人數} to yaml value "公會人數" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  965. set {_公會人數} to {_公會人數} parsed as integer
  966. remove 1 from {_公會人數}
  967. set "公會人數" to "%{_公會人數}%" in yaml file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  968. send "{@Tag} &c你從公會 &a%{公會系統::%UUID of player%::公會}% &c退出了" to player
  969. delete {公會系統::%UUID of player%::公會}
  970. set "公會" to "<none>" in yaml file "plugins/Skript/scripts/PlayerData/%UUID of player%.yml"
  971. set {公會系統::%uuid of player%::懲罰} to now
  972. if arg-2 is not set:
  973. set {_I} to slot player's current hotbar slot of player
  974. set {_book} to a new book
  975. set {_newline} to a new text component with " %nl%"
  976. set {_Page} to a new text component with "&8&l&m-------&8[解散公會]&8&l&m-------"
  977. add {_Page} to {_alltext::*}
  978. add {_newline} to {_alltext::*}
  979. set {_text} to a new text component with "&r &8退出公會後將無法反悔"
  980. add {_text} to {_alltext::*}
  981. add {_newline} to {_alltext::*}
  982. set {_text} to a new text component with "&r &8必須重新申請加入"
  983. add {_text} to {_alltext::*}
  984. add {_newline} to {_alltext::*}
  985. set {_text} to a new text component with "&r &8並得到批准才得以返回"
  986. add {_text} to {_alltext::*}
  987. add {_newline} to {_alltext::*}
  988. set {_text} to a new text component with "&r &8如果確認無誤"
  989. add {_text} to {_alltext::*}
  990. add {_newline} to {_alltext::*}
  991. set {_text} to a new text component with "&r &8請點選下方紅色 &4[&4確認&4]"
  992. add {_text} to {_alltext::*}
  993. add {_newline} to {_alltext::*}
  994. set {_text} to a new text component with "&r &8如果按錯或反悔"
  995. add {_text} to {_alltext::*}
  996. add {_newline} to {_alltext::*}
  997. set {_text} to a new text component with "&r &8請直接關閉此介面"
  998. add {_text} to {_alltext::*}
  999. add {_newline} to {_alltext::*}
  1000. add {_newline} to {_alltext::*}
  1001. set {_random} to random integer between 1 and 8
  1002. loop 4 times:
  1003. set {_text} to a new text component with "&r "
  1004. add {_text} to {_alltext::*}
  1005. set {_random2} to random integer between 1 and 5
  1006. if {_random2} is 1:
  1007. set {_format} to "&1[&1確認&1]"
  1008. if {_random2} is 2:
  1009. set {_format} to "&8[&8確認&8]"
  1010. if {_random2} is 3:
  1011. set {_format} to "&2[&2確認&2]"
  1012. if {_random2} is 4:
  1013. set {_format} to "&5[&5確認&5]"
  1014. if {_random2} is 5:
  1015. set {_format} to "&6[&6確認&6]"
  1016. if loop-number = {_random}:
  1017. set {_format} to "&4[&4確認&4]"
  1018. set {_text} to a new text component with "%{_format}%"
  1019. add hover event with action SHOW_TEXT with text "&a取消" to text component {_text}
  1020. if loop-number = {_random}:
  1021. add click event with action RUN_COMMAND with execute "/guild leave riohnsepoguibvefcwcb" to text component {_text}
  1022. add hover event with action SHOW_TEXT with text "&c確認退出%nl%&c退出後將無法反悔%nl%%nl%&4且會於12小時內%nl%無法再次加入或創建公會" to text component {_text}
  1023. add {_text} to {_alltext::*}
  1024. add {_newline} to {_alltext::*}
  1025. loop 4 times:
  1026. set {_text} to a new text component with "&r "
  1027. add {_text} to {_alltext::*}
  1028. set {_random2} to random integer between 1 and 5
  1029. if {_random2} is 1:
  1030. set {_format} to "&1[&1確認&1]"
  1031. if {_random2} is 2:
  1032. set {_format} to "&8[&8確認&8]"
  1033. if {_random2} is 3:
  1034. set {_format} to "&2[&2確認&2]"
  1035. if {_random2} is 4:
  1036. set {_format} to "&5[&5確認&5]"
  1037. if {_random2} is 5:
  1038. set {_format} to "&6[&6確認&6]"
  1039. if loop-number+4 = {_random}:
  1040. set {_format} to "&4[&4確認&4]"
  1041. set {_text} to a new text component with "%{_format}%"
  1042. add hover event with action SHOW_TEXT with text "&a取消" to text component {_text}
  1043. if loop-number+4 = {_random}:
  1044. add click event with action RUN_COMMAND with execute "/guild leave riohnsepoguibvefcwcb" to text component {_text}
  1045. add hover event with action SHOW_TEXT with text "&c確認退出%nl%&c退出後將無法反悔%nl%%nl%&4且會於12小時內%nl%無法再次加入或創建公會" to text component {_text}
  1046. add {_text} to {_alltext::*}
  1047. add {_newline} to {_alltext::*}
  1048. add {_newline} to {_alltext::*}
  1049. set {_Page} to a new text component with "&8&l&m----------------------&r"
  1050. add {_Page} to {_alltext::*}
  1051. add text component {_alltext::*} to book {_book}
  1052. open book {_book} to player
  1053. set slot player's current hotbar slot of player to {_I}
  1054. stop
  1055. stop
  1056. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  1057. # #Donate #貢獻 #捐獻
  1058. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  1059. if arg-1 is "donate":
  1060. if "%{公會系統::%UUID of player%::公會}%" is not "<none>":
  1061. if arg-2 is not set:
  1062. set {_I} to slot player's current hotbar slot of player
  1063. set {_book} to a new book
  1064. set {_newline} to a new text component with " %nl%"
  1065. set {_Page} to a new text component with "&8&l&m-------&8[公會捐獻]&8&l&m-------"
  1066. add {_Page} to {_alltext::*}
  1067. add {_newline} to {_alltext::*}
  1068. set {_text} to a new text component with "&r &8每捐獻&6&l100&8尼歐"
  1069. add {_text} to {_alltext::*}
  1070. add {_newline} to {_alltext::*}
  1071. set {_text} to a new text component with "&r &8並獲得&4&l1&8公會點數"
  1072. add {_text} to {_alltext::*}
  1073. add {_newline} to {_alltext::*}
  1074. set {_text} to a new text component with "&r &8將增加&6&l1&8公會資金"
  1075. add {_text} to {_alltext::*}
  1076. add {_newline} to {_alltext::*}
  1077. add {_newline} to {_alltext::*}
  1078. set {_text} to a new text component with "&r &8你的尼歐&8&l: &6%money of player%"
  1079. add {_text} to {_alltext::*}
  1080. add {_newline} to {_alltext::*}
  1081. set {_text} to a new text component with "&r &8你的公會點數&8&l: &4%{公會系統::%UUID of player%::點數}%"
  1082. add {_text} to {_alltext::*}
  1083. add {_newline} to {_alltext::*}
  1084. set {_公會資金} to yaml value "公會資金" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  1085. set {_text} to a new text component with "&r &8當前公會資金&8&l: &6%{_公會資金}%"
  1086. add {_text} to {_alltext::*}
  1087. add {_newline} to {_alltext::*}
  1088. add {_newline} to {_alltext::*}
  1089. set {_text} to a new text component with "&r"
  1090. add {_text} to {_alltext::*}
  1091. set {_text} to a new text component with "&8&l[&6&l1&6資金&8&l]"
  1092. add click event with action RUN_COMMAND with execute "/guild donate 1" to text component {_text}
  1093. add hover event with action SHOW_TEXT with text "&7捐獻&6100尼歐%nl%&7獲得&41點數%nl%&7增加&61公會資金" to text component {_text}
  1094. add {_text} to {_alltext::*}
  1095. set {_text} to a new text component with "&r "
  1096. add {_text} to {_alltext::*}
  1097. set {_text} to a new text component with "&8&l[&6&l10&6資金&8&l]"
  1098. add click event with action RUN_COMMAND with execute "/guild donate 10" to text component {_text}
  1099. add hover event with action SHOW_TEXT with text "&7捐獻&61000尼歐%nl%&7獲得&410點數%nl%&7增加&610公會資金" to text component {_text}
  1100. add {_text} to {_alltext::*}
  1101. set {_text} to a new text component with "&r "
  1102. add {_text} to {_alltext::*}
  1103. set {_text} to a new text component with "&8&l[&6&l100&6資金&8&l]"
  1104. add click event with action RUN_COMMAND with execute "/guild donate 100" to text component {_text}
  1105. add hover event with action SHOW_TEXT with text "&7捐獻&610000尼歐%nl%&7獲得&4100點數%nl%&7增加&6100公會資金" to text component {_text}
  1106. add {_text} to {_alltext::*}
  1107. set {_text} to a new text component with "&r "
  1108. add {_text} to {_alltext::*}
  1109. set {_text} to a new text component with "&8&l[&6&l1000&6資金&8&l]"
  1110. add click event with action RUN_COMMAND with execute "/guild donate 1000" to text component {_text}
  1111. add hover event with action SHOW_TEXT with text "&7捐獻&6100000尼歐%nl%&7獲得&41000點數%nl%&7增加&61000公會資金" to text component {_text}
  1112. add {_text} to {_alltext::*}
  1113. set {_text} to a new text component with "&r "
  1114. add {_text} to {_alltext::*}
  1115. set {_text} to a new text component with "&8&l[&6&l10000&6資金&8&l]"
  1116. add click event with action RUN_COMMAND with execute "/guild donate 10000" to text component {_text}
  1117. add hover event with action SHOW_TEXT with text "&7捐獻&61000000尼歐%nl%&7獲得&410000點數%nl%&7增加&610000公會資金" to text component {_text}
  1118. add {_text} to {_alltext::*}
  1119. add {_newline} to {_alltext::*}
  1120. add {_newline} to {_alltext::*}
  1121. set {_Page} to a new text component with "&8&l&m----------------------&r"
  1122. add {_Page} to {_alltext::*}
  1123. add text component {_alltext::*} to book {_book}
  1124. open book {_book} to player
  1125. set slot player's current hotbar slot of player to {_I}
  1126. stop
  1127. if arg-2 is "1" or "10" or "100" or "1000" or "10000":
  1128. set {_Donate} to arg-2 parsed as number
  1129. if player's money >= {_Donate}*100:
  1130. remove {_Donate}*100 from player's money
  1131. set {_MemberList::*} to yaml list "會員" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  1132. loop {_MemberList::*}:
  1133. set {_Member} to loop-value parsed as offlineplayer
  1134. if {_Member} is online:
  1135. send "{@Tag} &a公會成員 &b%player% &a捐獻了 &6%{_Donate}*100% &a尼歐" to {_Member}
  1136. set {_公會資金} to yaml value "公會資金" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  1137. set {_公會資金} to {_公會資金} parsed as integer
  1138. add {_Donate} to {_公會資金}
  1139. set "公會資金" to "%{_公會資金}%" in yaml file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  1140. if {公會系統::%UUID of player%::點數} is not set:
  1141. set {公會系統::%UUID of player%::點數} to 0
  1142. add {_Donate} to {公會系統::%UUID of player%::點數}
  1143. wait 1 tick
  1144. execute player command "/guild donate"
  1145. else:
  1146. send "{@Tag} &c尼歐不足 無法捐獻"
  1147. stop
  1148. stop
  1149. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  1150. # #LevelUp #Level #Up #升級
  1151. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  1152. if arg-1 is "levelup":
  1153. if "%{公會系統::%UUID of player%::公會}%" is not "<none>":
  1154. set {_會長} to yaml value "會長" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  1155. if "%player%" is "%{_會長}%":
  1156. set {_公會人數} to single value "公會人數" get of "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  1157. set {_公會等級} to single value "公會等級" get of "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  1158. set {_公會經驗} to single value "公會經驗" get of "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  1159. set {_公會資金} to single value "公會資金" get of "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  1160. set {_公會之星} to single value "公會之星" get of "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  1161. set {_公會人數} to {_公會人數} parsed as number
  1162. set {_公會等級} to {_公會等級} parsed as number
  1163. set {_公會經驗} to {_公會經驗} parsed as number
  1164. set {_公會資金} to {_公會資金} parsed as number
  1165. set {_公會之星} to {_公會之星} parsed as number
  1166. set {_LevelUpNeed} to GetGuildLevelNeed({_公會等級})
  1167. set {_LevelUpNeed::*} to {_LevelUpNeed} split at "/"
  1168. set {_LvNeed} to {_LevelUpNeed::1} parsed as number
  1169. set {_ExpNeed} to {_LevelUpNeed::2} parsed as number
  1170. set {_MoneyNeed} to {_LevelUpNeed::3} parsed as number
  1171. set {_StarNeed} to {_LevelUpNeed::4} parsed as number
  1172. set {_MemberNeed} to {_LevelUpNeed::5} parsed as number
  1173. set {_pass} to 0
  1174. if {_公會等級} = {_LvNeed}:
  1175. add 1 to {_pass}
  1176. if {_公會經驗} >= {_ExpNeed}:
  1177. add 1 to {_pass}
  1178. if {_公會資金} >= {_MoneyNeed}:
  1179. add 1 to {_pass}
  1180. if {_公會之星} >= {_StarNeed}:
  1181. add 1 to {_pass}
  1182. if {_公會人數} >= {_MemberNeed}:
  1183. add 1 to {_pass}
  1184. if {_pass} is 5:
  1185. set {_MemberList::*} to yaml list "會員" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  1186. loop {_MemberList::*}:
  1187. set {_Member} to loop-value parsed as offlineplayer
  1188. send "{@Tag} &6公會等級提升為 &a&l%{_公會等級}+1% &6級" to {_Member}
  1189. remove {_ExpNeed} from {_公會經驗}
  1190. remove {_MoneyNeed} from {_公會資金}
  1191. remove {_StarNeed} from {_公會之星}
  1192. add 1 to {_公會等級}
  1193. set "公會等級" to "%{_公會等級}%" in yaml file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  1194. set "公會經驗" to "%{_公會經驗}%" in yaml file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  1195. set "公會資金" to "%{_公會資金}%" in yaml file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  1196. set "公會之星" to "%{_公會之星}%" in yaml file "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  1197. else:
  1198. send "{@Tag} &c未達成指定條件 無法升級公會"
  1199. stop
  1200. else:
  1201. send "{@Tag} &c只有會長可以升級公會"
  1202. stop
  1203. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  1204. # #Disband #解散
  1205. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  1206. if arg-1 is "disband":
  1207. if "%{公會系統::%UUID of player%::公會}%" is not "<none>":
  1208. set {_會長} to yaml value "會長" from "plugins/Skript/scripts/Guild/%{公會系統::%UUID of player%::公會}%.yml"
  1209. if "%player%" is "%{_會長}%":
  1210. if arg-2 is "ierpoguraeihgpsoteub":
  1211. set {_GuildName} to {公會系統::%UUID of player%::公會}
  1212. set {_MemberList::*} to yaml list "會員" from "plugins/Skript/scripts/Guild/%{_GuildName}%.yml"
  1213. loop {_MemberList::*}:
  1214. set {_Member} to loop-value parsed as offlineplayer
  1215. set {_uuid} to uuid of {_Member}
  1216. set "公會" to "<none>" in yaml file "plugins/Skript/scripts/PlayerData/%{_uuid}%.yml"
  1217. delete {公會系統::%{_uuid}%::公會}
  1218. send "{@Tag} &c公會會長 &b%player% &c解散了公會" to {_Member}
  1219. delete file "plugins/Skript/scripts/Guild/%{_GuildName}%.yml"
  1220. remove {_GuildName} from {公會目錄::*}
  1221. send "{@Tag} &c公會 &6%{_GuildName}% &c解散了 大家快去挖人才(?" to all players
  1222. set {公會系統::%uuid of player%::懲罰} to now
  1223. stop
  1224. if arg-2 is not set:
  1225. set {_I} to slot player's current hotbar slot of player
  1226. set {_book} to a new book
  1227. set {_newline} to a new text component with " %nl%"
  1228. set {_Page} to a new text component with "&8&l&m-------&8[解散公會]&8&l&m-------"
  1229. add {_Page} to {_alltext::*}
  1230. add {_newline} to {_alltext::*}
  1231. set {_text} to a new text component with "&r &8公會解散後將無法反悔"
  1232. add {_text} to {_alltext::*}
  1233. add {_newline} to {_alltext::*}
  1234. set {_text} to a new text component with "&r &8公會的領地與資源"
  1235. add {_text} to {_alltext::*}
  1236. add {_newline} to {_alltext::*}
  1237. set {_text} to a new text component with "&r &8將會被系統移除"
  1238. add {_text} to {_alltext::*}
  1239. add {_newline} to {_alltext::*}
  1240. set {_text} to a new text component with "&r &8如果確認無誤"
  1241. add {_text} to {_alltext::*}
  1242. add {_newline} to {_alltext::*}
  1243. set {_text} to a new text component with "&r &8請點選下方紅色 &4[&4確認&4]"
  1244. add {_text} to {_alltext::*}
  1245. add {_newline} to {_alltext::*}
  1246. set {_text} to a new text component with "&r &8如果按錯或反悔"
  1247. add {_text} to {_alltext::*}
  1248. add {_newline} to {_alltext::*}
  1249. set {_text} to a new text component with "&r &8請直接關閉此介面"
  1250. add {_text} to {_alltext::*}
  1251. add {_newline} to {_alltext::*}
  1252. add {_newline} to {_alltext::*}
  1253. set {_random} to random integer between 1 and 8
  1254. loop 4 times:
  1255. set {_text} to a new text component with "&r "
  1256. add {_text} to {_alltext::*}
  1257. set {_random2} to random integer between 1 and 5
  1258. if {_random2} is 1:
  1259. set {_format} to "&1[&1確認&1]"
  1260. if {_random2} is 2:
  1261. set {_format} to "&8[&8確認&8]"
  1262. if {_random2} is 3:
  1263. set {_format} to "&2[&2確認&2]"
  1264. if {_random2} is 4:
  1265. set {_format} to "&5[&5確認&5]"
  1266. if {_random2} is 5:
  1267. set {_format} to "&6[&6確認&6]"
  1268. if loop-number = {_random}:
  1269. set {_format} to "&4[&4確認&4]"
  1270. set {_text} to a new text component with "%{_format}%"
  1271. add hover event with action SHOW_TEXT with text "&a取消" to text component {_text}
  1272. if loop-number = {_random}:
  1273. add click event with action RUN_COMMAND with execute "/guild disband ierpoguraeihgpsoteub" to text component {_text}
  1274. add hover event with action SHOW_TEXT with text "&c確認解散%nl%&c解散後將無法反悔%nl%%nl%&4且會於12小時內%nl%無法再次加入或創建公會" to text component {_text}
  1275. add {_text} to {_alltext::*}
  1276. add {_newline} to {_alltext::*}
  1277. loop 4 times:
  1278. set {_text} to a new text component with "&r "
  1279. add {_text} to {_alltext::*}
  1280. set {_random2} to random integer between 1 and 5
  1281. if {_random2} is 1:
  1282. set {_format} to "&1[&1確認&1]"
  1283. if {_random2} is 2:
  1284. set {_format} to "&8[&8確認&8]"
  1285. if {_random2} is 3:
  1286. set {_format} to "&2[&2確認&2]"
  1287. if {_random2} is 4:
  1288. set {_format} to "&5[&5確認&5]"
  1289. if {_random2} is 5:
  1290. set {_format} to "&6[&6確認&6]"
  1291. if loop-number+4 = {_random}:
  1292. set {_format} to "&4[&4確認&4]"
  1293. set {_text} to a new text component with "%{_format}%"
  1294. add hover event with action SHOW_TEXT with text "&a取消" to text component {_text}
  1295. if loop-number+4 = {_random}:
  1296. add click event with action RUN_COMMAND with execute "/guild disband ierpoguraeihgpsoteub" to text component {_text}
  1297. add hover event with action SHOW_TEXT with text "&c確認解散%nl%&c解散後將無法反悔%nl%%nl%&4且會於12小時內%nl%無法再次加入或創建公會" to text component {_text}
  1298. add {_text} to {_alltext::*}
  1299. add {_newline} to {_alltext::*}
  1300. add {_newline} to {_alltext::*}
  1301. set {_Page} to a new text component with "&8&l&m----------------------&r"
  1302. add {_Page} to {_alltext::*}
  1303. add text component {_alltext::*} to book {_book}
  1304. open book {_book} to player
  1305. set slot player's current hotbar slot of player to {_I}
  1306. stop
  1307. else:
  1308. send "{@Tag} &c你不是公會會長 你不能這麼做"
  1309. stop
  1310. stop
  1311. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  1312. # #Quest #任務
  1313. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  1314. if arg-1 is "quest":
  1315. if "%{公會系統::%UUID of player%::公會}%" is not "<none>":
  1316. if arg-2 is not set:
  1317. if "%{公會系統::%UUID of player%::任務::編號}%" is "<none>":
  1318. set {_任務::*} to skutil yaml nodes with keys "quest" from file "plugins/Skript/scripts/GuildQuest/quest.yml"
  1319. loop {_任務::*}:
  1320. set {_expand::%loop-value%} to skutil yaml value "quest.%loop-value%" from file "plugins/Skript/scripts/GuildQuest/quest.yml"
  1321. loop {_expand::*}:
  1322. if loop-index do not contain ".":
  1323. add loop-index to {_Random::*}
  1324. set {_Random} to amount of {_Random::*}
  1325. set {_Random} to random integer between 1 and {_Random}
  1326. loop {_expand::*}:
  1327. if loop-index is "%{_Random::%{_Random}%}%":
  1328. set {_Number} to loop-index
  1329. set {_Type} to {_expand::%{_Random::%{_Random}%}%.Type}
  1330. set {_Target} to {_expand::%{_Random::%{_Random}%}%.Target}
  1331. set {_Content} to {_expand::%{_Random::%{_Random}%}%.Content}
  1332. set {_Reward} to {_expand::%{_Random::%{_Random}%}%.Reward}
  1333.  
  1334. set {公會系統::%UUID of player%::任務::編號} to {_Number}
  1335. set {公會系統::%UUID of player%::任務::分類} to {_Type}
  1336. set {公會系統::%UUID of player%::任務::目標} to {_Target}
  1337. set {公會系統::%UUID of player%::任務::獎勵} to {_Reward}
  1338. #set {公會系統::%UUID of player%::任務冷卻} to now
  1339.  
  1340.  
  1341. set {_任務::*} to skutil yaml nodes with keys "quest" from file "plugins/Skript/scripts/GuildQuest/quest.yml"
  1342. loop {_任務::*}:
  1343. set {_expand::%loop-value%} to skutil yaml value "quest.%loop-value%" from file "plugins/Skript/scripts/GuildQuest/quest.yml"
  1344. loop {_expand::*}:
  1345. if loop-index do not contain ".":
  1346. add loop-index to {_Random::*}
  1347. set {_Type} to {公會系統::%UUID of player%::任務::分類}
  1348. set {_Target} to {公會系統::%UUID of player%::任務::目標}
  1349. set {_Content} to {_expand::%{公會系統::%UUID of player%::任務::編號}%.Content}
  1350. set {_Reward} to {公會系統::%UUID of player%::任務::獎勵}
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356. set {_I} to slot player's current hotbar slot of player
  1357. set {_book} to a new book
  1358. set {_newline} to a new text component with " %nl%"
  1359. set {_Page} to a new text component with "&8&l&m-------&8[公會任務]&8&l&m-------"
  1360. add {_Page} to {_alltext::*}
  1361. add {_newline} to {_alltext::*}
  1362. set {_text} to a new text component with "&r &8%{_Content}%"
  1363. add {_text} to {_alltext::*}
  1364. add {_newline} to {_alltext::*}
  1365. set {_text} to a new text component with "&r &8%{_Type}%"
  1366. add {_text} to {_alltext::*}
  1367. add {_newline} to {_alltext::*}
  1368. set {_text} to a new text component with "&r &8%{_Target}%"
  1369. add {_text} to {_alltext::*}
  1370. add {_newline} to {_alltext::*}
  1371. set {_text} to a new text component with "&r &8%{_Reward}%"
  1372. add {_text} to {_alltext::*}
  1373. add {_newline} to {_alltext::*}
  1374. set {_text} to a new text component with "&r "
  1375. add {_text} to {_alltext::*}
  1376. add {_newline} to {_alltext::*}
  1377. set {_text} to a new text component with "&r "
  1378. add {_text} to {_alltext::*}
  1379. add {_newline} to {_alltext::*}
  1380. set {_text} to a new text component with "&r "
  1381. add {_text} to {_alltext::*}
  1382. add {_newline} to {_alltext::*}
  1383. add {_newline} to {_alltext::*}
  1384. set {_random} to random integer between 1 and 8
  1385.  
  1386. add {_newline} to {_alltext::*}
  1387. add {_newline} to {_alltext::*}
  1388. set {_Page} to a new text component with "&8&l&m----------------------&r"
  1389. add {_Page} to {_alltext::*}
  1390. add text component {_alltext::*} to book {_book}
  1391. open book {_book} to player
  1392. set slot player's current hotbar slot of player to {_I}
  1393. stop
  1394.  
  1395.  
  1396. on skript load:
  1397. send "123" to all players
  1398.  
  1399.  
  1400.  
  1401. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  1402. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  1403. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  1404. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  1405. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  1406.  
  1407.  
  1408.  
  1409. command /guild12 [<text=menu>]:
  1410. trigger:
  1411. open anvil gui named "&0輸入公會名稱稱" to player with text "在此輸入名稱" and item book with lore "||&7輸入完名稱後||&7點擊右方物品確認||||&c&l確認後將不可反悔"
  1412. stop
  1413. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  1414. set {_Page} to a new text component with "&8&l&m-------&8[公會選單]&8&l&m-------"
  1415. add {_Page} to {_alltext::*}
  1416. add {_newline} to {_alltext::*}
  1417.  
  1418.  
  1419.  
  1420.  
  1421. add {_newline} to {_alltext::*}
  1422. add {_newline} to {_alltext::*}
  1423.  
  1424. add {_newline} to {_alltext::*}
  1425. add {_newline} to {_alltext::*}
  1426.  
  1427.  
  1428. #──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────#
  1429. set {_Page} to a new text component with "&8 剩餘點數: &5%{Data::%uuid of player%::技能點}%"
  1430. add {_Page} to {_alltext::*}
  1431. #
  1432. set {_Back} to a new text component with "&0&l◀◀◀"
  1433. add click event with action RUN_COMMAND with execute "/Menu_Sp1" to text component {_Back}
  1434. add hover event with action SHOW_TEXT with text "&6&o上一頁" to text component {_Back}
  1435. add {_Back} to {_alltext::*}
  1436. #
  1437. set {_Page} to a new text component with "&r &r"
  1438. add {_Page} to {_alltext::*}
  1439. #
  1440. set {_Back} to a new text component with "&0&l▶▶▶"
  1441. add click event with action RUN_COMMAND with execute "/Menu_Sp2" to text component {_Back}
  1442. add hover event with action SHOW_TEXT with text "&6&o下一頁" to text component {_Back}
  1443. add {_Back} to {_alltext::*}
  1444. #
  1445. add text component {_alltext::*} to book {_book}
  1446. clear {_alltext::*}
  1447. open book {_book} to player
  1448. set slot player's current hotbar slot of player to {_I}
Advertisement
Add Comment
Please, Sign In to add comment