· 8 years ago · Apr 12, 2018, 09:22 PM
1function refreshData(Player: player):
2 set {_mvdwsupport} to single value "General.MVdW-PlaceholderAPI-Support" get of "plugins/SUPERGUILDS/config.yml"
3 {_mvdwsupport} is "true"
4 set {_uuid} to "%uuid of {_Player}%"
5 add "guild_name" and "guild_rank" and "guild_leader" and "guild_division" and "guild_claimedland" and "guild_maxslot" and "guild_playercount" and "guild_warkills" and "guild_wardeaths" to {_variables::*}
6 set {superguilds::%{_Player}%::guild_name} to single value "Players.%{_uuid}%.Guild-Name" get of "plugins/SUPERGUILDS/playerdata.yml"
7 set {_pg} to {superguilds::%{_Player}%::guild_name}
8 if {superguilds::%{_Player}%::guild_name} is set:
9 if {superguilds::%{_Player}%::guild_name} is not "*":
10 set {_rank} to single value "Datas.Players.%{_uuid}%.Rank" get of "plugins/SUPERGUILDS/guilds/%{_pg}%.yml"
11 {_rank} is not set:
12 set {_rank} to "Leader"
13 wait 15 ticks
14 set {_name} to single value "Datas.Name" get of "plugins/SUPERGUILDS/guilds/%{_pg}%.yml"
15 set {superguilds::%{_Player}%::guild_name} to {_name}
16 set {superguilds::%{_Player}%::guild_rank} to uncolored {SG::Messages::Rank_%{_rank}%}
17 set {superguilds::%{_Player}%::guild_leader} to single value "Datas.Leader" get of "plugins/SUPERGUILDS/guilds/%{_pg}%.yml"
18 set {_d} to single value "Datas.Division" get of "plugins/SUPERGUILDS/guilds/%{_pg}%.yml"
19 set {superguilds::%{_Player}%::guild_division} to uncolored {SG::Messages::Divisions_%{_d}%}
20 set {superguilds::%{_Player}%::guild_claimedland} to single value "Datas.Claimed-Land" get of "plugins/SUPERGUILDS/guilds/%{_pg}%.yml"
21 set {superguilds::%{_Player}%::guild_maxslot} to single value "Datas.Max-Slot" get of "plugins/SUPERGUILDS/guilds/%{_pg}%.yml"
22 set {_p::*} to configuration section "Datas.Players" get of "plugins/SUPERGUILDS/guilds/%{_pg}%.yml"
23 set {superguilds::%{_Player}%::guild_playercount} to "%size of {_p::*}%"
24 set {superguilds::%{_Player}%::guild_warkills} to single value "Datas.War-Kills" get of "plugins/SUPERGUILDS/guilds/%{_pg}%.yml"
25 set {superguilds::%{_Player}%::guild_wardeaths} to single value "Datas.War-Deaths" get of "plugins/SUPERGUILDS/guilds/%{_pg}%.yml"
26 stop
27 loop {_variables::*}:
28 if loop-value is not "guild_name" or "guild_rank" or "guild_leader" or "guild_division":
29 set {superguilds::%{_Player}%::%loop-value%} to "0"
30 else:
31 set {superguilds::%{_Player}%::%loop-value%} to "?"
32function writeFile(variableName: text, value: text, fileDir: text):
33 set "%{_variableName}%" to "%{_value}%" in yaml file "plugins/SUPERGUILDS/%{_fileDir}%.yml"
34function checkFile(variableName: text, fileDir: text) :: text:
35 set {_v} to single value "%{_variableName}%" get of "plugins/SUPERGUILDS/%{_fileDir}%.yml"
36 {_v} is not set:
37 set {_v} to "*"
38 {_fileDir} is not "chunks"
39 writeFile("%{_variableName}%", "*", "%{_fileDir}%")
40 {_variableName} contains ".Guild-Name" or ".Rank" or ".Leader" or ".Division" or ".Claimed-Land" or ".Max-Slot" or ".War-Kills" or ".War-Deaths":
41 set {_uuid} to "%{_variableName}%"
42 replace all "Players." and "Datas.Players." and ".Guild-Name" and ".Rank" and ".Leader" and ".Division" and ".Claimed-Land" and ".Max-Slot" and ".War-Kills" and ".War-Deaths" with "" in {_uuid}
43 set {_p} to single value "Players.%{_uuid}%.Username" get of "plugins/SUPERGUILDS/playerdata.yml" parsed as player
44 refreshData({_p})
45 return "%{_v}%"
46function degerCikar(variableName: text, value: number, fileDir: text):
47 set {_v} to single value "%{_variableName}%" get of "plugins/SUPERGUILDS/%{_fileDir}%.yml" parsed as number
48 remove {_value} from {_v}
49 writeFile("%{_variableName}%", "%{_v}%", "%{_fileDir}%")
50function degerEkle(variableName: text, value: number, fileDir: text):
51 set {_v} to single value "%{_variableName}%" get of "plugins/SUPERGUILDS/%{_fileDir}%.yml" parsed as number
52 if {_v} is not set:
53 set {_v} to 0
54 add {_value} to {_v}
55 writeFile("%{_variableName}%", "%{_v}%", "%{_fileDir}%") # VARIABLE | REMOVE DATA | FOLDER | FILE
56function veriCikar(variableName: text, value: text, fileDir: text): #veriCikar("Datas.Players", "%uuid of player%", "guilds;playerdata")
57 set {_rVN} to {_variableName}
58 set {_mainLoc} to {_fileDir}
59 if {_variableName} contains ".":
60 replace all "." with ";" in {_variableName}
61 if {_fileDir} contains ";":
62 replace all ";" with "/" in {_mainLoc}
63 writeFile("%{_rVN}%.%{_value}%", "*", "%{_mainLoc}%")
64 set {_otherVariable} to checkFile("rList.%{_fileDir}%.%{_variableName}%", "rlist")
65 if {_otherVariable} is "*":
66 writeFile("rList.%{_fileDir}%.%{_variableName}%", "%{_value}%", "rlist")
67 else:
68 writeFile("rList.%{_fileDir}%.%{_variableName}%", "%{_otherVariable}%~%{_value}%", "rlist")
69 wait 1 ticks
70 purgeFiles("veriCikar")
71function sayiGoster(variableName: text, fileDir: text) :: number:
72 set {_input::*} to configuration section "%{_variableName}%" get of "plugins/SUPERGUILDS/%{_fileDir}%.yml"
73 set {_r} to "%size of {_input::*}%" parsed as number
74 return {_r}
75function guildBroadcast(gName: text, message: text):
76 set {_prefix} to {SG::Messages::Prefix}
77 {_message} contains "%{SG::Messages::Guild_Chat}%":
78 set {_prefix} to ""
79 set {_list::*} to configuration section "Datas.Players" get of "plugins/SUPERGUILDS/guilds/%{_gName}%.yml"
80 loop {_list::*}:
81 set {_lP} to checkFile("Datas.Players.%loop-value%.Username", "guilds/%{_gName}%") parsed as offline player
82 send "%{_prefix}% %{_message}%" to {_lP}
83function charControl(g: text) :: text:
84 set {_l} to "q-w-e-r-t-y-u-i-o-p-g-a-s-d-f-g-h-j-k-l-z-x-c-v-b-n-m-1-2-3-4-5-6-7-8-9-0-Q-W-E-R-T-Y-U-I-O-P-G-A-S-D-F-G-H-J-K-L-Z-X-C-V-B-N-M"
85 set {_letters::*} to {_l} split at "-"
86 loop {_letters::*}:
87 "%{_g}%" contains "%loop-value%"
88 replace all "%loop-value%" with "" in {_g}
89 return "%{_g}%"
90function downText(gName: text) :: text:
91 set {_kS} to "q-w-e-r-t-y-u-i-o-p-g-a-s-d-f-g-h-j-k-l-z-x-c-v-b-n-m"
92 set {_bS} to "Q-W-E-R-T-Y-U-I-O-P-G-A-S-D-F-G-H-J-K-L-Z-X-C-V-B-N-M"
93 set {_k::*} to {_kS} split at "-"
94 set {_b::*} to {_bS} split at "-"
95 loop {_b::*}:
96 if {_gName} contains "%loop-value%":
97 replace all "%loop-value%" with "%{_k::%loop-index%}%" in {_gName}
98 return "%{_gName}%"
99function timeChecker(gName: text, waitTime: number, type: text) :: text:
100 set {_now::Month} to "*%month%"
101 set {_now::Day} to "*%day%"
102 set {_now::Hour} to "*%hour%"
103 set {_now::Minute} to "*%minute%"
104 set {_now::Second} to "*%seconds%"
105 #
106 set {_timeScale} to checkFile("Datas.%{_type}%", "guilds/%{_gName}%")
107 set {_g::*} to {_timeScale} split at ";"
108 set {_g::Month} to {_g::1}
109 set {_g::Day} to {_g::2}
110 set {_g::Hour} to {_g::3}
111 set {_g::Minute} to {_g::4}
112 set {_g::Second} to {_g::5}
113 #
114 add "Month" and "Day" and "Hour" and "Minute" and "Second" to {_timeSpans::*}
115 loop {_timeSpans::*}:
116 {_now::%loop-value%} contains "*0":
117 replace all "*0" with "*9" in {_now::%loop-value%}
118 {_g::%loop-value%} contains "*0":
119 replace all "*0" with "*9" in {_g::%loop-value%}
120 replace all "*" with "" in {_now::%loop-value%}
121 replace all "*" with "" in {_g::%loop-value%}
122 set {_now::%loop-value%} to {_now::%loop-value%} parsed as number
123 set {_g::%loop-value%} to {_g::%loop-value%} parsed as number
124 if {_now::Month} is greater than {_g::Month}:
125 return "true"
126 else if {_now::Month} is equal to {_g::Month}:
127 if {_now::Day} is greater than {_g::Day}:
128 return "true"
129 else if {_now::Day} is equal to {_g::Day}:
130 if {_now::Hour} is greater than {_g::Hour}:
131 return "true"
132 else if {_now::Hour} is equal to {_g::Hour}:
133 if {_now::Minute} is greater than {_g::Minute}:
134 return "true"
135 else if {_now::Minute} is equal to {_g::Minute}:
136 set {_waitedSecond} to {_now::Second}-{_g::Second}
137 if {_waitedSecond} is greater or equal to {_waitTime}:
138 return "true"
139 else:
140 return "%{_waitTime}-{_waitedSecond}% %{SG::Messages::Text_Second}%"
141 else:
142 return "%{_g::Minute}-{_now::Minute}% %{SG::Messages::Text_Minute}%"
143 else:
144 return "%{_g::Hour}-{_now::Hour}% %{SG::Messages::Text_Hour}%"
145 else:
146 return "%{_g::Day}-{_now::Day}% %{SG::Messages::Text_Day}%"
147 else:
148 return "%{_g::Month}-{_now::Month}% %{SG::Messages::Text_Month}%"
149function chunkMiddle(p: player, x: number, y: number, z: number, world: world, type: text):
150 set {_loc} to location of block at location ({_x}, {_y}, {_z}) in world {_world}
151 if {_type} is "create":
152 set {_block} to diamond block
153 else if {_type} is "unclaim":
154 set {_block} to netherrack
155 else if {_type} is "claim":
156 set {_block} to gold block
157 else if {_type} is "show":
158 set {_block} to glowstone
159 else if {_type} is "all":
160 set {_block} to iron block
161 spawn 1 arrow at {_loc}
162 set {_e} to last spawned arrow
163 teleport {_e} to {_loc}
164 set {_x} to rounded down (1/16 * {_loc}'s x coordinate)
165 set {_x} to {_x} * 16
166 set {_y} to ({_loc}'s y-coordinate - 1)
167 set {_z} to rounded down (1/16 * {_loc}'s z coordinate)
168 set {_z} to {_z} * 16
169 {_type} is "show":
170 set {_middle} to block 1 under block 7 left block 7 forward block at 0, {_e}'s y-coord, 0 in chunk of {_e}
171 loop 4 times:
172 loop 16 times:
173 set {_y+} to 0
174 set {_unconfirmed} to true
175 while {_unconfirmed} is set:
176 if block at {_x}, ({_y} + {_y+}), {_z} in chunk of {_e} is not a air or tall grass or flower or double tall grass:
177 if block above block at {_x}, ({_y} + {_y+}), {_z} in chunk of {_e} is a air or tall grass or flower or double tall grass:
178 delete {_unconfirmed}
179 else:
180 add 1 to {_y+}
181 else:
182 subtract 1 from {_y+}
183 make {_p} see block at {_x}, ({_y} + {_y+}), {_z} in chunk of {_e} as {_block}
184 {_type} is "show":
185 make {_p} see {_middle} as {_block}
186 {_type} is not "all":
187 add location of block at {_x}, ({_y} + {_y+}), {_z} in chunk of {_e} to {_ChunkOutlines::*}
188 {_type} is "show":
189 add {_middle} to {_ChunkOutlines::*}
190 if loop-number-2 < 16:
191 if loop-number-1 is 1:
192 add 1 to {_x}
193 else if loop-number-1 is 2:
194 add 1 to {_z}
195 else if loop-number-1 is 3:
196 subtract 1 from {_x}
197 else if loop-number-1 is 4:
198 subtract 1 from {_z}
199 teleport {_e} to location of block at location ({_x}, -70, {_z}) in world {_world}
200 {_type} is not "all"
201 wait 5 seconds
202 loop {_ChunkOutlines::*}:
203 make {_p} see block at loop-value as block at loop-value
204function schematicAPI(p: text, type: text, building: text, level: text, pg: text):
205 set {_p} to "%{_p}%" parsed as player
206 set {_Sch} to checkFile("General.Schematics", "config")
207 {_Sch} is "true"
208 loop 2 times:
209 set {_location::%loop-number%::*} to checkFile("Datas.Schematic.%{_building}%.Pos-%loop-number%", "guilds/%{_pg}%") split at ";"
210 set {_pos%loop-number%::x} to {_location::%loop-number%::1} parsed as number
211 set {_pos%loop-number%::y} to {_location::%loop-number%::2} parsed as number
212 set {_pos%loop-number%::z} to {_location::%loop-number%::3} parsed as number
213 set {_pos%loop-number%::w} to {_location::%loop-number%::4} parsed as world
214 set {_loc1} to location of block at location ({_pos1::x}, {_pos1::y}+1, {_pos1::z}) in world {_pos1::w}
215 set {_loc2} to location of block at location ({_pos2::x}, {_pos2::y}, {_pos2::z}) in world {_pos2::w}
216 set {_currentLevel} to checkFile("Datas.Buildings-Level.%{_building}%", "guilds/%{_pg}%") parsed as number
217 {_currentLevel} is 1:
218 loop blocks within {_loc1} to {_loc2}:
219 block at loop-block is not air
220 set block at loop-block to air
221 #set block at {_loc1} to diamond block
222 #set block at {_loc2} to gold block
223 if {_type} is "1":
224 set {_location::*} to checkFile("Datas.Schematic.%{_building}%.Center", "guilds/%{_pg}%") split at ";"
225 set {_center.x} to {_location::1} parsed as number
226 set {_center.y} to {_location::2} parsed as number
227 set {_center.z} to {_location::3} parsed as number
228 set {_center.w} to {_location::4} parsed as world
229 set {_center} to location of block at location ({_center.x}, {_center.y}, {_center.z}) in world {_center.w}
230 teleport {_p} to {_center}
231 run {_p} command "//schematic load %{_building}%_L_%{_level}%" as op
232 wait 1 ticks
233 run {_p} command "//paste" as op
234function disbandGuild(g: text):
235 set {_list::*} to configuration section "Datas.Players" get of "plugins/SUPERGUILDS/guilds/%{_g}%.yml"
236 loop {_list::*}:
237 writeFile("Players.%loop-value%.Guild-Name", "*", "playerdata")
238 wait 1 ticks
239 set {_claims::*} to configuration section "Regions" get of "plugins/SUPERGUILDS/chunks.yml"
240 loop {_claims::*}:
241 set {_chunk} to checkFile("Regions.%loop-value%", "chunks")
242 {_chunk} is "%{_g}%"
243 veriCikar("Regions", "%loop-value%", "chunks")
244 wait 3 ticks
245 set {_name} to checkFile("Datas.Name", "guilds/%{_g}%")
246 set {_message} to {SG::Messages::Guild_Remove_Broadcast}
247 replace all "{GUILD}" with "%{_name}%" in {_message}
248 broadcast "%{SG::Messages::Prefix}% %{_message}%"
249 schematicAPI("Notch", "0", "1", "1", "%{_g}%")
250 wait 1 ticks
251 df "plugins/SUPERGUILDS/guilds/%{_g}%.yml"
252function pageAPI(Player: player, Type: text, Back: text):
253 set {_uuid} to "%uuid of {_Player}%"
254 #
255 {_Back} is "0":
256 writeFile("Players.%{_uuid}%.Page-Contains", "*", "playerdata")
257 if {_Type} is "0":
258 set {_Guilds::*} to files in "plugins/SUPERGUILDS/guilds"
259 loop {_Guilds::*}:
260 set {_ID} to "%loop-value%"
261 replace all ".yml" with "" in {_ID}
262 add {_ID} to {_Variables::*}
263 else if {_Type} is "1":
264 set {_pg} to checkFile("Players.%{_uuid}%.Guild-Name", "playerdata")
265 if {_pg} is not "*":
266 set {_Variables::*} to configuration section "Datas.Claims" get of "plugins/SUPERGUILDS/guilds/%{_pg}%.yml"
267 else:
268 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to {_Player}
269 stop
270 size of {_Variables::*} is less or equal to 0:
271 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Variable_List_%{_Type}%}%" to {_Player}
272 stop
273 #
274 set {_Pages} to checkFile("Players.%{_uuid}%.Page-Contains", "playerdata")
275 if {_Pages} is "*":
276 set {_Text} to ""
277 loop {_Variables::*}:
278 set {_Text} to "%{_Text}%;%loop-index%"
279 if size of {_Variables::*} is less than 26:
280 writeFile("Players.%{_uuid}%.Page-Contains", "*", "playerdata")
281 else:
282 writeFile("Players.%{_uuid}%.Page-Contains", "%{_Text}%", "playerdata")
283 else:
284 set {_AVariables::*} to {_Pages} split at ";"
285 loop {_AVariables::*}:
286 add {_Variables::%loop-value%} to {_T::*}
287 writeFile("Players.%{_uuid}%.Page-Contains", "%{_Pages}%", "playerdata")
288 set {_Variables::*} to {_T::*}
289 set {_Toplam} to size of {_Variables::*}
290 size of {_Variables::*} is greater than 26:
291 clear {_T::*}
292 set {_Pages} to checkFile("Players.%{_uuid}%.Page-Contains", "playerdata")
293 set {_AVariables::*} to {_Pages} split at ";"
294 loop 26 times:
295 add {_Variables::%loop-number%} to {_T::*}
296 clear {_AVariables::%loop-number%}
297 set {_Text} to ""
298 loop {_AVariables::*}:
299 set {_Text} to "%{_Text}%;%loop-value%"
300 writeFile("Players.%{_uuid}%.Page-Contains", "%{_Text}%", "playerdata")
301 set {_Variables::*} to {_T::*}
302 #
303 if size of {_Variables::*} is between 0 and 9:
304 set {_Rows} to 1
305 else if size of {_Variables::*} is between 9 and 18:
306 set {_Rows} to 2
307 else if size of {_Variables::*} is greater than 18:
308 set {_Rows} to 3
309 wait 3 ticks
310 open chest with {_Rows} rows named "%{SG::Messages::GUIPrefix}%%{SG::Messages::Header_%{_Type}%}%" to {_Player}
311 wait 1 tick
312 {_Toplam} is greater than 26:
313 format slot 26 of {_Player} with dark green glass named "%{SG::Messages::Forward_Header}%" to close then run [pageAPI({_Player}, "%{_Type}%", "1")]
314 set {_Number} to 0
315 loop {_Variables::*}:
316 delete {_V::*}
317 if {_Type} is "0":
318 set {_GName} to checkFile("Datas.Name", "guilds/%loop-value%")
319 set {_Leader} to checkFile("Datas.Leader", "guilds/%loop-value%")
320 set {_Division} to checkFile("Datas.Division", "guilds/%loop-value%")
321 set {_Msg} to {SG::Messages::Click_To_Info}
322 replace all "{LEADER}" with "%{_Leader}%" in {_Msg}
323 replace all "{LEVEL}" with "%{SG::Messages::Divisions_%{_Division}%}%" in {_Msg}
324 set {_V::Name} to "&6%{_GName}%"
325 set {_V::Item} to map
326 set {_V::Lore} to "%{_Msg}%"
327 set {_V::Command} to "sprglds guildInfo %{_Player}% %loop-value%"
328 else if {_Type} is "1":
329 set {_data::*} to checkFile("Datas.Claims.%loop-value%", "guilds/%{_pg}%") split at ";"
330 if {_data::5} is not set:
331 set {_V::Name} to "&6%{SG::Messages::Claimed_Land}%"
332 else:
333 set {_V::Name} to "&6%{_data::5}%"
334 set {_V::Item} to grass
335 set {_V::Command} to "sprglds teleporterAPI %{_Player}% %{_data::1}%;%{_data::2}%;%{_data::3}%;%{_data::4}%"
336 set {_Msg} to {SG::Messages::Claimed_Land_Lore}
337 replace all "{LOC}" with "%{_data::1}% / %{_data::2}% / %{_data::3}%" in {_Msg}
338 set {_V::Lore} to {_Msg}
339 format slot {_Number} of {_Player} with {_V::Item} named "%{_V::Name}%" with lore "%{_V::Lore}%" to close then run "%{_V::Command}%"
340 add 1 to {_Number}
341function warGUI(p: player):
342 set {_uuid} to "%uuid of {_p}%"
343 set {_pg} to checkFile("Players.%{_uuid}%.Guild-Name", "playerdata")
344 if {_pg} is not "*":
345 wait 2 ticks
346 open chest with 3 rows named "%{SG::Messages::GUIPrefix}%%{SG::Messages::Menu_War_GUI}%" to {_p}
347 wait 1 ticks
348 set {_x} to 0
349 loop 27 times:
350 {_x} is not 8 or 11 or 13 or 15:
351 format slot {_x} of {_p} with black glass named " " to be unstealable
352 add 1 to {_x}
353 format slot 8 of {_p} with red glass named "%{SG::Messages::Back_Header}%" to close then run [guildManagementGUI({_p})]
354 set {_TopKills} to -1
355 set {_TopKiller} to ""
356 set {_list::*} to configuration section "Datas.Players" get of "plugins/SUPERGUILDS/guilds/%{_pg}%.yml"
357 loop {_list::*}:
358 set {_lP::%loop-value%} to checkFile("Datas.Players.%loop-value%.Username", "guilds/%{_pg}%") #parsed as player
359 set {_Rank::%loop-value%} to checkFile("Datas.Players.%loop-value%.Rank", "guilds/%{_pg}%")
360 set {_Kills::%loop-value%} to checkFile("Datas.Players.%loop-value%.War-Kills", "guilds/%{_pg}%") parsed as number
361 {_Kills::%loop-value%} is greater than {_TopKills}:
362 set {_TopKills} to {_Kills::%loop-value%}
363 set {_TopKiller} to {_lP::%loop-value%}
364 set {_TopRank} to {_Rank::%loop-value%}
365 set {_barracksLevel} to checkFile("Datas.Buildings-Level.2", "guilds/%{_pg}%") parsed as number
366 set {_division} to checkFile("Datas.Division", "guilds/%{_pg}%")#
367 set {_points} to checkFile("Datas.War-Points", "guilds/%{_pg}%")#
368 set {_kills} to checkFile("Datas.War-Kills", "guilds/%{_pg}%")
369 set {_deaths} to checkFile("Datas.War-Deaths", "guilds/%{_pg}%")
370 set {_lore} to {SG::Messages::Menu_War_Lore_2}
371 replace all "{KILLS}" with "%{_kills}%" in {_lore}
372 replace all "{DEATHS}" with "%{_deaths}%" in {_lore}
373 replace all "{LEVEL}" with "%{SG::Messages::Divisions_%{_division}%}%" in {_lore}
374 replace all "{POINTS}" with "%{_points}%" in {_lore}
375 replace all "{ITEMS}" with "%{SG::Messages::Barrack_Upgrade_Item_%{_barracksLevel}%}%" in {_lore}
376 replace all "{TOP}" with "%{_TopKiller}%" in {_lore}
377 replace all "{RANK}" with "%{SG::Messages::Rank_%{_TopRank}%}%" in {_lore}
378 replace all "{NUM}" with "%{_TopKills}%" in {_lore}
379 format slot 11 of {_p} with {SG::Messages::Divisions_Item_%{_division}%} named "%{SG::Messages::Menu_War_Name_2}%" with lore "||&7%{_lore}%" to be unstealable
380 format slot 13 of {_p} with compass named "%{SG::Messages::Menu_War_Name_1}%" with lore "||&7%{SG::Messages::Menu_War_Lore_1}%" to run [send "%{SG::Messages::Prefix}% %{SG::Messages::Option_Disabled}%" to {_p}]
381 format slot 15 of {_p} with eye of ender named "%{SG::Messages::Menu_War_Name_3}%" with lore "||&7%{SG::Messages::Option_Disabled}%" to be unstealable
382 else:
383 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to {_p}
384function buyAlchemy(p: player, type: number):
385 set {_uuid} to "%uuid of {_p}%"
386 set {_pg} to checkFile("Players.%{_uuid}%.Guild-Name", "playerdata")
387 if {_pg} is not "*":
388 set {_r} to checkFile("Datas.Players.%{_uuid}%.Rank", "guilds/%{_pg}%")
389 if {_r} is "Leader" or "General":
390 set {_alchemyLevel} to checkFile("Datas.Buildings-Level.4", "guilds/%{_pg}%") parsed as number
391 set {_price} to checkFile("Guild-Management.Alchemy-%{_type}%.Level-1-Magic", "config") parsed as number
392 set {_plus} to checkFile("Guild-Management.Alchemy-Cost-Increase-Per-Level", "config") parsed as number
393 set {_islem} to {_alchemyLevel}-1
394 set {_islem2} to {_plus}*{_islem}
395 set {_price} to "%{_price}+{_islem2}%" parsed as number
396 set {_magic} to checkFile("Datas.Magic", "guilds/%{_pg}%") parsed as number
397 if {_magic} is greater or equal to {_price}:
398 degerCikar("Datas.Magic", {_price}, "guilds/%{_pg}%")
399 set {_name} to checkFile("Datas.Name", "guilds/%{_pg}%")
400 set {_msg} to {SG::Messages::Bought_Alchemy_Guild}
401 replace all "{GUILD}" with "%{_name}%" in {_msg}
402 replace all "{TYPE}" with "%{SG::Messages::Alchemy_Type_%{_Type}%_Name_%{_alchemyLevel}%}%" in {_msg}
403 broadcast "%{SG::Messages::Prefix}% %{_msg}%"
404 set {_msg} to {SG::Messages::Bought_Alchemy_Own}
405 replace all "{RANK}" with "%{SG::Messages::Rank_%{_r}%}%" in {_msg}
406 replace all "{PLAYER}" with "%{_p}%" in {_msg}
407 replace all "{TYPE}" with "%{SG::Messages::Alchemy_Type_%{_Type}%_Name_%{_alchemyLevel}%}%" in {_msg}
408 guildBroadcast({_pg},"%{_msg}%")
409 set {_list::*} to configuration section "Datas.Players" get of "plugins/SUPERGUILDS/guilds/%{_pg}%.yml"
410 loop {_list::*}:
411 set {_lP} to checkFile("Datas.Players.%loop-value%.Username", "guilds/%{_pg}%") parsed as player
412 if {_type} is 1:
413 remove strength from {_lP}
414 apply potion of strength of tier {_alchemyLevel} to {_lP} for 15 minutes
415 else if {_type} is 2:
416 loop all horses:
417 name of loop-horse contains "%{_lP}%"
418 damage loop-horse by 50 hearts
419 spawn 1 horse at {_lP}'s location
420 make {_lP} ride last spawned horse
421 set display name of spawned horse to "&9[%{_lP}%]"
422 make the last spawned horse wear a saddle
423 if {_alchemyLevel} is 2:
424 equip the spawned horse with iron horse armor
425 else if {_alchemyLevel} is 3:
426 equip the spawned horse with diamond horse armor
427 else if {_type} is 3:
428 remove speed from {_lP}
429 apply potion of speed of tier {_alchemyLevel} to {_lP} for 15 minutes
430 else if {_type} is 4:
431 remove resistance from {_lP}
432 apply potion of resistance of tier {_alchemyLevel} to {_lP} for 15 minutes
433 else:
434 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Magic_Guild}% &7[&9%{_price}% ⛃&7]" to {_p}
435 else:
436 send "%{SG::Messages::Prefix}% %{SG::Messages::Rank_Not_Enough}%" to {_p}
437 else:
438 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to {_p}
439function teleporterAPI(p: player, x: number, y: number, z: number, w: world):
440 set {_uuid} to "%uuid of {_p}%"
441 set {_pg} to checkFile("Players.%{_uuid}%.Guild-Name", "playerdata")
442 if {_pg} is not "*":
443 set {_tp} to checkFile("Players.%{_uuid}%.Teleport-Status", "playerdata")
444 send "%{SG::Messages::Prefix}% %{SG::Messages::Teleport_Starting}%" to {_p}
445 if {_tp} is "*":
446 writeFile("Players.%{_uuid}%.Teleport-Status", "true", "playerdata")
447 set {_time} to checkFile("General.Teleport-Time", "config") parsed as integer
448 set {_locControl} to {_p}'s x-coord
449 while {_time} is not 1:
450 if {_p} is online:
451 set {_tp} to checkFile("Players.%{_uuid}%.Teleport-Status", "playerdata")
452 if {_tp} is "true":
453 set {_CurrentX} to {_p}'s x-coord
454 if {_locControl} is not {_CurrentX}:
455 writeFile("Players.%{_uuid}%.Teleport-Status", "*", "playerdata")
456 remove 1 from {_time}
457 set {_message} to {SG::Messages::Teleporting_Message}
458 replace all "{TIME}" with "%{_time}%" in {_message}
459 send "%{SG::Messages::Prefix}% %{_message}%" to {_p}
460 #play raw sound "random.pop" at {_p} with pitch 1 volume 0.1
461 wait 21 ticks
462 else:
463 send "%{SG::Messages::Prefix}% %{SG::Messages::Teleport_Cancel}%" to {_p}
464 writeFile("Players.%{_uuid}%.Teleport-Status", "*", "playerdata")
465 stop
466 else:
467 stop
468 writeFile("Players.%{_uuid}%.Teleport-Status", "*", "playerdata")
469 set {_loc} to location of block at location ({_x}, {_y}, {_z}) in world {_w}
470 teleport {_p} to {_loc}
471 send "%{SG::Messages::Prefix}% %{SG::Messages::Teleport_Done}%" to {_p}
472 #play raw sound "tile.piston.out" at {_p} with pitch 1 volume 1
473 stop
474 else:
475 send "%{SG::Messages::Prefix}% %{SG::Messages::Already_Teleport}%" to {_p}
476 stop
477 else:
478 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to {_p}
479function guildKick(p: player, kicked: offline player):
480 set {_uuid} to "%uuid of {_p}%"
481 set {_pg} to checkFile("Players.%{_uuid}%.Guild-Name", "playerdata")
482 if {_pg} is not "*":
483 set {_uuidKicked} to "%uuid of {_kicked}%"
484 set {_gKicked} to checkFile("Players.%{_uuidKicked}%.Guild-Name", "playerdata")
485 if "%{_gKicked}%" is "%{_pg}%":
486 set {_rankP} to checkFile("Datas.Players.%{_uuid}%.Rank", "guilds/%{_pg}%")
487 set {_rankKicked} to checkFile("Datas.Players.%{_uuidKicked}%.Rank", "guilds/%{_pg}%")
488 set {_pRankLevel} to checkFile("General.%{_rankP}%-Perm-Level", "config") parsed as number
489 set {_kickedRankLevel} to checkFile("General.%{_rankKicked}%-Perm-Level", "config") parsed as number
490 if {_p} is not {_kicked}:
491 if {_pRankLevel} is greater than {_kickedRankLevel}:
492 writeFile("Players.%{_uuidKicked}%.Guild-Name", "*", "playerdata")
493 veriCikar("Datas.Players", "%{_uuidKicked}%", "guilds;%{_pg}%")
494 set {_message} to {SG::Messages::Kicked_Player}
495 replace all "{KICKED}" with "%{_kicked}%" in {_message}
496 replace all "{PLAYER}" with "%{_p}%" in {_message}
497 guildBroadcast({_pg},"%{_message}%")
498 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Kicked}%" to {_kicked}
499 else:
500 send "%{SG::Messages::Prefix}% %{SG::Messages::Kick_Error_No_Rank}%" to {_p}
501 else:
502 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Kick_Yourself}%" to {_p}
503 else:
504 send "%{SG::Messages::Prefix}% %{SG::Messages::Kick_Error_No_Guild}%" to {_p}
505 else:
506 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to {_p}
507function guildRank(p: player, target: offline player, targetRank: text):
508 set {_uuid} to "%uuid of {_p}%"
509 set {_pg} to checkFile("Players.%{_uuid}%.Guild-Name", "playerdata")
510 if {_pg} is not "*":
511 set {_uuidTarget} to "%uuid of {_target}%"
512 set {_gTarget} to checkFile("Players.%{_uuidTarget}%.Guild-Name", "playerdata")
513 if "%{_gTarget}%" is "%{_pg}%":
514 set {_rankP} to checkFile("Datas.Players.%{_uuid}%.Rank", "guilds/%{_pg}%")
515 set {_rankTarget} to checkFile("Datas.Players.%{_uuidTarget}%.Rank", "guilds/%{_pg}%")
516 set {_pRankLevel} to checkFile("General.%{_rankP}%-Perm-Level", "config") parsed as number
517 set {_TargetRankLevel} to checkFile("General.%{_rankTarget}%-Perm-Level", "config") parsed as number
518 set {_ranklevelnext} to checkFile("General.%{_targetRank}%-Perm-Level", "config") parsed as number
519 if {_p} is not {_target}:
520 if {_pRankLevel} is greater than {_TargetRankLevel}:
521 if {_pRankLevel} is greater than {_ranklevelnext}:
522 writeFile("Datas.Players.%{_uuidTarget}%.Rank", "%{_targetRank}%", "guilds/%{_pg}%")
523 set {_message} to {SG::Messages::Ranked_Player}
524 replace all "{NEWRANKCHANGEP}" with "%{SG::Messages::Rank_%{_targetRank}%}%" in {_message}
525 replace all "{RANKPLAYER}" with "%{SG::Messages::Rank_%{_rankP}%}%" in {_message}
526 replace all "{OLDRANKCHANGEP}" with "%{SG::Messages::Rank_%{_rankTarget}%}%" in {_message}
527 replace all "{CHANGEP}" with "%{_target}%" in {_message}
528 replace all "{PLAYER}" with "%{_p}%" in {_message}
529 guildBroadcast({_pg},"%{_message}%")
530 set {_msg} to {SG::Messages::Rank_Changed}
531 replace all "{RANK}" with "%{SG::Messages::Rank_%{_targetRank}%}%" in {_msg}
532 send "%{SG::Messages::Prefix}% %{_msg}%" to {_target}
533 else:
534 send "%{SG::Messages::Prefix}% %{SG::Messages::Rank_Wrong}%" to {_p}
535 else:
536 send "%{SG::Messages::Prefix}% %{SG::Messages::Rank_Not_Enough}%" to {_p}
537 else:
538 send "%{SG::Messages::Prefix}% %{SG::Messages::Rank_Yourself}%" to {_p}
539 else:
540 send "%{SG::Messages::Prefix}% %{SG::Messages::Player_No_Guild}%" to {_p}
541 else:
542 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to {_p}
543function alchemyGUI(p: player):
544 set {_uuid} to "%uuid of {_p}%"
545 set {_pg} to checkFile("Players.%{_uuid}%.Guild-Name", "playerdata")
546 if {_pg} is not "*":
547 wait 2 ticks
548 open chest with 3 rows named "%{SG::Messages::GUIPrefix}%%{SG::Messages::Menu_Alchemy_GUI}%" to {_p}
549 wait 1 ticks
550 set {_x} to 0
551 loop 27 times:
552 {_x} is not 8 or 10 or 12 or 14 or 16:
553 format slot {_x} of {_p} with black glass named " " to be unstealable
554 add 1 to {_x}
555 format slot 8 of {_p} with red glass named "%{SG::Messages::Back_Header}%" to close then run [guildManagement({_p})]
556 set {_alchemyLevel} to checkFile("Datas.Buildings-Level.4", "guilds/%{_pg}%") parsed as number
557 set {_s} to 10
558 loop 3 times:
559 set {_c.%loop-number%} to "&f"
560 set {_c.%{_alchemyLevel}%} to "&f&n"
561 loop 4 times:
562 loop 3 times:
563 set {_c.%loop-number-2%} to "&f"
564 set {_c.%{_alchemyLevel}%} to "&f&n"
565 set {_price} to checkFile("Guild-Management.Alchemy-%loop-number%.Level-1-Magic", "config") parsed as number
566 set {_plus} to checkFile("Guild-Management.Alchemy-Cost-Increase-Per-Level", "config") parsed as number
567 set {_priceLore} to {SG::Messages::Alchemy_Menu_Price_%loop-number%}
568 replace all "{MAGIC1}" with "%coloured {_c.1}%%{_price}%" in {_priceLore}
569 replace all "{MAGIC2}" with "%coloured {_c.2}%%{_price}+{_plus}%" in {_priceLore}
570 replace all "{MAGIC3}" with "%coloured {_c.3}%%{_price}+2*{_plus}%" in {_priceLore}
571 format slot {_s} of {_p} with {SG::Messages::Alchemy_Type_%loop-number%_Item_%{_alchemyLevel}%} named "%{SG::Messages::Alchemy_Type_%loop-number%_Name_%{_alchemyLevel}%}%" with lore "||%{SG::Messages::Text_Feature}%|| %{SG::Messages::Alchemy_Menu_Lore_%loop-number%}%||||%{SG::Messages::Text_Price}%||%{_priceLore}%||||%{SG::Messages::Text_Buy}%" to close then run "sprglds buyAlchemy %{_p}% %loop-number%"
572 add 2 to {_s}
573 else:
574 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to {_p}
575function storeGUI(p: player):
576 set {_uuid} to "%uuid of {_p}%"
577 set {_pg} to checkFile("Players.%{_uuid}%.Guild-Name", "playerdata")
578 if {_pg} is not "*":
579 set {_co::1} to checkFile("Datas.Gold", "guilds/%{_pg}%") parsed as number
580 set {_co::2} to checkFile("Datas.Magic", "guilds/%{_pg}%") parsed as number
581 set {_max::1} to checkFile("Datas.Max-Gold", "guilds/%{_pg}%") parsed as number
582 set {_max::2} to checkFile("Datas.Max-Magic", "guilds/%{_pg}%") parsed as number
583 wait 2 ticks
584 open chest with 3 rows named "%{SG::Messages::GUIPrefix}%%{SG::Messages::Store_GUI}%" to {_p}
585 wait 1 ticks
586 set {_x} to 0
587 loop 27 times:
588 {_x} is not 8 or 11 or 15:
589 format slot {_x} of {_p} with black glass named " " to be unstealable
590 add 1 to {_x}
591 format slot 8 of {_p} with red glass named "%{SG::Messages::Back_Header}%" to close then run [guildManagement({_p})]
592 loop 2 times:
593 set {_s::%loop-number-1%} to {_co::%loop-number-1%}*100
594 set {_r::%loop-number-1%} to rounded {_s::%loop-number-1%}/{_max::%loop-number-1%}
595 set {_l::%loop-number-1%} to {_r::%loop-number-1%}/10
596 set {_lore::%loop-number-1%} to ""
597 loop {_l::%loop-number-1%} times:
598 set {_lore::%loop-number-1%} to "%{_lore::%loop-number-1%}%%coloured {SG::Messages::Store_Color_%loop-number-1%}%⬛"
599 set {_k::%loop-number-1%} to 10-{_l::%loop-number-1%}
600 loop {_k::%loop-number-1%} times:
601 set {_lore::%loop-number-1%} to "%{_lore::%loop-number-1%}%%coloured {SG::Messages::Store_Color_%loop-number-1%}%⬜"
602 set {_test::%loop-number-1%} to {SG::Messages::Store_Status}
603 replace all "{NUMBER}" with "%{_co::%loop-number-1%}%/%{_max::%loop-number-1%}% (%%%{_r::%loop-number-1%}%)" in {_test::%loop-number-1%}
604 format slot 11 of {_p} with {SG::Messages::Buildings_Item_3} named "%{SG::Messages::Store_Name_Gold}%" with lore "||%{_test::1}%||&7 → %{_lore::1}%||||%{SG::Messages::Donate_Lore_Gold}%" to close then run [execute {_p} command "/g donate gold 32"]->[execute {_p} command "/g store"]
605 format slot 15 of {_p} with {SG::Messages::Buildings_Item_4} named "%{SG::Messages::Store_Name_Magic}%" with lore "||%{_test::2}%||&7 → %{_lore::2}%||||%{SG::Messages::Donate_Lore_Magic}%" to close then run [execute {_p} command "/g donate magic 32"]->[execute {_p} command "/g store"]
606 else:
607 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to {_p}
608function buildingsGUI(p: player):
609 set {_uuid} to "%uuid of {_p}%"
610 set {_pg} to checkFile("Players.%{_uuid}%.Guild-Name", "playerdata")
611 if {_pg} is not "*":
612 wait 2 ticks
613 open chest with 3 rows named "%{SG::Messages::GUIPrefix}%%{SG::Messages::Buildings_GUI}%" to {_p}
614 wait 1 ticks
615 set {_count} to 10
616 set {_maxLevel::1} to 4
617 set {_maxLevel::2} to 5
618 set {_maxLevel::3} to 8
619 set {_maxLevel::4} to 3
620 set {_x} to 0
621 format slot 8 of {_p} with red glass named "%{SG::Messages::Back_Header}%" to close then run [guildManagement({_p})]
622 loop 27 times:
623 {_x} is not 8 or 10 or 12 or 14 or 16:
624 format slot {_x} of {_p} with black glass named " " to be unstealable
625 add 1 to {_x}
626 #set {_gold} to checkFile("Datas.Gold", "guilds/%{_pg}%") parsed as number
627 #set {_magic} to checkFile("Datas.Magic", "guilds/%{_pg}%") parsed as number
628 loop 4 times:
629 set {_level} to checkFile("Datas.Buildings-Level.%loop-number%", "guilds/%{_pg}%") parsed as number
630 set {_m} to {SG::Messages::Buildings_Level}
631 replace all "{LEVEL}" with "%{SG::Messages::Romen_Num_%{_level}%}%" in {_m}
632 if {_level} is not {_maxLevel::%loop-number%}:
633 set {_msg} to {SG::Messages::Buildings_Required_Lore_1}
634 replace all "{GOLD}" with "%uncolored {SG::Messages::Store_Name_Gold}%" in {_msg}
635 replace all "{MAGIC}" with "%uncolored {SG::Messages::Store_Name_Magic}%" in {_msg}
636 set {_rGold} to checkFile("Guild-Management.%loop-number%-Upgrade.Gold", "config") parsed as number
637 set {_rMagic} to checkFile("Guild-Management.%loop-number%-Upgrade.Magic", "config") parsed as number
638 replace all "{GNEED}" with "%{_rGold}*{_level}%" in {_msg}
639 replace all "{MNEED}" with "%{_rMagic}*{_level}%" in {_msg}
640 set {_lore} to "||%{_m}%||||%{SG::Messages::Buildings_Required_Lore_0}%||%{_msg}%||||%{SG::Messages::Buildings_Lore_0}%||%{SG::Messages::Buildings_Lore_%loop-value%}%||||%{SG::Messages::Buildings_Upgrade}%"
641 else:
642 set {_lore} to "||%{_m}%||||%{SG::Messages::Limit_Buildings}%"
643 format slot {_count} of {_p} with {SG::Messages::Buildings_Item_%loop-number%} named "%{SG::Messages::Buildings_Name_%loop-number%}%" with lore "%{_lore}%" to close then run "sprglds upgradeBuild %{_p}% %{_pg}% %loop-number%"
644 add 2 to {_count}
645 else:
646 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to {_p}
647function guildPlayersGUI(p: player, type: text):
648 set {_uuid} to "%uuid of {_p}%"
649 set {_pg} to checkFile("Players.%{_uuid}%.Guild-Name", "playerdata")
650 if {_pg} is not "*":
651 set {_gP::*} to configuration section "Datas.Players" get of "plugins/SUPERGUILDS/guilds/%{_pg}%.yml"
652 set {_slot} to size of {_gP::*}
653 set {_rows} to {_slot}/9
654 if {_rows} is greater than 1:
655 set {_x} to 1
656 loop 7 times:
657 {_rows} is between {_x} and {_x}+1
658 set {_rows} to {_x}+1
659 add 1 to {_x}
660 else:
661 set {_rows} to 1
662 set {_count} to 0
663 wait 2 ticks
664 open chest with {_rows} rows named "%{SG::Messages::GUIPrefix}%%{SG::Messages::Guild_Header_%{_type}%}%" to {_p}
665 wait 1 ticks
666 loop {_gP::*}:
667 set {_lP} to checkFile("Datas.Players.%loop-value%.Username", "guilds/%{_pg}%") parsed as offline player
668 set {_rank} to checkFile("Datas.Players.%loop-value%.Rank", "guilds/%{_pg}%")
669 if {_type} is "List" or "Rank":
670 set {_date} to checkFile("Datas.Players.%loop-value%.Join-Date", "guilds/%{_pg}%")
671 set {_warkills} to checkFile("Datas.Players.%loop-value%.War-Kills", "guilds/%{_pg}%")
672 set {_wardeaths} to checkFile("Datas.Players.%loop-value%.War-Deaths", "guilds/%{_pg}%")
673 set {_donategold} to checkFile("Datas.Players.%loop-value%.Donated-Gold", "guilds/%{_pg}%")
674 set {_donatemagic} to checkFile("Datas.Players.%loop-value%.Donated-Magic", "guilds/%{_pg}%")
675 set {_seen} to checkFile("Players.%loop-value%.Last-Seen", "playerdata")
676 set {_lore} to {SG::Messages::Manage_Panel_2_Lore}
677 replace all "{NAME}" with "%{_lP}%" in {_lore}
678 if {_lp} is online:
679 replace all "{STATUS}" with "%{SG::Messages::Status_Online}%" in {_lore}
680 else:
681 replace all "{STATUS}" with "%{SG::Messages::Status_Offline}%" in {_lore}
682 replace all "{SEEN}" with "%{_seen}%" in {_lore}
683 replace all "{RANK}" with "%{SG::Messages::Rank_%{_rank}%}%" in {_lore}
684 replace all "{DATE}" with "%{_date}%" in {_lore}
685 replace all "{WARKILLS}" with "%{_warkills}%" in {_lore}
686 replace all "{WARDEATHS}" with "%{_wardeaths}%" in {_lore}
687 replace all "{DGOLD}" with "%{_donategold}%" in {_lore}
688 replace all "{DMAGIC}" with "%{_donatemagic}%" in {_lore}
689 if {_type} is "Rank":
690 set {_lore} to "%{_lore}%||%{SG::Messages::Change_Rank}%"
691 set {_command} to "sprglds rankGUI %{_p}% %{_lp}%"
692 else:
693 set {_lore} to "%{_lore}%||%{SG::Messages::See_Stats}%"
694 set {_command} to "sprglds playerInfo %{_p}% %{_lp}%"
695 format slot {_count} of {_p} with skull of {_lp} named "&2%{_lP}%" with lore "%{_lore}%" to close then run "%{_command}%"
696 else:
697 set {_lore} to {SG::Messages::Guild_Kick_Lore}
698 replace all "{RANK}" with "%{SG::Messages::Rank_%{_rank}%}%" in {_lore}
699 format slot {_count} of {_p} with skull of {_lp} named "&2%{_lP}%" with lore "%{_lore}%" to close then run "sprglds guildKick %{_p}% %{_lp}%"
700 add 1 to {_count}
701 else:
702 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to {_p}
703function selectListType(p: player):
704 set {_uuid} to "%uuid of {_p}%"
705 set {_pg} to checkFile("Players.%{_uuid}%.Guild-Name", "playerdata")
706 if {_pg} is not "*":
707 wait 2 ticks
708 open chest with 3 rows named "%{SG::Messages::GUIPrefix}%%{SG::Messages::Select_GUI}%" to {_p}
709 wait 1 ticks
710 set {_count} to 0
711 set {_x} to 0
712 loop 27 times:
713 {_x} is not 8 or 11 or 13 or 15:
714 format slot {_x} of {_p} with black glass named " " to be unstealable
715 add 1 to {_x}
716 format slot 8 of {_p} with red glass named "%{SG::Messages::Back_Header}%" to close then run [guildManagement({_p})]
717 format slot 11 of {_p} with flint and steel named "&6%{SG::Messages::Guild_Header_Kick}%" to close then run [guildPlayersGUI({_p}, "Kick")]
718 format slot 13 of {_p} with player head named "&6%{SG::Messages::Guild_Header_List}%" to close then run [guildPlayersGUI({_p}, "List")]
719 format slot 15 of {_p} with name tag named "&6%{SG::Messages::Guild_Header_Rank}%" to close then run [guildPlayersGUI({_p}, "Rank")]
720 else:
721 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to {_p}
722function rankGUI(p: player, selectedPlayer: offline player):
723 set {_uuid} to "%uuid of {_p}%"
724 set {_pg} to checkFile("Players.%{_uuid}%.Guild-Name", "playerdata")
725 if {_pg} is not "*":
726 set {_uuidSelected} to "%uuid of {_selectedPlayer}%"
727 set {_gSelected} to checkFile("Players.%{_uuidSelected}%.Guild-Name", "playerdata")
728 set {_rankP} to checkFile("Datas.Players.%{_uuid}%.Rank", "guilds/%{_pg}%")
729 set {_rankSelected} to checkFile("Datas.Players.%{_uuidSelected}%.Rank", "guilds/%{_pg}%")
730 "%{_gSelected}%" is "%{_pg}%"
731 set {_pRankLevel} to checkFile("General.%{_rankP}%-Perm-Level", "config") parsed as number
732 set {_selectedRankLevel} to checkFile("General.%{_rankSelected}%-Perm-Level", "config") parsed as number
733 if {_p} is not {_selectedPlayer}:
734 if {_pRankLevel} is greater than {_selectedRankLevel}:
735 wait 2 ticks
736 open chest with 3 rows named "%{SG::Messages::GUIPrefix}%%{SG::Messages::Guild_Header_Rank}%" to {_p}
737 wait 1 ticks
738 set {_x} to 0
739 loop 27 times:
740 {_x} is not 8 or 10 or 13 or 14 or 15 or 16:
741 format slot {_x} of {_p} with black glass named " " to be unstealable
742 add 1 to {_x}
743 format slot 8 of {_p} with red glass named "%{SG::Messages::Back_Header}%" to close then run [guildPlayersGUI({_p}, "Rank")]
744 set {_rank} to checkFile("Datas.Players.%{_uuidSelected}%.Rank", "guilds/%{_pg}%")
745 set {_lore} to {SG::Messages::Guild_Rank_Lore}
746 replace all "{RANK}" with "%{SG::Messages::Rank_%{_rank}%}%" in {_lore}
747 format slot 10 of {_p} with skull of {_selectedPlayer} named "&6%{_selectedPlayer}%" with lore "%{_lore}%" to be unstealable
748 format slot 13 of {_p} with nether star named "%{SG::Messages::Rank_Leader}%" with lore "%{SG::Messages::Change_Rank}%" to close then run [guildRank({_p}, {_selectedPlayer}, "Leader")]
749 format slot 14 of {_p} with diamond named "%{SG::Messages::Rank_General}%" with lore "%{SG::Messages::Change_Rank}%" to close then run [guildRank({_p}, {_selectedPlayer}, "General")]
750 format slot 15 of {_p} with gold ingot named "%{SG::Messages::Rank_Captain}%" with lore "%{SG::Messages::Change_Rank}%" to close then run [guildRank({_p}, {_selectedPlayer}, "Captain")]
751 format slot 16 of {_p} with iron ingot named "%{SG::Messages::Rank_Member}%" with lore "%{SG::Messages::Change_Rank}%" to close then run [guildRank({_p}, {_selectedPlayer}, "Member")]
752 else:
753 send "%{SG::Messages::Prefix}% %{SG::Messages::Rank_Not_Enough}%" to {_p}
754 else:
755 send "%{SG::Messages::Prefix}% %{SG::Messages::Rank_Yourself}%" to {_p}
756 else:
757 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to {_p}
758function guildInfo(p: player, pg: text):
759 set {_uuid} to "%uuid of {_target}%"
760 file "plugins/SUPERGUILDS/guilds/%{_pg}%.yml" exists
761 set {_name} to checkFile("Datas.Name", "guilds/%{_pg}%")
762 set {_design} to checkFile("Datas.Emblem", "guilds/%{_pg}%")#
763 set {_creator} to checkFile("Datas.Creator", "guilds/%{_pg}%")#
764 set {_time} to checkFile("Datas.Create-Time", "guilds/%{_pg}%")#
765 set {_leader} to checkFile("Datas.Leader", "guilds/%{_pg}%")#
766 set {_level} to checkFile("Datas.Division", "guilds/%{_pg}%")#
767 set {_claimed} to checkFile("Datas.Claimed-Land", "guilds/%{_pg}%")
768 set {_maxslot} to checkFile("Datas.Max-Slot", "guilds/%{_pg}%")
769 set {_slot} to sayiGoster("Datas.Players", "guilds/%{_pg}%")
770 set {_kills} to checkFile("Datas.War-Kills", "guilds/%{_pg}%")
771 set {_deaths} to checkFile("Datas.War-Deaths", "guilds/%{_pg}%")
772 wait 3 ticks
773 open chest with 3 rows named "%{SG::Messages::GUIPrefix}%%{SG::Messages::Guild_Info_Header}%" to {_p}
774 wait 1 ticks
775 set {_lore1} to {SG::Messages::Guild_Info_1_Lore}
776 set {_lore2} to {SG::Messages::Guild_Info_2_Lore}
777 set {_lore3} to {SG::Messages::Guild_Info_3_Lore}
778 {_design} is "*":
779 set {_design} to "f"
780 loop 64 times:
781 set {_design} to "%{_design}%;f"
782 set {_unicodes::*} to {_design} split at ";"
783 set {_no} to 0
784 loop 8 times:
785 set {_anamsg} to ""
786 loop 8 times:
787 add 1 to {_no}
788 clear {_msg}
789 set {_msg} to coloured "&%{_unicodes::%{_no}%}%â–ˆ"
790 set {_anamsg} to "%{_anamsg}%%{_msg}%"
791 set {_dlore%loop-number%} to "%{_anamsg}%"
792 set {_design} to "%{_dlore1}%||%{_dlore2}%||%{_dlore3}%||%{_dlore4}%||%{_dlore5}%||%{_dlore6}%||%{_dlore7}%||%{_dlore8}%"
793 replace all "{NAME}" with "%{_name}%" in {_lore1}
794 replace all "{EMBLEM}" with "%{_design}%" in {_lore1}
795 replace all "{TIME}" with "%{_time}%" in {_lore2}
796 replace all "{CREATOR}" with "%{_creator}%" in {_lore2}
797 replace all "{LEADER}" with "%{_leader}%" in {_lore1}
798 replace all "{KILLS}" with "%{_kills}%" in {_lore3}
799 replace all "{DEATHS}" with "%{_deaths}%" in {_lore3}
800 replace all "{LEVEL}" with "%{SG::Messages::Divisions_%{_level}%}%" in {_lore3}
801 replace all "{CLAIMED}" with "%{_claimed}%" in {_lore3}
802 set {_online} to {SG::Messages::Number_Online}
803 set {_x} to 0
804 set {_list::*} to configuration section "Datas.Players" get of "plugins/SUPERGUILDS/guilds/%{_pg}%.yml"
805 loop {_list::*}:
806 set {_lP} to checkFile("Datas.Players.%loop-value%.Username", "guilds/%{_pg}%") parsed as offline player
807 {_lP} is online
808 add 1 to {_x}
809 replace all "{PLAYER}" with "%{_x}%" in {_online}
810 replace all "{PLAYERS}" with "%{_slot}%" in {_lore3}
811 replace all "{MAX}" with "%{_maxslot}% %{_online}%" in {_lore3}
812 set {_x} to 0
813 loop 27 times:
814 {_x} is not 8 or 11 or 13 or 15:
815 format slot {_x} of {_p} with black glass named " " to be unstealable
816 add 1 to {_x}
817 format slot 8 of {_p} with red glass named "%{SG::Messages::Back_Header}%" to close then run [guildManagement({_p})]
818 format slot 11 of {_p} with paper named "%{SG::Messages::Guild_Info_1}%" with lore "%{_lore1}%" to be unstealable
819 format slot 13 of {_p} with gold helmet named "%{SG::Messages::Guild_Info_3}%" with lore "%{_lore3}%" to be unstealable
820 format slot 15 of {_p} with clock named "%{SG::Messages::Guild_Info_2}%" with lore "%{_lore2}%" to be unstealable
821function guildManagement(p: player):
822 set {_uuid} to "%uuid of {_p}%"
823 set {_pg} to checkFile("Players.%{_uuid}%.Guild-Name", "playerdata")
824 if {_pg} is not "*":
825 set {_rank} to checkFile("Datas.Players.%{_uuid}%.Rank", "guilds/%{_pg}%")
826 set {_s} to sayiGoster("Datas.Players", "guilds/%{_pg}%")
827 wait 2 ticks
828 open chest with 4 rows named "%{SG::Messages::GUIPrefix}%%{SG::Messages::Guild_Management}%" to {_p}
829 wait 1 ticks
830 loop integers from 0 to 35:
831 if loop-integer is not 10 or 11 or 12 or 13 or 14 or 15 or 16 or 19 or 20 or 21 or 22 or 23 or 24 or 25:
832 add loop-integer to {_b.glass::*}
833 else:
834 add loop-integer to {_g.glass::*}
835 loop {_b.glass::*}:
836 loop-value is not 8
837 format slot loop-value of {_p} with black glass to be unstealable
838 loop {_g.glass::*}:
839 loop-value is not 11 or 13 or 15 or 19 or 21 or 23 or 25
840 format slot loop-value of {_p} with black glass named " " to be unstealable
841 format slot 8 of {_p} with red glass named "%{SG::Messages::Back_Header}%" to close then run [guildManagementGUI({_p})]
842 format slot 11 of {_p} with painting named "%{SG::Messages::Guild_Emblem_GUI}%" with lore "%{SG::Messages::Guild_Emblem_Lore}%" to close then run [execute {_p} command "/g emblem"]
843 format slot 13 of {_p} with book named "%{SG::Messages::Guild_Info}%" with lore "%{SG::Messages::Guild_Info_Lore}%" to close then run [guildInfo({_p}, "%{_pg}%")]
844 format slot 15 of {_p} with {_s} of player head named "%{SG::Messages::Check_Players}%" with lore "%{SG::Messages::Check_Players_Lore}%" to close then run [selectListType({_p})]
845 format slot 19 of {_p} with gold ingot named "%{SG::Messages::Guild_Store}%" with lore "%{SG::Messages::Guild_Store_Lore}%" to close then run [storeGUI({_p})]
846 format slot 21 of {_p} with gold shovel named "%{SG::Messages::Claimed_Lands}%" with lore "%{SG::Messages::Claimed_Lands_Lore}%" to close then run [pageAPI({_p}, "1", "0")]
847 format slot 23 of {_p} with enchantment table named "%{SG::Messages::Guild_Alchemy}%" with lore "%{SG::Messages::Guild_Alchemy_Lore}%" to close then run [alchemyGUI({_p})]
848 format slot 25 of {_p} with crafting table named "%{SG::Messages::Guild_Buildings}%" with lore "%{SG::Messages::Guild_Buildings_Lore}%" to close then run [buildingsGUI({_p})]
849 else:
850 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to {_p}
851function guildManagementGUI(p: player):
852 set {_uuid} to "%uuid of {_p}%"
853 set {_pg} to checkFile("Players.%{_uuid}%.Guild-Name", "playerdata")
854 if {_pg} is not "*":
855 set {_rank} to checkFile("Datas.Players.%{_uuid}%.Rank", "guilds/%{_pg}%")
856 set {_date} to checkFile("Datas.Players.%{_uuid}%.Join-Date", "guilds/%{_pg}%")
857 set {_warkills} to checkFile("Datas.Players.%{_uuid}%.War-Kills", "guilds/%{_pg}%")
858 set {_wardeaths} to checkFile("Datas.Players.%{_uuid}%.War-Deaths", "guilds/%{_pg}%")
859 set {_dgold} to checkFile("Datas.Players.%{_uuid}%.Donated-Gold", "guilds/%{_pg}%")
860 set {_dmagic} to checkFile("Datas.Players.%{_uuid}%.Donated-Magic", "guilds/%{_pg}%")
861 set {_seen} to checkFile("Players.%{_uuid}%.Last-Seen", "playerdata")
862 set {_lore} to {SG::Messages::Manage_Panel_2_Lore}
863 replace all "{NAME}" with "%{_p}%" in {_lore}
864 replace all "{STATUS}" with "%{SG::Messages::Status_Online}%" in {_lore}
865 replace all "{SEEN}" with "%{_seen}%" in {_lore}
866 replace all "{RANK}" with "%{SG::Messages::Rank_%{_rank}%}%" in {_lore}
867 replace all "{DATE}" with "%{_date}%" in {_lore}
868 replace all "{WARKILLS}" with "%{_warkills}%" in {_lore}
869 replace all "{WARDEATHS}" with "%{_wardeaths}%" in {_lore}
870 replace all "{DGOLD}" with "%{_dgold}%" in {_lore}
871 replace all "{DMAGIC}" with "%{_dmagic}%" in {_lore}
872 wait 2 ticks
873 open chest with 3 rows named "%{SG::Messages::GUIPrefix}%%{SG::Messages::Guild_Management}%" to {_p}
874 wait 1 ticks
875 set {_x} to 0
876 loop 27 times:
877 {_x} is not 11 or 13 or 15:
878 format slot {_x} of {_p} with black glass named " " to be unstealable
879 add 1 to {_x}
880 format slot 11 of {_p} with book named "%{SG::Messages::Manage_Panel_1}%" to close then run [guildManagement({_p})]
881 format slot 13 of {_p} with skull of {_p} named "%{SG::Messages::Manage_Panel_2}%" with lore "%{_lore}%" to be unstealable
882 format slot 15 of {_p} with helmet named "%{SG::Messages::Manage_Panel_3}%" to close then run [warGUI({_p})]
883 else:
884 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to {_p}
885function inviteGUI(p: player, gName: text, type: text):
886 set {_uuid} to "%uuid of {_p}%"
887 if {_type} is "gui":
888 wait 2 ticks
889 open chest with 3 rows named "%{SG::Messages::GUIPrefix}%%{SG::Messages::Invite_GUI}%" to {_p}
890 wait 1 ticks
891 set {_msg} to {SG::Messages::InviteC_Accept}
892 set {_guildlongname} to checkFile("Datas.Name", "guilds/%{_gName}%")
893 replace all "{GUILD}" with "%{_guildlongname}%" in {_msg}
894 set {_x} to 0
895 loop 27 times:
896 {_x} is not 11 or 15:
897 format slot {_x} of {_p} with black glass named " " to be unstealable
898 add 1 to {_x}
899 format slot 11 of {_p} with green clay named "%{_msg}%" to close then run [inviteGUI({_p}, {_gName}, "accept")]
900 format slot 15 of {_p} with red clay named "%{SG::Messages::InviteC_Reject}%" to close then run [inviteGUI({_p}, {_gName}, "reject")]
901 #play raw sound "note.pling" at {_p} with pitch 1 volume 0.1
902 else if {_type} is "reject":
903 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Reject}%" to {_p}
904 else if {_type} is "accept":
905 set {_invitedGuild} to checkFile("Players.%{_uuid}%.Guild-Name", "playerdata")
906 if {_invitedGuild} is "*":
907 set {_maxslot} to checkFile("Datas.Max-Slot", "guilds/%{_gName}%") parsed as integer
908 set {_s} to sayiGoster("Datas.Players", "guilds/%{_gName}%")
909 if {_s} is less than {_maxslot}:
910 writeFile("Datas.Players.%{_uuid}%.Username", "%{_p}%", "guilds/%{_gName}%")
911 writeFile("Datas.Players.%{_uuid}%.Rank", "Member", "guilds/%{_gName}%")
912 writeFile("Datas.Players.%{_uuid}%.Join-Date", "%now%", "guilds/%{_gName}%")
913 writeFile("Datas.Players.%{_uuid}%.War-Kills", "0", "guilds/%{_gName}%")
914 writeFile("Datas.Players.%{_uuid}%.War-Deaths", "0", "guilds/%{_gName}%")
915 writeFile("Datas.Players.%{_uuid}%.Donated-Gold", "0", "guilds/%{_gName}%")
916 writeFile("Datas.Players.%{_uuid}%.Donated-Magic", "0", "guilds/%{_gName}%")
917 writeFile("Players.%{_uuid}%.Guild-Name", "%{_gName}%", "playerdata")
918 set {_guildlongname} to checkFile("Datas.Name", "guilds/%{_gName}%")
919 set {_msg1} to {SG::Messages::You_Joined_Guild}
920 replace all "{GUILD}" with "%{_guildlongname}%" in {_msg1}
921 send "%{SG::Messages::Prefix}% %{_msg1}%" to {_p}
922 set {_msg2} to {SG::Messages::Player_Joined_Guild}
923 replace all "{PLAYER}" with "%{_p}%" in {_msg2}
924 replace all "{GUILD}" with "%{_guildlongname}%" in {_msg2}
925 broadcast "%{SG::Messages::Prefix}% %{_msg2}%" to all worlds
926 else:
927 send "%{SG::Messages::Prefix}% %{SG::Messages::This_Guild_Is_Full}%" to {_P}
928 else:
929 send "%{SG::Messages::Prefix}% %{SG::Messages::Player_Has_Guild}%" to {_P}
930function upgradeBuild(p: player, gName: text, type: number):
931 set {_uuid} to "%uuid of {_p}%"
932 set {_pg} to checkFile("Players.%{_uuid}%.Guild-Name", "playerdata")
933 if {_pg} is "%{_gName}%":
934 set {_r} to checkFile("Datas.Players.%{_uuid}%.Rank", "guilds/%{_gName}%")
935 if {_r} is "Leader" or "General" or "Captain":
936 set {_currentLevel} to checkFile("Datas.Buildings-Level.%{_type}%", "guilds/%{_gName}%") parsed as number
937 set {_gold} to checkFile("Datas.Gold", "guilds/%{_gName}%") parsed as number
938 set {_requiredGold} to checkFile("Guild-Management.%{_type}%-Upgrade.Gold", "config") parsed as number
939 set {_magic} to checkFile("Datas.Magic", "guilds/%{_gName}%") parsed as number
940 set {_requiredMagic} to checkFile("Guild-Management.%{_type}%-Upgrade.Magic", "config") parsed as number
941 if {_gold} is greater or equal to {_requiredGold}*{_currentLevel}:
942 if {_magic} is greater or equal to {_requiredMagic}*{_currentLevel}:
943 set {_maxLevel::1} to 4
944 set {_maxLevel::2} to 5
945 set {_maxLevel::3} to 8
946 set {_maxLevel::4} to 3
947 if {_currentLevel} is less than {_maxLevel::%{_type}%}:
948 add 1 to {_currentLevel}
949 degerCikar("Datas.Gold", {_requiredGold}*{_currentLevel}, "guilds/%{_gName}%")
950 degerCikar("Datas.Magic", {_requiredMagic}*{_currentLevel}, "guilds/%{_gName}%")
951 degerEkle("Datas.Buildings-Level.%{_type}%", 1, "guilds/%{_gName}%")
952 set {_m} to {SG::Messages::Building_Upgrade}
953 replace all "{RANK}" with "%{SG::Messages::Rank_%{_r}%}%" in {_m}
954 replace all "{PLAYER}" with "%{_p}%" in {_m}
955 replace all "{BUILD}" with "%{SG::Messages::Buildings_Name_%{_type}%}%" in {_m}
956 replace all "{NUMBER}" with "%{_currentLevel}%" in {_m}
957 loop 20 times:
958 send "" to {_p}
959 guildBroadcast({_gName}, "%{_m}%")
960 if {_type} is 1:
961 degerEkle("Datas.Max-Slot", 4, "guilds/%{_gName}%")
962 schematicAPI("%{_p}%", "1", "1", "%{_currentLevel}%", "%{_gName}%")
963 guildBroadcast({_gName}, "%{SG::Messages::Buildings_Broadcast_1}%")
964 else if {_type} is 2:
965 set {_msg} to {SG::Messages::Buildings_Broadcast_2}
966 replace all "{ITEM}" with "%{SG::Messages::Barrack_Upgrade_Item_%{_currentLevel}%}%" in {_msg}
967 guildBroadcast({_gName}, "%{_msg}%")
968 else if {_type} is 3:
969 degerEkle("Datas.Max-Gold", 500, "guilds/%{_gName}%")
970 degerEkle("Datas.Max-Magic", 500, "guilds/%{_gName}%")
971 guildBroadcast({_gName}, "%{SG::Messages::Buildings_Broadcast_3}%")
972 else if {_type} is 4:
973 guildBroadcast({_gName}, "%{SG::Messages::Buildings_Broadcast_4}%")
974 else:
975 send "%{SG::Messages::Prefix}% %{SG::Messages::Limit_Buildings}%" to {_p}
976 else:
977 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Magic_Guild}% &7[&9%{_requiredMagic}% ⛃&7]" to {_p}
978 else:
979 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Gold_Guild}% &7[&e%{_requiredGold}% ⛃&7]" to {_p}
980 else:
981 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Rank}%" to {_p}
982 else:
983 send "%{SG::Messages::Prefix}% %{SG::Messages::Guild_Error_Upgrade}%" to {_p}
984function playerInfo(p: player, target: offline player):
985 set {_uuid} to "%uuid of {_target}%"
986 set {_pg} to checkFile("Players.%{_uuid}%.Guild-Name", "playerdata")
987 if {_pg} is "*":
988 set {_Lore.1} to "%{SG::Messages::Player_Info_No_Guild}%"
989 else:
990 set {_rank} to checkFile("Datas.Players.%{_uuid}%.Rank", "guilds/%{_pg}%")
991 set {_date} to checkFile("Datas.Players.%{_uuid}%.Join-Date", "guilds/%{_pg}%")
992 set {_warkills} to checkFile("Datas.Players.%{_uuid}%.War-Kills", "guilds/%{_pg}%")
993 set {_wardeaths} to checkFile("Datas.Players.%{_uuid}%.War-Deaths", "guilds/%{_pg}%")
994 set {_dgold} to checkFile("Datas.Players.%{_uuid}%.Donated-Gold", "guilds/%{_pg}%")
995 set {_dmagic} to checkFile("Datas.Players.%{_uuid}%.Donated-Magic", "guilds/%{_pg}%")
996 set {_name} to checkFile("Datas.Name", "guilds/%{_pg}%")
997 set {_Lore.1} to "%{SG::Messages::Player_Info_1}%"
998 replace all "{GUILD}" with "%{_name}%" in {_Lore.1}
999 replace all "{RANK}" with "%{SG::Messages::Rank_%{_rank}%}%" in {_Lore.1}
1000 replace all "{DATE}" with "%{_date}%" in {_Lore.1}
1001 replace all "{KILLS}" with "%{_warkills}%" in {_Lore.1}
1002 replace all "{DEATHS}" with "%{_wardeaths}%" in {_Lore.1}
1003 replace all "{DGOLD}" with "%{_dgold}%" in {_Lore.1}
1004 replace all "{DMAGIC}" with "%{_dmagic}%" in {_Lore.1}
1005 set {_Lore.2} to {SG::Messages::Player_Info_2}
1006 set {_kills} to checkFile("Players.%{_uuid}%.Kills", "playerdata")
1007 set {_deaths} to checkFile("Players.%{_uuid}%.Deaths", "playerdata")
1008 set {_donatedG} to checkFile("Players.%{_uuid}%.Donated-Gold", "playerdata")
1009 set {_donatedM} to checkFile("Players.%{_uuid}%.Donated-Mana", "playerdata")
1010 set {_kda} to {_kills}/{_deaths}
1011 set {_seen} to checkFile("Players.%{_uuid}%.Last-Seen", "playerdata")
1012 set {_c} to checkFile("Guild-Management.Player-Stats-Show-Location", "config")
1013 if {_c} is "true":
1014 set {_location} to "%location of {_target}%"
1015 else:
1016 set {_location} to "?"
1017 replace all "{PLAYER}" with "%{_target}%" in {_Lore.2}
1018 replace all "{KILLS}" with "%{_kills}%" in {_Lore.2}
1019 replace all "{DEATHS}" with "%{_deaths}%" in {_Lore.2}
1020 replace all "{DGOLD}" with "%{_donatedG}%" in {_Lore.2}
1021 replace all "{DMAGIC}" with "%{_donatedM}%" in {_Lore.2}
1022 replace all "{KDA}" with "%{_kda}%" in {_Lore.2}
1023 if {_target} is online:
1024 set {_Lore.3} to {SG::Messages::Player_Info_3}
1025 replace all "{HEALTH}" with "%{_target}'s health%" in {_Lore.3}
1026 replace all "{HUNGER}" with "%{_target}'s hunger%" in {_Lore.3}
1027 replace all "{LOCATION}" with "%{_location}%" in {_Lore.3}
1028 else:
1029 set {_Lore.3} to {SG::Messages::Player_Info_4}
1030 replace all "{SEEN}" with "%{_seen}%" in {_Lore.3}
1031 wait 3 ticks
1032 open chest with 3 rows named "%{SG::Messages::GUIPrefix}%%{SG::Messages::Player_Stats}%" to {_p}
1033 wait 1 ticks
1034 set {_x} to 0
1035 loop 27 times:
1036 {_x} is not 8 or 11 or 13 or 15:
1037 format slot {_x} of {_p} with black glass named " " to be unstealable
1038 add 1 to {_x}
1039 format slot 8 of {_p} with red glass named "%{SG::Messages::Back_Header}%" to close then run [guildPlayersGUI({_p}, "List")]
1040 format slot 11 of {_p} with item frame named "%{SG::Messages::Player_Info_Name_1}%" with lore "%{_Lore.1}%" to be unstealable
1041 format slot 13 of {_p} with skull of {_target} named "%{SG::Messages::Player_Info_Name_2}%" with lore "%{_Lore.2}%" to be unstealable
1042 format slot 15 of {_p} with paper named "%{SG::Messages::Player_Info_Name_3}%" with lore "%{_Lore.3}%" to be unstealable
1043function guildEmblemGUI(Player: player):
1044 set {_UUID} to "%uuid of {_Player}%"
1045 set {_design} to checkFile("Players.%{_UUID}%.Emblem-Design", "playerdata")
1046 {_design} is "*":
1047 set {_design} to "f"
1048 loop 64 times:
1049 set {_design} to "%{_design}%;f"
1050 set {_unicodes::*} to {_design} split at ";"
1051 set {_no} to 0
1052 loop 20 times:
1053 send "" to {_Player}
1054 wait 1 ticks
1055 send "%{SG::Messages::Emblem_Menu}%" to {_Player}
1056 send "" to {_Player}
1057 send "" to {_Player}
1058 loop 8 times:
1059 set {_command} to ""
1060 loop 8 times:
1061 add 1 to {_no}
1062 clear {_jsonText}
1063 set {_msg} to coloured "&%{_unicodes::%{_no}%}%â–ˆ"
1064 {_no} is 1 or 9 or 17 or 25 or 33 or 41 or 49 or 57:
1065 set {_msg} to coloured " &%{_unicodes::%{_no}%}%â–ˆ"
1066 set {_jsonText} to "{""text"":""%{_msg}%"",""color"":""white"",""clickEvent"":{""action"":""run_command"",""value"":""/g emblem Select %{_no}%""}}"
1067 if {_command} is not "":
1068 set {_command} to "%{_command}%,%{_jsonText}%"
1069 else:
1070 set {_command} to "%{_jsonText}%"
1071 run {_Player} command "/tellraw @p ["""",%{_command}%]" as op
1072 set {_clr} to "white|yellow|dark_green|dark_gray|blue|black|green|aqua|red|light_purple|dark_blue|dark_red|dark_purple|gold|gray"
1073 set {_colors::*} to {_clr} split at "|"
1074 set {_no} to 0
1075 set {_command} to ""
1076 send "" to {_Player}
1077 send "" to {_Player}
1078 loop 15 times:
1079 add 1 to {_no}
1080 clear {_jsonText}
1081 set {_msg} to "â–ˆ"
1082 {_no} is 1:
1083 set {_msg} to " %{SG::Messages::Color_Select}% â–ˆ"
1084 set {_jsonText} to "{""text"":""%{_msg}%"",""color"":""%{_colors::%{_no}%}%"",""clickEvent"":{""action"":""run_command"",""value"":""/g emblem Color %{_no}%""}}"
1085 if {_command} is not "":
1086 set {_command} to "%{_command}%,%{_jsonText}%"
1087 else:
1088 set {_command} to "%{_jsonText}%"
1089 run {_Player} command "/tellraw @p ["""",%{_command}%]" as op
1090 send "" to {_Player}
1091 send "" to {_Player}
1092 run {_Player} command "/tellraw @p ["""",{""text"":""%{SG::Messages::Save_Emblem_Button}%"",""color"":""green"",""clickEvent"":{""action"":""run_command"",""value"":""/g emblem Save""}},{""text"":""%{SG::Messages::Reset_Emblem_Button}%"",""color"":""red"",""clickEvent"":{""action"":""run_command"",""value"":""/g emblem Reset""}}]" as op
1093 send "" to {_Player}
1094 run {_Player} command "/tellraw @p ["""",{""text"":""%{SG::Messages::Use_Guild_Button}%"",""color"":""gray"",""clickEvent"":{""action"":""run_command"",""value"":""/g emblem Use""}}]" as op
1095command /sprglds [<text>] [<text>] [<text>] [<text>]:
1096 executable by: console
1097 trigger:
1098 if arg 1 is "guildKick":
1099 set {_arg2} to "%arg 2%" parsed as player
1100 set {_arg3} to "%arg 3%" parsed as offline player
1101 #broadcast "(%{_arg2}%, %{_arg3}%)"
1102 guildKick({_arg2}, {_arg3})
1103 else if arg 1 is "playerInfo":
1104 set {_arg2} to "%arg 2%" parsed as player
1105 set {_arg3} to "%arg 3%" parsed as offline player
1106 #broadcast "(%{_arg2}%, %{_arg3}%)"
1107 playerInfo({_arg2}, {_arg3})
1108 else if arg 1 is "upgradeBuild":
1109 set {_arg2} to "%arg 2%" parsed as player
1110 set {_arg3} to "%arg 3%"
1111 set {_arg4} to "%arg 4%" parsed as number
1112 upgradeBuild({_arg2}, {_arg3}, {_arg4})
1113 else if arg 1 is "rankGUI":
1114 set {_arg2} to "%arg 2%" parsed as player
1115 set {_arg3} to "%arg 3%" parsed as offline player
1116 #broadcast "(%{_arg2}%, %{_arg3}%)"
1117 rankGUI({_arg2}, {_arg3})
1118 else if arg 1 is "buyAlchemy":
1119 set {_arg2} to "%arg 2%" parsed as player
1120 set {_arg3} to "%arg 3%" parsed as number
1121 #broadcast "(%{_arg2}%, %{_arg3}%)"
1122 buyAlchemy({_arg2}, {_arg3})
1123 else if arg 1 is "teleporterAPI":
1124 set {_arg2} to "%arg 2%" parsed as player
1125 set {_arg3::*} to arg 3 split at ";"
1126 set {_x} to {_arg3::1} parsed as number
1127 set {_y} to {_arg3::2} parsed as number
1128 set {_z} to {_arg3::3} parsed as number
1129 set {_w} to {_arg3::4} parsed as world
1130 teleporterAPI({_arg2}, {_x}, {_y}, {_z}, {_w})
1131 else if arg 1 is "guildInfo":
1132 set {_arg2} to "%arg 2%" parsed as player
1133 guildInfo({_arg2}, "%arg 3%")
1134on load:
1135 set {_debug} to checkFile("General.Debug", "config")
1136 set {_list::*} to configuration section "Players" get of "plugins/SUPERGUILDS/playerdata.yml"
1137 loop {_list::*}:
1138 set {_n} to false
1139 set {_guildName} to checkFile("Players.%loop-value%.Guild-Name", "playerdata")
1140 if {_guildName} is not "*":
1141 if file "plugins/SUPERGUILDS/guilds/%{_guildName}%.yml" doesn't exists:
1142 set {_n} to true
1143 else:
1144 set {_test} to checkFile("Datas.Name", "guilds/%{_guildName}%")
1145 {_test} is "*"
1146 set {_n} to true
1147 {_n} is true
1148 writeFile("Players.%loop-value%.Guild-Name", "*", "playerdata")
1149 add {_guildName} to {_wRemoveGuild::*}
1150 wait 5 ticks
1151 loop {_wRemoveGuild::*}:
1152 disbandGuild("%{_guildName}%")
1153 wait 2 ticks
1154 set {_sch} to checkFile("General.Schematics", "config")
1155 {_sch} is "true"
1156 set {_file} to checkFile("General.Schematic-Folder", "config")
1157 add "1_L_1" and "1_L_2" and "1_L_3" and "1_L_4" to {_builds::*}
1158 loop {_builds::*}:
1159 file "plugins/%{_file}%/%loop-value%.schematic" doesn't exists
1160 writeFile("General.Schematics", "false", "config")
1161 send "[SG DEBUG] Schematics options has been set to false because plugins/%{_file}%/%loop-value%.schematic file not found." to console
1162 send "[SG DEBUG] Download at republicansensei.com (SUPERGUILDS Schematic Pack.rar file)" to console
1163 stop
1164command /SuperGuilds [<text>] [<text>] [<text>] [<text>] [<integer>]:
1165 aliases: g, sg, guilds, f, faction, clan
1166 executable by: players
1167 trigger:
1168 if arg 1 is not set:
1169 if player has permission "guilds.*" or "guilds.player":
1170 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1171 if {_pg} is not "*":
1172 guildManagementGUI(player)
1173 else:
1174 make player execute command "/g help"
1175 else:
1176 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1177 else if arg 1 is "help":
1178 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.help":
1179 if arg 2 is not set:
1180 execute player command "/guilds help 1"
1181 stop
1182 else:
1183 if arg 2 is "1" or "2" or "3":
1184 set {_page} to "%arg 2%" parsed as integer
1185 else:
1186 execute player command "/guilds help 1"
1187 stop
1188 send "&8&m--------------(&r &6&lSUPERGUILDS &8&m)--------------" to player
1189 loop 8 times:
1190 if {SG::Messages::Help_Pages_%{_page}%::Line_%loop-number%} is set:
1191 send " %{SG::Messages::Help_Pages_%{_page}%::Line_%loop-number%}%" to player
1192 if {_page} is less than 3:
1193 set {_msg} to {SG::Messages::Next_Page}
1194 replace all "{NEXT}" with "%{_page}+1%" in {_msg}
1195 send "%{_msg}%" to player
1196 else:
1197 send "&8&m--------------------------------------------" to player
1198 else:
1199 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1200 else if arg 1 is "create":
1201 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.create":
1202 set {_debug} to single value "General.Debug" get of "plugins/SUPERGUILDS/config.yml"
1203 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1204 if {_pg} is "*":
1205 if arg 2 is set:
1206 set {_yazi} to charControl("%arg-2%")
1207 wait 1 ticks
1208 {_debug} is "true":
1209 send "[SG DEBUG] Guild name: %arg 2%, {_yazi}: %{_yazi}% (%player%)" to console
1210 if length of {_yazi} is not 0:
1211 send "%{SG::Messages::Prefix}% %{SG::Messages::Char_Error}% &7[%{_yazi}%]"
1212 stop
1213 set {_downText} to downText("%arg-2%")
1214 if file "plugins/SUPERGUILDS/guilds/%{_downText}%.yml" doesn't exists:
1215 set {_min} to checkFile("Guild-Management.Min-Name-Length", "config") parsed as number
1216 set {_max} to checkFile("Guild-Management.Max-Name-Length", "config") parsed as number
1217 {_debug} is "true":
1218 send "[SG DEBUG] No file found about guilds/%{_downText}%.yml. min: %{_min}%, max: %{_max}% (%player%)" to console
1219 if length of {_downText} is between {_min} and {_max}:
1220 if block under player isn't lava source, air or water source:
1221 set {_disabled::*} to checkFile("General.Guild-Create-Disabled-Worlds", "config") split at ","
1222 size of {_disabled::*} > 0:
1223 loop size of {_disabled::*} times:
1224 "%{_disabled::%loop-number%}%" is "%world of player%"
1225 send "%{SG::Messages::Prefix}% %{SG::Messages::Create_Guild_Disabled_World}%" to player
1226 stop
1227 set {_wg} to checkFile("General.WorldGuard-Support", "config")
1228 {_wg} is "true":
1229 player cannot build at player's location
1230 send "%{SG::Messages::Prefix}% %{SG::Messages::WorldGuard_Error}%" to player
1231 stop
1232 set {_Sch} to checkFile("General.Schematics", "config")
1233 set {_Claims} to checkFile("General.Claims", "config")
1234 set {_StartW} to checkFile("Guild-Management.Start-With-Claim", "config")
1235 {_Claims} is "true":
1236 {_Sch} is "true":
1237 set {_c} to chunk at player
1238 if chunk at block under block 7 north is not {_c}:
1239 set {_x} to x coordinate of player
1240 set {_y} to y coordinate of player
1241 set {_z} to z coordinate of player
1242 set {_world} to world of player
1243 chunkMiddle(player, {_x}, {_y}, {_z}, {_world}, "show")
1244 send "%{SG::Messages::Prefix}% %{SG::Messages::Chunk_Middle}%"
1245 stop
1246 if chunk at block under block 7 south is not {_c}:
1247 set {_x} to x coordinate of player
1248 set {_y} to y coordinate of player
1249 set {_z} to z coordinate of player
1250 set {_world} to world of player
1251 chunkMiddle(player, {_x}, {_y}, {_z}, {_world}, "show")
1252 send "%{SG::Messages::Prefix}% %{SG::Messages::Chunk_Middle}%"
1253 stop
1254 if chunk at block under block 7 west is not {_c}:
1255 send "%{SG::Messages::Prefix}% %{SG::Messages::Chunk_Middle}%"
1256 set {_x} to x coordinate of player
1257 set {_y} to y coordinate of player
1258 set {_z} to z coordinate of player
1259 set {_world} to world of player
1260 chunkMiddle(player, {_x}, {_y}, {_z}, {_world}, "show")
1261 stop
1262 if chunk at block under block 7 east is not {_c}:
1263 send "%{SG::Messages::Prefix}% %{SG::Messages::Chunk_Middle}%"
1264 set {_x} to x coordinate of player
1265 set {_y} to y coordinate of player
1266 set {_z} to z coordinate of player
1267 set {_world} to world of player
1268 chunkMiddle(player, {_x}, {_y}, {_z}, {_world}, "show")
1269 stop
1270 set {_chunk} to checkFile("Regions.%chunk at location of player%", "chunks")
1271 {_chunk} is not "*":
1272 send "%{SG::Messages::Prefix}% %{SG::Messages::Chunk_Error}%" to player
1273 stop
1274 #
1275 {_debug} is "true":
1276 send "[SG DEBUG] Chunk/Region/Claim control done. {_Sch}: %{_Sch}%, {_Claims}: %{_Claims}%, {_StartW}: %{_StartW}% (%player%)" to console
1277 set {_ph} to "%number of gold ingot in player's inventory%" parsed as number
1278 set {_cn} to checkFile("Guild-Management.Required-Gold-To-Create", "config") parsed as number
1279 if {_ph} is greater or equal to {_cn}:
1280 remove {_cn} of gold ingot from player's inventory
1281 else:
1282 send "%{SG::Messages::Prefix}% %{SG::Messages::Dont_Have_Gold_To_Create}%" to player
1283 {_debug} is "true":
1284 send "[SG DEBUG] Player %player% doesn't have required gold ingot: %{_cn}%" to console
1285 stop
1286 {_debug} is "true":
1287 send "[SG DEBUG] File creating for %player%'s new guild %{_downText}%." to console
1288 writeFile("Players.%uuid of player%.Guild-Name", "%{_downText}%", "playerdata")
1289 set {_startSlot} to checkFile("Guild-Management.Start-MaxSlot", "config") parsed as number
1290 set {_startGold} to checkFile("Guild-Management.Start-Gold", "config") parsed as number
1291 set {_startMagic} to checkFile("Guild-Management.Start-Magic", "config") parsed as number
1292 #
1293 set {_dsc} to "f"
1294 loop 64 times:
1295 set {_dsc} to "%{_dsc}%;f"
1296 #
1297 set {_ploc} to location of player
1298 set {_pchunk} to chunk at player
1299 create file "plugins/SUPERGUILDS/guilds/%{_downText}%.yml"
1300 wait 1 tick
1301 writeFile("Datas.Name", "%arg 2%", "guilds/%{_downText}%")
1302 writeFile("Datas.Creator", "%player%", "guilds/%{_downText}%")
1303 writeFile("Datas.Create-Time", "%now%", "guilds/%{_downText}%")
1304 writeFile("Datas.Leader", "%player%", "guilds/%{_downText}%")
1305 writeFile("Datas.Emblem", "%{_dsc}%", "guilds/%{_downText}%")
1306 writeFile("Datas.Gold", "%{_startGold}%", "guilds/%{_downText}%")
1307 writeFile("Datas.Magic", "%{_startMagic}%", "guilds/%{_downText}%")
1308 writeFile("Datas.Division", "0", "guilds/%{_downText}%")
1309 writeFile("Datas.War-Points", "1", "guilds/%{_downText}%")
1310 writeFile("Datas.Max-Gold", "500", "guilds/%{_downText}%")
1311 writeFile("Datas.Max-Magic", "500", "guilds/%{_downText}%")
1312 writeFile("Datas.Max-Slot", "%{_startSlot}%", "guilds/%{_downText}%")
1313 writeFile("Datas.Buildings-Level.1", "1", "guilds/%{_downText}%")
1314 writeFile("Datas.Buildings-Level.2", "1", "guilds/%{_downText}%")
1315 writeFile("Datas.Buildings-Level.3", "1", "guilds/%{_downText}%")
1316 writeFile("Datas.Buildings-Level.4", "1", "guilds/%{_downText}%")
1317 writeFile("Datas.War-Kills", "0", "guilds/%{_downText}%")
1318 writeFile("Datas.War-Deaths", "0", "guilds/%{_downText}%")
1319 writeFile("Datas.War-Wins", "0", "guilds/%{_downText}%")
1320 writeFile("Datas.War-Wins", "0", "guilds/%{_downText}%")
1321 writeFile("Datas.War-Loses", "0", "guilds/%{_downText}%")
1322 writeFile("Datas.War-Status", "*", "guilds/%{_downText}%")
1323 writeFile("Datas.Claimed-Land", "0", "guilds/%{_downText}%")
1324 writeFile("Datas.Invite-Time", "*%month%;*%day%;*%hour%;*%minute%;*%second%", "guilds/%{_downText}%")
1325 writeFile("Datas.Show-Claims-Time", "*%month%;*%day%;*%hour%;*%minute%;*%second%", "guilds/%{_downText}%")
1326 writeFile("Datas.Players.%uuid of player%.Username", "%player%", "guilds/%{_downText}%")
1327 writeFile("Datas.Players.%uuid of player%.Rank", "Leader", "guilds/%{_downText}%")
1328 writeFile("Datas.Players.%uuid of player%.Join-Date", "%now%", "guilds/%{_downText}%")
1329 writeFile("Datas.Players.%uuid of player%.War-Kills", "0", "guilds/%{_downText}%")
1330 writeFile("Datas.Players.%uuid of player%.War-Deaths", "0", "guilds/%{_downText}%")
1331 writeFile("Datas.Players.%uuid of player%.Donated-Gold", "0", "guilds/%{_downText}%")
1332 writeFile("Datas.Players.%uuid of player%.Donated-Magic", "0", "guilds/%{_downText}%")
1333 writeFile("Datas.Home-Location", "%player's x coordinate%;%player's y coordinate%;%player's z coordinate%;%world of player%", "guilds/%{_downText}%")
1334 writeFile("Datas.Center-Location", "%player's x coordinate%;%player's y coordinate%;%player's z coordinate%;%world of player%", "guilds/%{_downText}%")
1335 {_Claims} is "true":
1336 {_StartW} is "true"
1337 writeFile("Regions.%chunk at location of player%", "%{_downText}%", "chunks")
1338 writeFile("Datas.Claimed-Land", "1", "guilds/%{_downText}%")
1339 set {_x} to x coordinate of player
1340 set {_y} to y coordinate of player
1341 set {_z} to z coordinate of player
1342 set {_world} to world of player
1343 #
1344 set {_townhall} to "%uncolored {SG::Messages::Buildings_Name_1}%"
1345 writeFile("Datas.Claims.%chunk at player%", "%player's x coordinate%;%player's y coordinate%;%player's z coordinate%;%world of player%;%{_townhall}%", "guilds/%{_downText}%")
1346 #
1347 {_Sch} is "true":
1348 set {_pos1} to location of block at block 7 behind block 8 east block under {_ploc}
1349 set {_pos2} to location of block at block 8 forward block 7 west block 8 above {_ploc}
1350 writeFile("Datas.Schematic.1.Main-Chunk", "%{_pchunk}%", "guilds/%{_downText}%")
1351 writeFile("Datas.Schematic.1.Pos-1", "%{_pos1}'s x coordinate%;%{_pos1}'s y coordinate%;%{_pos1}'s z coordinate%;%world of player%", "guilds/%{_downText}%")
1352 writeFile("Datas.Schematic.1.Pos-2", "%{_pos2}'s x coordinate%;%{_pos2}'s y coordinate%;%{_pos2}'s z coordinate%;%world of player%", "guilds/%{_downText}%")
1353 writeFile("Datas.Schematic.1.Center", "%{_ploc}'s x coordinate%;%{_ploc}'s y coordinate%;%{_ploc}'s z coordinate%;%world of player%", "guilds/%{_downText}%")
1354 #
1355 schematicAPI("%player%", "1", "1", "1", "%{_downText}%")
1356 wait 3 ticks
1357 chunkMiddle(player, {_x}, {_y}, {_z}, {_world}, "create")
1358 set {_message} to "%{SG::Messages::Created_Guild}%"
1359 replace all "{GUILD}" with "%arg 2%" in {_message}
1360 replace all "{PLAYER}" with "%name of player%" in {_message}
1361 broadcast "%{SG::Messages::Prefix}% %{_message}%"
1362 #guildManagement(player)
1363 {_debug} is "true":
1364 send "[SG DEBUG] Created %{_downText}% guild by %player%." to console
1365 else:
1366 send "%{SG::Messages::Prefix}% %{SG::Messages::Land_Error}%" to player
1367 else:
1368 send "%{SG::Messages::Prefix}% %{SG::Messages::Guild_Name_Length}%" to player
1369 else:
1370 send "%{SG::Messages::Prefix}% %{SG::Messages::That_Guild_Exists}%" to player
1371 else:
1372 send "%{SG::Messages::Prefix}% %{SG::Messages::Enter_Guild_Name}%" to player
1373 else:
1374 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Have_Guild}%" to player
1375 else:
1376 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1377 else if arg 1 is "remove" or "disband":
1378 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.remove" or "guilds.disband":
1379 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1380 if {_pg} is not "*":
1381 set {_r} to checkFile("Datas.Players.%uuid of player%.Rank", "guilds/%{_pg}%")
1382 if {_r} is "Leader":
1383 set {_remove} to checkFile("Players.%uuid of player%.Remove-Command-Confirm", "playerdata")
1384 if {_remove} is "*":
1385 send "%{SG::Messages::Prefix}% %{SG::Messages::Remove_Confirm}%" to player
1386 writeFile("Players.%uuid of player%.Remove-Command-Confirm", "true", "playerdata")
1387 else:
1388 send "%{SG::Messages::Prefix}% %{SG::Messages::Guild_Removed}%" to player
1389 disbandGuild("%{_pg}%")
1390 writeFile("Players.%uuid of player%.Remove-Command-Confirm", "*", "playerdata")
1391 else:
1392 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Arent_Leader}%" to player
1393 else:
1394 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to player
1395 else:
1396 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1397 else if arg 1 is "home":
1398 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.home":
1399 set {_h} to checkFile("Guild-Management.Homes", "config")
1400 if {_h} is "true":
1401 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1402 if {_pg} is not "*":
1403 set {_location::*} to checkFile("Datas.Home-Location", "guilds/%{_pg}%") split at ";"
1404 set {_x} to {_location::1} parsed as number
1405 set {_y} to {_location::2} parsed as number
1406 set {_z} to {_location::3} parsed as number
1407 set {_w} to {_location::4} parsed as world
1408 set {_loc} to location of block at location ({_x}, {_y}, {_z}) in world {_w}
1409 if {_loc} is set:
1410 teleporterAPI(player, {_x}, {_y}, {_z}, {_w})
1411 else:
1412 send "%{SG::Messages::Prefix}% %{SG::Messages::Home_Not_Set}%"
1413 else:
1414 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to player
1415 else:
1416 send "%{SG::Messages::Prefix}% %{SG::Messages::Option_Disabled}%" to player
1417 else:
1418 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1419 else if arg 1 is "sethome":
1420 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.sethome":
1421 set {_h} to checkFile("Guild-Management.Homes", "config")
1422 if {_h} is "true":
1423 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1424 if {_pg} is not "*":
1425 set {_r} to checkFile("Datas.Players.%uuid of player%.Rank", "guilds/%{_pg}%")
1426 if {_r} is "Leader" or "General" or "Captain":
1427 set {_chunk} to checkFile("Regions.%chunk at location of player%", "chunks")
1428 if {_chunk} is "%{_pg}%":
1429 if block under player isn't lava source or water source or air:
1430 writeFile("Datas.Home-Location.x", "%player's x coordinate%", "guilds/%{_pg}%")
1431 writeFile("Datas.Home-Location.y", "%player's y coordinate%", "guilds/%{_pg}%")
1432 writeFile("Datas.Home-Location.z", "%player's z coordinate%", "guilds/%{_pg}%")
1433 writeFile("Datas.Home-Location.world", "%world of player%", "guilds/%{_pg}%")
1434 send "%{SG::Messages::Prefix}% %{SG::Messages::Done_Set_Home}%" to player
1435 else:
1436 send "%{SG::Messages::Prefix}% %{SG::Messages::Land_Error}%" to player
1437 else:
1438 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_This_Chunk}%" to player
1439 else:
1440 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Rank}%" to player
1441 else:
1442 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to player
1443 else:
1444 send "%{SG::Messages::Prefix}% %{SG::Messages::Option_Disabled}%" to player
1445 else:
1446 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1447 else if arg 1 is "claim":
1448 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.claim":
1449 set {_c} to checkFile("General.Claims", "config")
1450 if {_c} is "true":
1451 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1452 if {_pg} is not "*":
1453 set {_r} to checkFile("Datas.Players.%uuid of player%.Rank", "guilds/%{_pg}%")
1454 if {_r} is "Leader" or "General" or "Captain":
1455 set {_gold} to checkFile("Datas.Gold", "guilds/%{_pg}%") parsed as number
1456 set {_required} to checkFile("Guild-Management.Claim-Gold-Cost", "config") parsed as number
1457 if {_gold} is greater or equal to {_required}:
1458 set {_wg} to checkFile("General.WorldGuard-Support", "config")
1459 {_wg} is "true":
1460 player cannot build at player's location
1461 send "%{SG::Messages::Prefix}% %{SG::Messages::WorldGuard_Error}%" to player
1462 stop
1463 set {_chunk} to checkFile("Regions.%chunk at location of player%", "chunks")
1464 if {_chunk} is "%{_pg}%":
1465 send "%{SG::Messages::Prefix}% %{SG::Messages::Claim_Error}%" to player
1466 stop
1467 else if {_chunk} is not "*":
1468 set {_levelBy} to checkFile("Datas.Division", "guilds/%{_pg}%") parsed as number
1469 {_levelBy} is not set:
1470 set {_levelBy} to 0
1471 writeFile("Datas.Division", "0", "guilds/%{_pg}%")
1472 set {_levelOwn} to checkFile("Datas.Division", "guilds/%{_chunk}%") parsed as number
1473 {_levelOwn} is not set:
1474 set {_levelOwn} to 0
1475 writeFile("Datas.Division", "0", "guilds/%{_chunk}%")
1476 if {_levelBy} is less or equal to {_levelOwn}:
1477 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Claim_Level}%" to player
1478 stop
1479 set {_message} to {SG::Messages::Attacking_You}
1480 replace all "{ATTACKER}" with "%{_pg}%" in {_message}
1481 replace all "{LAND}" with "%location of player%" in {_message}
1482 guildBroadcast({_chunk},"%{_message}%")
1483 set {_message} to {SG::Messages::Attacked_Chunk}
1484 replace all "{OWN}" with "%{_chunk}%" in {_message}
1485 replace all "{LAND}" with "%location of player%" in {_message}
1486 guildBroadcast({_pg},"%{_message}%")
1487 degerCikar("Datas.Claimed-Land", 1, "guilds/%{_chunk}%")
1488 writeFile("Regions.%chunk at location of player%", "%{_pg}%", "chunks")
1489 writeFile("Datas.Claims.%chunk at player%", "%player's x coordinate%;%player's y coordinate%;%player's z coordinate%;%world of player%", "guilds/%{_pg}%")
1490 degerCikar("Datas.Gold", {_required}, "guilds/%{_pg}%")
1491 degerEkle("Datas.Claimed-Land", 1, "guilds/%{_pg}%")
1492 set {_message} to {SG::Messages::Chunk_Claimed}
1493 replace all "{LAND}" with "%location of player%" in {_message}
1494 guildBroadcast({_pg},"%{_message}%")
1495 set {_x} to x coordinate of player
1496 set {_y} to y coordinate of player
1497 set {_z} to z coordinate of player
1498 set {_world} to world of player
1499 chunkMiddle(player, {_x}, {_y}, {_z}, {_world}, "claim")
1500 else:
1501 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Gold_Guild}% &7[&e%{_required}% ⛃&7]" to player
1502 else:
1503 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Rank}%" to player
1504 else:
1505 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to player
1506 else:
1507 send "%{SG::Messages::Prefix}% %{SG::Messages::Option_Disabled}%" to player
1508 else:
1509 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1510 else if arg 1 is "unclaim":
1511 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.unclaim":
1512 set {_c} to checkFile("General.Claims", "config")
1513 if {_c} is "true":
1514 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1515 if {_pg} is not "*":
1516 set {_r} to checkFile("Datas.Players.%uuid of player%.Rank", "guilds/%{_pg}%")
1517 if {_r} is "Leader" or "General" or "Captain":
1518 set {_chunk} to checkFile("Regions.%chunk at location of player%", "chunks")
1519 if {_chunk} is "%{_pg}%":
1520 loop 4 times:
1521 clear {_buildMainChunk}
1522 set {_buildMainChunk} to checkFile("Datas.Schematic.%loop-number%.Main-Chunk", "guilds/%{_pg}%")
1523 {_buildMainChunk} is "%chunk of player%"
1524 set {_msg} to {SG::Messages::You_Cant_Unclaim}
1525 replace all "{BUILD}" with "%uncolored {SG::Messages::Buildings_Name_%loop-number%}%" in {_msg}
1526 send "%{SG::Messages::Prefix}% %{_msg}%" to player
1527 stop
1528 set {_message} to {SG::Messages::Chunk_Unclaimed}
1529 replace all "{PLAYER}" with "%player%" in {_message}
1530 replace all "{LAND}" with "%location of player%" in {_message}
1531 guildBroadcast({_pg},"%{_message}%")
1532 set {_required} to checkFile("Guild-Management.Claim-Gold-Cost", "config") parsed as number
1533 set {_gived} to {_required}/2
1534 degerEkle("Datas.Gold", {_gived}, "guilds/%{_pg}%")
1535 degerCikar("Datas.Claimed-Land", 1, "guilds/%{_pg}%")
1536 veriCikar("Regions", "%chunk at location of player%", "chunks")
1537 #
1538 veriCikar("Datas.Claims", "%chunk at player%", "guilds;%{_pg}%")
1539 #
1540 set {_x} to x coordinate of player
1541 set {_y} to y coordinate of player
1542 set {_z} to z coordinate of player
1543 set {_world} to world of player
1544 chunkMiddle(player, {_x}, {_y}, {_z}, {_world}, "unclaim")
1545 else:
1546 send "%{SG::Messages::Prefix}% %{SG::Messages::Chunk_Error_You}%" to player
1547 else:
1548 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Rank}%" to player
1549 else:
1550 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to player
1551 else:
1552 send "%{SG::Messages::Prefix}% %{SG::Messages::Option_Disabled}%" to player
1553 else:
1554 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1555 else if arg 1 is "kick":
1556 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.kick":
1557 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1558 if {_pg} is not "*":
1559 set {_r} to checkFile("Datas.Players.%uuid of player%.Rank", "guilds/%{_pg}%")
1560 if {_r} is "Leader" or "General" or "Captain":
1561 guildPlayersGUI(player, "Kick")
1562 else:
1563 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Rank}%" to player
1564 else:
1565 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to player
1566 else:
1567 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1568 else if arg 1 is "emblem" or "desc":
1569 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.desc" or "guilds.emblem":
1570 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1571 if {_pg} is not "*":
1572 set {_r} to checkFile("Datas.Players.%uuid of player%.Rank", "guilds/%{_pg}%")
1573 if {_r} is "Leader" or "General":
1574 if arg 2 is not set:
1575 guildEmblemGUI(player)
1576 else if arg 2 is "Save":
1577 set {_design} to checkFile("Players.%uuid of player%.Emblem-Design", "playerdata")
1578 writeFile("Datas.Emblem", "%{_design}%", "guilds/%{_pg}%")
1579 send "%{SG::Messages::Prefix}% %{SG::Messages::Emblem_Saved}%" to player
1580 set {_message} to {SG::Messages::Guild_Emblem_Changed}
1581 replace all "{PLAYER}" with "%player%" in {_message}
1582 guildBroadcast({_pg},"%{_message}%")
1583 #play raw sound "random.successful_hit" at player with pitch 1 volume 1
1584 else if arg 2 is "Reset":
1585 set {_design} to "f"
1586 loop 64 times:
1587 set {_design} to "%{_design}%;f"
1588 writeFile("Players.%uuid of player%.Emblem-Design", "%{_design}%", "playerdata")
1589 execute player command "/g emblem"
1590 #play raw sound "mob.cat.hitt" at player with pitch 1 volume 1
1591 else if arg 2 is "Color":
1592 if arg 3 is "1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9" or "10" or "11" or "12" or "13" or "14" or "15":
1593 set {_sw::1} to "f"
1594 set {_sw::2} to "e"
1595 set {_sw::3} to "2"
1596 set {_sw::4} to "8"
1597 set {_sw::5} to "9"
1598 set {_sw::6} to "0"
1599 set {_sw::7} to "a"
1600 set {_sw::8} to "b"
1601 set {_sw::9} to "c"
1602 set {_sw::10} to "d"
1603 set {_sw::11} to "1"
1604 set {_sw::12} to "4"
1605 set {_sw::13} to "5"
1606 set {_sw::14} to "6"
1607 set {_sw::15} to "7"
1608 writeFile("Players.%uuid of player%.Selected-Color", "%{_sw::%arg 3%}%", "playerdata")
1609 execute player command "/g emblem"
1610 #play raw sound "random.pop" at player with pitch 1 volume 1
1611 else:
1612 send "%{SG::Messages::Prefix}% %{SG::Messages::Select_Color}%" to player
1613 else if arg 2 is "Select":
1614 set {_num} to "%arg 3%" parsed as number
1615 if {_num} is set:
1616 {_num} is between 1 and 64
1617 set {_design} to checkFile("Players.%uuid of player%.Emblem-Design", "playerdata")
1618 {_design} is "*":
1619 set {_design} to "f"
1620 loop 64 times:
1621 set {_design} to "%{_design}%;f"
1622 writeFile("Players.%uuid of player%.Emblem-Design", "%{_design}%", "playerdata")
1623 set {_playercolor} to checkFile("Players.%uuid of player%.Selected-Color", "playerdata")
1624 {_playercolor} is "*":
1625 set {_playercolor} to "f"
1626 set {_unicodes::*} to {_design} split at ";"
1627 set {_unicodes::%{_num}%} to "%{_playercolor}%"
1628 set {_desc} to ""
1629 loop {_unicodes::*}:
1630 if {_desc} is not "":
1631 set {_desc} to "%{_desc}%;%loop-value%"
1632 else:
1633 set {_desc} to "%loop-value%"
1634 writeFile("Players.%uuid of player%.Emblem-Design", "%{_desc}%", "playerdata")
1635 execute player command "/g emblem"
1636 #play raw sound "random.wood_click" at player with pitch 1 volume 1
1637 else:
1638 send "%{SG::Messages::Prefix}% %{SG::Messages::Select_Code}%" to player
1639 else if arg 2 is "Use":
1640 set {_design} to checkFile("Datas.Emblem", "guilds/%{_pg}%")
1641 writeFile("Players.%uuid of player%.Emblem-Design", "%{_design}%", "playerdata")
1642 execute player command "/g emblem"
1643 #play raw sound "random.click" at player with pitch 1 volume 1
1644 else:
1645 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Rank}%" to player
1646 else:
1647 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to player
1648 else:
1649 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1650 else if arg 1 is "chat" or "c":
1651 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.chat" or "guilds.c":
1652 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1653 if {_pg} is not "*":
1654 set {_chat} to checkFile("Players.%uuid of player%.Chat-Enabled", "playerdata")
1655 if {_chat} is "*" or "true":
1656 writeFile("Players.%uuid of player%.Chat-Enabled", "false", "playerdata")
1657 send "%{SG::Messages::Prefix}% %{SG::Messages::Disabled_Chat}%" to player
1658 else:
1659 writeFile("Players.%uuid of player%.Chat-Enabled", "true", "playerdata")
1660 send "%{SG::Messages::Prefix}% %{SG::Messages::Enabled_Chat}%" to player
1661 else:
1662 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to player
1663 else:
1664 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1665 else if arg 1 is "members":
1666 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.members":
1667 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1668 if {_pg} is not "*":
1669 guildPlayersGUI(player, "List")
1670 else:
1671 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to player
1672 else:
1673 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1674 else if arg 1 is "info":
1675 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.info":
1676 if arg 2 is set:
1677 if file "plugins/SUPERGUILDS/guilds/%arg 2%.yml" exists:
1678 guildInfo(player, "%arg 2%")
1679 else:
1680 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Guild_Like_This}%" to player
1681 else:
1682 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1683 if {_pg} is not "*":
1684 guildInfo(player, "%{_pg}%")
1685 else:
1686 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to player
1687 else:
1688 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1689 else if arg 1 is "stats":
1690 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.stats":
1691 if arg 2 is set:
1692 set {_arg} to "%arg 2%" parsed as offline player
1693 set {_uuid} to "%uuid of {_arg}%"
1694 set {_username} to checkFile("Players.%{_uuid}%.Username", "playerdata")
1695 if {_username} is not "*":
1696 playerInfo(player, {_arg})
1697 else:
1698 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Player_Like_This}%" to player
1699 else:
1700 playerInfo(player, player)
1701 else:
1702 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1703 else if arg 1 is "list":
1704 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.list":
1705 pageAPI(player, "0", "0")
1706 else:
1707 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1708 else if arg 1 is "rank":
1709 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.rank":
1710 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1711 if {_pg} is not "*":
1712 guildPlayersGUI(player, "Rank")
1713 else:
1714 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to player
1715 else:
1716 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1717 else if arg 1 is "buildings":
1718 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.buildings":
1719 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1720 if {_pg} is not "*":
1721 buildingsGUI(player)
1722 else:
1723 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to player
1724 else:
1725 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1726 else if arg 1 is "alchemy":
1727 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.alchemy":
1728 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1729 if {_pg} is not "*":
1730 alchemyGUI(player)
1731 else:
1732 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to player
1733 else:
1734 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1735 else if arg 1 is "store":
1736 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.store":
1737 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1738 if {_pg} is not "*":
1739 storeGUI(player)
1740 else:
1741 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to player
1742 else:
1743 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1744 else if arg 1 is "invite":
1745 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.invite":
1746 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1747 if {_pg} is not "*":
1748 set {_r} to checkFile("Datas.Players.%uuid of player%.Rank", "guilds/%{_pg}%")
1749 if {_r} is "Leader" or "General" or "Captain":
1750 if arg 2 is set:
1751 if arg 2 is not "%player%":
1752 set {_invitedPlayer} to "%arg 2%" parsed as player
1753 set {_uuidInvited} to "%uuid of {_invitedPlayer}%"
1754 set {_invitedGuild} to checkFile("Players.%{_uuidInvited}%.Guild-Name", "playerdata")
1755 if {_invitedGuild} is "*":
1756 set {_invites} to checkFile("Players.%{_uuidInvited}%.Invites-Enabled", "playerdata")
1757 if {_invites} is "*" or "true":
1758 set {_maxslot} to checkFile("Datas.Max-Slot", "guilds/%{_pg}%") parsed as integer
1759 set {_s} to sayiGoster("Datas.Players", "guilds/%{_pg}%")
1760 if {_s} is less than {_maxslot}:
1761 set {_number} to checkFile("General.Invite-Time", "config") parsed as number
1762 set {_inviteCheck} to timeChecker("%{_pg}%", {_number}, "Invite-Time")
1763 if {_inviteCheck} is "true":
1764 inviteGUI({_invitedPlayer}, {_pg}, "gui")
1765 send "%{SG::Messages::Prefix}% %{SG::Messages::Invite_Send}%" to player
1766 writeFile("Datas.Invite-Time", "*%month%;*%day%;*%hour%;*%minute%;*%second%", "guilds/%{_pg}%")
1767 else:
1768 set {_msg} to {SG::Messages::Invite_Wait}
1769 replace all "{TIME}" with "%{_inviteCheck}%" in {_msg}
1770 send "%{SG::Messages::Prefix}% %{_msg}%" to player
1771 else:
1772 send "%{SG::Messages::Prefix}% %{SG::Messages::Your_Guild_Is_Full}%" to player
1773 else:
1774 send "%{SG::Messages::Prefix}% %{SG::Messages::Player_Closed_Invites}%" to player
1775 else:
1776 send "%{SG::Messages::Prefix}% %{SG::Messages::Player_Has_Guild}%" to player
1777 else:
1778 send "%{SG::Messages::Prefix}% %{SG::Messages::Cant_Invite_Yourself}%" to player
1779 else:
1780 send "%{SG::Messages::Prefix}% %{SG::Messages::Invite_Player_Name}%" to player
1781 else:
1782 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Rank}%" to player
1783 else:
1784 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to player
1785 else:
1786 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1787 else if arg 1 is "invites":
1788 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.invites":
1789 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1790 if {_pg} is "*":
1791 set {_invites} to checkFile("Players.%uuid of player%.Invites-Enabled", "playerdata")
1792 if {_invites} is "*" or "true":
1793 writeFile("Players.%uuid of player%.Invites-Enabled", "false", "playerdata")
1794 send "%{SG::Messages::Prefix}% %{SG::Messages::Disabled_Invites}%" to player
1795 else:
1796 writeFile("Players.%uuid of player%.Invites-Enabled", "true", "playerdata")
1797 send "%{SG::Messages::Prefix}% %{SG::Messages::Enabled_Invites}%" to player
1798 else:
1799 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Have_Guild}%" to player
1800 else:
1801 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1802 else if arg 1 is "claimname":
1803 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.claimname":
1804 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1805 if {_pg} is not "*":
1806 if arg 2 is set:
1807 set {_r} to checkFile("Datas.Players.%uuid of player%.Rank", "guilds/%{_pg}%")
1808 if {_r} is "Leader" or "General" or "Captain":
1809 set {_chunk} to checkFile("Regions.%chunk at location of player%", "chunks")
1810 if {_chunk} is "%{_pg}%":
1811 set {_arg} to "%arg 2%"
1812 replace all "_" with " " in {_arg}
1813 writeFile("Datas.Claims.%chunk at player%", "%player's x coordinate%;%player's y coordinate%;%player's z coordinate%;%world of player%;%{_arg}%", "guilds/%{_pg}%")
1814 set {_msg} to {SG::Messages::ClaimName_Changed}
1815 replace all "{LOC}" with "%player's x coordinate% / %player's y coordinate% /%player's z coordinate%" in {_msg}
1816 replace all "{NAME}" with "%arg 2%" in {_msg}
1817 replace all "{BY}" with "%player%" in {_msg}
1818 guildBroadcast("%{_pg}%", "%{_msg}%")
1819 else:
1820 send "%{SG::Messages::Prefix}% %{SG::Messages::Chunk_Error_You}%" to player
1821 else:
1822 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Rank}%" to player
1823 else:
1824 send "%{SG::Messages::Prefix}% %{SG::Messages::ClaimName_Usage}%" to player
1825 else:
1826 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to player
1827 else:
1828 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1829 else if arg 1 is "donate":
1830 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.donate":
1831 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1832 if {_pg} is not "*":
1833 if arg 2 is set:
1834 if arg 2 is "gold" or "magic":
1835 if arg 2 is "gold":
1836 set {_donatedResource} to "Gold"
1837 set {_donatedItem} to "gold ingot"
1838 else:
1839 set {_donatedResource} to "Magic"
1840 set {_donatedItem} to "level"
1841 set {_num} to "%arg 3%" parsed as integer
1842 if {_num} is set:
1843 if {_num} is greater than 0:
1844 if {_donatedResource} is "Gold":
1845 set {_donatedItem} to "%{_num}% %{_donatedItem}%" parsed as material
1846 set {_currentR} to checkFile("Datas.%{_donatedResource}%", "guilds/%{_pg}%") parsed as integer
1847 set {_maxR} to checkFile("Datas.Max-%{_donatedResource}%", "guilds/%{_pg}%") parsed as integer
1848 set {_newR} to {_currentR}+{_num}
1849 if {_newR} is less or equal to {_maxR}:
1850 if {_donatedResource} is "Gold":
1851 number of {_donatedItem} in player's inventory is greater or equal to {_num}
1852 set {_control} to "true"
1853 else if {_donatedResource} is "Magic":
1854 player's level is greater or equal to {_num}
1855 set {_control} to "true"
1856 if {_control} is "true":
1857 if {_donatedResource} is "Gold":
1858 remove {_donatedItem} from player's inventory
1859 else:
1860 set {_z} to "%player's level%" parsed as integer
1861 remove {_num} from {_z}
1862 set player's level to {_z}
1863 set {_r} to checkFile("Datas.Players.%uuid of player%.Rank", "guilds/%{_pg}%")
1864 degerEkle("Datas.%{_donatedResource}%", {_num}, "guilds/%{_pg}%")
1865 degerEkle("Datas.Players.%uuid of player%.Donated-%{_donatedResource}%", {_num}, "guilds/%{_pg}%")
1866 degerEkle("Players.%uuid of player%.Donated-%{_donatedResource}%", {_num}, "playerdata")
1867 set {_msg} to {SG::Messages::Player_Donated}
1868 replace all "{RANK}" with "%{SG::Messages::Rank_%{_r}%}%" in {_msg}
1869 replace all "{PLAYER}" with "%player%" in {_msg}
1870 replace all "{NUMBER}" with "%{_num}%" in {_msg}
1871 replace all "{RESOURCE}" with "%{SG::Messages::Store_Name_%{_donatedResource}%}%" in {_msg}
1872 guildBroadcast({_pg},"%{_msg}%")
1873 set {_msg} to {SG::Messages::You_Donated}
1874 replace all "{NUMBER}" with "%{_num}%" in {_msg}
1875 replace all "{RESOURCE}" with "%{SG::Messages::Store_Name_%{_donatedResource}%}%" in {_msg}
1876 send "%{SG::Messages::Prefix}% %{_msg}%" to player
1877 else:
1878 set {_msg} to {SG::Messages::No_Item_To_Donate}
1879 replace all "{ITEM}" with "%{_donatedItem}%" in {_msg}
1880 send "%{SG::Messages::Prefix}% %{_msg}%" to player
1881 else:
1882 set {_msg} to {SG::Messages::No_Storage}
1883 replace all "{NUMBER}" with "%{_num}%" in {_msg}
1884 replace all "{RESOURCE}" with "%{SG::Messages::Store_Name_%{_donatedResource}%}%" in {_msg}
1885 send "%{SG::Messages::Prefix}% %{_msg}%" to player
1886 else:
1887 send "%{SG::Messages::Prefix}% %{SG::Messages::Donations_0}%" to player
1888 else:
1889 send "%{SG::Messages::Prefix}% %{SG::Messages::Enter_An_Integer}%" to player
1890 else:
1891 send "%{SG::Messages::Prefix}% %{SG::Messages::Donate_Must_Be_Gold_Magic}%" to player
1892 else:
1893 send "%{SG::Messages::Prefix}% %{SG::Messages::Donate_Usage}%" to player
1894 else:
1895 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to player
1896 else:
1897 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1898 else if arg 1 is "leave":
1899 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.leave":
1900 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
1901 if {_pg} is not "*":
1902 set {_r} to checkFile("Datas.Players.%uuid of player%.Rank", "guilds/%{_pg}%")
1903 if {_r} is not "Leader":
1904 writeFile("Players.%uuid of player%.Guild-Name", "*", "playerdata")
1905 set {_name} to checkFile("Datas.Name", "guilds/%{_pg}%")
1906 veriCikar("Datas.Players", "%uuid of player%", "guilds/%{_pg}%")
1907 set {_msg} to {SG::Messages::You_Leave}
1908 replace all "{GUILD}" with "%{_name}%" in {_msg}
1909 send "%{SG::Messages::Prefix}% %{_msg}%"
1910 set {_msg} to {SG::Messages::Player_Leave}
1911 replace all "{RANK}" with "%{SG::Messages::Rank_%{_r}%}%" in {_msg}
1912 replace all "{PLAYER}" with "%player%" in {_msg}
1913 guildBroadcast({_pg}, "%{_msg}%")
1914 else:
1915 send "%{SG::Messages::Prefix}% %{SG::Messages::Leader_Leave}%" to player
1916 else:
1917 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to player
1918 else:
1919 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1920 else if arg 1 is "locale" or "language":
1921 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.locale" or "guilds.language":
1922 if arg 2 is set:
1923 if arg 2 is "en_US" or "tr_TR" or "es_ES" or "de_DE" or "it_IT":
1924 wait 1 ticks
1925 if file "plugins/SUPERGUILDS/locale/%arg 2%.sk" exists:
1926 set {SG::Locale} to "%arg 2%"
1927 load script from file "plugins/SUPERGUILDS/locale/%{SG::Locale}%.sk"
1928 wait 2 ticks
1929 set {_msg} to {SG::Messages::Language_Select}
1930 replace all "{LANG}" with "%{SG::Locale}%" in {_msg}
1931 send "%{SG::Messages::Prefix}% %{_msg}%" to player
1932 else if arg 2 is not "en_US":
1933 set {_result} to text from "https://raw.githubusercontent.com/rplcnn/SuperGuilds/master/Locales/%arg-2%.sk"
1934 if {_result} is not set:
1935 send "%{SG::Messages::Prefix}% %{SG::Messages::Locale_Error}%" to player
1936 stop
1937 else:
1938 set {SG::Locale} to "%arg 2%"
1939 download from "https://raw.githubusercontent.com/rplcnn/SuperGuilds/master/Locales/%arg-2%.sk" to file "plugins/SUPERGUILDS/locale/%{SG::Locale}%.sk"
1940 wait 1 seconds
1941 load script from file "plugins/SUPERGUILDS/locale/%{SG::Locale}%.sk"
1942 wait 10 ticks
1943 set {_msg} to {SG::Messages::Language_Select}
1944 replace all "{LANG}" with "%{SG::Locale}%" in {_msg}
1945 send "%{SG::Messages::Prefix}% %{_msg}%" to player
1946 else:
1947 set {SG::Locale} to "en_US"
1948 execute console command "/sk reload SUPERGUILDS_files"
1949 load script from file "plugins/SUPERGUILDS/locale/%{SG::Locale}%.sk"
1950 wait 2 ticks
1951 set {_msg} to {SG::Messages::Language_Select}
1952 replace all "{LANG}" with "%{SG::Locale}%" in {_msg}
1953 send "%{SG::Messages::Prefix}% %{_msg}%" to player
1954 else:
1955 send "%{SG::Messages::Prefix}% %{SG::Messages::Enter_Language}% (en_US, tr_TR, es_ES, de_DE, it_IT)" to player
1956 else:
1957 send "%{SG::Messages::Prefix}% %{SG::Messages::Enter_Language}% (en_US, tr_TR, es_ES, de_DE, it_IT)" to player
1958 else:
1959 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1960 else if arg 1 is "sync":
1961 if player has permission "guilds.*" or "guilds.admin" or "guilds.sync":
1962 if arg 2 is set:
1963 if arg 2 is "locale" or "config":
1964 set {_fileDir::locale} to "plugins/SUPERGUILDS/locale/%{SG::Locale}%.sk"
1965 set {_fileDir::config} to "plugins/SUPERGUILDS/config.yml"
1966 df "%{_fileDir::%arg 2%}%"
1967 wait 2 ticks
1968 if file "%{_fileDir::%arg 2%}%" doesn't exists:
1969 execute console command "sk reload SUPERGUILDS_files"
1970 wait 0.5 seconds
1971 if file "%{_fileDir::%arg 2%}%" exists:
1972 set {_msg} to {SG::Messages::SYNC_Done}
1973 replace all "{FILE}" with "%arg 2%" in {_msg}
1974 send "%{SG::Messages::Prefix}% %{_msg}% (%{_fileDir::%arg 2%}%)" to player
1975 else:
1976 set {_msg} to {SG::Messages::SYNC_Load_Error}
1977 replace all "{FILE}" with "%arg 2%" in {_msg}
1978 send "%{SG::Messages::Prefix}% %{_msg}% (%{_fileDir::%arg 2%}%)" to player
1979 else:
1980 set {_msg} to {SG::Messages::SYNC_Delete_Failed}
1981 replace all "{FILE}" with "%arg 2%" in {_msg}
1982 send "%{SG::Messages::Prefix}% %{_msg}% (%{_fileDir::%arg 2%}%)" to player
1983 else:
1984 send "%{SG::Messages::Prefix}% %{SG::Messages::SYNC_Enter_File}%" to player
1985 else:
1986 send "%{SG::Messages::Prefix}% %{SG::Messages::SYNC_Enter_File}%" to player
1987 else:
1988 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1989 else if arg 1 is "reload":
1990 if player has permission "guilds.*" or "guilds.admin" or "guilds.reload":
1991 send "%{SG::Messages::Prefix}% %{SG::Messages::Reloading_1}%" to player
1992 execute console command "/sk reload SUPERGUILDS_files"
1993 send "%{SG::Messages::Prefix}% %{SG::Messages::Reloading_2}%" to player
1994 else:
1995 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
1996 else if arg 1 is "version":
1997 set {_msg} to {SG::Messages::Version}
1998 replace all "{VERSION}" with "%{SG::Version}%" in {_msg}
1999 send "%{SG::Messages::Prefix}% %{_msg}%" to player
2000 else if arg 1 is "showclaims":
2001 if player has permission "guilds.*" or "guilds.player" or "guilds.admin" or "guilds.showclaims":
2002 set {_c} to checkFile("General.Claims", "config")
2003 if {_c} is "true":
2004 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
2005 if {_pg} is not "*":
2006 set {_number} to checkFile("General.Show-Claims-Time", "config") parsed as number
2007 set {_check} to timeChecker("%{_pg}%", {_number}, "Show-Claims-Time")
2008 if {_check} is "true":
2009 writeFile("Datas.Show-Claims-Time", "*%month%;*%day%;*%hour%;*%minute%;*%second%", "guilds/%{_pg}%")
2010 set {_claims::*} to configuration section "Datas.Claims" get of "plugins/SUPERGUILDS/guilds/%{_pg}%.yml"
2011 if size of {_claims::*} is greater than 0:
2012 loop {_claims::*}:
2013 set {_location::*} to checkFile("Datas.Claims.%loop-value%", "guilds/%{_pg}%") split at ";"
2014 set {_xLoc} to {_location::1} parsed as number
2015 set {_yLoc} to {_location::2} parsed as number
2016 set {_zLoc} to {_location::3} parsed as number
2017 set {_worldLoc} to {_location::4} parsed as world
2018 chunkMiddle(player, {_xLoc}, {_yLoc}, {_zLoc}, {_worldLoc}, "all")
2019 send "%{SG::Messages::Prefix}% %{SG::Messages::Showing_Claims}%" to player
2020 else:
2021 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Claims}%" to player
2022 else:
2023 set {_msg} to {SG::Messages::Show_Claim_Wait}
2024 replace all "{TIME}" with "%{_check}%" in {_msg}
2025 send "%{SG::Messages::Prefix}% %{_msg}%" to player
2026 else:
2027 send "%{SG::Messages::Prefix}% %{SG::Messages::You_Dont_Have_Guild}%" to player
2028 else:
2029 send "%{SG::Messages::Prefix}% %{SG::Messages::Option_Disabled}%" to player
2030 else:
2031 send "%{SG::Messages::Prefix}% %{SG::Messages::No_Permission}%" to player
2032 else:
2033 send "%{SG::Messages::Prefix}% %{SG::Messages::Unknown_Command}%" to player
2034on join:
2035 writeFile("Players.%uuid of player%.Username", "%player%", "playerdata")
2036 writeFile("Players.%uuid of player%.Last-Seen", "%now%", "playerdata")
2037 refreshData(player)
2038on damage of player:
2039 attacker is a player
2040 set {_ag} to checkFile("Players.%uuid of attacker%.Guild-Name", "playerdata")
2041 {_ag} is not "*"
2042 set {_vg} to checkFile("Players.%uuid of victim%.Guild-Name", "playerdata")
2043 {_vg} is not "*"
2044 {_ag} is {_vg}
2045 cancel event
2046 send "%{SG::Messages::Prefix}% %{SG::Messages::Cant_Attack_Member}%" to attacker
2047on break:
2048 player doesn't have permission "guilds.admin" or "guilds.bypass"
2049 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
2050 {_pg} is not "*"
2051 set {_chunk} to checkFile("Regions.%chunk at location of event-block%", "chunks")
2052 if {_chunk} is "%{_pg}%":
2053 loop 4 times:
2054 clear {_buildMainChunk}
2055 set {_buildMainChunk} to checkFile("Datas.Schematic.%loop-number%.Main-Chunk", "guilds/%{_pg}%")
2056 {_buildMainChunk} is "%chunk of event-block%"
2057 cancel event
2058 set {_msg} to {SG::Messages::You_Cant_Action}
2059 replace all "{BUILD}" with "%uncolored {SG::Messages::Buildings_Name_%loop-number%}%" in {_msg}
2060 send "%{SG::Messages::Prefix}% %{_msg}%" to player
2061 stop
2062 else if {_chunk} is not "*":
2063 cancel event
2064 set {_msg} to {SG::Messages::Owned_By}
2065 set {_name} to checkFile("Datas.Name", "guilds/%{_chunk}%")
2066 replace all "{GUILD}" with "%{_name}%" in {_msg}
2067 send "%{SG::Messages::Prefix}% %{_msg}%" to player
2068on place:
2069 player doesn't have permission "guilds.admin" or "guilds.bypass"
2070 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
2071 {_pg} is not "*"
2072 set {_chunk} to checkFile("Regions.%chunk at location of event-block%", "chunks")
2073 if {_chunk} is "%{_pg}%":
2074 loop 4 times:
2075 clear {_buildMainChunk}
2076 set {_buildMainChunk} to checkFile("Datas.Schematic.%loop-number%.Main-Chunk", "guilds/%{_pg}%")
2077 {_buildMainChunk} is "%chunk of event-block%"
2078 cancel event
2079 set {_msg} to {SG::Messages::You_Cant_Action}
2080 replace all "{BUILD}" with "%uncolored {SG::Messages::Buildings_Name_%loop-number%}%" in {_msg}
2081 send "%{SG::Messages::Prefix}% %{_msg}%" to player
2082 stop
2083 else if {_chunk} is not "*":
2084 cancel event
2085 set {_msg} to {SG::Messages::Owned_By}
2086 set {_name} to checkFile("Datas.Name", "guilds/%{_chunk}%")
2087 replace all "{GUILD}" with "%{_name}%" in {_msg}
2088 send "%{SG::Messages::Prefix}% %{_msg}%" to player
2089on click:
2090 player doesn't have permission "guilds.admin" or "guilds.bypass"
2091 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
2092 {_pg} is not "*"
2093 set {_chunk} to checkFile("Regions.%chunk at location of event-block%", "chunks")
2094 {_chunk} is not "%{_pg}%" or "*"
2095 cancel event
2096 set {_msg} to {SG::Messages::Owned_By}
2097 set {_name} to checkFile("Datas.Name", "guilds/%{_chunk}%")
2098 replace all "{GUILD}" with "%{_name}%" in {_msg}
2099 send "%{SG::Messages::Prefix}% %{_msg}%" to player
2100on chat:
2101 set {_pg} to checkFile("Players.%uuid of player%.Guild-Name", "playerdata")
2102 {_pg} is not "*"
2103 set {_chat} to checkFile("Players.%uuid of player%.Chat-Enabled", "playerdata")
2104 {_chat} is "true"
2105 cancel event
2106 set {_r} to checkFile("Datas.Players.%uuid of player%.Rank", "guilds/%{_pg}%")
2107 guildBroadcast("%{_pg}%", "%{SG::Messages::Guild_Chat}% %{SG::Messages::Rank_%{_r}%}% %player% &8&l» &f%message%")
2108on death of horse:
2109 name of victim contains "&9["
2110 clear drops